modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java

reset Typevars-Namen wieder rausgenommen

	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/factory/NameGenerator.java

	modified:   src/test/java/insertGenerics/TestAny.java
	modified:   src/test/java/insertGenerics/TestClassField.java
	modified:   src/test/java/insertGenerics/TestContraVariant.java
	modified:   src/test/java/insertGenerics/TestGGFinder.java
	modified:   src/test/java/insertGenerics/TestLocalVarLambda.java
	modified:   src/test/java/insertGenerics/TestMutualRecursion.java
	modified:   src/test/java/insertGenerics/TestReturnVar.java
	modified:   src/test/java/insertGenerics/TestSecondLineOfClassConstraints.java
	modified:   src/test/java/insertGenerics/TestTPHsAndGenerics.java
	modified:   src/test/java/insertGenerics/TestTPHsAndGenerics2.java
	modified:   src/test/java/insertGenerics/TestThreeArgs.java
	modified:   src/test/java/insertGenerics/TestTwoArgs.java
	modified:   src/test/java/insertGenerics/TestTwoArgs2.java
	modified:   src/test/java/insertGenerics/TestTwoCalls.java
	modified:   src/test/java/insertGenerics/TestVector.java
	modified:   src/test/java/insertGenerics/TestVoidMeth.java
Reset Typevar-Namen in @BeforeClass eingefuegt
This commit is contained in:
pl@gohorb.ba-horb.de 2021-04-01 19:16:57 +02:00
parent bbfd8aa203
commit b46415e45a
18 changed files with 123 additions and 12 deletions

View File

@ -102,7 +102,6 @@ public class JavaTXCompiler {
}
classLoader = new DirectoryClassLoader(contextPath, ClassLoader.getSystemClassLoader());
environment = new CompilationEnvironment(sources);
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
for (File s : sources) {
sourceFiles.put(s, parse(s));
}

View File

@ -6,7 +6,7 @@ public class NameGenerator {
/**
* Setzt den zu Beginn der Typinferenz auf "A" zurueck.
* Dies ist beio den JUnit-Test noetig
* Dies ist bei JUnit-Test noetig
* <code>TypePlaceholder</code>. <br>Author: Martin Pluemicke
* @return void
*/

View File

@ -12,6 +12,8 @@ import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@ -32,6 +34,11 @@ public class TestAny {
public static final String rootDirectory = System.getProperty("user.dir")+"/src/test/resources/insertGenericsJav/";
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void ggFinder() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"TestAny.jav"));

View File

@ -8,6 +8,8 @@ import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
@ -24,6 +26,11 @@ public class TestClassField {
public static final String rootDirectory = System.getProperty("user.dir")+"/src/test/resources/insertGenericsJav/";
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void ggFinder() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"TestClassField.jav"));

View File

@ -12,6 +12,8 @@ import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@ -32,6 +34,11 @@ public class TestContraVariant {
public static final String rootDirectory = System.getProperty("user.dir")+"/src/test/resources/insertGenericsJav/";
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void ggFinder() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"TestContraVariant.jav"));

View File

@ -12,6 +12,8 @@ import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@ -39,7 +41,12 @@ public class TestGGFinder {
private static Class<?> classToTest;
private static Object instanceOfClass;
private static String className = "TestGGFinder";
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void ggFinder() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
execute(new File(rootDirectory+className+".jav"));

View File

@ -12,6 +12,8 @@ import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@ -39,7 +41,12 @@ public class TestLocalVarLambda {
private static Class<?> classToTest;
private static Object instanceOfClass;
private static String className = "TestLocalVarLambda";
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void ggFinder() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
execute(new File(rootDirectory+className+".jav"));

View File

@ -12,6 +12,8 @@ import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@ -39,7 +41,12 @@ public class TestMutualRecursion {
private static Class<?> classToTest;
private static Object instanceOfClass;
private static String className;
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void TestMutualRecursion1() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
className = "TestMutualRecursion";

View File

@ -8,6 +8,8 @@ import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
@ -24,6 +26,11 @@ public class TestReturnVar {
public static final String rootDirectory = System.getProperty("user.dir")+"/src/test/resources/insertGenericsJav/";
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void ggFinder() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"TestReturnVar.jav"));

View File

@ -8,6 +8,8 @@ import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
@ -24,6 +26,11 @@ public class TestSecondLineOfClassConstraints {
public static final String rootDirectory = System.getProperty("user.dir")+"/src/test/resources/insertGenericsJav/";
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void ggFinder() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"TestSecondLineOfClassConstraints.jav"));

View File

@ -12,7 +12,9 @@ import de.dhbwstuttgart.core.JavaTXCompiler;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.Test;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@ -40,7 +42,12 @@ public class TestTPHsAndGenerics {
private static Class<?> classToTest;
private static Object instanceOfClass;
private static String className = "TestTPHsAndGenerics";
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void ggFinder() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
execute(new File(rootDirectory+className+".jav"));

View File

@ -8,6 +8,8 @@ import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
@ -24,6 +26,11 @@ public class TestTPHsAndGenerics2 {
public static final String rootDirectory = System.getProperty("user.dir")+"/src/test/resources/insertGenericsJav/";
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void ggFinder() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"TestTPHSAndGenerics2.jav"));

View File

@ -12,6 +12,8 @@ import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@ -39,7 +41,12 @@ public class TestThreeArgs {
private static Class<?> classToTest;
private static Object instanceOfClass;
private static String className = "TestThreeArgs";
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void ggFinder() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
execute(new File(rootDirectory+className+".jav"));

View File

@ -15,6 +15,8 @@ import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
@ -40,7 +42,12 @@ public class TestTwoArgs {
private static Class<?> classToTest;
private static Object instanceOfClass;
private static String className = "TestTwoArgs";
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void ggFinder() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
execute(new File(rootDirectory+className+".jav"));

View File

@ -12,6 +12,8 @@ import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@ -39,7 +41,12 @@ public class TestTwoArgs2 {
private static Class<?> classToTest;
private static Object instanceOfClass;
private static String className = "TestTwoArgs2";
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void ggFinder() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
execute(new File(rootDirectory+className+".jav"));

View File

@ -12,6 +12,8 @@ import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@ -39,7 +41,12 @@ public class TestTwoCalls {
private static Class<?> classToTest;
private static Object instanceOfClass;
private static String className = "TestTwoCalls";
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void ggFinder() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
execute(new File(rootDirectory+className+".jav"));

View File

@ -12,6 +12,8 @@ import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@ -39,7 +41,12 @@ public class TestVector {
private static Class<?> classToTest;
private static Object instanceOfClass;
private static String className = "TestVector";
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void ggFinder() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
execute(new File(rootDirectory+className+".jav"));

View File

@ -8,6 +8,8 @@ import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
import de.dhbwstuttgart.typedeployment.TypeInsert;
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
@ -24,6 +26,11 @@ public class TestVoidMeth {
public static final String rootDirectory = System.getProperty("user.dir")+"/src/test/resources/insertGenericsJav/";
@BeforeClass
public static void resetNamesOfTypePlaceholder() {
de.dhbwstuttgart.syntaxtree.factory.NameGenerator.reset();
}
@Test
public void ggFinder() throws IOException, ClassNotFoundException {
execute(new File(rootDirectory+"TestVoidMeth.jav"));