• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ExecutionEnvironment类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment的典型用法代码示例。如果您正苦于以下问题:Java ExecutionEnvironment类的具体用法?Java ExecutionEnvironment怎么用?Java ExecutionEnvironment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ExecutionEnvironment类属于org.wso2.carbon.automation.engine.annotations包,在下文中一共展示了ExecutionEnvironment类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testSendingLoadBalancingEndpoint12

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE
})
    @Test(groups = "wso2.esb", description = "Test sending request to Load Balancing Endpoint With the RoundRobin Algorithm Receiving Sequence in Gov Registry while BuildMessage Enabled")
    public void testSendingLoadBalancingEndpoint12() throws IOException {

        String response = lbClient.sendLoadBalanceRequest(getProxyServiceURLHttp("loadBalancingEndPoint12"),
                                                          "http://localhost:9001/services/LBService1");
        Assert.assertNotNull(response);
        Assert.assertTrue(response.toString().contains("Response from server: Server_1"));

        response = lbClient.sendLoadBalanceRequest(getProxyServiceURLHttp("loadBalancingEndPoint12"),
                                                   "http://localhost:9002/services/LBService1");
        Assert.assertNotNull(response);
        Assert.assertTrue(response.toString().contains("Response from server: Server_2"));

        response = lbClient.sendLoadBalanceRequest(getProxyServiceURLHttp("loadBalancingEndPoint12"),
                                                   "http://localhost:9003/services/LBService1");
        Assert.assertNotNull(response);
        Assert.assertTrue(response.toString().contains("Response from server: Server_3"));

        response = lbClient.sendLoadBalanceRequest(getProxyServiceURLHttp("loadBalancingEndPoint12"),
                                                   "http://localhost:9001/services/LBService1");
        Assert.assertNotNull(response);
        Assert.assertTrue(response.toString().contains("Response from server: Server_1"));

    }
 
开发者ID:wso2,项目名称:product-ei,代码行数:27,代码来源:SendIntegrationTestCase.java


示例2: testVFSProxyFileURI_LinuxPath_ContentType_XML

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.ALL})
@Test(groups = {"wso2.esb"}, description = "Sending a file through VFS Transport : " +
                                           "transport.vfs.FileURI = Linux Path, " +
                                           "transport.vfs.ContentType = text/xml, " +
                                           "transport.vfs.FileNamePattern = - *\\.xml")
