KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > wsdl > model > WSDLModelFactoryTest


1 /*
2  * WSDLModelFactoryTest.java
3  * JUnit based test
4  *
5  * Created on November 15, 2005, 4:51 PM
6  */

7
8 package org.netbeans.modules.xml.wsdl.model;
9
10 import java.util.Collection JavaDoc;
11 import junit.framework.*;
12
13 /**
14  *
15  * @author nn136682
16  */

17 public class WSDLModelFactoryTest extends TestCase {
18     
19     public WSDLModelFactoryTest(String JavaDoc testName) {
20         super(testName);
21     }
22
23     WSDLModel model;
24     protected void setUp() throws Exception JavaDoc {
25         model = Util.loadWSDLModel("resources/stockquote.xml");
26     }
27
28     protected void tearDown() throws Exception JavaDoc {
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 JavaDoc<Binding> bindings = definitions.getBindings();
46         System.out.println("number of bindings: " + bindings.size());
47         for(Binding binding : bindings){
48             Collection JavaDoc<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