diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..998e0dd --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1 @@ +/nl diff --git a/nl.jssl.autounit.testclasses.BooleanArguments.xml b/nl.jssl.autounit.testclasses.BooleanArguments.xml new file mode 100644 index 0000000..0b71359 --- /dev/null +++ b/nl.jssl.autounit.testclasses.BooleanArguments.xml @@ -0,0 +1,16 @@ + + + public java.lang.String getText(boolean arg1,boolean arg2) + + + + + false + false + + falsefalse + + + + + \ No newline at end of file diff --git a/nl.jssl.autounit.testclasses.ByteArguments.xml b/nl.jssl.autounit.testclasses.ByteArguments.xml new file mode 100644 index 0000000..8d8158b --- /dev/null +++ b/nl.jssl.autounit.testclasses.ByteArguments.xml @@ -0,0 +1,21 @@ + + + public int getDouble(byte arg1) + + + + + -128 + + -256 + + + + 0 + + 11 + + + + + \ No newline at end of file diff --git a/nl.jssl.autounit.testclasses.FloatArguments.xml b/nl.jssl.autounit.testclasses.FloatArguments.xml new file mode 100644 index 0000000..7cd0e0b --- /dev/null +++ b/nl.jssl.autounit.testclasses.FloatArguments.xml @@ -0,0 +1,15 @@ + + + public int round(float arg1) + + + + + -7.5912475E37 + + -2147483648 + + + + + \ No newline at end of file diff --git a/nl.jssl.autounit.testclasses.IntArguments.xml b/nl.jssl.autounit.testclasses.IntArguments.xml new file mode 100644 index 0000000..35f1a54 --- /dev/null +++ b/nl.jssl.autounit.testclasses.IntArguments.xml @@ -0,0 +1,34 @@ + + + public java.lang.String evenOrUneven(int arg1) + + + + + -819817314 + + even + + + + -916902647 + + uneven + + + + + + public int randomOther(int arg1) + + + + + -1762850486 + + 0 + + + + + \ No newline at end of file diff --git a/src/nl/jssl/autounit/utils/MemoryClassloader.java b/src/nl/jssl/autounit/utils/MemoryClassloader.java new file mode 100644 index 0000000..08d9f06 --- /dev/null +++ b/src/nl/jssl/autounit/utils/MemoryClassloader.java @@ -0,0 +1,32 @@ +package nl.jssl.autounit.utils; + +import java.util.HashMap; +import java.util.Map; + +public class MemoryClassloader extends ClassLoader { + + private final Map definitions = new HashMap(); + + /** + * Add a in-memory representation of a class. + * + * @param name + * name of the class + * @param bytes + * class definition + */ + public void addDefinition(final String name, final byte[] bytes) { + definitions.put(name, bytes); + } + + @Override + protected Class loadClass(final String name, final boolean resolve) + throws ClassNotFoundException { + final byte[] bytes = definitions.get(name); + if (bytes != null) { + return defineClass(name, bytes, 0, bytes.length); + } + return super.loadClass(name, resolve); + } + +} \ No newline at end of file