Browse Source

Removing import that is no more needed... wiped out. :)

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269943 13f79535-47bb-0310-9956-ffa450edef68
master
Stephane Bailliez 23 years ago
parent
commit
aa51279001
1 changed files with 8 additions and 9 deletions
  1. +8
    -9
      src/testcases/org/apache/tools/ant/taskdefs/optional/sitraka/ClassFileTest.java

+ 8
- 9
src/testcases/org/apache/tools/ant/taskdefs/optional/sitraka/ClassFileTest.java View File

@@ -53,13 +53,12 @@
*/
package org.apache.tools.ant.taskdefs.optional.sitraka;

import java.io.InputStream;
import java.io.IOException;
import java.io.InputStream;

import junit.framework.TestCase;
import org.apache.tools.ant.taskdefs.optional.sitraka.bytecode.ClassFile;
import org.apache.tools.ant.taskdefs.optional.sitraka.bytecode.MethodInfo;
import org.apache.tools.ant.taskdefs.optional.sitraka.bytecode.attributes.LineNumberTable;

/**
* Nothing special about this testcase...
@@ -72,7 +71,7 @@ public class ClassFileTest extends TestCase {
}

public void testVector() throws IOException {
String classname = ClassTest.class.getName().replace('.','/') + ".class";
String classname = ClassTest.class.getName().replace('.', '/') + ".class";
InputStream is = ClassLoader.getSystemResourceAsStream(classname);
ClassFile clazzfile = new ClassFile(is);
assertEquals("ClassTest", clazzfile.getName());
@@ -84,11 +83,11 @@ public class ClassFileTest extends TestCase {
assertHasMethod("void testOneLine()", 3, methods);
}

protected void assertHasMethod(String methodsig, int line, MethodInfo[] methods){
protected void assertHasMethod(String methodsig, int line, MethodInfo[] methods) {
boolean found = false;
for (int i = 0; i < methods.length; i++) {
MethodInfo method = methods[i];
if ( methodsig.equals(method.getFullSignature()) ){
if (methodsig.equals(method.getFullSignature())) {
assertEquals(methodsig, line, method.getNumberOfLines());
return;
}
@@ -100,19 +99,19 @@ public class ClassFileTest extends TestCase {
class ClassTest {

// 2 lines
public ClassTest(){
public ClassTest() {
}

// 2 lines
public void testTwoLines(){
public void testTwoLines() {
System.out.println("This is 1 line");
}

// 1 line
public void testOneLine() {
public void testOneLine() {
try {
throw new Exception();
} catch (Exception e){
} catch (Exception e) {
}
}
}

Loading…
Cancel
Save