當前位置: 首頁>>代碼示例>>Java>>正文


Java OMElement.getChildrenWithName方法代碼示例

本文整理匯總了Java中org.apache.axiom.om.OMElement.getChildrenWithName方法的典型用法代碼示例。如果您正苦於以下問題:Java OMElement.getChildrenWithName方法的具體用法?Java OMElement.getChildrenWithName怎麽用?Java OMElement.getChildrenWithName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.axiom.om.OMElement的用法示例。


在下文中一共展示了OMElement.getChildrenWithName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testLessNumberThanMaximum

import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
@Test(groups = {"wso2.esb"}, description = "less number of messages than minimum count")
public void testLessNumberThanMaximum() throws IOException, XMLStreamException {
    int responseCount = 0;


    no_of_requests = 3;
    aggregatedRequestClient.setNoOfIterations(no_of_requests);
    String Response = aggregatedRequestClient.getResponse();
    Assert.assertNotNull(Response);
    OMElement Response2 = AXIOMUtil.stringToOM(Response);
    OMElement soapBody = Response2.getFirstElement();
    Iterator iterator = soapBody.getChildrenWithName(new QName("http://services.samples",
                                                               "getQuoteResponse"));

    while (iterator.hasNext()) {
        responseCount++;
        OMElement getQuote = (OMElement) iterator.next();
        Assert.assertTrue(getQuote.toString().contains("IBM"));
    }


    Assert.assertTrue(2 <= responseCount && responseCount <= no_of_requests);

}
 
開發者ID:wso2,項目名稱:product-ei,代碼行數:25,代碼來源:AggregateWithMaxMInLimitsTestCase.java

示例2: testMoreNumberThanMinimum

import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
@Test(groups = {"wso2.esb"}, description = "higher number of messages than minimum count")
public void testMoreNumberThanMinimum() throws IOException, XMLStreamException {
    int responseCount = 0;


    no_of_requests = 80;
    aggregatedRequestClient.setNoOfIterations(no_of_requests);
    String Response = aggregatedRequestClient.getResponse();
    Assert.assertNotNull(Response);
    OMElement Response2 = AXIOMUtil.stringToOM(Response);
    OMElement soapBody = Response2.getFirstElement();
    Iterator iterator = soapBody.getChildrenWithName(new QName("http://services.samples",
                                                               "getQuoteResponse"));

    while (iterator.hasNext()) {
        responseCount++;
        OMElement getQuote = (OMElement) iterator.next();
        Assert.assertTrue(getQuote.toString().contains("IBM"));
    }


    Assert.assertTrue(50 <= responseCount && responseCount <= no_of_requests);

}
 
開發者ID:wso2,項目名稱:product-ei,代碼行數:25,代碼來源:AggregationWithoutMaxValueTestCase.java

示例3: testEqualtoMinimum

import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
@Test(groups = {"wso2.esb"}, description = "number of messages is equal to the minimum")
public void testEqualtoMinimum() throws IOException, XMLStreamException {
    int responseCount=0;
    no_of_requests=minMessageCount;
    aggregatedRequestClient.setNoOfIterations(no_of_requests);
    String Response= aggregatedRequestClient.getResponse();
    Assert.assertNotNull(Response);
    OMElement Response2= AXIOMUtil.stringToOM(Response);
    OMElement soapBody = Response2.getFirstElement();
    Iterator iterator =soapBody.getChildrenWithName(new QName("http://services.samples",
            "getQuoteResponse"));

    while (iterator.hasNext()) {
        responseCount++;
        OMElement getQuote = (OMElement) iterator.next();
        Assert.assertTrue(getQuote.toString().contains("IBM"));
    }
    Assert.assertEquals(no_of_requests,responseCount);

}
 
開發者ID:wso2,項目名稱:product-ei,代碼行數:21,代碼來源:SpecifyBothMinMaxByExpressionTestCase.java

示例4: testEqualtoMinimum

import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
@Test(groups = {"wso2.esb"}, description = "number of messages is equal to the minimum")
public void testEqualtoMinimum() throws IOException, XMLStreamException {
    int responseCount = 0;
    no_of_requests = 50;
    aggregatedRequestClient.setNoOfIterations(no_of_requests);
    String Response = aggregatedRequestClient.getResponse();
    Assert.assertNotNull(Response);
    OMElement Response2 = AXIOMUtil.stringToOM(Response);
    OMElement soapBody = Response2.getFirstElement();
    Iterator iterator = soapBody.getChildrenWithName(new QName("http://services.samples",
                                                               "getQuoteResponse"));

    while (iterator.hasNext()) {
        responseCount++;
        OMElement getQuote = (OMElement) iterator.next();
        Assert.assertTrue(getQuote.toString().contains("IBM"));
    }

    Assert.assertEquals(responseCount, no_of_requests, "GetQuoteResponse Element count mismatched");

}
 
開發者ID:wso2,項目名稱:product-ei,代碼行數:22,代碼來源:AggregationWithoutMaxValueTestCase.java

