new file: applyLambdaTest.java

modified:   javFiles/Lambda.jav
	new file:   javFiles/applyLambda.jav
An das JavaTXExamples angepasst
This commit is contained in:
Martin Plümicke 2018-07-14 09:28:13 +02:00
parent d373b3dbf8
commit 2a5c727400
3 changed files with 43 additions and 9 deletions

View File

@ -0,0 +1,23 @@
package bytecode;
import java.io.File;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class applyLambdaTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
@Test
public void generateBC() throws Exception {
path = System.getProperty("user.dir")+"/test/bytecode/javFiles/applyLambda.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
compiler.generateBytecode(System.getProperty("user.dir")+"/testBytecode/generatedBC/");
}
}

View File

@ -1,16 +1,11 @@
import java.util.Vector;
class Apply { }
import java.lang.Integer;
public class Lambda {
m () {
var lam1 = (x) -> {
return x;
var lam1 = (Integer x) -> {
return x * x;
};
return lam1.apply(new Apply());
//return lam1;
// return new Vector();
return lam1;
}
}

View File

@ -0,0 +1,16 @@
import java.util.Vector;
class Apply { }
public class applyLambda {
m () {
var lam1 = (x) -> {
return x;
};
return lam1.apply(new Apply());
//return lam1;
//return new Vector();
}
}