User: jung
Date: 00/12/04 04:36:47
Modified: src/test Test.java TestMS.java test.dfPackage
Log:
adopted to latest jboss container,
added decimal and date
removed some problems due to forward-referencing in meta-data
added serialisation policy
Revision Changes Path
1.4 +264 -238 zoap/src/test/Test.java
Index: Test.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/test/Test.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Test.java 2000/09/04 16:45:48 1.3
+++ Test.java 2000/12/04 12:36:46 1.4
@@ -1,241 +1,273 @@
-/*
- * $Id: Test.java,v 1.3 2000/09/04 16:45:48 jung Exp $
- * Copyright (c) 2000 infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-package test;
-
-import de.infor.businessobjects.test.*;
-import de.infor.businessservices.test.*;
-
-import org.zoap.soap.SoapInvocationHandler;
-import org.zoap.soap.meta.SoapBinding;
-import org.zoap.soap.meta.builtin.DefaultMetaBinding;
-
-import org.zoap.xml.XmlObjectReader;
-import org.zoap.xml.Schema;
-
-import de.infor.ce.util.URN;
-
-import java.net.URL;
-
-/**
- * <Description>
- * @see <related>
- * @author $Author: jung $
- * @version $Revision: 1.3 $
- */
-
-public class Test extends junit.framework.TestCase {
-
- private String
absolutePath="c:/dokume~1/jung/eigene~[EMAIL PROTECTED]/";
-
- public Test(String name) {
- super(name);
- }
-
- public static void main(String[] args) {
-
- junit.textui.TestRunner runner=new junit.textui.TestRunner();
-
- try{
- runner.run(suite());
- } catch (Exception e) {
- }
- }
-
- public static junit.framework.Test suite() {
- junit.framework.TestSuite testSuite=new junit.framework.TestSuite();
- testSuite.addTest(de.infor.ce.http.test.Http.suite());
- testSuite.addTest(org.zoap.xml.test.Xml.suite());
- testSuite.addTest(org.zoap.soap.test.Soap.suite());
- testSuite.addTest(new junit.framework.TestSuite(Test.class));
- return testSuite;
- }
-
- TestInterface testProxy=null;
-
- public void setUp() {
- try{
- URL proxyURL= new URL("http://localhost:2121/");
-
- URL targetURL= new URL(proxyURL,"test/TestService/");
-
- URN firstUrn=new URN("file:"+absolutePath+"etc/META-INF/test/contract.scl");
-
- SoapBinding newBinding=new DefaultMetaBinding();
-
- XmlObjectReader xmlObjectReader=new XmlObjectReader(new
- java.io.InputStreamReader(firstUrn.openStream()),firstUrn,
- newBinding);
-
- Schema testSchema=(Schema) xmlObjectReader.readObject();
-
- testProxy=(TestInterface)
- java.lang.reflect.Proxy.newProxyInstance(
- Thread.currentThread().getContextClassLoader(),
- new Class[] {TestInterface.class},
- new SoapInvocationHandler(null,proxyURL,targetURL,newBinding));
-
- } catch(Exception e) {
- e.printStackTrace();
- }
- }
-
- public void testBoolean() throws Exception {
-
- assert("Testing testBoolean",testProxy.testBoolean());
-
- }
-
- public void testString() throws Exception {
-
- assert("Testing to call string","42".equals(testProxy.testString("42")));
-
- }
-
- public void testObject() throws Exception {
-
- TestObject2 testObject=new TestObject2();
-
- TestObject3 testObject2=new TestObject3();
-
- testObject.setTestInherited(true);
-
- testObject.setTestBoolean(true);
-
- testObject.setTestPublic(true);
-
- testObject.setTestProtected(true);
-
- testObject.setTestPrivate(true);
-
- testObject.setTestStatic(true);
-
- testObject.setTestTransient(true);
-
- testObject.setTestByte((byte) 42);
-
- testObject.setTestInteger(42);
-
- testObject.setTestShort((short) 42);
-
- testObject.setTestCharacter('z');
-
- testObject.setTestLong((long) 42);
-
- testObject.setTestFloat((float) 42.0);
-
- testObject.setTestDouble((double) 42.0);
-
- testObject.setTestString("42");
-
- testObject.setTestReference(testObject2);
-
- testObject.setTestArray(new TestObject3[] {testObject2});
-
- testObject.setTestCollection(new java.util.Vector());
-
- testObject.getTestCollection().add(testObject2);
-
- testObject.setTestExtension(true);
-
- testObject2.setTestReturn(testObject);
-
- TestObject2 testObject3=(TestObject2) testProxy.testObject(testObject);
-
- assert("Asserting inherited attribute",testObject3.getTestInherited()!=
- testObject.getTestInherited());
-
- assert("Asserting private attribute",testObject3.isTestPrivate()==
- testObject.isTestPrivate());
-
- assert("Asserting protected attribute",testObject3.isTestProtected()==
- testObject.isTestProtected());
-
- assert("Asserting public attribute",testObject3.isTestPublic()==
- testObject.isTestPublic());
-
- assert("Asserting static attribute",testObject3.isTestStatic()==
- testObject.isTestStatic());
-
- assert("Asserting transient attribute",testObject3.isTestTransient()!=
- testObject.isTestTransient());
-
- assert("Asserting boolean attribute",testObject3.isTestBoolean()==
- testObject.isTestBoolean());
-
- assert("Asserting byte attribute",testObject3.getTestByte()==
- testObject.getTestByte());
-
- assert("Asserting char attribute",testObject3.getTestCharacter()==
- testObject.getTestCharacter());
-
- assert("Asserting integer attribute",testObject3.getTestInteger()==
- testObject.getTestInteger());
-
- assert("Asserting short attribute",testObject3.getTestShort()==
- testObject.getTestShort());
-
- assert("Asserting long attribute",testObject3.getTestLong()==
- testObject.getTestLong());
-
- assert("Asserting float attribute",testObject3.getTestFloat()==
- testObject.getTestFloat());
-
- assert("Asserting double attribute",testObject3.getTestDouble()==
- testObject.getTestDouble());
-
- assert("Asserting string attribute",testObject.getTestString().
- equals(testObject3.getTestString()));
-
- assert("Asserting reference attribute",testObject3.getTestReference().
- getTestReturn()==testObject3);
-
- assert("Asserting array element",testObject3.getTestArray()!=null &&
- testObject3.getTestArray().length==1 && testObject3.getTestArray()[0]==
- testObject3.getTestReference());
-
- assert("Asserting collection element",testObject3.getTestCollection()!=null &&
- testObject3.getTestCollection().size()==1 &&
testObject3.getTestCollection().get(0)==
- testObject3.getTestReference());
-
- assert("Asserting extension attribute",testObject3.isTestExtension()==
- testObject.isTestExtension());
-
- }
-
- public void testException() throws Exception {
-
- try{
- testProxy.testException();
- fail("Expected an exception to occur");
- } catch(TestException e) {}
-
- }
-
- public void tearDown() {
- testProxy=null;
- }
-}
-
-/*
+/*
+ * $Id: Test.java,v 1.4 2000/12/04 12:36:46 jung Exp $
+ * Copyright (c) 2000 infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+package test;
+
+import de.infor.businessobjects.test.*;
+import de.infor.businessservices.test.*;
+
+import org.zoap.soap.SoapInvocationHandler;
+import org.zoap.soap.meta.SoapBinding;
+import org.zoap.soap.meta.builtin.DefaultMetaBinding;
+
+import org.zoap.xml.XmlObjectReader;
+import org.zoap.xml.Schema;
+
+import de.infor.ce.util.URN;
+
+import java.net.URL;
+
+/**
+ * <Description>
+ * @see <related>
+ * @author $Author: jung $
+ * @version $Revision: 1.4 $
+ */
+
+public class Test extends junit.framework.TestCase {
+
+ private String
absolutePath="c:/dokume~1/jung/eigene~1/projekte/inforce/modules/Standard_Base/zoap/";
+
+ public Test(String name) {
+ super(name);
+ }
+
+ public static void main(String[] args) {
+
+ junit.textui.TestRunner runner=new junit.textui.TestRunner();
+
+ try{
+ runner.run(suite());
+ } catch (Exception e) {
+ }
+ }
+
+ public static junit.framework.Test suite() {
+ junit.framework.TestSuite testSuite=new junit.framework.TestSuite();
+ testSuite.addTest(de.infor.ce.http.test.Http.suite());
+ testSuite.addTest(org.zoap.xml.test.Xml.suite());
+ testSuite.addTest(org.zoap.soap.test.Soap.suite());
+ testSuite.addTest(new junit.framework.TestSuite(Test.class));
+ return testSuite;
+ }
+
+ TestInterface testProxy=null;
+
+ public void setUp() {
+ try{
+ URL proxyURL= new URL("http://localhost:2121/");
+
+ URL targetURL= new URL(proxyURL,"test/TestService/");
+
+ URN firstUrn=new URN("file:"+absolutePath+"etc/META-INF/test/contract.scl");
+
+ SoapBinding newBinding=new DefaultMetaBinding();
+
+ XmlObjectReader xmlObjectReader=new XmlObjectReader(new
+ java.io.InputStreamReader(firstUrn.openStream()),firstUrn,
+ newBinding);
+
+ Schema testSchema=(Schema) xmlObjectReader.readObject();
+
+ testProxy=(TestInterface)
+ java.lang.reflect.Proxy.newProxyInstance(
+ Thread.currentThread().getContextClassLoader(),
+ new Class[] {TestInterface.class},
+ new SoapInvocationHandler(null,proxyURL,targetURL,newBinding));
+
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void testBoolean() throws Exception {
+
+ assert("Testing testBoolean",testProxy.testBoolean());
+
+ }
+
+ public void testString() throws Exception {
+
+ assert("Testing to call
string","42���</>\'&\"".equals(testProxy.testString("42���</>\'&\"")));
+
+ }
+
+ public void testNullString() throws Exception {
+
+ assertNull("Testing to call string",testProxy.testString(null));
+
+ }
+
+ public void testObject() throws Exception {
+
+ TestObject2 testObject=new TestObject2();
+
+ TestObject3 testObject2=new TestObject3();
+
+ testObject.setTestInherited(true);
+
+ testObject.setTestBoolean(true);
+
+ testObject.setTestPublic(true);
+
+ testObject.setTestProtected(true);
+
+ testObject.setTestPrivate(true);
+
+ testObject.setTestStatic(true);
+
+ testObject.setTestTransient(true);
+
+ testObject.setTestByte((byte) 42);
+
+ testObject.setTestInteger(42);
+
+ testObject.setTestShort((short) 42);
+
+ testObject.setTestCharacter('z');
+
+ testObject.setTestLong((long) 42);
+
+ testObject.setTestFloat((float) 42.0);
+
+ testObject.setTestDouble((double) 42.0);
+
+ testObject.setTestDecimal(new java.math.BigDecimal("42.0"));
+
+ testObject.setTestDate(new java.util.Date((long) 42));
+
+ testObject.setTestString("42���</>\'&\"");
+
+ testObject.setTestReference(testObject2);
+
+ testObject.setTestArray(new TestObject3[] {testObject2});
+
+ testObject.setTestCollection(new java.util.Vector());
+
+ testObject.getTestCollection().add(testObject2);
+
+ testObject.setTestExtension(true);
+
+ testObject2.setTestReturn(testObject);
+
+ TestObject2 testObject3=(TestObject2) testProxy.testObject(testObject);
+
+ assert("Asserting inherited attribute",testObject3.getTestInherited()!=
+ testObject.getTestInherited());
+
+ assert("Asserting private attribute",testObject3.isTestPrivate()==
+ testObject.isTestPrivate());
+
+ assert("Asserting protected attribute",testObject3.isTestProtected()==
+ testObject.isTestProtected());
+
+ assert("Asserting public attribute",testObject3.isTestPublic()==
+ testObject.isTestPublic());
+
+ assert("Asserting static attribute",testObject3.isTestStatic()==
+ testObject.isTestStatic());
+
+ assert("Asserting transient attribute",testObject3.isTestTransient()!=
+ testObject.isTestTransient());
+
+ assert("Asserting boolean attribute",testObject3.isTestBoolean()==
+ testObject.isTestBoolean());
+
+ assert("Asserting byte attribute",testObject3.getTestByte()==
+ testObject.getTestByte());
+
+ assert("Asserting char attribute",testObject3.getTestCharacter()==
+ testObject.getTestCharacter());
+
+ assert("Asserting integer attribute",testObject3.getTestInteger()==
+ testObject.getTestInteger());
+
+ assert("Asserting short attribute",testObject3.getTestShort()==
+ testObject.getTestShort());
+
+ assert("Asserting long attribute",testObject3.getTestLong()==
+ testObject.getTestLong());
+
+ assert("Asserting float attribute",testObject3.getTestFloat()==
+ testObject.getTestFloat());
+
+ assert("Asserting double attribute",testObject3.getTestDouble()==
+ testObject.getTestDouble());
+
+ assert("Asserting string attribute",testObject.getTestString().
+ equals(testObject3.getTestString()));
+
+ assert("Asserting decimal attribute",testObject.getTestDecimal().floatValue()==
+ testObject3.getTestDecimal().floatValue());
+
+ assert("Asserting date attribute",testObject.getTestDate().
+ equals(testObject3.getTestDate()));
+
+ assert("Asserting reference attribute",testObject3.getTestReference().
+ getTestReturn()==testObject3);
+
+ assert("Asserting array element",testObject3.getTestArray()!=null &&
+ testObject3.getTestArray().length==1 && testObject3.getTestArray()[0]==
+ testObject3.getTestReference());
+
+ assert("Asserting collection element",testObject3.getTestCollection()!=null &&
+ testObject3.getTestCollection().size()==1 &&
testObject3.getTestCollection().get(0)==
+ testObject3.getTestReference());
+
+ assert("Asserting extension attribute",testObject3.isTestExtension()==
+ testObject.isTestExtension());
+
+ }
+
+ public void testException() throws Exception {
+
+ try{
+ testProxy.testException();
+ fail("Expected an exception to occur");
+ } catch(TestException e) {}
+
+ }
+
+ public void tearDown() {
+ testProxy=null;
+ }
+}
+
+/*
* $Log: Test.java,v $
+ * Revision 1.4 2000/12/04 12:36:46 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.2 2000/11/22 14:21:47 jung
+ * added date to test
+ *
+ * Revision 1.1.1.1 2000/11/16 14:50:02 jung
+ * added the up-to-date ZOAP source (how I know: I
+ * made it).
+ *
* Revision 1.3 2000/09/04 16:45:48 jung
* GPL header and log adjust
*
@@ -247,4 +279,4 @@
*
* Revision 1.1.1.1 2000/08/10 21:08:17 jung
* Initial import.
- */
+ */
1.2 +182 -178 zoap/src/test/TestMS.java
Index: TestMS.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/test/TestMS.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestMS.java 2000/08/10 21:08:17 1.1
+++ TestMS.java 2000/12/04 12:36:46 1.2
@@ -1,181 +1,191 @@
-/*
- * $Id: TestMS.java,v 1.1 2000/08/10 21:08:17 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package test;
-
-import de.infor.ce.http.Server;
-import de.infor.ce.http.Request;
-import de.infor.ce.http.Response;
-import de.infor.ce.http.ProcessException;
-import de.infor.ce.http.StatusCodeException;
-import de.infor.ce.http.UnknownRequestMethodException;
-
-
-import org.zoap.soap.HttpRequest;
-
-
-import java.util.Hashtable;
-
-/**
- * <Description/>
- * @see <related/>
- * @author $Author: jung $
- * @version $Revision: 1.1 $
- */
-
-public class TestMS extends Server{
-
- public TestMS() throws java.net.UnknownHostException, java.io.IOException {
- super(80);
- start();
- }
-
-
- /**
- * this method is called by the server, whenever an incoming
- * @arg request has been sucessfully parsed. It returns a corresponding
- * @arg Response that will be delivered to the client in return. It may
- * throw an @throws ProcessException to indicate a failure in processing
- * that message.
- *
- * This default implementation simply returns the general "not implemented"
response.
- * Overwrite to get useful services.
- */
-
- protected Response processRequest(Request request) throws ProcessException {
-
- System.out.println("Server.processRequest("+request.getBody()+")");
-
- try{
-
- Hashtable header=new Hashtable();
-
- header.put("Content-Type","text/xml");
-
- //header.put("SOAPAction","http://localhost/#GetStockQuoteResponse");
-
- // <SOAP:Envelope
xmlns:SOAP="HTTP://schemas.xmlsoap.org/soap/envelope/2000-03-01"
- // encodingStyle="HTTP://schemas.xmlsoap.org/soap/envelope/2000-03-01">
- // <SOAP:Body>
- // <testString>
- // <input>Text1</input>
- // </testString>
- // </SOAP:Body>
- // </SOAP:Envelope>
-
- //<SOAP-ENV:Envelope
- //xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- //SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- //<SOAP-ENV:Body>
- //<m:GetLastTradePriceResponse xmlns:m="Some-URI">
- //<Price>34.5</Price>
- //</m:GetLastTradePriceResponse>
- //</SOAP-ENV:Body>
- //</SOAP-ENV:Envelope>
-
-
-
//"<testObjectResponse><return><name>Name</name><objectId>1200</objectId></return></testObjectReponse>"+
- //"<testString><testString-Return>Text1</testString-Return>"+
- //"</testString>"+
-
- Response response=new Response(null,1,1,
- "<?xml version=\"1.0\"?> <SOAP:Envelope
encodingStyle=\"http://schemas.xmlsoap.org/soap/envelope/2000-03-01\""+
- "
xmlns:SOAP=\"HTTP://schemas.xmlsoap.org/soap/envelope/2000-03-01\"><SOAP:Body>"+
- " <testObject> <testObject-Argument-0 xsi:type=\"co:Company\"
objectId=\"1000\" testBoolean=\"true\"/> </testObject>"+
- "</SOAP:Body>"+
- "</SOAP:Envelope>",true,200,"OK");
-
- return response;
-
- } catch(StatusCodeException e) {
-
- System.err.println("Server.processRequest("+request+"): encountered status
exception "+e);
-
- throw new ProcessException();
-
- }
-
- }
-
- /**
- * request factory
- */
-
- protected Request createRequest() throws UnknownRequestMethodException {
-
- System.out.println("HttpServer.createRequest()");
-
- // we have to install the databinding correctly
- return new HttpRequest(getURL(),null);
- }
-
- public static void main(String[] args) {
-
- try{
- new TestMS();
- } catch(Exception e) {
- e.printStackTrace();
- }
-
- }
-
-
-}
-
-/*
+/*
+ * $Id: TestMS.java,v 1.2 2000/12/04 12:36:46 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package test;
+
+import de.infor.ce.http.Server;
+import de.infor.ce.http.Request;
+import de.infor.ce.http.Response;
+import de.infor.ce.http.ProcessException;
+import de.infor.ce.http.StatusCodeException;
+import de.infor.ce.http.UnknownRequestMethodException;
+
+
+import org.zoap.soap.HttpRequest;
+
+
+import java.util.Hashtable;
+
+/**
+ * <Description/>
+ * @see <related/>
+ * @author $Author: jung $
+ * @version $Revision: 1.2 $
+ */
+
+public class TestMS extends Server{
+
+ public TestMS() throws java.net.UnknownHostException, java.io.IOException {
+ super(80);
+ start();
+ }
+
+
+ /**
+ * this method is called by the server, whenever an incoming
+ * @arg request has been sucessfully parsed. It returns a corresponding
+ * @arg Response that will be delivered to the client in return. It may
+ * throw an @throws ProcessException to indicate a failure in processing
+ * that message.
+ *
+ * This default implementation simply returns the general "not implemented"
response.
+ * Overwrite to get useful services.
+ */
+
+ protected Response processRequest(Request request) throws ProcessException {
+
+ System.out.println("Server.processRequest("+request.getBody()+")");
+
+ try{
+
+ Hashtable header=new Hashtable();
+
+ header.put("Content-Type","text/xml");
+
+ //header.put("SOAPAction","http://localhost/#GetStockQuoteResponse");
+
+ // <SOAP:Envelope
xmlns:SOAP="HTTP://schemas.xmlsoap.org/soap/envelope/2000-03-01"
+ // encodingStyle="HTTP://schemas.xmlsoap.org/soap/envelope/2000-03-01">
+ // <SOAP:Body>
+ // <testString>
+ // <input>Text1</input>
+ // </testString>
+ // </SOAP:Body>
+ // </SOAP:Envelope>
+
+ //<SOAP-ENV:Envelope
+ //xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ //SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ //<SOAP-ENV:Body>
+ //<m:GetLastTradePriceResponse xmlns:m="Some-URI">
+ //<Price>34.5</Price>
+ //</m:GetLastTradePriceResponse>
+ //</SOAP-ENV:Body>
+ //</SOAP-ENV:Envelope>
+
+
+
//"<testObjectResponse><return><name>Name</name><objectId>1200</objectId></return></testObjectReponse>"+
+ //"<testString><testString-Return>Text1</testString-Return>"+
+ //"</testString>"+
+
+ Response response=new Response(null,1,1,
+ "<?xml version=\"1.0\"?> <SOAP:Envelope
encodingStyle=\"http://schemas.xmlsoap.org/soap/envelope/2000-03-01\""+
+ "
xmlns:SOAP=\"HTTP://schemas.xmlsoap.org/soap/envelope/2000-03-01\"><SOAP:Body>"+
+ " <testObject> <testObject-Argument-0 xsi:type=\"co:Company\"
objectId=\"1000\" testBoolean=\"true\"/> </testObject>"+
+ "</SOAP:Body>"+
+ "</SOAP:Envelope>",true,200,"OK");
+
+ return response;
+
+ } catch(StatusCodeException e) {
+
+ System.err.println("Server.processRequest("+request+"): encountered status
exception "+e);
+
+ throw new ProcessException();
+
+ }
+
+ }
+
+ /**
+ * request factory
+ */
+
+ protected Request createRequest() throws UnknownRequestMethodException {
+
+ System.out.println("HttpServer.createRequest()");
+
+ // we have to install the databinding correctly
+ return new HttpRequest(getURL(),null);
+ }
+
+ public static void main(String[] args) {
+
+ try{
+ new TestMS();
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+
+}
+
+/*
* $Log: TestMS.java,v $
- * Revision 1.1 2000/08/10 21:08:17 jung
- * Initial revision
- *
- * Revision 1.2 2000/07/06 16:55:05 jung
- * moved the default binding caches in order to make apartments
- * with different versions of the same class possible.
- *
- * Revision 1.1.1.1 2000/07/06 14:11:25 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:46 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:08:17 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.2 2000/07/06 16:55:05 jung
+ * moved the default binding caches in order to make apartments
+ * with different versions of the same class possible.
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:25 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +84 -73 zoap/src/test/test.dfPackage
Index: test.dfPackage
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/test/test.dfPackage,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- test.dfPackage 2000/08/10 21:08:16 1.1
+++ test.dfPackage 2000/12/04 12:36:47 1.2
@@ -1,73 +1,84 @@
-package id3g5qbc9pgodo2c9pgqw31;
-
-/**
-@version 2.0
-@physicalPackage
-@__modelType diagram
-*/
-class diagram {
-/**
-@__ref <oiref:java#Class#test.Test:oiref><oihard>
-@__modelType reference
-*/
-class reference {
-}/**
-@__ref <oiref:java#Class#test.TestMS:oiref><oihard>
-@__modelType reference
-*/
-class reference9 {
-}/**
-@shapeType DependencyLink
-@__modelType link
-@__ref <oiref:design#Class#id1k4jdc8v9c1p6c8v9hgrr.diagram:oiref><oihard>
-@label tests
-*/
-class link {
-}/**
-@shapeType DependencyLink
-@__modelType link
-@__ref <oiref:design#Class#id3lximc9pgodo2c9pqksa8.diagram:oiref><oihard>
-@label tests
-*/
-class link17 {
-}/**
-@shapeType DependencyLink
-@__modelType link
-@__ref <oiref:design#Class#id1atnbca8544noca855nay.diagram:oiref><oihard>
-@label tests
-*/
-class link18 {
-}/**
-@shapeType DependencyLink
-@__modelType link
-@__ref <oiref:design#Class#id4kjhfca3fgnbmca3tca74.diagram:oiref><oihard>
-@label tests
-*/
-class link19 {
-}/**
-@shapeType DependencyLink
-@__modelType link
-@__ref <oiref:design#Class#idqnwuc9pgodo2c9pqkznw.diagram:oiref><oihard>
-@label tests
-*/
-class link20 {
-}/**
-@shapeType NoteLink
-@__modelType link
-@__ref <oiref:design#Class#id2e2vrc9pgodo2c9pgqtl6.node26:oiref><oihard>
-*/
-class link28 {
-}}/**
-@__tags
-@shapeType ClassDiagram
-*/
-class __tags {
-}/**
-@__options
-*/
-class __options {
-}/**
-@__positions
-*/
-class __positions {
-}
\ No newline at end of file
+package id3g5qbc9pgodo2c9pgqw31;
+
+/**
+@version 2.0
+@physicalPackage
+@__modelType diagram
+*/
+class diagram {
+/**
+@__ref <oiref:java#Class#test.TestMS:oiref><oihard>
+@__modelType reference
+*/
+class reference9 {
+}/**
+@shapeType DependencyLink
+@__modelType link
+@__ref <oiref:design#Class#id1k4jdc8v9c1p6c8v9hgrr.diagram:oiref><oihard>
+@label tests
+@number txmiid2
+@isElementExists
+*/
+class link {
+}/**
+@shapeType DependencyLink
+@__modelType link
+@__ref <oiref:design#Class#id3lximc9pgodo2c9pqksa8.diagram:oiref><oihard>
+@label tests
+@number txmiid5
+@isElementExists
+*/
+class link17 {
+}/**
+@shapeType DependencyLink
+@__modelType link
+@__ref <oiref:design#Class#id1atnbca8544noca855nay.diagram:oiref><oihard>
+@label tests
+@number txmiid7
+@isElementExists
+*/
+class link18 {
+}/**
+@shapeType DependencyLink
+@__modelType link
+@__ref <oiref:design#Class#id4kjhfca3fgnbmca3tca74.diagram:oiref><oihard>
+@label tests
+@number txmiid9
+@isElementExists
+*/
+class link19 {
+}/**
+@shapeType DependencyLink
+@__modelType link
+@__ref <oiref:design#Class#idqnwuc9pgodo2c9pqkznw.diagram:oiref><oihard>
+@label tests
+@number txmiidb
+@isElementExists
+*/
+class link20 {
+}/**
+@shapeType NoteLink
+@__modelType link
+@__ref <oiref:design#Class#id2e2vrc9pgodo2c9pgqtl6.node26:oiref><oihard>
+*/
+class link28 {
+}/**
+@__ref <oiref:java#Class#test.Test:oiref><oihard>
+@__modelType reference
+*/
+class reference {
+}}/**
+@__tags
+@shapeType ClassDiagram
+@number txmiid3
+*/
+class __tags {
+}/**
+@__options
+*/
+class __options {
+}/**
+@__positions
+*/
+class __positions {
+}