示例5: getModifiedTime

import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
private String getModifiedTime(String feedURL) throws XMLStreamException, IOException {
    OMElement mailFeed = getAtomFeedContent(feedURL);
    Iterator itr = mailFeed.getChildrenWithName(new QName("entry"));
    if (itr.hasNext()) {
        OMElement countOm = (OMElement) itr.next();
        for (Iterator itrTitle = countOm.getChildrenWithName(new QName("title")); itrTitle.hasNext(); ) {
            OMElement title = (OMElement) itrTitle.next();
            if (title.getText().equals("SOAPAction: http://ws.apache.org/ws/2007/05/eventing-extended/Publish")) {
                OMElement modified = (OMElement) countOm.getChildrenWithName(new QName("modified")).next();
                return modified.getText();
            }

        }
    }
    return null;
}
 
開發者ID:wso2,項目名稱:product-ei,代碼行數:17,代碼來源:EventingSampleTestCase.java

示例6: testMoreNumberThanMinimum

import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
@Test(groups = {"wso2.esb"}, description = "higher number of messages than minimum count")
public void testMoreNumberThanMinimum() throws IOException, XMLStreamException {
    int responseCount=0;
    no_of_requests=8;
    aggregatedRequestClient.setNoOfIterations(no_of_requests);
    String Response= aggregatedRequestClient.getResponse();
    Assert.assertNotNull(Response);
    OMElement Response2= AXIOMUtil.stringToOM(Response);
    OMElement soapBody = Response2.getFirstElement();
    Iterator iterator =soapBody.getChildrenWithName(new QName("http://services.samples",
            "getQuoteResponse"));

    while (iterator.hasNext()) {
        responseCount++;
        OMElement getQuote = (OMElement) iterator.next();
        Assert.assertTrue(getQuote.toString().contains("IBM"));
    }
    Assert.assertTrue(minMessageCount<=responseCount&&responseCount<=no_of_requests);

}
 
開發者ID:wso2,項目名稱:product-ei,代碼行數:21,代碼來源:SpecifyBothMinMaxByExpressionTestCase.java

示例7: testNamedEndpoints

import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE
})
	@Test(groups = "wso2.esb", description = "Tests for named endpoints")
	public void testNamedEndpoints() throws Exception {

        IterateClient client = new IterateClient();
		String response = client.getMultipleResponse(
				getProxyServiceURLHttp("iterateNamedEndpointsTestProxy"), "WSO2", 2);
		Assert.assertNotNull(response);
		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 count mismatched");
	}
 
開發者ID:wso2,項目名稱:product-ei,代碼行數:23,代碼來源:IterateNamedEndpointsTest.java

示例8: testSequence

import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
@Test(groups = "wso2.esb", description = "Tests http address")
public void testSequence() throws Exception {

    String response = client.getResponse(getProxyServiceURLHttp("CloneIntegrationAnonymousEndpointsTestProxy"), "WSO2");
    Assert.assertNotNull(response);
    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 count mismatched");
}
 
開發者ID:wso2,項目名稱:product-ei,代碼行數:20,代碼來源:CloneIntegrationAnonymousEndpointsTestCase.java

示例9: testEqualtoMaximum

import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
@Test(groups = {"wso2.esb"}, description = "number of messages is equal to the maximum")
public void testEqualtoMaximum() throws IOException, XMLStreamException {
    int responseCount=0;
    no_of_requests=maxMessageCount;
    aggregatedRequestClient.setNoOfIterations(no_of_requests);
    String Response= aggregatedRequestClient.getResponse();
    Assert.assertNotNull(Response);
    OMElement Response2= AXIOMUtil.stringToOM(Response);
    OMElement soapBody = Response2.getFirstElement();
    Iterator iterator =soapBody.getChildrenWithName(new QName("http://services.samples",
            "getQuoteResponse"));

    while (iterator.hasNext()) {
        responseCount++;
        OMElement getQuote = (OMElement) iterator.next();
        Assert.assertTrue(getQuote.toString().contains("IBM"));
    }
    Assert.assertTrue(minMessageCount<=responseCount&&responseCount<=no_of_requests);

}
 
開發者ID:wso2,項目名稱:product-ei,代碼行數:21,代碼來源:SpecifyBothMinMaxByExpressionTestCase.java

示例10: testMoreNumberThanMaximum

import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
@Test(groups = {"wso2.esb"}, description = "less number of messages than minimum count")
public void testMoreNumberThanMaximum() throws IOException, XMLStreamException {
    int responseCount = 0;


    no_of_requests = 10;
    aggregatedRequestClient.setNoOfIterations(no_of_requests);
    String Response = aggregatedRequestClient.getResponse();
    Assert.assertNotNull(Response);
    OMElement Response2 = AXIOMUtil.stringToOM(Response);
    OMElement soapBody = Response2.getFirstElement();
    Iterator iterator = soapBody.getChildrenWithName(new QName("http://services.samples",
                                                               "getQuoteResponse"));

    while (iterator.hasNext()) {
        responseCount++;
        OMElement getQuote = (OMElement) iterator.next();
        Assert.assertTrue(getQuote.toString().contains("IBM"));
    }


    Assert.assertTrue(2 <= responseCount && responseCount <= 5);

}
 
