1 /*2 * WSDLSemanticsVisitorTest.java3 * JUnit based test4 *5 * Created on January 29, 2007, 10:39 AM6 */7 8 package org.netbeans.modules.xml.wsdl.validator.visitor;9 10 import junit.framework.*;11 import java.util.ArrayList ;12 import java.util.Collection ;13 import java.util.HashSet ;14 import java.util.Iterator ;15 import java.util.List ;16 import java.util.Properties ;17 import java.util.Set ;18 import java.util.Vector ;19 import org.netbeans.modules.xml.schema.model.Annotation;20 import org.netbeans.modules.xml.schema.model.Schema;21 import org.netbeans.modules.xml.schema.model.SchemaComponent;22 import org.netbeans.modules.xml.schema.model.SchemaModel;23 import org.netbeans.modules.xml.wsdl.model.Binding;24 import org.netbeans.modules.xml.wsdl.model.BindingFault;25 import org.netbeans.modules.xml.wsdl.model.BindingInput;26 import org.netbeans.modules.xml.wsdl.model.BindingOperation;27 import org.netbeans.modules.xml.wsdl.model.BindingOutput;28 import org.netbeans.modules.xml.wsdl.model.Definitions;29 import org.netbeans.modules.xml.wsdl.model.Documentation;30 import org.netbeans.modules.xml.wsdl.model.ExtensibilityElement;31 import org.netbeans.modules.xml.wsdl.model.Fault;32 import org.netbeans.modules.xml.wsdl.model.Import;33 import org.netbeans.modules.xml.wsdl.model.Input;34 import org.netbeans.modules.xml.wsdl.model.Message;35 import org.netbeans.modules.xml.wsdl.model.NotificationOperation;36 import org.netbeans.modules.xml.wsdl.model.OneWayOperation;37 import org.netbeans.modules.xml.wsdl.model.Operation;38 import org.netbeans.modules.xml.wsdl.model.Output;39 import org.netbeans.modules.xml.wsdl.model.Part;40 import org.netbeans.modules.xml.wsdl.model.Port;41 import org.netbeans.modules.xml.wsdl.model.PortType;42 import org.netbeans.modules.xml.wsdl.model.RequestResponseOperation;43 import org.netbeans.modules.xml.wsdl.model.Service;44 import org.netbeans.modules.xml.wsdl.model.SolicitResponseOperation;45 import org.netbeans.modules.xml.wsdl.model.Types;46 import org.netbeans.modules.xml.wsdl.model.WSDLComponent;47 import org.netbeans.modules.xml.wsdl.model.WSDLModel;48 import org.netbeans.modules.xml.wsdl.model.extensions.xsd.WSDLSchema;49 import org.netbeans.modules.xml.wsdl.model.spi.GenericExtensibilityElement.StringAttribute;50 import org.netbeans.modules.xml.wsdl.model.visitor.WSDLVisitor;51 import org.netbeans.modules.xml.wsdl.validator.WSDLSemanticValidator;52 import org.netbeans.modules.xml.xam.Model;53 import org.netbeans.modules.xml.xam.dom.NamedComponentReference;54 import org.netbeans.modules.xml.xam.spi.Validation;55 import org.netbeans.modules.xml.xam.spi.ValidationResult;56 import org.netbeans.modules.xml.xam.spi.Validator;57 import org.netbeans.modules.xml.xam.spi.Validation.ValidationType;58 import org.netbeans.modules.xml.xam.spi.Validator.ResultItem;59 60 /**61 *62 * @author radval63 */64 public class WSDLSemanticsVisitorTest extends TestCase {65 66 public WSDLSemanticsVisitorTest(String testName) {67 super(testName);68 }69 70 protected void setUp() throws Exception {71 }72 73 protected void tearDown() throws Exception {74 }75 76 /**77 * Test of getResultItems method, of class org.netbeans.modules.xml.wsdl.validator.visitor.WSDLSemanticsVisitor.78 */79 public void testGetResultItems() {80 System.out.println("getResultItems");81 82 WSDLSemanticValidator wv = new WSDLSemanticValidator(); 83 Validation v = new Validation();84 List <Model> models = new ArrayList <Model>();85 WSDLSemanticsVisitor instance = new WSDLSemanticsVisitor(wv, v, models);86 87 List <ResultItem> expResult = new ArrayList <ResultItem>();88 List <ResultItem> result = instance.getResultItems();89 assertEquals(expResult, result);90 91 }92 93 /**94 * Test of getValidation method, of class org.netbeans.modules.xml.wsdl.validator.visitor.WSDLSemanticsVisitor.95 */96 public void testGetValidation() {97 System.out.println("getValidation");98 99 WSDLSemanticValidator wv = new WSDLSemanticValidator(); 100 Validation v = new Validation();101 List <Model> models = new ArrayList <Model>();102 WSDLSemanticsVisitor instance = new WSDLSemanticsVisitor(wv, v, models);103 104 105 Validation expResult = v;106 Validation result = instance.getValidation();107 assertEquals(expResult, result);108 109 }110 111 112 113 }114