Commit 19aa8886 by Eric Bruneton

Merge branch 'delete-abstract-test' into 'master'

Delete AbstractTest and refactor the last test using it.

See merge request !41
2 parents c21379d4 6b91ee9d
......@@ -31,7 +31,7 @@ import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.objectweb.asm.AbstractTest;
import org.junit.Test;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
......@@ -43,9 +43,9 @@ import org.objectweb.asm.Opcodes;
*
* @author Eugene Kuleshov
*/
public class AdviceAdapterUnitTest extends AbstractTest {
public class AdviceAdapterUnitTest {
@Override
@Test
public void test() throws Exception {
Class<?> c = getClass();
String name = c.getName();
......
......@@ -47,7 +47,6 @@ import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.objectweb.asm.Opcodes;
/**
* Base class for the parameterized ASM tests. ASM can be used to read, write or transform any Java
......@@ -160,10 +159,10 @@ public abstract class AsmTest {
* @return whether this class was compiled with a JDK which is more recent than api.
*/
public boolean isMoreRecentThan(Api api) {
if (name.startsWith("jdk8") && api.value() < Opcodes.ASM5) {
if (name.startsWith("jdk8") && api.value() < Api.ASM5.value()) {
return true;
}
if (name.startsWith("jdk9") && api.value() < Opcodes.ASM6) {
if (name.startsWith("jdk9") && api.value() < Api.ASM6.value()) {
return true;
}
return false;
......@@ -220,9 +219,9 @@ public abstract class AsmTest {
/** An ASM API version. */
public static enum Api {
ASM4("ASM4", Opcodes.ASM4),
ASM5("ASM5", Opcodes.ASM5),
ASM6("ASM6", Opcodes.ASM6);
ASM4("ASM4", 4 << 16),
ASM5("ASM5", 5 << 16),
ASM6("ASM6", 6 << 16);
private final String name;
private final int value;
......
......@@ -37,7 +37,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.objectweb.asm.Opcodes;
/**
* Unit tests for {@link AsmTest}.
......@@ -56,7 +55,7 @@ public class AsmTestTest extends AsmTest {
/** Tests that we can get the byte array content of each precompiled class. */
@Test
public void testGetBytes() {
assertEquals(Opcodes.ASM6, apiParameter.value());
assertEquals(Api.ASM6, apiParameter);
assertEquals("ASM6", apiParameter.toString());
assertThatClass(classParameter.getBytes()).contains(classParameter.getInternalName());
}
......
......@@ -37,37 +37,8 @@
failureproperty="test.failed">
<batchtest fork="yes" todir="${out.test}/reports">
<fileset dir="${test}/conform">
<include name="org/objectweb/asm/AnnotationVisitorTest.java"/>
<include name="org/objectweb/asm/AttributeTest.java"/>
<include name="org/objectweb/asm/ClassReaderTest.java"/>
<include name="org/objectweb/asm/ClassVisitorTest.java"/>
<include name="org/objectweb/asm/ClassWriterTest.java"/>
<include name="org/objectweb/asm/LabelTest.java"/>
<include name="org/objectweb/asm/MethodVisitorTest.java"/>
<include name="org/objectweb/asm/TypePathTest.java"/>
<include name="org/objectweb/asm/TypeTest.java"/>
<include name="org/objectweb/asm/commons/AdviceAdapterTest.java"/>
<include name="org/objectweb/asm/commons/AnalyzerAdapterTest.java"/>
<include name="org/objectweb/asm/commons/ClassRemapperTest.java"/>
<include name="org/objectweb/asm/commons/CodeSizeEvaluatorTest.java"/>
<include name="org/objectweb/asm/commons/JSRInlinerAdapterTest.java"/>
<include name="org/objectweb/asm/commons/LocalVariablesSorterTest.java"/>
<include name="org/objectweb/asm/commons/SerialVersionUIDAdderTest.java"/>
<include name="org/objectweb/asm/commons/StaticInitMergerTest.java"/>
<include name="org/objectweb/asm/signature/SignatureReaderTest.java"/>
<include name="org/objectweb/asm/signature/SignatureWriterTest.java"/>
<include name="org/objectweb/asm/test/AsmTestTest.java"/>
<include name="org/objectweb/asm/tree/ClassNodeTest.java"/>
<include name="org/objectweb/asm/tree/analysis/BasicInterpreterTest.java"/>
<include name="org/objectweb/asm/tree/analysis/BasicVerifierTest.java"/>
<include name="org/objectweb/asm/tree/analysis/SimpleVerifierTest.java"/>
<include name="org/objectweb/asm/tree/analysis/SourceInterpreterTest.java"/>
<include name="org/objectweb/asm/util/ASMifierTest.java"/>
<include name="org/objectweb/asm/util/CheckClassAdapterTest.java"/>
<include name="org/objectweb/asm/util/CheckSignatureAdapterTest.java"/>
<include name="org/objectweb/asm/util/TraceClassAdapterTest.java"/>
<include name="org/objectweb/asm/xml/SAXAdapterTest.java"/>
<include name="**/*UnitTest.java"/>
<include name="**/*Test.java"/>
<exclude name="**/AsmTest.java"/>
</fileset>
</batchtest>
<formatter type="xml"/>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!