1 package net.firstpartners.nounit.snippet.test; 2 3 26 import java.util.HashMap ; 27 import java.util.Iterator ; 28 29 import junit.framework.Test; 30 import junit.framework.TestCase; 31 import junit.framework.TestSuite; 32 import net.firstpartners.nounit.snippet.ISnippet; 33 import net.firstpartners.nounit.snippet.SnippetClass; 34 import net.firstpartners.nounit.snippet.SnippetMethod; 35 import net.firstpartners.nounit.snippet.Snippets; 36 37 41 public class TestSnippets extends TestCase { 42 43 47 public TestSnippets(String name) { 48 super(name); 49 } 50 51 54 public void setUp(){ 55 56 } 57 58 61 protected void tearDown() 62 { 63 64 } 65 66 70 public static void main(String [] args) { 71 junit.textui.TestRunner.run (suite()); 72 } 73 74 78 public static Test suite() { 79 return new TestSuite(TestSnippets.class); 80 } 81 82 public void testSnippets() throws Exception { 83 84 SnippetClass testSClass = new SnippetClass("","","",new Snippets()); 85 SnippetMethod testSMethod = new SnippetMethod("","",new HashMap (),null); 86 87 Snippets mySet = new Snippets(); 88 mySet.add(testSClass); 89 mySet.add(testSMethod); 90 91 Iterator testIterator = mySet.getIterator(); 93 while (testIterator.hasNext()) { 94 assertTrue(testIterator.next() instanceof ISnippet); 95 } 96 97 98 } 99 100 101 } | Popular Tags |