public void testVFSProxyFileURI_LinuxPath_ContentType_XML()
        throws Exception {

    addVFSProxy1();

    File sourceFile = new File(pathToVfsDir + File.separator + "test.xml");
    File targetFile = new File(pathToVfsDir + "test" + File.separator + "in" + File.separator + "test.xml");
    File outfile = new File(pathToVfsDir + "test" + File.separator + "out" + File.separator + "out.xml");
    try {
        FileUtils.copyFile(sourceFile, targetFile);
        Thread.sleep(2000);

        Assert.assertTrue(outfile.exists());
        String vfsOut = FileUtils.readFileToString(outfile);
        Assert.assertTrue(vfsOut.contains("WSO2 Company"));
    } finally {
        deleteFile(targetFile);
        deleteFile(outfile);
        removeProxy("VFSProxy1");
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:27,代码来源:VFSTransportTestCase.java


示例3: testHOST_HEADERPropertyTest

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.ALL})
@Test(groups = "wso2.esb", description = "Test wrong port(80) attached with the HOST_HEADERS for https backend")
public void testHOST_HEADERPropertyTest() throws Exception {
    try {
        axis2Client.sendSimpleStockQuoteRequest(getProxyServiceURLHttp("ESBJAVA3336httpsBackendProxyService"), null, "WSO2");
    } catch (Exception e) {

    }

    LogEvent[] logs = logViewer.getAllRemoteSystemLogs();
    boolean errorLogFound = false;
    for (LogEvent log : logs) {
        if (log.getMessage().contains("Host: google.com:80")) {
            errorLogFound = true;
            break;
        }
    }
    assertFalse(errorLogFound, "Port 80 should not append to the Host header");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:20,代码来源:ESBJAVA3336HostHeaderValuePortCheckTestCase.java


示例4: testVFSProxyContentType_NotSpecified

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
@Test(groups = {"wso2.esb"}, description = "Sending a file through VFS Transport : " +
                                           "transport.vfs.FileURI = Linux Path, " +
                                           "transport.vfs.ContentType = Not Specified, " +
                                           "transport.vfs.FileNamePattern = - *\\.xml " +
                                           "transport.vfs.FileURI = Invalid", enabled = false)
public void testVFSProxyContentType_NotSpecified()
        throws Exception {

    addVFSProxy17();

    File sourceFile = new File(pathToVfsDir + File.separator + "test.xml");
    File targetFile = new File(pathToVfsDir + "test" + File.separator + "in" + File.separator + "test.xml");
    File outfile = new File(pathToVfsDir + "test" + File.separator + "out" + File.separator + "out.xml");
    try {
        FileUtils.copyFile(sourceFile, targetFile);
        Thread.sleep(2000);

        Assert.assertTrue(!outfile.exists());
    } finally {
        deleteFile(targetFile);
        deleteFile(outfile);
        removeProxy("VFSProxy17");
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:26,代码来源:VFSTransportTestCase.java


示例5: testDBmediatorFailCase

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
/**
 * Test with UseTransaction flag. The transaction mediator is used to handle transactional behaviour.
 * The rollback operation is checked.
 * @throws Exception
 */
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
/*JIRA issue: https://wso2.org/jira/browse/ESBJAVA-1553*/
@Test(groups = "wso2.esb", description = "Test UseTransaction option ." +
        "Use in conjunction with Transaction mediator. Fail casse"
)
public void testDBmediatorFailCase() throws Exception {
    String sunStringtDB1, sunStringtDB2;
    sunStringtDB1 = getDatabaseResultsForDB1FailCase();
    assertTrue(sunStringtDB1.contains("SUN"), "Fault, invalid response");
    sunStringtDB2 = getDatabaseResultsForDB2FailCase();
    assertTrue(sunStringtDB2.contains("SUN"), "Fault, invalid response");
    HttpRequestUtil.doPost(new URL(getApiInvocationURL(API_URL + COMMIT_CONTEXT + "?nameEntry=SUN")), "");
    sunStringtDB1 = getDatabaseResultsForDB1FailCase();
    assertTrue(sunStringtDB1.contains("SUN"), "Fault, invalid response. Transaction is not rollbacked.");
    sunStringtDB2 = getDatabaseResultsForDB2FailCase();
    assertTrue(sunStringtDB2.contains("SUN"), "Fault, invalid response.Transaction is not rollbacked.");

}
 
开发者ID:wso2,项目名称:product-ei,代码行数:24,代码来源:DBMediatorUseTransaction.java


示例6: testVFSProxyReplyFileName_Invalid

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
@Test(groups = {"wso2.esb"}, description = "Sending a file through VFS Transport :" +
                                           " transport.vfs.FileURI = Linux Path, " +
                                           "transport.vfs.ContentType = text/xml, " +
                                           "transport.vfs.FileNamePattern = - *\\.xml, " +
                                           "transport.vfs.ReplyFileName  = Invalid")
public void testVFSProxyReplyFileName_Invalid()
        throws Exception {

    addVFSProxy24();

    File sourceFile = new File(pathToVfsDir + File.separator + "test.xml");
    File targetFile = new File(pathToVfsDir + "test" + File.separator + "in" + File.separator + "test.xml");
    File outfile = new File(pathToVfsDir + "test" + File.separator + "out" + File.separator + "out.xml");
    try {
        FileUtils.copyFile(sourceFile, targetFile);
        Thread.sleep(2000);
        Assert.assertTrue(!outfile.exists());
    } finally {
        deleteFile(targetFile);
        deleteFile(outfile);
        removeProxy("VFSProxy24");
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:25,代码来源:VFSTransportTestCase.java


示例7: dbLookupMediatorTestMultipleStatements

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
@Test(groups = "wso2.esb", description = "Test dblookup mediator with multiple SQL statements")
public void dbLookupMediatorTestMultipleStatements() throws Exception {
    h2DatabaseManager.executeUpdate("INSERT INTO company VALUES(100.0,'IBM')");
    h2DatabaseManager.executeUpdate("INSERT INTO company VALUES(2000.0,'XYZ')");
    h2DatabaseManager.executeUpdate("INSERT INTO company VALUES(" + WSO2_PRICE + ",'WSO2')");
    h2DatabaseManager.executeUpdate("INSERT INTO company VALUES(300.0,'MNO')");
    URL fileLocation = getClass().getResource("/artifacts/ESB/mediatorconfig/dblookup/" +
            "dbLookupMediatorMultipleSQLStatementsTestProxy.xml");
    String proxyContent = FileUtils.readFileToString(new File(fileLocation.toURI()));
    proxyContent = updateDatabaseInfo(proxyContent);
    addProxyService(AXIOMUtil.stringToOM(proxyContent));
    OMElement response = axis2Client.sendSimpleStockQuoteRequest(getProxyServiceURLHttp
            ("dbLookupMediatorMultipleSQLStatementsTestProxy"), null, "WSO2");
    Assert.assertTrue(response.toString().contains("WSO2"));
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:17,代码来源:DBlookupMediatorTestCase.java


示例8: testRetryOnSOAPFaultWithInOutFalse

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
@Test(groups = "wso2.esb", description = "<property name=\"RETRY_ON_SOAPFAULT\" value=\"false\"/>")
public void testRetryOnSOAPFaultWithInOutFalse() throws Exception {

    loadESBConfigurationFromClasspath(File.separator + "artifacts" + File.separator + "ESB" + File.separator
                                      + "synapseconfig" + File.separator + "processor" + File.separator +
                                      "forwarding" + File.separator + "Retry_On_SOAPFault_In_Out.xml");

    AxisServiceClient serviceClient = new AxisServiceClient();
    serviceClient.fireAndForget(clearCountRequest(), getBackEndServiceUrl(), "clearRequestCount");
    OMElement requestCount = serviceClient.sendReceive(getCountRequest(), getBackEndServiceUrl(), "getRequestCount");
    Assert.assertEquals(requestCount.getFirstElement().getText(), "0", "Request Cunt not clear");

    serviceClient.sendRobust(getThrowAxisFaultRequest(), getMainSequenceURL(), "urn:throwAxisFault");
    Thread.sleep(5000);
    requestCount = serviceClient.sendReceive(getCountRequest(), getBackEndServiceUrl(), "getRequestCount");
    Assert.assertEquals(requestCount.getFirstElement().getText(), "1", "Request Count mismatched. Sent more than one request");

}
 
开发者ID:wso2,项目名称:product-ei,代码行数:20,代码来源:ESBJAVA2006RetryOnSOAPFaultTestCase.java


示例9: DBReportUseMessageContentTestCase

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
@Test(groups = "wso2.esb", description = "Insert or update DB table using message contents."
)
public void DBReportUseMessageContentTestCase() throws Exception {
    double price = 200.0;
    OMElement response;
    String priceMessageContent;
    h2DataBaseManager.executeUpdate("INSERT INTO company VALUES(100.0,'ABC')");
    h2DataBaseManager.executeUpdate("INSERT INTO company VALUES(2000.0,'XYZ')");
    h2DataBaseManager.executeUpdate("INSERT INTO company VALUES(" + price + ",'WSO2')");
    h2DataBaseManager.executeUpdate("INSERT INTO company VALUES(300.0,'MNO')");

    File synapseFile = new File(getClass().getResource("/artifacts/ESB/mediatorconfig/dbreport/" +
            "dbReportMediatorUsingMessageContentTestProxy.xml").getPath());
    addProxyService(updateSynapseConfiguration(synapseFile));
    priceMessageContent = getPrice();
    assertEquals(priceMessageContent, Double.toString(price), "Fault, invalid response");
    response = axis2Client.sendSimpleStockQuoteRequest(getProxyServiceURLHttp
            ("dbReportMediatorUsingMessageContentTestProxy"), null, "WSO2");
    priceMessageContent = getPrice();
    OMElement returnElement = response.getFirstElement();
    OMElement lastElement = returnElement.getFirstChildWithName(new QName("http://services.samples/xsd", "last"));
    assertEquals(priceMessageContent, lastElement.getText(), "Fault, invalid response");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:25,代码来源:DBReportMediatorTestCase.java


示例10: testReturnContentType

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
@Test(groups = {"wso2.esb"}, description = "Test for DEFAULT_REQUEST_TYPE for nhttp transport")
public void testReturnContentType() throws Exception {
    try {
        String url = getApiInvocationURL("defaultRequestContentTypeApi").concat("?symbol=wso2");
        HttpUriRequest request = new HttpPut(url);
        DefaultHttpClient client = new DefaultHttpClient();

        ((HttpPut)request).setEntity(new StringEntity("<request/>"));

        HttpResponse response = client.execute(request);
        Assert.assertNotNull(response);
        Assert.assertTrue(getResponse(response).toString().contains("WSO2"));
    } catch (IOException e) {
        log.error("Error while sending the request to the endpoint. ", e);
    }

}
 
开发者ID:wso2,项目名称:product-ei,代码行数:19,代码来源:DefaultRequestContentTypeTestCase.java


示例11: testHLProxyApplicationAck

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.STANDALONE })
@Test(groups = { "wso2.esb" }, description = "testing application ack")
public void testHLProxyApplicationAck() throws Exception {

	addHL7ApplicationAckProxy();

	HL7Server server = new HL7Server(9988);
	server.start();
	Thread.sleep(2000);

	HL7Sender sender = new HL7Sender();
	String response = sender.send("localhost", 9293);

	Assert.assertTrue(response.contains("error msg"));

	removeProxy("HL7ApplicationAckProxy");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:18,代码来源:HL7TestCase.java


示例12: testJmsQueueToHttpWithInboundEndpoint

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
/**
 * Test whether consuming message from a queue and sending to a backend works (i.e. JMS -> HTTP)
 *
 * @throws Exception if any error occurred while running tests
 */
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
@Test(groups = {"wso2.esb"}, description = "Test JMS to HTTP communication with inbound endpoint")
public void testJmsQueueToHttpWithInboundEndpoint() throws Exception {
    LogViewerClient logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie());
    logViewerClient.clearLogs();

    //send a message to the queue
    sendMessage();

    //check for the log
    boolean assertValue = Utils.assertIfSystemLogContains(logViewerClient,
                                                          "** testJmsQueueToHttpWithInboundEndpoint RESPONSE **");

    Assert.assertTrue(assertValue, "HTTP backend response did not receive with the inbound endpoint.");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:21,代码来源:JmsToBackendWithInboundEndpointTestCase.java


示例13: messageStoreFIXStoringTest

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
@Test(groups = { "wso2.esb" }, description = "Test whether FIX messages are stored from store mediator")
public void messageStoreFIXStoringTest() throws Exception {
	// The count should be 0 as soon as the message store is created
	Assert.assertTrue(messageStoreAdminClient.getMessageCount(MESSAGE_STORE_NAME) == 0,
	                  "Message store should be initially empty");
	// refer within a sequence through a store mediator, mediate messages
	// and verify the messages are stored correctly in the store.
	loadESBConfigurationFromClasspath("/artifacts/ESB/synapseconfig/messageStore/sample_700.xml");
	for (int i = 0; i < 5; i++) {
		axis2Client.sendSimpleQuoteRequest(getMainSequenceURL(), null, "WSO2");
	}
	Assert.assertTrue(Utils.waitForMessageCount(messageStoreAdminClient, MESSAGE_STORE_NAME, 5, 30000),
			"Messages are missing or repeated");
       serverConfigurationManager.restartGracefully();
       super.init();
       initVariables();
       messageStores = messageStoreAdminClient.getMessageStores();
       Assert.assertNotNull(messageStores);
       if (messageStores != null) {
           Assert.assertTrue(messageStoreAdminClient.getMessageCount(MESSAGE_STORE_NAME) == 0,
                   "Messages have not cleaned");
       }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:25,代码来源:MessageStoreMessageCleaningTestCase.java


示例14: testInboundEnpointReadFileinFTP

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.STANDALONE })
@Test(groups = "wso2.esb", description = "Inbound endpoint Reading file in FTP Test Case")
public void testInboundEnpointReadFileinFTP() throws Exception {


	File sourceFile = new File(pathToFtpDir + File.separator + "test.xml");
	File targetFolder = new File(FTPFolder + File.separator + "ftpin");
	File targetFile = new File(targetFolder + File.separator + "test.xml");

	try {
		FileUtils.copyFile(sourceFile, targetFile);
		addInboundEndpoint(addEndpoint1());
		boolean isFileRead = Utils.checkForLog(logViewerClient, "<m0:symbol>WSO2</m0:symbol>", 10);
		Assert.assertTrue(isFileRead, "The XML file is not getting read");
	} finally {
		deleteFile(targetFile);
	}
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:19,代码来源:FtpInboundTransportTest.java


示例15: testRetryOnSOAPFaultWithInOutFalse

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.ALL
})
    @Test(groups = "wso2.esb", description = "<property name=\"RETRY_ON_SOAPFAULT\" value=\"false\"/>")
    public void testRetryOnSOAPFaultWithInOutFalse() throws Exception {

        AxisServiceClient serviceClient = new AxisServiceClient();
        serviceClient.fireAndForget(clearCountRequest(), getBackEndServiceUrl(), "clearRequestCount");
        OMElement requestCount = serviceClient.sendReceive(getCountRequest(), getBackEndServiceUrl(), "getRequestCount");
        Assert.assertEquals(requestCount.getFirstElement().getText(), "0", "Request Cunt not clear");

        serviceClient.sendRobust(getThrowAxisFaultRequest(), getProxyServiceURLHttp("messageProcessorRetryOnSOAPFaultFalseTestProxy"), "urn:throwAxisFault");
        Thread.sleep(5000);
        requestCount = serviceClient.sendReceive(getCountRequest(), getBackEndServiceUrl(), "getRequestCount");
        Assert.assertEquals(requestCount.getFirstElement().getText(), "1", "Request Count mismatched. Sent more than one request");

    }
 
开发者ID:wso2,项目名称:product-ei,代码行数:17,代码来源:ESBJAVA2006RetryOnSOAPFaultTestCase.java


示例16: dbLookupTestStoredProcedures

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
@Test(groups = "wso2.esb", description = "Test dblookup mediator with stored procedures")
public void dbLookupTestStoredProcedures() throws Exception {
    h2DatabaseManager.executeUpdate("INSERT INTO company VALUES(100.0,'ABC')");
    h2DatabaseManager.executeUpdate("INSERT INTO company VALUES(2000.0,'XYZ')");
    h2DatabaseManager.executeUpdate("INSERT INTO company VALUES(" + WSO2_PRICE + ",'WSO2')");
    h2DatabaseManager.executeUpdate("INSERT INTO company VALUES(300.0,'MNO')");
    // in H2 the stored procedures has to be defined as an alias
    h2DatabaseManager.executeUpdate("DROP ALIAS IF EXISTS getId;");
    String storedProcStr = "CREATE ALIAS getId AS $$ " +
                            "ResultSet query(Connection conn, String nameVal) throws SQLException { " +
                                "String sql = \"select * from company where name = '\" + nameVal + \"'\";" +
                                "return conn.createStatement().executeQuery(sql); " +
                            "} $$;";
    h2DatabaseManager.executeUpdate(storedProcStr);
    URL fileLocation = getClass().getResource("/artifacts/ESB/mediatorconfig/dblookup/" +
            "dbLookupMediatorStoredProcedureTestProxy.xml");
    String proxyContent = FileUtils.readFileToString(new File(fileLocation.toURI()));
    proxyContent = updateDatabaseInfo(proxyContent);
    addProxyService(AXIOMUtil.stringToOM(proxyContent));
    OMElement response = axis2Client.sendSimpleStockQuoteRequest(getProxyServiceURLHttp
            ("dbLookupMediatorStoredProcedureTestProxy"), null, "WSO2");
    Assert.assertTrue(response.toString().contains("WSO2"));
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:25,代码来源:DBlookupMediatorTestCase.java


示例17: testSequence

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
@Test(groups = "wso2.esb", description = "Tests http address")
public void testSequence() throws Exception {

    String response = client.getResponse(getMainSequenceURL(), "WSO2");
    Assert.assertNotNull(response, "Response Message is null");
    OMElement envelope = client.toOMElement(response);
    OMElement soapBody = envelope.getFirstElement();
    Iterator iterator =
            soapBody.getChildrenWithName(new QName("http://services.samples",
                                                   "getQuoteResponse"));
    int i = 0;
    while (iterator.hasNext()) {
        i++;
        OMElement getQuote = (OMElement) iterator.next();
        Assert.assertTrue(getQuote.toString().contains("WSO2"));
    }
    Assert.assertEquals(i, 2, "Child Element mismatched");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:20,代码来源:CloneIntegrationNamedEndpointsTestCase.java


示例18: testJRubyScriptMediationScriptFromGovRegistry

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = {
        ExecutionEnvironment.STANDALONE
})
@Test(groups = { "wso2.esb", "localOnly" },
      description = "Script Mediator -Run a Ruby script with the mediator" + " -Script from gov registry")
public void testJRubyScriptMediationScriptFromGovRegistry() throws Exception {
    enableDebugLogging();
    uploadResourcesToConfigRegistry();

    OMElement response = axis2Client
            .sendCustomQuoteRequest(getProxyServiceURLHttp("scriptMediatorRubyStoredInRegistryTestProxy"), null,
                    "WSO2");

    assertNotNull(response, "Fault response message null");

    assertNotNull(response.getQName().getLocalPart(), "Fault response null localpart");
    assertEquals(response.getQName().getLocalPart(), "CheckPriceResponse", "Fault localpart mismatched");

    assertNotNull(response.getFirstElement().getQName().getLocalPart(), " Fault response null localpart");
    assertEquals(response.getFirstElement().getQName().getLocalPart(), "Code", "Fault localpart mismatched");

    assertNotNull(response.getFirstChildWithName(new QName("http://services.samples/xsd", "Price")),
            "Fault response null localpart");
    clearUploadedResource();
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:26,代码来源:RubyScriptSupportTestCase.java


示例19: testVfsTransport

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.STANDALONE })
@Test(groups = { "wso2.esb" }, description = "Testing VFS transport")
public void testVfsTransport() throws Exception {
    File sourceFile = new File(pathToVfsDir + "test.xml");
    File targetFile = new File(inFolder.getAbsolutePath() + File.separator + "test.xml");
    outfile = new File(outFolder.getAbsolutePath() + File.separator + "out.xml");
    try {
        FileUtils.copyFile(sourceFile, targetFile);
        boolean isOutFileExist = isOutFileExist();
        assertTrue(isOutFileExist, "out.xml file not found");
        String vfsOut = FileUtils.readFileToString(outfile);
        assertTrue(vfsOut.contains("WSO2 Company"), "WSO2 Company string not found");
    } finally {
        deleteFolder(targetFile);
        deleteFolder(outfile);
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:18,代码来源:Sample254TestCase.java


示例20: testSynapseObservers

import org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment; //导入依赖的package包/类
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
@Test(groups = {"wso2.esb"}, description = "Test synapse observer ",enabled = false)
public void testSynapseObservers() throws Exception {

    Thread.sleep(30000);

    boolean isRequestLogFound = false;

    LogEvent[] logEvents = logViewerClient.getAllSystemLogs();
    for (LogEvent event : logEvents) {
        if (event.getMessage().contains("Simple logging observer initialized")) {
            isRequestLogFound = true;
            break;
        }
    }

    Assert.assertTrue("Simple observer not working", isRequestLogFound);

}
 
开发者ID:wso2,项目名称:product-ei,代码行数:20,代码来源:Sample651TestCase.java



注:本文中的org.wso2.carbon.automation.engine.annotations.ExecutionEnvironment类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FileDiff类代码示例发布时间:2022-05-23
下一篇:
Java InterpolationFilterReader类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap