JUnit Test für Lokale Variabeln erstellt

This commit is contained in:
Enrico Schrödter 2015-10-28 10:48:14 +01:00
parent ce52fd8904
commit f077829d30
8 changed files with 97 additions and 6 deletions

View File

@ -0,0 +1,7 @@
import java.util.Vector;
class LocalVariableStringVector{
void method() {
Vector<String> vector;
}
}

View File

@ -0,0 +1,39 @@
package bytecode.types;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Vector;
import org.junit.Test;
import bytecode.BytecodeTest;
public class LocalVariableStringVectorTest extends BytecodeTest{
@Override
protected void init() {
testName = "LocalVariableStringVector";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/types/";
}
@Test
public void testCompiler() {
try{
ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}catch(Exception e){
throw new RuntimeException(e);
}
}
}

View File

@ -0,0 +1,7 @@
import java.util.Vector;
class LocalVariableVector{
void method() {
Vector vector;
}
}

View File

@ -0,0 +1,38 @@
package bytecode.types;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Vector;
import org.junit.Test;
import bytecode.BytecodeTest;
public class LocalVariableVectorTest extends BytecodeTest{
@Override
protected void init() {
testName = "LocalVariableVector";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/types/";
}
@Test
public void testCompiler() {
try{
ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}catch(Exception e){
throw new RuntimeException(e);
}
}
}

View File

@ -1,6 +1,6 @@
import java.util.Vector;
class TypedVector{
class MethodWithTypedVector{
public void method(Vector<String> v) {
}

View File

@ -15,10 +15,10 @@ import bytecode.BytecodeTest;
import de.dhbwstuttgart.logger.Logger;
import de.dhbwstuttgart.logger.Section;
public class TypedVectorTest extends BytecodeTest{
public class MethodWithTypedVectorTest extends BytecodeTest{
@Override
protected void init() {
testName = "TypedVector";
testName = "MethodWithTypedVector";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/types/";
}

View File

@ -1,6 +1,6 @@
import java.util.Vector;
class UntypedVector{
class MethodWithUntypedVector{
public void method(Vector v) {
}

View File

@ -15,10 +15,10 @@ import bytecode.BytecodeTest;
import de.dhbwstuttgart.logger.Logger;
import de.dhbwstuttgart.logger.Section;
public class UntypedVectorTest extends BytecodeTest{
public class MethodWithUntypedVectorTest extends BytecodeTest{
@Override
protected void init() {
testName = "UntypedVector";
testName = "MethodWithUntypedVector";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/types/";
}