1 26 27 package org.objectweb.jonas_ws.deployment.tests; 28 29 import java.io.StringReader ; 30 import java.io.Reader ; 31 import org.objectweb.jonas_lib.deployment.xml.AbsElement; 32 import org.objectweb.jonas_lib.deployment.tests.AbsDeploymentTest; 33 import org.objectweb.jonas_ws.deployment.api.MappingFile; 34 import org.objectweb.jonas_ws.deployment.lib.WSDeploymentDescManager; 35 import org.objectweb.jonas_ws.deployment.lib.MappingFileManager; 36 import org.objectweb.jonas_ws.deployment.xml.Webservices; 37 import org.objectweb.jonas_ws.deployment.xml.JavaWsdlMapping; 38 39 44 45 public class WsDeploymentTest extends AbsDeploymentTest { 46 47 50 51 public AbsElement getTopLevelElement() throws Exception { 52 Webservices ws = new Webservices(); 53 return ws; 54 } 55 56 59 60 public String parse(Reader reader, String name, boolean validation) throws Exception { 61 WSDeploymentDescManager.setParsingWithValidation(validation); 62 String xmlParsed = WSDeploymentDescManager.loadWebservices(reader, "test").toXML(); 63 return xmlParsed; 64 } 65 66 67 68 69 74 public void startJaxrpcMappingTest(boolean random) throws Exception { 75 JavaWsdlMapping jmp = new JavaWsdlMapping(); 76 fill(jmp, random); 77 String xmlOriginal = jmp.toXML(); 78 MappingFile mapFile = MappingFileManager.getInstance(new StringReader (xmlOriginal), "test", false); 79 String xmlParsed = mapFile.getXmlJavaWsdlMapping().toXML(); 80 checkDiff(xmlOriginal, xmlParsed); 81 } 82 83 84 88 public void parseJaxrcpMappingElement() throws Exception { 89 JavaWsdlMapping jmp = new JavaWsdlMapping(); 90 fill(jmp, false); 91 System.out.println("Parsing xml :"); 92 System.out.println(jmp); 93 String xmlOriginal = jmp.toXML(); 94 MappingFile mapFile = MappingFileManager.getInstance(new StringReader (xmlOriginal), "test", false); 95 String xmlParsed = mapFile.getXmlJavaWsdlMapping().toXML(); 96 System.out.println("Result = "); 97 System.out.println(xmlParsed); 98 } 99 100 } 101 | Popular Tags |