forked from JavaTX/JavaCompilerCore
BCEL Test für BoolLit
This commit is contained in:
parent
8da8eb7d28
commit
68aa427220
24
.classpath
24
.classpath
@ -1,12 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry excluding=".classpath|.cvsignore|.externalToolBuilders/|.project|.settings/|Papers/|bin/|doc/|examples/|lib/|notizen/|src/|test/|tools/" including="log4j.xml" kind="src" path=""/>
|
<classpathentry excluding=".classpath|.cvsignore|.externalToolBuilders/|.project|.settings/|Papers/|bin/|doc/|examples/|lib/|notizen/|src/|test/|tools/" including="log4j.xml" kind="src" path=""/>
|
||||||
<classpathentry kind="src" path="test"/>
|
<classpathentry kind="src" path="test"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||||
<classpathentry kind="lib" path="lib/junit-4.0.jar" sourcepath="/home/janulrich/.m2/repository/junit/junit/4.0/junit-4.0-sources.jar"/>
|
<classpathentry kind="lib" path="lib/junit-4.0.jar" sourcepath="/home/janulrich/.m2/repository/junit/junit/4.0/junit-4.0-sources.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/cloning.jar"/>
|
<classpathentry kind="lib" path="lib/cloning.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/bcel-5.2.jar"/>
|
<classpathentry kind="lib" path="lib/bcel-5.2.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
||||||
</classpath>
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
</classpath>
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
||||||
|
|
||||||
<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
|
<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
|
||||||
|
|
||||||
<appender name="CONSOLE" class="de.dhbwstuttgart.logger.ConsoleAppender">
|
<appender name="CONSOLE" class="de.dhbwstuttgart.logger.ConsoleAppender">
|
||||||
<param name="Target" value="System.out"/>
|
<param name="Target" value="System.out"/>
|
||||||
|
|
||||||
<layout class="de.dhbwstuttgart.logger.PatternLayout">
|
<layout class="de.dhbwstuttgart.logger.PatternLayout">
|
||||||
<param name="ConversionPattern" value="%-15C{1} %-5p [%-9c] %m%n"/>
|
<param name="ConversionPattern" value="%-15C{1} %-5p [%-9c] %m%n"/>
|
||||||
</layout>
|
</layout>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<logger name="codegen">
|
<logger name="codegen">
|
||||||
<level value="INFO"/>
|
<level value="INFO"/>
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
|
||||||
<logger name="parser">
|
<logger name="parser">
|
||||||
<level value="OFF"/>
|
<level value="OFF"/>
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
|
||||||
<logger name="inference">
|
<logger name="inference">
|
||||||
<level value="WARN"/>
|
<level value="WARN"/>
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
|
||||||
|
|
||||||
<logger name="bytecode">
|
<logger name="bytecode">
|
||||||
<level value="INFO"/>
|
<level value="INFO"/>
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
|
||||||
</log4j:configuration>
|
</log4j:configuration>
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
||||||
|
|
||||||
<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
|
<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
|
||||||
|
|
||||||
<appender name="CONSOLE" class="de.dhbwstuttgart.logger.ConsoleAppender">
|
<appender name="CONSOLE" class="de.dhbwstuttgart.logger.ConsoleAppender">
|
||||||
<param name="Target" value="System.out"/>
|
<param name="Target" value="System.out"/>
|
||||||
|
|
||||||
<layout class="de.dhbwstuttgart.logger.PatternLayout">
|
<layout class="de.dhbwstuttgart.logger.PatternLayout">
|
||||||
<param name="ConversionPattern" value="%-15C{1} %-5p [%-9c] %m%n"/>
|
<param name="ConversionPattern" value="%-15C{1} %-5p [%-9c] %m%n"/>
|
||||||
</layout>
|
</layout>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<logger name="trtest">
|
<logger name="trtest">
|
||||||
<level value="DEBUG"/>
|
<level value="DEBUG"/>
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
|
||||||
<logger name="funcTest">
|
<logger name="funcTest">
|
||||||
<level value="DEBUG"/>
|
<level value="DEBUG"/>
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
|
||||||
</log4j:configuration>
|
</log4j:configuration>
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
class Matrix{
|
class Matrix{
|
||||||
<A extends B, C extends B> String op = "String";
|
<A extends B, C extends B> String op = "String";
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
class FieldInitializationTest{
|
class FieldInitializationTest{
|
||||||
String var = "hallo";
|
String var = "hallo";
|
||||||
}
|
}
|
@ -1,3 +1,3 @@
|
|||||||
class Test{
|
class Test{
|
||||||
<A> A var;
|
<A> A var;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
class ImportTest{
|
class ImportTest{
|
||||||
}
|
}
|
7
test/bytecode/BoolLit.jav
Normal file
7
test/bytecode/BoolLit.jav
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
class BoolLit{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
45
test/bytecode/BoolLitTest.java
Normal file
45
test/bytecode/BoolLitTest.java
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
package bytecode;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import plugindevelopment.TypeInsertTester;
|
||||||
|
import de.dhbwstuttgart.core.MyCompiler;
|
||||||
|
import de.dhbwstuttgart.core.MyCompilerAPI;
|
||||||
|
import de.dhbwstuttgart.logger.LoggerConfiguration;
|
||||||
|
import de.dhbwstuttgart.logger.Section;
|
||||||
|
import de.dhbwstuttgart.parser.JavaParser.yyException;
|
||||||
|
import de.dhbwstuttgart.typeinference.ByteCodeResult;
|
||||||
|
import de.dhbwstuttgart.typeinference.Menge;
|
||||||
|
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
|
||||||
|
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
|
||||||
|
|
||||||
|
public class BoolLitTest {
|
||||||
|
|
||||||
|
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
|
||||||
|
public final static String testFile = "BoolLit.jav";
|
||||||
|
public final static String outputFile = "BoolLit.class";
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test() {
|
||||||
|
LoggerConfiguration logConfig = new LoggerConfiguration().setOutput(Section.PARSER, System.out);
|
||||||
|
MyCompilerAPI compiler = MyCompiler.getAPI(logConfig);
|
||||||
|
try {
|
||||||
|
compiler.parse(new File(rootDirectory + testFile));
|
||||||
|
compiler.typeReconstruction();
|
||||||
|
ByteCodeResult bytecode = compiler.generateBytecode();
|
||||||
|
System.out.println(bytecode);
|
||||||
|
bytecode.getByteCode().getJavaClass().dump(new File(rootDirectory + outputFile));
|
||||||
|
} catch (IOException | yyException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
TestCase.fail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user