01: package org.acm.seguin.summary;
02:
03: import java.io.File;
04: import java.util.Iterator;
05: import org.acm.seguin.io.FileCopy;
06: import org.acm.seguin.junit.DirSourceTestCase;
07:
08: public class TestSummaryLoadVisitor extends DirSourceTestCase {
09: public TestSummaryLoadVisitor(String name) {
10: super (name);
11: }
12:
13: public void test1() {
14: File cleanDir = new File(clean);
15: File destDir = new File(root + "\\test");
16: destDir.mkdirs();
17:
18: File currentFile = new File(destDir, "ClassInMethod.java");
19:
20: (new FileCopy(new File(cleanDir, "test_ClassInMethod.java"),
21: currentFile, false)).run();
22:
23: FileSummary result = FileSummary.getFileSummary(currentFile);
24:
25: Iterator typeIterator = result.getTypes();
26: assertTrue("No types found", (typeIterator != null)
27: && (typeIterator.hasNext()));
28:
29: TypeSummary next = (TypeSummary) typeIterator.next();
30: Iterator methodIterator = next.getMethods();
31:
32: assertTrue("No methods found", (methodIterator != null)
33: && (methodIterator.hasNext()));
34: }
35: }
|