Hi All,
I have been writing test cases for an esb connector using wso2 integration
test framework. When I invoke the sendReceive method in AxisServiceClient
it gave me following errors.
Please be kind enough to help me on this.
Test Method
@Test(groups = { "wso2.esb" }, description = "Evernote {createNote}
Mandatory Parameters integration test.")
public void testCreateNoteMandatoryParams() throws Exception {
try {
final String methodName = "createNote";
final String noteTitle =
evernoteConnectorProperties.getProperty("noteTitle");
final String omString =
"<soapenv:Envelope
xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"
xmlns:evr=\"wso2.connector.evernote\">\n"
+ " <soapenv:Header/>\n"
+ " <soapenv:Body>\n"
+ " <root>\n"
+ " <evr:devToken>"
+
evernoteConnectorProperties.getProperty("devToken")
+ "</evr:devToken>\n"
+ " <evr:noteStoreUrl>"
+
evernoteConnectorProperties.getProperty("noteStoreUrl")
+ "</evr:noteStoreUrl>\n" +
"<evr:title>" + noteTitle + "</evr:title>\n"
+ "<evr:method>"
+ methodName
+ "</evr:method>\n"
+ " </root>\n" + "
</soapenv:Body>\n" + " </soapenv:Envelope>";
AxisServiceClient axisServiceClient = new AxisServiceClient();
OMElement createNoteMandatoryParamRequest =
AXIOMUtil.stringToOM(omString);
axisServiceClient.sendReceive(createNoteMandatoryParamRequest,getProxyServiceURL(CONNECTOR_NAME),"mediate");
OMElement response =
ConnectorIntegrationUtil.sendReceive(createNoteMandatoryParamRequest,
getProxyServiceURL(CONNECTOR_NAME),
"mediate");
//Assert.assertNotEquals(((OMElement)
(response.getChildrenWithLocalName("message").next())).getText(),
"0");
}finally {
proxyAdmin.deleteProxy(CONNECTOR_NAME);
}
}
Log
[2014-06-24 16:06:36,645] ERROR
{org.wso2.carbon.automation.utils.axis2client.AxisServiceClient} -
The input stream for an incoming message is null.
[2014-06-24 16:06:36,648] ERROR
{org.wso2.carbon.automation.core.PlatformTestManager} - On Test
failure..
[2014-06-24 16:06:36,648] ERROR
{org.wso2.carbon.automation.core.PlatformTestManager} -
org.apache.axis2.AxisFault: AxisFault while getting response :The
input stream for an incoming message is null.
[2014-06-24 16:06:36,648] INFO
{org.wso2.carbon.automation.core.PlatformTestManager} -
--------------Tests Failed
org.wso2.carbon.connector.integration.test.evernote.EvernoteConnectorIntegrationTest.testCreateNoteMandatoryParams--------
FAILED: testCreateNoteMandatoryParams
Evernote {createNote} Mandatory Parameters integration test.
org.apache.axis2.AxisFault: AxisFault while getting response :The
input stream for an incoming message is null.
at
org.wso2.carbon.automation.utils.axis2client.AxisServiceClient.sendReceive(AxisServiceClient.java:61)
at
org.wso2.carbon.connector.integration.test.evernote.EvernoteConnectorIntegrationTest.testCreateNoteMandatoryParams(EvernoteConnectorIntegrationTest.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:673)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166)
at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.runWorkers(TestRunner.java:1178)
at org.testng.TestRunner.privateRun(TestRunner.java:757)
at org.testng.TestRunner.run(TestRunner.java:608)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1083)
at org.testng.TestNG.run(TestNG.java:999)
at
org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:178)
at
org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at
org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: org.apache.axis2.AxisFault: The input stream for an
incoming message is null.
at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:93)
at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:68)
at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:346)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:413)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:224)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:554)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:530)
at
org.wso2.carbon.automation.utils.axis2client.AxisServiceClient.sendReceive(AxisServiceClient.java:55)
... 35 more
===============================================
Evernote-Connector-Test
Tests run: 1, Failures: 1, Skips: 0
===============================================
[2014-06-24 16:06:36,666] INFO
{org.wso2.carbon.automation.core.PlatformTestManager} -
--------------Finishing executing test class Evernote-Connector-Test
on suiteESBTestSuite--------
[2014-06-24 16:06:36,671] INFO
{org.wso2.carbon.automation.core.PlatformSuiteManager} -
***********Finishing executing test Suite ESBTestSuite on user*******
[2014-06-24 16:06:36,672] INFO
{org.wso2.carbon.automation.core.PlatformExecutionManager} -
---------------Test Execution Finished --------------------------
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@7e13efdf: 6 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@29dbf9c3: 11 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter@6f10b308: 5 ms
[TestNG] Time taken by [TestListenerAdapter] Passed:0 Failed:0 Skipped:0]: 5 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@5ba1cdb: 8 ms
[2014-06-24 16:06:36,720] INFO
{org.wso2.carbon.automation.core.PlatformReportManager} -
----/home/udeesha/Desktop/esb-connector/connector/evernote/target/surefire-reports/ESBTestSuite---------
[TestNG] Time taken by
org.wso2.carbon.automation.core.PlatformReportManager@3aa3cf94: 21 ms
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 36.336
sec <<< FAILURE!
testCreateNoteMandatoryParams(org.wso2.carbon.connector.integration.test.evernote.EvernoteConnectorIntegrationTest)
Time elapsed: 2.02 sec <<< FAILURE!
org.apache.axis2.AxisFault: AxisFault while getting response :The
input stream for an incoming message is null.
at
org.wso2.carbon.automation.utils.axis2client.AxisServiceClient.sendReceive(AxisServiceClient.java:61)
at
org.wso2.carbon.connector.integration.test.evernote.EvernoteConnectorIntegrationTest.testCreateNoteMandatoryParams(EvernoteConnectorIntegrationTest.java:122)
Caused by: org.apache.axis2.AxisFault: The input stream for an
incoming message is null.
at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:93)
at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:68)
at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:346)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:413)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:224)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:554)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:530)
at
org.wso2.carbon.automation.utils.axis2client.AxisServiceClient.sendReceive(AxisServiceClient.java:55)
... 35 more
Results :
Failed tests:
testCreateNoteMandatoryParams(org.wso2.carbon.connector.integration.test.evernote.EvernoteConnectorIntegrationTest):
AxisFault while getting response :The input stream for an incoming
message is null.
Thank you
Udeesha Isurinda
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev