1 package net.firstpartners.nounit.reader.bytecode.test; 2 3 26 27 import junit.framework.Test; 28 import junit.framework.TestCase; 29 import junit.framework.TestSuite; 30 import net.firstpartners.nounit.reader.ISnippetFactory; 31 import net.firstpartners.nounit.reader.bytecode.ByteCodePackageSnippetFactory; 32 import net.firstpartners.nounit.snippet.Snippets; 33 import net.firstpartners.nounit.test.TestData; 34 35 39 public class TestByteCodePackageSnippetFactory extends TestCase { 40 41 45 public TestByteCodePackageSnippetFactory(String name) { 46 super(name); 47 } 48 49 52 public void setUp(){ 53 54 } 55 56 59 protected void tearDown() 60 { 61 62 } 63 64 68 public static void main(String [] args) { 69 junit.textui.TestRunner.run (suite()); 70 } 71 72 76 public static Test suite() { 77 return new TestSuite(TestByteCodePackageSnippetFactory.class); 78 } 79 80 public void testGetSnippetInfo() throws Exception { 81 82 Snippets javaInformation; 84 String info; 85 String sourceDirectory = TestData.SAMPLE_CLASS_SOURCE; 86 87 ISnippetFactory myFactory = new ByteCodePackageSnippetFactory(sourceDirectory); 89 javaInformation = myFactory.getSnippets(); 90 info = javaInformation.toString(); 91 92 93 assertTrue(info.indexOf("public net.firstpartners.nounit.utility.TextUtil")>-1); 94 assertTrue(info.indexOf("public static replaceAll(java.lang.String:java.lang.String:java.lang.String:java.lang.String:), public static find(java.lang.String:ILjava.lang.String:java.lang.String:java.lang.String:), public <init>(), public static removeTrailing(java.lang.String:java.lang.String:java.lang.String:), public static removeAll(java.lang.String:java.lang.String:java.lang.String:), public static replace(java.lang.String:java.lang.String:java.lang.String:java.lang.String:)]}extends java.lang.Object")>-1); 95 assertTrue(info.indexOf("public net.firstpartners.nounit.utility.DirectoryWalker")>-1); 96 97 } 98 99 100 101 } | Popular Tags |