1 7 8 package org.netbeans.modules.xml.wsdl.model; 9 10 import java.util.Collection ; 11 import junit.framework.*; 12 13 17 public class WSDLModelFactoryTest extends TestCase { 18 19 public WSDLModelFactoryTest(String testName) { 20 super(testName); 21 } 22 23 WSDLModel model; 24 protected void setUp() throws Exception { 25 model = Util.loadWSDLModel("resources/stockquote.xml"); 26 } 27 28 protected void tearDown() throws Exception { 29 TestCatalogModel.getDefault().clearDocumentPool(); 30 } 31 32 public static Test suite() { 33 TestSuite suite = new TestSuite(WSDLModelFactoryTest.class); 34 return suite; 35 } 36 37 public void testGetModel() { 38 Documentation documentation = model.getDefinitions().getDocumentation(); 39 System.out.println("content: " + documentation.getTextContent()); 40 assertEquals("test getModel", "Hello World!", documentation.getTextContent()); 41 } 42 43 public void testExtension(){ 44 Definitions definitions = model.getDefinitions(); 45 Collection <Binding> bindings = definitions.getBindings(); 46 System.out.println("number of bindings: " + bindings.size()); 47 for(Binding binding : bindings){ 48 Collection <ExtensibilityElement> ee = binding.getExtensibilityElements(); 49 for(ExtensibilityElement e : ee){ 50 System.out.println("ExtensibilityElement: " + e.getClass().getName()); 51 } 52 } 53 } 54 55 } 56 | Popular Tags |