開發者ID:wso2,項目名稱:product-ei,代碼行數:25,代碼來源:AggregateWithMaxMInLimitsTestCase.java

示例11: testMoreNumberThanMinimum

import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
@Test(groups = {"wso2.esb"}, description = "less number of messages than minimum count")
public void testMoreNumberThanMinimum() throws IOException, XMLStreamException {
    int responseCount = 0;


    no_of_requests = 4;
    aggregatedRequestClient.setNoOfIterations(no_of_requests);
    String Response = aggregatedRequestClient.getResponse();
    Assert.assertNotNull(Response);
    OMElement Response2 = AXIOMUtil.stringToOM(Response);
    OMElement soapBody = Response2.getFirstElement();
    Iterator iterator = soapBody.getChildrenWithName(new QName("http://services.samples",
                                                               "getQuoteResponse"));

    while (iterator.hasNext()) {
        responseCount++;
        OMElement getQuote = (OMElement) iterator.next();
        Assert.assertTrue(getQuote.toString().contains("IBM"));
    }


    Assert.assertTrue(2 <= responseCount && responseCount <= no_of_requests);

}
 
開發者ID:wso2,項目名稱:product-ei,代碼行數:25,代碼來源:AggregateWithMaxMInLimitsTestCase.java

示例12: testLargeMessage

import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
@Test(groups = "wso2.esb", description = "Tests large message ~3MB")
public void testLargeMessage() throws Exception {

    String symbol = FixedSizeSymbolGenerator.generateMessageMB(3);
    String response = client.getResponse(getProxyServiceURLHttp("CloneAndAggregateTestProxy"), symbol);
    symbol = null;
    Assert.assertNotNull(response);
    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, " Aggregated message should contain two chilled element"); // Aggregated message should contain two
    // return elements from each cloned endpoint
    response = null;
}
 
開發者ID:wso2,項目名稱:product-ei,代碼行數:24,代碼來源:CloneLargeMessageTestCase.java

示例13: testNestedAggregateWithLargeMessage

import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
@Test(groups = {"wso2.esb"}, description = "sending nested aggregate request > request iterator count 2500")
public void testNestedAggregateWithLargeMessage() throws IOException, XMLStreamException {
    int messageItr = 15;
    String response = aggregatedRequestClient.getResponse(createNestedQuoteRequestBody("WSO2", messageItr));
    OMElement response2 = AXIOMUtil.stringToOM(response);
    OMElement soapBody = response2.getFirstElement();
    Iterator iterator = soapBody.getChildrenWithName(new QName("http://services.samples",
                                                               "getQuoteResponse"));

    int responseCount = 0;
    while (iterator.hasNext()) {
        responseCount++;
        OMElement getQuote = (OMElement) iterator.next();
        Assert.assertTrue(getQuote.toString().contains("WSO2 Company"));
    }


    Assert.assertEquals(responseCount, messageItr * messageItr, "Response count Mismatched");
}
 
開發者ID:wso2,項目名稱:product-ei,代碼行數:20,代碼來源:NestedAggregatesTestCase.java

示例14: testHTTP

import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
@Test(groups = "wso2.esb", description = "Tests for http endpoint")
public void testHTTP() throws Exception, InterruptedException {
       String response = client.getMultipleResponse(
               getProxyServiceURLHttp("iterateWithHttpEndPointTestProxy"), "WSO2",
               2);
       Assert.assertNotNull(response);
	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, "Message count mismatched");

}
 
開發者ID:wso2,項目名稱:product-ei,代碼行數:21,代碼來源:IterateEndpointsTest.java

示例15: maxValueTest

import org.apache.axiom.om.OMElement; //導入方法依賴的package包/類
@Test(groups = {"wso2.esb"}, description = "replacing a property by using an enrich mediator")
public void maxValueTest() throws IOException, XMLStreamException {
    int responseCount = 0;

    String Response = aggregatedRequestClient.getResponse();
    Assert.assertNotNull(Response);

    OMElement Response2 = AXIOMUtil.stringToOM(Response);
    OMElement soapBody = Response2.getFirstElement();
    Iterator iterator = soapBody.getChildrenWithName(new QName("http://services.samples",
                                                               "getQuoteResponse"));

    while (iterator.hasNext()) {
        responseCount++;
        OMElement getQuote = (OMElement) iterator.next();
        Assert.assertTrue(getQuote.toString().contains("IBM"));
    }

    Assert.assertEquals(responseCount, no_of_requests, "GetQuoteResponse Element count mismatched");
}
 
開發者ID:wso2,項目名稱:product-ei,代碼行數:21,代碼來源:HighTimeoutWithLessMessagesTestCase.java


注:本文中的org.apache.axiom.om.OMElement.getChildrenWithName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。