From eb3db718adee6af17ee0929efd4a9a85a6f0b83e Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Tue, 29 Sep 2015 18:18:06 +0200 Subject: [PATCH] =?UTF-8?q?Neue=20Testf=C3=A4lle=20in=20bytecode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/bytecode/LambdaExpr2.jav | 8 ++++++++ test/bytecode/LambdaExpr2.java | 34 ++++++++++++++++++++++++++++++++++ test/bytecode/Test3.java | 6 ++++++ 3 files changed, 48 insertions(+) create mode 100644 test/bytecode/LambdaExpr2.jav create mode 100644 test/bytecode/LambdaExpr2.java create mode 100644 test/bytecode/Test3.java diff --git a/test/bytecode/LambdaExpr2.jav b/test/bytecode/LambdaExpr2.jav new file mode 100644 index 00000000..39e6cfd5 --- /dev/null +++ b/test/bytecode/LambdaExpr2.jav @@ -0,0 +1,8 @@ +class LambdaExpr2 { + + op = ()->method(); + + method() { + return 2; + } +} \ No newline at end of file diff --git a/test/bytecode/LambdaExpr2.java b/test/bytecode/LambdaExpr2.java new file mode 100644 index 00000000..ff607c6c --- /dev/null +++ b/test/bytecode/LambdaExpr2.java @@ -0,0 +1,34 @@ +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 LambdaExpr2 { + + public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; + public final static String testFile = "LambdaExpr2.jav"; + public final static String outputFile = "LambdaExpr2.class"; + + @Test + public void test() { + SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); + } + +} diff --git a/test/bytecode/Test3.java b/test/bytecode/Test3.java new file mode 100644 index 00000000..5c1fc6a3 --- /dev/null +++ b/test/bytecode/Test3.java @@ -0,0 +1,6 @@ +class Test3{ + +public static void main(String[] args){ +System.out.println(new LambdaExpr2().op.apply()); +} +}