Update tests
This commit is contained in:
parent
0b58fcf3a3
commit
778d1aed9d
8
.idea/compiler.xml
generated
Normal file
8
.idea/compiler.xml
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="JavacSettings">
|
||||||
|
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
||||||
|
<module name="Beethoven" />
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
BIN
out.class
Normal file
BIN
out.class
Normal file
Binary file not shown.
@ -1,5 +1,6 @@
|
|||||||
import dev.w1zzrd.asm.InjectClass;
|
import dev.w1zzrd.asm.InjectClass;
|
||||||
import dev.w1zzrd.asm.Inject;
|
import dev.w1zzrd.asm.Inject;
|
||||||
|
|
||||||
import static dev.w1zzrd.asm.InPlaceInjection.*;
|
import static dev.w1zzrd.asm.InPlaceInjection.*;
|
||||||
|
|
||||||
@InjectClass(value = MergeTest.class)
|
@InjectClass(value = MergeTest.class)
|
||||||
@ -27,12 +28,15 @@ public class MergeInject extends MergeTest implements Runnable {
|
|||||||
public String test(String retVal){
|
public String test(String retVal){
|
||||||
System.out.println("Got retval: "+retVal);
|
System.out.println("Got retval: "+retVal);
|
||||||
|
|
||||||
if (retVal.equals("Test")) {
|
if (retVal.endsWith("e!!Test")) {
|
||||||
System.out.println("Test");
|
System.out.println("Special case!");
|
||||||
|
return "Not Modified?";
|
||||||
}
|
}
|
||||||
|
|
||||||
retVal = "ASDF";
|
retVal = "ASDF";
|
||||||
|
|
||||||
|
System.out.println("Eyyyy");
|
||||||
|
|
||||||
String a = "retVal";
|
String a = "retVal";
|
||||||
|
|
||||||
System.out.println(a);
|
System.out.println(a);
|
||||||
@ -63,6 +67,10 @@ public class MergeInject extends MergeTest implements Runnable {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Inject
|
@Inject
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -1,11 +1,23 @@
|
|||||||
import dev.w1zzrd.asm.Merger;
|
import dev.w1zzrd.asm.Merger;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class Test {
|
public class Test {
|
||||||
public static void main(String... args) throws IOException {
|
public static void main(String... args) throws IOException {
|
||||||
Merger m = new Merger("MergeTest");
|
Merger m = new Merger("MergeTest");
|
||||||
m.inject("MergeInject");
|
m.inject("MergeInject");
|
||||||
|
|
||||||
|
// Save injected data
|
||||||
|
File f = new File("out.class");
|
||||||
|
if(f.isFile() && f.delete() && f.createNewFile()) {
|
||||||
|
FileOutputStream fos = new FileOutputStream(f);
|
||||||
|
fos.write(m.toByteArray());
|
||||||
|
fos.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compile and run
|
||||||
m.compile();
|
m.compile();
|
||||||
|
|
||||||
Runnable r = (Runnable)new MergeTest("Constructor message");
|
Runnable r = (Runnable)new MergeTest("Constructor message");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user