You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ch...@apache.org on 2005/02/14 12:14:04 UTC

svn commit: r153775 - webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/SampleEnvironmentCreator.java

Author: chathura
Date: Mon Feb 14 03:14:00 2005
New Revision: 153775

URL: http://svn.apache.org/viewcvs?view=rev&rev=153775
Log:
Made independent of the JUnit test.

Modified:
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/SampleEnvironmentCreator.java

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/SampleEnvironmentCreator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/SampleEnvironmentCreator.java?view=diff&r1=153774&r2=153775
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/SampleEnvironmentCreator.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/SampleEnvironmentCreator.java Mon Feb 14 03:14:00 2005
@@ -15,17 +15,8 @@
  */
 package samples.userguide.sample2.server;
 
-import java.io.FileReader;
-import java.net.URL;
-
 import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
 
-import org.apache.axis.AbstractTestCase;
-import org.apache.axis.addressing.AddressingConstants;
-import org.apache.axis.addressing.EndpointReference;
-import org.apache.axis.clientapi.Call;
 import org.apache.axis.context.MessageContext;
 import org.apache.axis.description.AxisGlobal;
 import org.apache.axis.description.AxisOperation;
@@ -34,8 +25,6 @@
 import org.apache.axis.engine.EngineRegistry;
 import org.apache.axis.engine.EngineRegistryImpl;
 import org.apache.axis.engine.EngineUtils;
-import org.apache.axis.om.SOAPEnvelope;
-import org.apache.axis.om.impl.llom.builder.StAXSOAPModelBuilder;
 import org.apache.axis.testUtils.SimpleJavaProvider;
 import org.apache.axis.transport.http.SimpleHTTPReceiver;
 import org.apache.commons.logging.Log;
@@ -45,10 +34,10 @@
  * @author chathura@opensource.lk
  * 
  */
-public class SampleEnvironmentCreator extends  AbstractTestCase{
+public class SampleEnvironmentCreator {
 	
     private Log log = LogFactory.getLog(getClass());
-    private QName serviceName = new QName("","EchoXMLService");
+    private QName serviceName = new QName("","sample2");
     private QName operationName1 = new QName("http://localhost/my","echoInt");
     private QName operationName2 = new QName("http://localhost/my","echoString");
     private QName transportName = new QName("http://localhost/my","NullTransport");
@@ -59,21 +48,10 @@
     private SimpleHTTPReceiver sas;
     
     public SampleEnvironmentCreator(){
-        super(SampleEnvironmentCreator.class.getName());
-//        try {
-//			this.setUp();
-//			this.testInt();
-//			this.tearDown();
-//		} catch (Exception e) {
-//			// TODO Auto-generated catch block
-//			e.printStackTrace();
-//		}
+       
         
     }
 
-    public SampleEnvironmentCreator(String testName) {
-        super(testName);
-    }
     
     public void setUp() throws Exception {
         AxisGlobal global = new AxisGlobal();
@@ -103,69 +81,5 @@
 }
 
 
-public void testInt() throws Exception{
-    try{
-   
-        Call call = new Call();
-        URL url = new URL("http","127.0.0.1",EngineUtils.TESTING_PORT,"/axis/services/EchoXMLService");
-        EndpointReference epr = new EndpointReference(AddressingConstants.WSA_TO, url.toString());
-        call.setTo(epr);
-        SOAPEnvelope reply = call.sendReceive(this.getechoIntEnvelope());
-        reply.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out), false);
-        
-    }catch(Exception e){
-        e.printStackTrace();
-        tearDown();
-        throw e;
-    }    
-}
-public void testString() throws Exception{
-//    try{
-//        OMFactory fac = OMFactory.newInstance();
-//
-//        OMNamespace omNs = fac.createOMNamespace("http://localhost/my","my");
-//        OMElement method =  fac.createOMElement("echoOMElement",omNs) ;
-//        OMElement value =  fac.createOMElement("myValue",omNs) ;
-//        value.setValue("Isaac Assimov, the foundation Sega");
-//        method.addChild(value);
-//        
-//        Call call = new Call();
-//        URL url = new URL("http","127.0.0.1",EngineUtils.TESTING_PORT,"/axis/services/EchoXMLService");
-//        
-//        CallBack callback = new CallBack() {
-//            public void doWork(OMElement ele) {
-//                System.out.print("got the result = " + ele +" :)");
-//
-//            }
-//            public void reportError(Exception e) {
-//                log.info("reporting error from callback !");
-//                e.printStackTrace();
-//            }
-//        };
-//        
-//        call.asyncCall(method,url,callback);
-//        log.info("send the reqest");
-//        
-//        Thread.sleep(1000);
-//    }catch(Exception e){
-//        e.printStackTrace();
-//        tearDown();
-//        throw e;
-//    }    
-}
-
- public static void main(String[] args) {
- 	new SampleEnvironmentCreator();
-	
-}
-
-private SOAPEnvelope getechoIntEnvelope() throws Exception {
-
-    SOAPEnvelope envelope = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(
-            new FileReader(getTestResourceFile("echo/echoInt.xml")))).getSOAPEnvelope();
-    envelope.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out), false);
-    return envelope;
-}
-	
     
 }