Kleiner Hack für Inherit test
This commit is contained in:
parent
8e2d4e1c70
commit
60b182b9b1
4
pom.xml
4
pom.xml
@ -75,7 +75,7 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<sourceDirectory>src/main/antlr4/java8</sourceDirectory>
|
<sourceDirectory>src/main/antlr4/java8</sourceDirectory>
|
||||||
<outputDirectory>${project.basedir}/target/generated-sources/antlr4/de/dhbwstuttgart/parser/antlr</outputDirectory>
|
<outputDirectory>${project.basedir}/src/main/java/de/dhbwstuttgart/parser/antlr</outputDirectory>
|
||||||
<arguments>
|
<arguments>
|
||||||
<argument>-package</argument>
|
<argument>-package</argument>
|
||||||
<argument>de.dhbwstuttgart.parser.antlr</argument>
|
<argument>de.dhbwstuttgart.parser.antlr</argument>
|
||||||
@ -89,7 +89,7 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<sourceDirectory>src/main/antlr4/sat</sourceDirectory>
|
<sourceDirectory>src/main/antlr4/sat</sourceDirectory>
|
||||||
<outputDirectory>${project.basedir}/target/generated-sources/antlr4/de/dhbwstuttgart/sat/asp/parser/antlr</outputDirectory>
|
<outputDirectory>${project.basedir}/src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr</outputDirectory>
|
||||||
<arguments>
|
<arguments>
|
||||||
<argument>-package</argument>
|
<argument>-package</argument>
|
||||||
<argument>de.dhbwstuttgart.sat.asp.parser.antlr</argument>
|
<argument>de.dhbwstuttgart.sat.asp.parser.antlr</argument>
|
||||||
|
@ -138,11 +138,12 @@ public class InheritTest {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testmainAA() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException {
|
public void testmainAA() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
|
||||||
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
||||||
classToTest = loader.loadClass("Inherit");
|
classToTest = loader.loadClass("Inherit");
|
||||||
Method m = classToTestAA.getDeclaredMethod("m", Integer.class);
|
Method m = classToTestAA.getDeclaredMethod("m", Integer.class);
|
||||||
assertEquals(m.invoke(instanceOfClassAA, 5), "AA");
|
assertEquals(m.invoke(instanceOfClassAA, 5), "AA");
|
||||||
|
classToTestAA = classToTest.getField("aafield").getType();
|
||||||
Method main = classToTest.getDeclaredMethod("main", classToTestAA, Integer.class);
|
Method main = classToTest.getDeclaredMethod("main", classToTestAA, Integer.class);
|
||||||
assertEquals(main.invoke(instanceOfClass, instanceOfClassAA, 5), "AA");
|
assertEquals(main.invoke(instanceOfClass, instanceOfClassAA, 5), "AA");
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import java.lang.String;
|
|||||||
|
|
||||||
public class Inherit {
|
public class Inherit {
|
||||||
|
|
||||||
|
AA aafield;
|
||||||
//m(Integer i) { return "AA"; }
|
//m(Integer i) { return "AA"; }
|
||||||
|
|
||||||
main(d, i) {
|
main(d, i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user