group codegen test files into directories per test case

This commit is contained in:
Dmitry Jemerov
2011-05-13 12:30:28 +02:00
parent e57ed7401d
commit 5c2e90345a
24 changed files with 21 additions and 21 deletions
@@ -8,7 +8,7 @@ import java.util.List;
*/ */
public class ClassGenTest extends CodegenTestCase { public class ClassGenTest extends CodegenTestCase {
public void testPSVMClass() throws Exception { public void testPSVMClass() throws Exception {
loadFile("simpleClass.jet"); loadFile("classes/simpleClass.jet");
System.out.println(generateToText()); System.out.println(generateToText());
final Class aClass = loadClass("SimpleClass", generateClassesInFile()); final Class aClass = loadClass("SimpleClass", generateClassesInFile());
@@ -17,7 +17,7 @@ public class ClassGenTest extends CodegenTestCase {
} }
public void testArrayListInheritance() throws Exception { public void testArrayListInheritance() throws Exception {
loadFile("inheritingFromArrayList.jet"); loadFile("classes/inheritingFromArrayList.jet");
System.out.println(generateToText()); System.out.println(generateToText());
final Class aClass = loadClass("Foo", generateClassesInFile()); final Class aClass = loadClass("Foo", generateClassesInFile());
@@ -25,15 +25,15 @@ public class ClassGenTest extends CodegenTestCase {
} }
public void testInheritanceAndDelegation_DelegatingDefaultConstructorProperties() throws Exception { public void testInheritanceAndDelegation_DelegatingDefaultConstructorProperties() throws Exception {
blackBoxFile("inheritance.jet"); blackBoxFile("classes/inheritance.jet");
} }
public void testFunDelegation() throws Exception { public void testFunDelegation() throws Exception {
blackBoxFile("funDelegation.jet"); blackBoxFile("classes/funDelegation.jet");
} }
public void testPropertyDelegation() throws Exception { public void testPropertyDelegation() throws Exception {
blackBoxFile("propertyDelegation.jet"); blackBoxFile("classes/propertyDelegation.jet");
} }
private static void checkInterface(Class aClass, Class ifs) { private static void checkInterface(Class aClass, Class ifs) {
@@ -44,7 +44,7 @@ public class ClassGenTest extends CodegenTestCase {
} }
public void testNewInstanceExplicitConstructor() throws Exception { public void testNewInstanceExplicitConstructor() throws Exception {
loadFile("newInstanceDefaultConstructor.jet"); loadFile("classes/newInstanceDefaultConstructor.jet");
System.out.println(generateToText()); System.out.println(generateToText());
final Codegens codegens = generateClassesInFile(); final Codegens codegens = generateClassesInFile();
loadImplementationClass(codegens, "SimpleClass"); loadImplementationClass(codegens, "SimpleClass");
@@ -10,7 +10,7 @@ import java.util.List;
*/ */
public class ControlStructuresTest extends CodegenTestCase { public class ControlStructuresTest extends CodegenTestCase {
public void testIf() throws Exception { public void testIf() throws Exception {
loadFile("if.jet"); loadFile("controlStructures/if.jet");
System.out.println(generateToText()); System.out.println(generateToText());
final Method main = generateFunction(); final Method main = generateFunction();
@@ -19,7 +19,7 @@ public class ControlStructuresTest extends CodegenTestCase {
} }
public void testSingleBranchIf() throws Exception { public void testSingleBranchIf() throws Exception {
loadFile("singleBranchIf.jet"); loadFile("controlStructures/singleBranchIf.jet");
System.out.println(generateToText()); System.out.println(generateToText());
final Method main = generateFunction(); final Method main = generateFunction();
@@ -28,15 +28,15 @@ public class ControlStructuresTest extends CodegenTestCase {
} }
public void testWhile() throws Exception { public void testWhile() throws Exception {
factorialTest("while.jet"); factorialTest("controlStructures/while.jet");
} }
public void testDoWhile() throws Exception { public void testDoWhile() throws Exception {
factorialTest("doWhile.jet"); factorialTest("controlStructures/doWhile.jet");
} }
public void testBreak() throws Exception { public void testBreak() throws Exception {
factorialTest("break.jet"); factorialTest("controlStructures/break.jet");
} }
private void factorialTest(final String name) throws IllegalAccessException, InvocationTargetException { private void factorialTest(final String name) throws IllegalAccessException, InvocationTargetException {
@@ -49,7 +49,7 @@ public class ControlStructuresTest extends CodegenTestCase {
} }
public void testContinue() throws Exception { public void testContinue() throws Exception {
loadFile("continue.jet"); loadFile("controlStructures/continue.jet");
System.out.println(generateToText()); System.out.println(generateToText());
final Method main = generateFunction(); final Method main = generateFunction();
assertEquals(3, main.invoke(null, 4)); assertEquals(3, main.invoke(null, 4));
@@ -57,7 +57,7 @@ public class ControlStructuresTest extends CodegenTestCase {
} }
public void testIfNoElse() throws Exception { public void testIfNoElse() throws Exception {
loadFile("ifNoElse.jet"); loadFile("controlStructures/ifNoElse.jet");
System.out.println(generateToText()); System.out.println(generateToText());
final Method main = generateFunction(); final Method main = generateFunction();
assertEquals(5, main.invoke(null, 5, true)); assertEquals(5, main.invoke(null, 5, true));
@@ -72,7 +72,7 @@ public class ControlStructuresTest extends CodegenTestCase {
} }
public void testFor() throws Exception { public void testFor() throws Exception {
loadFile("for.jet"); loadFile("controlStructures/for.jet");
System.out.println(generateToText()); System.out.println(generateToText());
final Method main = generateFunction(); final Method main = generateFunction();
List<String> args = Arrays.asList("IntelliJ", " ", "IDEA"); List<String> args = Arrays.asList("IntelliJ", " ", "IDEA");
@@ -80,7 +80,7 @@ public class ControlStructuresTest extends CodegenTestCase {
} }
public void testForInArray() throws Exception { public void testForInArray() throws Exception {
loadFile("forInArray.jet"); loadFile("controlStructures/forInArray.jet");
System.out.println(generateToText()); System.out.println(generateToText());
final Method main = generateFunction(); final Method main = generateFunction();
String[] args = new String[] { "IntelliJ", " ", "IDEA" }; String[] args = new String[] { "IntelliJ", " ", "IDEA" };
@@ -102,7 +102,7 @@ public class ControlStructuresTest extends CodegenTestCase {
} }
public void testTryCatch() throws Exception { public void testTryCatch() throws Exception {
loadFile("tryCatch.jet"); loadFile("controlStructures/tryCatch.jet");
System.out.println(generateToText()); System.out.println(generateToText());
final Method main = generateFunction(); final Method main = generateFunction();
assertEquals("no message", main.invoke(null, "0")); assertEquals("no message", main.invoke(null, "0"));
@@ -9,7 +9,7 @@ import java.lang.reflect.Modifier;
*/ */
public class PropertyGenTest extends CodegenTestCase { public class PropertyGenTest extends CodegenTestCase {
public void testPrivateVal() throws Exception { public void testPrivateVal() throws Exception {
loadFile("privateVal.jet"); loadFile("properties/privateVal.jet");
System.out.println(generateToText()); System.out.println(generateToText());
final Class aClass = loadImplementationClass(generateClassesInFile(), "PrivateVal"); final Class aClass = loadImplementationClass(generateClassesInFile(), "PrivateVal");
final Field[] fields = aClass.getDeclaredFields(); final Field[] fields = aClass.getDeclaredFields();
@@ -19,7 +19,7 @@ public class PropertyGenTest extends CodegenTestCase {
} }
public void testPrivateVar() throws Exception { public void testPrivateVar() throws Exception {
loadFile("privateVar.jet"); loadFile("properties/privateVar.jet");
System.out.println(generateToText()); System.out.println(generateToText());
final Class aClass = loadImplementationClass(generateClassesInFile(), "PrivateVar"); final Class aClass = loadImplementationClass(generateClassesInFile(), "PrivateVar");
final Object instance = aClass.newInstance(); final Object instance = aClass.newInstance();
@@ -60,7 +60,7 @@ public class PropertyGenTest extends CodegenTestCase {
} }
public void testFieldPropertyAccess() throws Exception { public void testFieldPropertyAccess() throws Exception {
loadFile("fieldPropertyAccess.jet"); loadFile("properties/fieldPropertyAccess.jet");
final Method method = generateFunction(); final Method method = generateFunction();
assertEquals(1, method.invoke(null)); assertEquals(1, method.invoke(null));
assertEquals(2, method.invoke(null)); assertEquals(2, method.invoke(null));
@@ -73,7 +73,7 @@ public class PropertyGenTest extends CodegenTestCase {
} }
public void testFieldSetter() throws Exception { public void testFieldSetter() throws Exception {
loadFile("fieldSetter.jet"); loadFile("properties/fieldSetter.jet");
System.out.println(generateToText()); System.out.println(generateToText());
final Method method = generateFunction("append"); final Method method = generateFunction("append");
method.invoke(null, "IntelliJ "); method.invoke(null, "IntelliJ ");
@@ -82,7 +82,7 @@ public class PropertyGenTest extends CodegenTestCase {
} }
public void testFieldSetterPlusEq() throws Exception { public void testFieldSetterPlusEq() throws Exception {
loadFile("fieldSetterPlusEq.jet"); loadFile("properties/fieldSetterPlusEq.jet");
System.out.println(generateToText()); System.out.println(generateToText());
final Method method = generateFunction("append"); final Method method = generateFunction("append");
method.invoke(null, "IntelliJ "); method.invoke(null, "IntelliJ ");