forked from JavaTX/JavaCompilerCore
Hinzufügen von Test zu IntermediateRefTypeTest und IntermediateGenericTypeTest.
This commit is contained in:
parent
55a75b04a0
commit
8b58259fe0
@ -1,11 +1,59 @@
|
|||||||
package intermediate.types;
|
package intermediate.types;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import de.dhbwstuttgart.intermediate.types.IntermediateGenericType;
|
||||||
|
import de.dhbwstuttgart.intermediate.types.IntermediateRefType;
|
||||||
|
import de.dhbwstuttgart.parser.scope.JavaClassName;
|
||||||
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.objectweb.asm.Type;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
public class IntermediateGenericTypeTest {
|
public class IntermediateGenericTypeTest {
|
||||||
|
|
||||||
|
private static String tSignature;
|
||||||
|
private static String tDescriptor;
|
||||||
|
private static IntermediateGenericType t;
|
||||||
|
|
||||||
|
private static String sExtendsStringSignature;
|
||||||
|
private static String sExtendsStringDescriptor;
|
||||||
|
private static IntermediateGenericType sExtendsString;
|
||||||
|
|
||||||
|
private static String rExtendsSSignature;
|
||||||
|
private static String rExtendsSDescriptor;
|
||||||
|
private static IntermediateGenericType rExtendsS;
|
||||||
|
|
||||||
|
@BeforeClass
|
||||||
|
public static void StartUp(){
|
||||||
|
tSignature = "TT;";
|
||||||
|
tDescriptor = "Ljava/lang/Object;";
|
||||||
|
t = new IntermediateGenericType("T");
|
||||||
|
|
||||||
|
sExtendsStringSignature = "TS;";
|
||||||
|
sExtendsStringDescriptor = "Ljava/lang/String;";
|
||||||
|
sExtendsString = new IntermediateGenericType("S",
|
||||||
|
new IntermediateRefType(new JavaClassName(Type.getInternalName(String.class))));
|
||||||
|
|
||||||
|
rExtendsSSignature = "TR;";
|
||||||
|
rExtendsSDescriptor = sExtendsStringDescriptor;
|
||||||
|
rExtendsS = new IntermediateGenericType("R", sExtendsString);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void ToDo(){
|
public void SignatureTest_T(){ assertEquals(tSignature, t.getSignature()); }
|
||||||
Assert.fail();
|
|
||||||
}
|
@Test
|
||||||
|
public void DescriptorTest_T(){ assertEquals(tDescriptor, t.getDescriptor()); }
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void SignatureTest_TExtendsString(){ assertEquals(sExtendsStringSignature, sExtendsString.getSignature()); }
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void DescriptorTest_TExtendsString(){ assertEquals(sExtendsStringDescriptor, sExtendsString.getDescriptor()); }
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void SignatureTest_TExtendsS(){ assertEquals(rExtendsSSignature, rExtendsS.getSignature()); }
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void DescriptorTest_TExtendsS(){ assertEquals(rExtendsSDescriptor, rExtendsS.getDescriptor()); }
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class IntermediateRefTypeTest {
|
|||||||
|
|
||||||
private static String listOfIntegerSignature;
|
private static String listOfIntegerSignature;
|
||||||
private static String listOfIntegerDescriptor;
|
private static String listOfIntegerDescriptor;
|
||||||
private static IntermediateRefType typeToTest_ListofInteger;
|
private static IntermediateRefType typeToTest_ListOfInteger;
|
||||||
|
|
||||||
private static String voidSignature;
|
private static String voidSignature;
|
||||||
private static String voidDescriptor;
|
private static String voidDescriptor;
|
||||||
@ -34,7 +34,7 @@ public class IntermediateRefTypeTest {
|
|||||||
|
|
||||||
listOfIntegerSignature = "Ljava/util/List<Ljava/lang/Integer;>;";
|
listOfIntegerSignature = "Ljava/util/List<Ljava/lang/Integer;>;";
|
||||||
listOfIntegerDescriptor = "Ljava/util/List;";
|
listOfIntegerDescriptor = "Ljava/util/List;";
|
||||||
typeToTest_ListofInteger = new IntermediateRefType(
|
typeToTest_ListOfInteger = new IntermediateRefType(
|
||||||
new JavaClassName(Type.getInternalName(List.class)),
|
new JavaClassName(Type.getInternalName(List.class)),
|
||||||
Arrays.asList(typeToTest_Integer));
|
Arrays.asList(typeToTest_Integer));
|
||||||
|
|
||||||
@ -54,10 +54,10 @@ public class IntermediateRefTypeTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void SignatureTest_List(){ assertEquals(listOfIntegerSignature, typeToTest_ListofInteger.getSignature()); }
|
public void SignatureTest_List(){ assertEquals(listOfIntegerSignature, typeToTest_ListOfInteger.getSignature()); }
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void DescriptorTest_List(){ assertEquals(listOfIntegerDescriptor, typeToTest_ListofInteger.getDescriptor()); }
|
public void DescriptorTest_List(){ assertEquals(listOfIntegerDescriptor, typeToTest_ListOfInteger.getDescriptor()); }
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void SignatureTest_Void(){
|
public void SignatureTest_Void(){
|
||||||
|
Loading…
Reference in New Issue
Block a user