1 package net.firstpartners.nounit.snippet.test; 2 3 26 import java.util.Iterator ; 27 28 import junit.framework.Test; 29 import junit.framework.TestCase; 30 import junit.framework.TestSuite; 31 import net.firstpartners.nounit.snippet.Snippets; 32 import net.firstpartners.nounit.snippet.xml.IXmlSource; 33 import org.apache.log4j.Logger; 34 38 public class TestSnippetMethod extends TestCase { 39 40 static Logger log = Logger.getLogger(TestSnippetMethod.class); 42 43 47 public TestSnippetMethod(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(TestSnippetMethod.class); 80 } 81 82 public void testSnippetMethodXml() throws Exception { 83 84 IXmlSource thisXmlSource; 86 Iterator loop; 87 String tmpString; 88 StringBuffer results = new StringBuffer (); 89 90 91 Snippets someMethods = TestSnippetData.getSnippetMethods(); 93 94 loop = someMethods.getIterator(); 95 while (loop.hasNext()) { 96 97 thisXmlSource=(IXmlSource)loop.next(); 99 results.append(thisXmlSource.toXml()); 100 results.append("\n"); 101 102 } 103 104 tmpString = results.toString(); 106 107 log.debug(tmpString); 108 assertTrue(tmpString.indexOf("<METHOD name=")>-1); 109 assertTrue(tmpString.indexOf("access=")>-1); 110 assertTrue(tmpString.indexOf("<PARAM>")>-1); 111 assertTrue(tmpString.indexOf("<CLASS name=")>-1); 112 assertTrue(tmpString.indexOf("</PARAM>")>-1); 113 assertTrue(tmpString.indexOf("</METHOD")>-1); 114 115 } 116 117 118 } | Popular Tags |