fix imports; restructure annotations tests

This commit is contained in:
Julian Dolby 2015-09-16 13:25:21 -04:00
parent 13de4a3bd1
commit 26b126203d
8 changed files with 151 additions and 189 deletions

View File

@ -12,8 +12,7 @@ package com.ibm.wala.core.tests.cha;
import java.io.IOException;
import junit.framework.Assert;
import org.junit.Assert;
import org.junit.Test;
import com.ibm.wala.core.tests.ir.DeterministicIRTest;

View File

@ -12,7 +12,6 @@ package com.ibm.wala.core.tests.ir;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;
import org.junit.Test;
@ -22,6 +21,8 @@ import com.ibm.wala.classLoader.IBytecodeMethod;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.classLoader.IField;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.core.tests.util.JVMLTestAssertions;
import com.ibm.wala.core.tests.util.TestAssertions;
import com.ibm.wala.core.tests.util.WalaTestCase;
import com.ibm.wala.ipa.cha.ClassHierarchyException;
import com.ibm.wala.ipa.cha.IClassHierarchy;
@ -36,18 +37,19 @@ import com.ibm.wala.util.collections.HashSetFactory;
import com.ibm.wala.util.collections.Pair;
import com.ibm.wala.util.strings.Atom;
public abstract class AnnotationTest extends WalaTestCase {
protected abstract void assertEquals(Object findOrCreate, Object type);
protected abstract void assertNotNull(String string, Object classUnderTest);
protected abstract void assertTrue(String x, boolean b);
public class AnnotationTest extends WalaTestCase {
private final IClassHierarchy cha;
protected AnnotationTest(IClassHierarchy cha) {
private final TestAssertions harness;
protected AnnotationTest(TestAssertions harness, IClassHierarchy cha) {
this.cha = cha;
this.harness = harness;
}
public AnnotationTest() throws ClassHierarchyException, IOException {
this(new JVMLTestAssertions(), WalaTestCase.makeCHA());
}
@Test
@ -90,32 +92,17 @@ public abstract class AnnotationTest extends WalaTestCase {
Collection<Annotation> expectedRuntimeVisibleAnnotations) throws IOException, ClassHierarchyException,
InvalidClassFileException {
IClass classUnderTest = cha.lookupClass(typeUnderTest);
assertNotNull(typeUnderTest.toString() + " not found", classUnderTest);
assertTrue(classUnderTest + " must be BytecodeClass", classUnderTest instanceof BytecodeClass);
harness.assertNotNull(typeUnderTest.toString() + " not found", classUnderTest);
harness.assertTrue(classUnderTest + " must be BytecodeClass", classUnderTest instanceof BytecodeClass);
BytecodeClass<?> bcClassUnderTest = (BytecodeClass<?>) classUnderTest;
Collection<Annotation> runtimeInvisibleAnnotations = bcClassUnderTest.getAnnotations(true);
assertEqualCollections(expectedRuntimeInvisibleAnnotations, runtimeInvisibleAnnotations);
harness.assertEqualCollections(expectedRuntimeInvisibleAnnotations, runtimeInvisibleAnnotations);
Collection<Annotation> runtimeVisibleAnnotations = bcClassUnderTest.getAnnotations(false);
assertEqualCollections(expectedRuntimeVisibleAnnotations, runtimeVisibleAnnotations);
harness.assertEqualCollections(expectedRuntimeVisibleAnnotations, runtimeVisibleAnnotations);
}
private <T> void assertEqualCollections(Collection<T> expected, Collection<T> actual) {
if (expected == null) {
expected = Collections.emptySet();
}
if (actual == null) {
actual = Collections.emptySet();
}
if (expected.size() != actual.size()) {
assertTrue("expected=" + expected + " actual=" + actual, false);
}
for (T a : expected) {
assertTrue("missing " + a.toString(), actual.contains(a));
}
}
@SuppressWarnings("unchecked")
@Test
@ -123,31 +110,31 @@ public abstract class AnnotationTest extends WalaTestCase {
TypeReference typeRef = TypeReference.findOrCreate(ClassLoaderReference.Application, "Lannotations/AnnotatedClass3");
IClass klass = cha.lookupClass(typeRef);
assertNotNull(typeRef + " must exist", klass);
harness.assertNotNull(typeRef + " must exist", klass);
BytecodeClass<?> shrikeClass = (BytecodeClass<?>) klass;
Collection<Annotation> classAnnotations = shrikeClass.getAnnotations(true);
assertEquals("[Annotation type <Application,Lannotations/AnnotationWithParams> {strParam=classStrParam}]",
harness.assertEquals("[Annotation type <Application,Lannotations/AnnotationWithParams> {strParam=classStrParam}]",
classAnnotations.toString());
MethodReference methodRefUnderTest = MethodReference.findOrCreate(typeRef, Selector.make("foo()V"));
IMethod methodUnderTest = cha.resolveMethod(methodRefUnderTest);
assertNotNull(methodRefUnderTest.toString() + " not found", methodUnderTest);
assertTrue(methodUnderTest + " must be IBytecodeMethod", methodUnderTest instanceof IBytecodeMethod);
harness.assertNotNull(methodRefUnderTest.toString() + " not found", methodUnderTest);
harness.assertTrue(methodUnderTest + " must be IBytecodeMethod", methodUnderTest instanceof IBytecodeMethod);
IBytecodeMethod bcMethodUnderTest = (IBytecodeMethod) methodUnderTest;
Collection<Annotation> runtimeInvisibleAnnotations = bcMethodUnderTest.getAnnotations(true);
assertEquals(1, runtimeInvisibleAnnotations.size());
harness.assertEquals(1, runtimeInvisibleAnnotations.size());
Annotation x = runtimeInvisibleAnnotations.iterator().next();
assertEquals(TypeReference.findOrCreate(ClassLoaderReference.Application, "Lannotations/AnnotationWithParams"), x.getType());
harness.assertEquals(TypeReference.findOrCreate(ClassLoaderReference.Application, "Lannotations/AnnotationWithParams"), x.getType());
for(Pair<String,String> n : new Pair[]{Pair.make("enumParam", "EnumElementValue [type=Lannotations/AnnotationEnum;, val=VAL1]"),
Pair.make("strArrParam", "ArrayElementValue [vals=[biz, boz]]"),
Pair.make("annotParam", "AnnotationElementValue [type=Lannotations/AnnotationWithSingleParam;, elementValues={value=sdfevs}]"),
Pair.make("strParam", "sdfsevs"),
Pair.make("intParam", "25"),
Pair.make("klassParam", "Ljava/lang/Integer;")}) {
assertEquals(n.snd, x.getNamedArguments().get(n.fst).toString());
harness.assertEquals(n.snd, x.getNamedArguments().get(n.fst).toString());
}
}
@ -158,10 +145,10 @@ public abstract class AnnotationTest extends WalaTestCase {
FieldReference fieldRefUnderTest = FieldReference.findOrCreate(typeRef, Atom.findOrCreateUnicodeAtom("foo"), TypeReference.Int);
IField fieldUnderTest = cha.resolveField(fieldRefUnderTest);
assertNotNull(fieldRefUnderTest.toString() + " not found", fieldUnderTest);
harness.assertNotNull(fieldRefUnderTest.toString() + " not found", fieldUnderTest);
Collection<Annotation> annots = fieldUnderTest.getAnnotations();
assertEquals(
harness.assertEquals(
"[Annotation type <Application,Lannotations/RuntimeInvisableAnnotation>, Annotation type <Application,Lannotations/RuntimeVisableAnnotation>]",
annots.toString());
@ -194,12 +181,12 @@ public abstract class AnnotationTest extends WalaTestCase {
MethodReference methodRefUnderTest = MethodReference.findOrCreate(typeRef, Selector.make(selector));
IMethod methodUnderTest = cha.resolveMethod(methodRefUnderTest);
assertTrue(methodRefUnderTest.toString() + " not found", methodUnderTest != null);
assertTrue(methodUnderTest + " must be bytecode method", methodUnderTest instanceof IBytecodeMethod);
harness.assertTrue(methodRefUnderTest.toString() + " not found", methodUnderTest != null);
harness.assertTrue(methodUnderTest + " must be bytecode method", methodUnderTest instanceof IBytecodeMethod);
IBytecodeMethod IBytecodeMethodUnderTest = (IBytecodeMethod) methodUnderTest;
Collection<Annotation>[] parameterAnnotations = IBytecodeMethodUnderTest.getParameterAnnotations();
assertEquals(expected.length, parameterAnnotations.length);
harness.assertEquals(expected.length, parameterAnnotations.length);
for (int i = 0; i < expected.length; i++) {
Set<String> e = HashSetFactory.make();
for(String s : expected[i]) {
@ -213,7 +200,7 @@ public abstract class AnnotationTest extends WalaTestCase {
}
}
assertTrue(e + " must be " + a, e.equals(a));
harness.assertTrue(e + " must be " + a, e.equals(a));
}
}

View File

@ -10,69 +10,47 @@
*******************************************************************************/
package com.ibm.wala.core.tests.ir;
import org.junit.AfterClass;
import java.io.IOException;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import com.ibm.wala.cfg.ControlFlowGraph;
import com.ibm.wala.classLoader.ClassLoaderFactory;
import com.ibm.wala.classLoader.ClassLoaderFactoryImpl;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.classLoader.Language;
import com.ibm.wala.core.tests.util.TestConstants;
import com.ibm.wala.core.tests.util.WalaTestCase;
import com.ibm.wala.ipa.callgraph.AnalysisCache;
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.callgraph.impl.Everywhere;
import com.ibm.wala.ipa.cha.ClassHierarchy;
import com.ibm.wala.ipa.cha.ClassHierarchyException;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.ssa.IR;
import com.ibm.wala.ssa.ISSABasicBlock;
import com.ibm.wala.ssa.SSACFG;
import com.ibm.wala.ssa.SSAInstruction;
import com.ibm.wala.ssa.SSAOptions;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.util.config.AnalysisScopeReader;
import com.ibm.wala.util.debug.Assertions;
import com.ibm.wala.util.graph.GraphIntegrity;
import com.ibm.wala.util.graph.GraphIntegrity.UnsoundGraphException;
import com.ibm.wala.util.intset.IntSet;
import com.ibm.wala.util.io.FileProvider;
import com.ibm.wala.util.strings.StringStuff;
import com.ibm.wala.util.warnings.Warnings;
/**
* Test integrity of CFGs
*/
public class CFGTest extends WalaTestCase {
private final IClassHierarchy cha;
private static AnalysisScope scope;
private static ClassHierarchy cha;
@BeforeClass
public static void beforeClass() throws Exception {
scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA,
(new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), CFGTest.class.getClassLoader());
ClassLoaderFactory factory = new ClassLoaderFactoryImpl(scope.getExclusions());
try {
cha = ClassHierarchy.make(scope, factory);
} catch (ClassHierarchyException e) {
throw new Exception();
}
}
@AfterClass
public static void afterClass() throws Exception {
Warnings.clear();
scope = null;
cha = null;
}
protected CFGTest(IClassHierarchy cha) {
this.cha = cha;
}
public CFGTest() throws ClassHierarchyException, IOException {
this(WalaTestCase.makeCHA());
}
public static void main(String[] args) {
justThisTest(CFGTest.class);
}
@ -89,7 +67,7 @@ public class CFGTest extends WalaTestCase {
Assertions.UNREACHABLE("could not resolve " + mr);
}
AnalysisOptions options = new AnalysisOptions();
AnalysisCache cache = new AnalysisCache();
AnalysisCache cache = makeAnalysisCache();
options.getSSAOptions().setPiNodePolicy(SSAOptions.getAllBuiltInPiNodes());
IR ir = cache.getSSACache().findOrCreateIR(m, Everywhere.EVERYWHERE, options.getSSAOptions());
@ -133,7 +111,7 @@ public class CFGTest extends WalaTestCase {
MethodReference mr = StringStuff.makeMethodReference("hello.Hello.main([Ljava/lang/String;)V");
IMethod m = cha.resolveMethod(mr);
AnalysisCache cache = new AnalysisCache();
AnalysisCache cache = makeAnalysisCache();
IR irBefore = cache.getIR(m);
cache.getSSACache().wipe();
IR irAfter = cache.getIR(m);
@ -149,7 +127,7 @@ public class CFGTest extends WalaTestCase {
MethodReference mr = StringStuff.makeMethodReference("cfg.MonitorTest.sync1()V");
IMethod m = cha.resolveMethod(mr);
AnalysisCache cache = new AnalysisCache();
AnalysisCache cache = makeAnalysisCache();
IR ir = cache.getIR(m);
System.out.println(ir);
SSACFG controlFlowGraph = ir.getControlFlowGraph();
@ -161,7 +139,7 @@ public class CFGTest extends WalaTestCase {
MethodReference mr = StringStuff.makeMethodReference("cfg.MonitorTest.sync2()V");
IMethod m = cha.resolveMethod(mr);
AnalysisCache cache = new AnalysisCache();
AnalysisCache cache = makeAnalysisCache();
IR ir = cache.getIR(m);
System.out.println(ir);
SSACFG controlFlowGraph = ir.getControlFlowGraph();
@ -176,7 +154,7 @@ public class CFGTest extends WalaTestCase {
MethodReference mr = StringStuff.makeMethodReference("cfg.MonitorTest.sync3()V");
IMethod m = cha.resolveMethod(mr);
AnalysisCache cache = new AnalysisCache();
AnalysisCache cache = makeAnalysisCache();
IR ir = cache.getIR(m);
SSACFG controlFlowGraph = ir.getControlFlowGraph();
Assert.assertEquals(1, controlFlowGraph.getSuccNodeCount(controlFlowGraph.getBlockForInstruction(33)));

View File

@ -10,35 +10,28 @@
*******************************************************************************/
package com.ibm.wala.core.tests.ir;
import java.io.IOException;
import java.util.Iterator;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import com.ibm.wala.classLoader.ClassLoaderFactory;
import com.ibm.wala.classLoader.ClassLoaderFactoryImpl;
import com.ibm.wala.classLoader.IMethod;
import com.ibm.wala.core.tests.util.TestConstants;
import com.ibm.wala.core.tests.util.WalaTestCase;
import com.ibm.wala.ipa.callgraph.AnalysisCache;
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.callgraph.impl.Everywhere;
import com.ibm.wala.ipa.cha.ClassHierarchy;
import com.ibm.wala.ipa.cha.ClassHierarchyException;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.ssa.IR;
import com.ibm.wala.ssa.SSAInstruction;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.util.config.AnalysisScopeReader;
import com.ibm.wala.util.graph.GraphIntegrity;
import com.ibm.wala.util.graph.GraphIntegrity.UnsoundGraphException;
import com.ibm.wala.util.io.FileProvider;
import com.ibm.wala.util.strings.Atom;
import com.ibm.wala.util.strings.ImmutableByteArray;
import com.ibm.wala.util.strings.UTF8Convert;
import com.ibm.wala.util.warnings.Warnings;
/**
* Test that the SSA-numbering of variables in the IR is deterministic.
@ -48,49 +41,27 @@ import com.ibm.wala.util.warnings.Warnings;
*/
public class DeterministicIRTest extends WalaTestCase {
private static final ClassLoader MY_CLASSLOADER = DeterministicIRTest.class.getClassLoader();
private IClassHierarchy cha;
private static AnalysisScope scope;
private static ClassHierarchy cha;
private static AnalysisOptions options;
private static AnalysisCache cache;
private final AnalysisOptions options = new AnalysisOptions();
protected DeterministicIRTest(IClassHierarchy cha) {
this.cha = cha;
}
public DeterministicIRTest() throws ClassHierarchyException, IOException {
this(WalaTestCase.makeCHA());
}
public static void main(String[] args) {
justThisTest(DeterministicIRTest.class);
}
@BeforeClass
public static void beforeClass() throws Exception {
scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA,
(new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
options = new AnalysisOptions(scope, null);
cache = new AnalysisCache();
ClassLoaderFactory factory = new ClassLoaderFactoryImpl(scope.getExclusions());
try {
cha = ClassHierarchy.make(scope, factory);
} catch (ClassHierarchyException e) {
throw new Exception();
}
}
@AfterClass
public static void afterClass() throws Exception {
Warnings.clear();
scope = null;
cha = null;
options = null;
cache = null;
}
/**
/**
* @param method
*/
private IR doMethod(MethodReference method) {
AnalysisCache cache = makeAnalysisCache();
Assert.assertNotNull("method not found", method);
IMethod imethod = cha.resolveMethod(method);
Assert.assertNotNull("imethod not found", imethod);
@ -148,26 +119,26 @@ public class DeterministicIRTest extends WalaTestCase {
@Test public void testIR1() {
// 'remove' is a nice short method
doMethod(scope.findMethod(AnalysisScope.APPLICATION, "Ljava/util/HashMap", Atom.findOrCreateUnicodeAtom("remove"),
doMethod(cha.getScope().findMethod(AnalysisScope.APPLICATION, "Ljava/util/HashMap", Atom.findOrCreateUnicodeAtom("remove"),
new ImmutableByteArray(UTF8Convert.toUTF8("(Ljava/lang/Object;)Ljava/lang/Object;"))));
}
@Test public void testIR2() {
// 'equals' is a nice medium-sized method
doMethod(scope.findMethod(AnalysisScope.APPLICATION, "Ljava/lang/String", Atom.findOrCreateUnicodeAtom("equals"),
doMethod(cha.getScope().findMethod(AnalysisScope.APPLICATION, "Ljava/lang/String", Atom.findOrCreateUnicodeAtom("equals"),
new ImmutableByteArray(UTF8Convert.toUTF8("(Ljava/lang/Object;)Z"))));
}
@Test public void testIR3() {
// 'resolveProxyClass' is a nice long method (at least in Sun libs)
doMethod(scope.findMethod(AnalysisScope.APPLICATION, "Ljava/io/ObjectInputStream", Atom
doMethod(cha.getScope().findMethod(AnalysisScope.APPLICATION, "Ljava/io/ObjectInputStream", Atom
.findOrCreateUnicodeAtom("resolveProxyClass"), new ImmutableByteArray(UTF8Convert
.toUTF8("([Ljava/lang/String;)Ljava/lang/Class;"))));
}
@Test public void testIR4() {
// test some corner cases with try-finally
doMethod(scope.findMethod(AnalysisScope.APPLICATION, "LcornerCases/TryFinally", Atom.findOrCreateUnicodeAtom("test1"),
doMethod(cha.getScope().findMethod(AnalysisScope.APPLICATION, "LcornerCases/TryFinally", Atom.findOrCreateUnicodeAtom("test1"),
new ImmutableByteArray(UTF8Convert.toUTF8("(Ljava/io/InputStream;Ljava/io/InputStream;)V"))));
}
}

View File

@ -1,46 +0,0 @@
package com.ibm.wala.core.tests.ir;
import java.io.IOException;
import org.junit.Assert;
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
import com.ibm.wala.core.tests.util.TestConstants;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.cha.ClassHierarchy;
import com.ibm.wala.ipa.cha.ClassHierarchyException;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.util.config.AnalysisScopeReader;
import com.ibm.wala.util.io.FileProvider;
public class JVMLAnnotationTest extends AnnotationTest {
public static void main(String[] args) {
justThisTest(JVMLAnnotationTest.class);
}
private static IClassHierarchy makeCHA() throws IOException, ClassHierarchyException {
AnalysisScope scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA,
(new FileProvider()).getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS), AnnotationTest.class.getClassLoader());
return ClassHierarchy.make(scope);
}
public JVMLAnnotationTest() throws ClassHierarchyException, IOException {
super(makeCHA());
}
@Override
protected void assertEquals(Object a, Object b) {
Assert.assertEquals(a, b);
}
@Override
protected void assertNotNull(String msg, Object obj) {
Assert.assertNotNull(msg, obj);
}
@Override
protected void assertTrue(String x, boolean b) {
Assert.assertTrue(x, b);
}
}

View File

@ -0,0 +1,22 @@
package com.ibm.wala.core.tests.util;
import org.junit.Assert;
public class JVMLTestAssertions extends TestAssertions {
@Override
public void assertEquals(Object a, Object b) {
Assert.assertEquals(a, b);
}
@Override
public void assertNotNull(String msg, Object obj) {
Assert.assertNotNull(msg, obj);
}
@Override
public void assertTrue(String x, boolean b) {
Assert.assertTrue(x, b);
}
}

View File

@ -0,0 +1,43 @@
package com.ibm.wala.core.tests.util;
import java.util.Collection;
import java.util.Collections;
public abstract class TestAssertions {
public abstract void assertEquals(Object findOrCreate, Object type);
public abstract void assertNotNull(String string, Object classUnderTest);
public abstract void assertTrue(String x, boolean b);
public <T> void assertEqualCollections(Collection<T> expected, Collection<T> actual) {
if (expected == null) {
expected = Collections.emptySet();
}
if (actual == null) {
actual = Collections.emptySet();
}
if (expected.size() != actual.size()) {
assertTrue("expected=" + expected + " actual=" + actual, false);
}
for (T a : expected) {
assertTrue("missing " + a.toString(), actual.contains(a));
}
}
public void assertBound(String tag, double quantity, double bound) {
String msg = tag + ", quantity: " + quantity + ", bound:" + bound;
System.err.println(msg);
assertTrue(msg, quantity <= bound);
}
public void assertBound(String tag, int quantity, int bound) {
String msg = tag + ", quantity: " + quantity + ", bound:" + bound;
System.err.println(msg);
assertTrue(msg, quantity <= bound);
}
}

View File

@ -10,12 +10,22 @@
*******************************************************************************/
package com.ibm.wala.core.tests.util;
import java.io.IOException;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.runner.JUnitCore;
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
import com.ibm.wala.core.tests.ir.AnnotationTest;
import com.ibm.wala.ipa.callgraph.AnalysisCache;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.cha.ClassHierarchy;
import com.ibm.wala.ipa.cha.ClassHierarchyException;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.util.config.AnalysisScopeReader;
import com.ibm.wala.util.heapTrace.HeapTracer;
import com.ibm.wala.util.io.FileProvider;
import com.ibm.wala.util.warnings.Warnings;
/**
@ -55,6 +65,16 @@ public abstract class WalaTestCase {
}
}
protected AnalysisCache makeAnalysisCache() {
return new AnalysisCache();
}
public static IClassHierarchy makeCHA() throws IOException, ClassHierarchyException {
AnalysisScope scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA,
(new FileProvider()).getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS), AnnotationTest.class.getClassLoader());
return ClassHierarchy.make(scope);
}
/**
* Utility function: each DetoxTestCase subclass can have a main() method that calls this, to create a test suite consisting of
* just this test. Useful when investigating a single failing test.
@ -63,16 +83,4 @@ public abstract class WalaTestCase {
JUnitCore.runClasses(testClass);
}
protected static void assertBound(String tag, double quantity, double bound) {
String msg = tag + ", quantity: " + quantity + ", bound:" + bound;
System.err.println(msg);
Assert.assertTrue(msg, quantity <= bound);
}
protected static void assertBound(String tag, int quantity, int bound) {
String msg = tag + ", quantity: " + quantity + ", bound:" + bound;
System.err.println(msg);
Assert.assertTrue(msg, quantity <= bound);
}
}