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 pe...@apache.org on 2005/02/10 16:16:13 UTC

cvs commit: ws-axis/c/tests/auto_build/testcases/tests IHeaderBlockTest7.xml IHeaderBlockTest8.xml

perryan     2005/02/10 07:16:13

  Added:       c/tests/auto_build/testcases/client/cpp
                        IHeaderBlockTest7Client.cpp
                        IHeaderBlockTest8Client.cpp
               c/tests/auto_build/testcases/output
                        IHeaderBlockTest7.expected
                        IHeaderBlockTest7Request.out
                        IHeaderBlockTest8.expected
                        IHeaderBlockTest8Request.out
               c/tests/auto_build/testcases/tests IHeaderBlockTest7.xml
                        IHeaderBlockTest8.xml
  Log:
  New tests added for James Jose who is still awaiting commiter access.
  
  Revision  Changes    Path
  1.1                  ws-axis/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest7Client.cpp
  
  Index: IHeaderBlockTest7Client.cpp
  ===================================================================
  
  /* Tests addChild() API in IHeaderBlock
    Author @James Jose  
  */
  
  #include "Calculator.hpp"
  #include <axis/IHeaderBlock.hpp>
  #include <axis/IAttribute.hpp>
  #include <axis/AxisException.hpp>
  #include <stdio.h>
  #include <iostream>
  
  int main(int argc, char* argv[])
  {
  	char endpoint[256];
  	const char* url="http://localhost:80/axis/Calculator";
  	int i1=2, i2=3;
  	int iResult;
  
  	if(argc > 1)
  		url = argv[1];
  
  	try
  	{
  		sprintf(endpoint, "%s", url);
  		Calculator ws(endpoint);
  		AxisChar *uri="http://ws.apache.org/";
  		IHeaderBlock *phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");		
  		BasicNode * Bnode1=phb->createChild(CHARACTER_NODE,NULL,NULL,NULL,"APACHE ");
  		phb->addChild(Bnode1);
  		phb->addChild(Bnode1);
  		iResult=ws.add(i1, i2);			
  		cout << endl << iResult << endl;
  	}
  	catch(AxisException& e)
  	{
  		cout << "Exception : " << e.what() << endl;
  	}
  	catch(exception& e)
  	{
  		cout << "Unknown exception has occured" << endl;
  	}
  	catch(...)
  	{
  		cout << "Unspecified exception has occured" << endl;
  	}
  	cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;	
  	return 0;
  }
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/client/cpp/IHeaderBlockTest8Client.cpp
  
  Index: IHeaderBlockTest8Client.cpp
  ===================================================================
  /* Tests createStdAttribute APIs for SOAPVER_1_1 in IHeaderBlock 
     Author @ James Jose
  */
  
  #include "Calculator.hpp"
  #include <axis/IHeaderBlock.hpp>
  #include <axis/AxisException.hpp>
  #include <stdio.h>
  #include <iostream>
  
  int main(int argc, char* argv[])
  {
  	char endpoint[256];
  	const char* url="http://localhost:80/axis/Calculator";
  	int i1=0, i2=0;
  	int iResult;
  
  	if(argc>1)
  		url = argv[1];
  
  	try
  	{
  		sprintf(endpoint, "%s", url);
  		Calculator ws(endpoint);
  		i1 = 2;
  		i2 = 3; 
  		IHeaderBlock *phb = ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
  		IAttribute *attr = phb->createStdAttribute(ACTOR,SOAP_VER_1_1);
  		iResult=ws.add(i1, i2);	
  		cout << iResult << endl;
  		Calculator ws1(endpoint);
  		IHeaderBlock *phb1 = ws1.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
  		IAttribute *attr1 = phb1->createStdAttribute(MUST_UNDERSTAND_TRUE,SOAP_VER_1_1);
  		iResult=ws1.add(i1, i2);	
  		cout << iResult << endl;
  		Calculator ws2(endpoint);
  		IHeaderBlock *phb2 = ws2.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
  		IAttribute *attr2 = phb2->createStdAttribute(MUST_UNDERSTAND_FALSE,SOAP_VER_1_1);
  		iResult=ws2.add(i1, i2);	
  		cout << iResult << endl;
  		Calculator ws3(endpoint);
  		IHeaderBlock *phb3 = ws3.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/");
  		IAttribute *attr3 = phb3->createStdAttribute(ROLE_NEXT,SOAP_VER_1_1);
  		iResult=ws3.add(i1, i2);	
  		cout << iResult << endl;
  	}
  	catch(AxisException& e)
  	{
  		cout << "Exception : " << e.what() << endl;
  	}
  	catch(exception& e)
  	{
  		cout << "Unknown exception has occured" << endl;
  	}
  	catch(...)
  	{
  		cout << "Unspecified exception has occured" << endl;
  	}
  	cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;	
  	return 0;
  }
  
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/output/IHeaderBlockTest7.expected
  
  Index: IHeaderBlockTest7.expected
  ===================================================================
  
  5
  ---------------------- TEST COMPLETE -----------------------------
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/output/IHeaderBlockTest7Request.out
  
  Index: IHeaderBlockTest7Request.out
  ===================================================================
  POST /Calculator/services/Calculator HTTP/1.1
  Host: localhost:13620
  Content-Type: text/xml; charset=UTF-8
  SOAPAction: "Calculator#add"
  Content-Length: 514
  
  <?xml version='1.0' encoding='utf-8' ?>
  <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header><ns2:TestHeader xmlns:ns2="http://ws.apache.org/">APACHE APACHE </ns2:TestHeader></SOAP-ENV:Header>
  <SOAP-ENV:Body>
  <ns1:add xmlns:ns1="http://localhost/axis/Calculator">
  <ns1:arg_0_0>2</ns1:arg_0_0>
  <ns1:arg_1_0>3</ns1:arg_1_0>
  </ns1:add>
  </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>
  
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/output/IHeaderBlockTest8.expected
  
  Index: IHeaderBlockTest8.expected
  ===================================================================
  5
  5
  5
  5
  ---------------------- TEST COMPLETE -----------------------------
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/output/IHeaderBlockTest8Request.out
  
  Index: IHeaderBlockTest8Request.out
  ===================================================================
  POST /Calculator/services/Calculator HTTP/1.1
  Host: localhost:13620
  Content-Type: text/xml; charset=UTF-8
  SOAPAction: "Calculator#add"
  Content-Length: 560
  
  <?xml version='1.0' encoding='utf-8' ?>
  <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header><ns2:TestHeader xmlns:ns2="http://ws.apache.org/" SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next"></ns2:TestHeader></SOAP-ENV:Header>
  <SOAP-ENV:Body>
  <ns1:add xmlns:ns1="http://localhost/axis/Calculator">
  <ns1:arg_0_0>2</ns1:arg_0_0>
  <ns1:arg_1_0>3</ns1:arg_1_0>
  </ns1:add>
  </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>
  
  POST /Calculator/services/Calculator HTTP/1.1
  Host: localhost:13620
  Content-Type: text/xml; charset=UTF-8
  SOAPAction: "Calculator#add"
  Content-Length: 528
  
  <?xml version='1.0' encoding='utf-8' ?>
  <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header><ns2:TestHeader xmlns:ns2="http://ws.apache.org/" SOAP-ENV:mustUnderstand="1"></ns2:TestHeader></SOAP-ENV:Header>
  <SOAP-ENV:Body>
  <ns1:add xmlns:ns1="http://localhost/axis/Calculator">
  <ns1:arg_0_0>2</ns1:arg_0_0>
  <ns1:arg_1_0>3</ns1:arg_1_0>
  </ns1:add>
  </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>
  
  POST /Calculator/services/Calculator HTTP/1.1
  Host: localhost:13620
  Content-Type: text/xml; charset=UTF-8
  SOAPAction: "Calculator#add"
  Content-Length: 528
  
  <?xml version='1.0' encoding='utf-8' ?>
  <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header><ns2:TestHeader xmlns:ns2="http://ws.apache.org/" SOAP-ENV:mustUnderstand="0"></ns2:TestHeader></SOAP-ENV:Header>
  <SOAP-ENV:Body>
  <ns1:add xmlns:ns1="http://localhost/axis/Calculator">
  <ns1:arg_0_0>2</ns1:arg_0_0>
  <ns1:arg_1_0>3</ns1:arg_1_0>
  </ns1:add>
  </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>
  
  POST /Calculator/services/Calculator HTTP/1.1
  Host: localhost:13620
  Content-Type: text/xml; charset=UTF-8
  SOAPAction: "Calculator#add"
  Content-Length: 500
  
  <?xml version='1.0' encoding='utf-8' ?>
  <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header><ns2:TestHeader xmlns:ns2="http://ws.apache.org/"></ns2:TestHeader></SOAP-ENV:Header>
  <SOAP-ENV:Body>
  <ns1:add xmlns:ns1="http://localhost/axis/Calculator">
  <ns1:arg_0_0>2</ns1:arg_0_0>
  <ns1:arg_1_0>3</ns1:arg_1_0>
  </ns1:add>
  </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>
  
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/tests/IHeaderBlockTest7.xml
  
  Index: IHeaderBlockTest7.xml
  ===================================================================
  <test>
      <name>IHeaderBlockTest7</name>
      <description>IHeaderBlockTest7</description>
      <clientLang>cpp</clientLang>
      <clientCode>IHeaderBlockTest7Client.cpp</clientCode>
      <wsdl>CalculatorDoc.wsdl</wsdl>
      <expected>
          <output>
              IHeaderBlockTest7.expected
          </output>
  	<request> 
  	IHeaderBlockTest7Request.out 
  	</request> 
  
      </expected>
  	<endpoint>http://localhost:80/Calculator/services/Calculator</endpoint>
  </test>
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/tests/IHeaderBlockTest8.xml
  
  Index: IHeaderBlockTest8.xml
  ===================================================================
  <test>
      <name>IHeaderBlockTest8</name>
      <description>IHeaderBlockTest8</description>
      <clientLang>cpp</clientLang>
      <clientCode>IHeaderBlockTest8Client.cpp</clientCode>
      <wsdl>CalculatorDoc.wsdl</wsdl>
      <expected>
          <output>
              IHeaderBlockTest8.expected
          </output>
  	<request> 
  		IHeaderBlockTest8Request.out 
  	</request>
  
      </expected>
  	<endpoint>http://localhost:80/Calculator/services/Calculator</endpoint>
  </test>