本文整理匯總了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);
}
示例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);
}
示例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);
}
示例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");
}
示例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;
}
示例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);
}
示例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");
}
示例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");
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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");
}
示例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");
}
示例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");
}