Java Code Examples for org.apache.axiom.om.OMElement

The following examples show how to use org.apache.axiom.om.OMElement. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@BeforeClass(alwaysRun = true)
public void initialize() throws Exception {
    super.init();
    OMElement mailToProxyOMElement = AXIOMUtil.stringToOM(FileUtils.readFileToString(new File(
            getESBResourceLocation() + File.separator + "mailTransport" + File.separator
                    + "mailTransportReceiver" + File.separator + "mail_transport_folder.xml")));
    Utils.deploySynapseConfiguration(mailToProxyOMElement,
            "MailTransportFolder","proxy-services",
            true);
    carbonLogReader = new CarbonLogReader();
    greenMailUser = GreenMailServer.getPrimaryUser();
    greenMailClient = new GreenMailClient(greenMailUser);
    carbonLogReader.start();

    // Since ESB reads all unread emails one by one, we have to delete
    // the all unread emails before run the test
    GreenMailServer.deleteAllEmails("imap");
}
 
Example 2
@Test(groups = "wso2.esb", description = "secure Request to a pass through proxy refer secure backend service")
public void secureRequestScenario1() throws Exception {
    applySecurity("UTSecureStockQuoteProxy", 1, getUserRole());
    addProxy();
    OMElement response = new SecureStockQuoteClient().sendSecuredSimpleStockQuoteRequest(userInfo.getUserName()
            , userInfo.getPassword(), getProxyServiceURLHttps(proxyName + "1")
            , policyPath + "scenario1-policy.xml", "Secured");

    String lastPrice = response.getFirstElement().getFirstChildWithName(new QName("http://services.samples/xsd", "last"))
            .getText();
    assertNotNull(lastPrice, "Fault: response message 'last' price null");

    String symbol = response.getFirstElement().getFirstChildWithName(new QName("http://services.samples/xsd", "symbol"))
            .getText();
    assertEquals(symbol, "Secured", "Fault: value 'symbol' mismatched");

}
 
Example 3
Source Project: micro-integrator   Source File: AddScheduleTaskTestCase.java    License: Apache License 2.0 6 votes vote down vote up
private void addEmployee(String employeeNumber) throws AxisFault {
    OMElement payload = fac.createOMElement("addEmployee", omNs);

    OMElement empNo = fac.createOMElement("employeeNumber", omNs);
    empNo.setText(employeeNumber);
    payload.addChild(empNo);

    OMElement lastName = fac.createOMElement("lastName", omNs);
    lastName.setText("BBB");
    payload.addChild(lastName);

    OMElement fName = fac.createOMElement("firstName", omNs);
    fName.setText("AAA");
    payload.addChild(fName);

    OMElement email = fac.createOMElement("email", omNs);
    email.setText("[email protected]");
    payload.addChild(email);

    OMElement salary = fac.createOMElement("salary", omNs);
    salary.setText("50000");
    payload.addChild(salary);

    new AxisServiceClient().sendRobust(payload, serviceEndPoint, "addEmployee");

}
 
Example 4
Source Project: product-ei   Source File: ServiceInvoker.java    License: Apache License 2.0 6 votes vote down vote up
public void run() {

        client.getOptions().setAction(operation);

        try {

            long t1 = System.currentTimeMillis();

            for (long i=0; i < iterations; i++) {
                OMElement response2 = client.sendReceive(msg);
                OMElement loadElement = response2.getFirstChildWithName(new QName("load"));
                System.out.println(invokerName + ": " + loadElement.toString());
            }

            long t2 = System.currentTimeMillis();

            System.out.println("================================================================");
            System.out.println(invokerName + " completed requests.");
            System.out.println("================================================================");
            runningTime = t2 - t1;

        } catch (AxisFault axisFault) {
            System.out.println(axisFault.getMessage());
        }
    }
 
Example 5
Source Project: micro-integrator   Source File: Sample704TestCase.java    License: Apache License 2.0 6 votes vote down vote up
private OMElement createPayload() {   // creation of payload for placeOrder

        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = fac.createOMNamespace("http://services.samples", "ser");
        OMNamespace xsdNs = fac.createOMNamespace("http://services.samples", "xsd");
        OMElement payload = fac.createOMElement("placeOrder", omNs);
        OMElement order = fac.createOMElement("order", omNs);

        OMElement price = fac.createOMElement("price", xsdNs);
        price.setText("10");
        OMElement quantity = fac.createOMElement("quantity", xsdNs);
        quantity.setText("100");
        OMElement symbol = fac.createOMElement("symbol", xsdNs);
        symbol.setText("WSO2");

        order.addChild(price);
        order.addChild(quantity);
        order.addChild(symbol);
        payload.addChild(order);
        return payload;
    }
 
Example 6
Source Project: carbon-commons   Source File: MessageSender.java    License: Apache License 2.0 6 votes vote down vote up
private Config getDiscoveryConfig(AxisService service) {
    Parameter parameter = service.getParameter(DiscoveryConstants.WS_DISCOVERY_PARAMS);
    Config config;
    if (parameter != null) {
        OMElement element = parameter.getParameterElement();

        // For a ProxyService, the parameter defined as XML, is returned as a string value.
        // Until this problem is solved, we'll be adopting the approach below, to make an
        // attempt to construct the parameter element.
        if (element == null) {
            if (parameter.getValue() != null) {
                try {
                    String wrappedElementText = "<wrapper>" + parameter.getValue() + "</wrapper>";
                    element = AXIOMUtil.stringToOM(wrappedElementText);
                } catch (Exception ignored) { }
            } else {
                return getDefaultConfig();
            }
        }

        config = Config.fromOM(element);
    } else {
        return getDefaultConfig();
    }
    return config;
}
 
Example 7
Source Project: openxds   Source File: QueryTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testFindDocuments_MultipleStatus() throws Exception {
	//Generate StoredQuery request message
	patientId = XdsTest.patientId;
	String message = findDocumentsQuery(patientId);
	OMElement request = OMUtil.xmlStringToOM(message);			
	System.out.println("Request:\n" +request);

	//3. Send a StoredQuery
	ServiceClient sender = getRegistryServiceClient();															 
	OMElement response = sender.sendReceive( request );
	assertNotNull(response); 

	//4. Verify the response is correct
	OMAttribute status = response.getAttribute(new QName("status"));
	assertEquals("urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Success", status.getAttributeValue()); 

	String result = response.toString();
	System.out.println("Result:\n" +result);
}
 
Example 8
Source Project: garoon-google   Source File: HeaderFactory.java    License: MIT License 6 votes vote down vote up
/**
 * SOAPリクエストで送るヘッダを作成します。
 * 
 * @param actionName 利用するAPI名
 * @param username APIを利用するユーザー名
 * @param password APIを利用するユーザーのパスワード
 * @param createdTime SOAPメッセージの作成日時
 * @param expiredTime SOAPメッセージの有効期限
 * @return org.apache.axiom.om.OMElement 生成されたヘッダ
 */
public static OMElement create(String actionName, String username, String password, Date createdTime,
        Date expiredTime) {
    OMElement soapHeader = getHeaderElement();

    OMElement actionElement = getActionElement(actionName);
    soapHeader.addChild(actionElement);

    OMElement securityElement = getSecurityElement(username, password);
    soapHeader.addChild(securityElement);

    OMElement timestampElement = getTimestampElement(createdTime, expiredTime);
    soapHeader.addChild(timestampElement);

    return soapHeader;
}
 
Example 9
Source Project: openxds   Source File: TestkitStructure.java    License: Apache License 2.0 6 votes vote down vote up
List<String> getStepIds(File testplan) {
	ArrayList<String> ids = new ArrayList<String>();
	OMElement tplan;
	try {
		tplan = Util.parse_xml(testplan);
		AXIOMXPath xpathExpression = new AXIOMXPath ("//TestPlan/TestStep");
		List<OMNode> nodes = xpathExpression.selectNodes(tplan);

		for (int i=0; i<nodes.size(); i++) {
			OMElement testStep = (OMElement) nodes.get(i);
			ids.add(testStep.getAttributeValue(MetadataSupport.id_qname));
		}

	} catch (Exception e) {
		e.printStackTrace();
		System.err.println(ExceptionUtil.exception_details(e));
		System.exit(-1);
	}

	return ids;
}
 
Example 10
Source Project: carbon-apimgt   Source File: ThrottleHandler.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * This method will intialize subscription level throttling context and throttle object.
 * This method need to be called for each and every request of spike arrest is enabled.
 * If throttle context for incoming message is already created method will do nothing. Else
 * it will create throttle object and context.
 */
private void initThrottleForHardLimitThrottling() {
    OMElement hardThrottlingPolicy = createHardThrottlingPolicy();
    if (hardThrottlingPolicy != null) {
        Throttle tempThrottle;
        try {
            tempThrottle = ThrottleFactory.createMediatorThrottle(
                    PolicyEngine.getPolicy(hardThrottlingPolicy));
            ThrottleConfiguration newThrottleConfig = tempThrottle.getThrottleConfiguration(ThrottleConstants
                                                                                                    .ROLE_BASED_THROTTLE_KEY);
            ThrottleContext hardThrottling = ThrottleContextFactory.createThrottleContext(ThrottleConstants
                                                                                                  .ROLE_BASE,
                                                                                          newThrottleConfig);
            tempThrottle.addThrottleContext(APIThrottleConstants.HARD_THROTTLING_CONFIGURATION, hardThrottling);
            if (throttle != null) {
                throttle.addThrottleContext(APIThrottleConstants.HARD_THROTTLING_CONFIGURATION, hardThrottling);
            } else {
                throttle = tempThrottle;
            }
        } catch (ThrottleException e) {
            log.error("Error occurred while creating policy file for Hard Throttling.", e);
        }
    }
}
 
Example 11
Source Project: micro-integrator   Source File: QueryFactory.java    License: Apache License 2.0 6 votes vote down vote up
private static CSVQuery createCSVQuery(DataService dataService,
                                          OMElement queryEl) throws DataServiceFault {
	String queryId, configId, inputNamespace;
	EventTrigger[] eventTriggers;
	Result result;
	try {
	    queryId = getQueryId(queryEl);
	    configId = getConfigId(queryEl);
	    eventTriggers = getEventTriggers(dataService, queryEl);
	    result = getResultFromQueryElement(dataService, queryEl);
	    inputNamespace = extractQueryInputNamespace(dataService, result, queryEl);
	} catch (Exception e) {
		throw new DataServiceFault(e, "Error in parsing CSV query element");
	}
	CSVQuery query = new CSVQuery(dataService, queryId,
                                     getQueryParamsFromQueryElement(queryEl), configId, result,
                                     eventTriggers[0], eventTriggers[1],
                                     extractAdvancedProps(queryEl), inputNamespace);
	return query;
}
 
Example 12
Source Project: attic-stratos   Source File: IaasProviderConfigParser.java    License: Apache License 2.0 6 votes vote down vote up
private static void loadClassName(final String fileName, final IaasProvider iaas, final OMElement iaasElt) {

        Iterator<?> it =
                iaasElt.getChildrenWithName(new QName(
                        CloudControllerConstants.CLASS_NAME_ELEMENT));

        if (it.hasNext()) {
            OMElement classNameElt = (OMElement) it.next();
            iaas.setClassName(classNameElt.getText());
        }

        if (it.hasNext()) {
            log.warn(" file contains more than one " +
                    CloudControllerConstants.CLASS_NAME_ELEMENT + " elements!" +
                    " Elements other than the first will be neglected.");
        }

        if (iaas.getClassName() == null) {
            String msg =
                    "Essential '" + CloudControllerConstants.CLASS_NAME_ELEMENT + "' element " +
                            "has not specified in " + fileName;
            handleException(msg);
        }

    }
 
Example 13
@Test(groups = "wso2.esb", description = "Pass through proxy https with addressing uri")
public void testHttpsPassThroughProxyWithAddressing() throws Exception {

    OMElement response = axis2Client
            .sendSimpleStockQuoteRequest(getProxyServiceURLHttps("StockQuotePassThroughProxyWithAddressing"),
                    getBackEndServiceUrl(ESBTestConstant.SIMPLE_STOCK_QUOTE_SERVICE), "WSO2");

    String lastPrice = response.getFirstElement()
            .getFirstChildWithName(new QName("http://services.samples/xsd", "last")).getText();
    assertNotNull(lastPrice, "Fault: response message 'last' price null");

    String symbol = response.getFirstElement()
            .getFirstChildWithName(new QName("http://services.samples/xsd", "symbol")).getText();
    assertEquals(symbol, "WSO2", "Fault: value 'symbol' mismatched");

}
 
Example 14
Source Project: openxds   Source File: Parse.java    License: Apache License 2.0 6 votes vote down vote up
static public OMElement parse_xml_string(String input_string) throws XMLParserException {
		byte[] ba = input_string.getBytes();

//		create the parser
		XMLStreamReader parser=null;

		try {
			parser = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(ba));
		} catch (XMLStreamException e) {
			throw new XMLParserException("gov.nist.registry.common2.xml.Parse: Could not create XMLStreamReader from " + "input stream");
		}
//		create the builder
		StAXOMBuilder builder = new StAXOMBuilder(parser);

//		get the root element (in this case the envelope)
		OMElement documentElement =  builder.getDocumentElement();

		return documentElement;
	}
 
Example 15
Source Project: carbon-identity   Source File: OAuthServerConfiguration.java    License: Apache License 2.0 6 votes vote down vote up
private void parseTokenValidators(OMElement tokenValidators) {
    if (tokenValidators == null) {
        return;
    }

    Iterator validators = tokenValidators.getChildrenWithLocalName(ConfigElements.TOKEN_VALIDATOR);
    if (validators != null) {
        for (; validators.hasNext(); ) {
            OMElement validator = (OMElement) validators.next();
            if (validator != null) {
                String clazzName = validator.getAttributeValue(new QName(ConfigElements.TOKEN_CLASS_ATTR));
                String type = validator.getAttributeValue(new QName(ConfigElements.TOKEN_TYPE_ATTR));
                tokenValidatorClassNames.put(type, clazzName);
            }
        }
    }
}
 
Example 16
@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(responseCount, no_of_requests, "GetQuoteResponse Element count mismatched");

}
 
Example 17
Source Project: micro-integrator   Source File: LBService1.java    License: Apache License 2.0 6 votes vote down vote up
public OMElement loadOperation(OMElement param) throws AxisFault {

        param.build();
        param.detach();

        OMElement loadElement = param.getFirstChildWithName(new QName("load"));
        String l = loadElement.getText();
        long load = Long.parseLong(l);

        for (long i = 0; i < load; i++) {
            System.out.println("Iteration: " + i);
        }

        String sName = System.getProperty("server_name");
        if (sName != null) {
            loadElement.setText("Response from server: " + sName);
        } else {
            loadElement.setText("Response from anonymous server");
        }
        return param;
    }
 
Example 18
Source Project: micro-integrator   Source File: VFSTransportTestCase.java    License: Apache License 2.0 6 votes vote down vote up
private void addVFSProxy23() throws Exception {

        String proxyName = "VFSProxy23";
        OMElement proxy = AXIOMUtil.stringToOM("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
                + "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" name=\"VFSProxy23\" transports=\"vfs\">\n"
                + "                <parameter name=\"transport.vfs.FileURI\">file://" + pathToVfsDir + "test"
                + File.separator + proxyName + File.separator + "in" + File.separator + "</parameter> <!--CHANGE-->\n"
                + "                <parameter name=\"transport.vfs.ContentType\">text/xml</parameter>\n"
                + "                <parameter name=\"transport.vfs.FileNamePattern\">.*\\.xml</parameter>\n"
                + "                <parameter name=\"transport.PollInterval\">1</parameter>\n"
                + "                <target>\n" + "                        <endpoint>\n"
                + "                                <address format=\"soap12\" uri=\"http://localhost:9000/services/SimpleStockQuoteService\"/>\n"
                + "                        </endpoint>\n" + "                        <outSequence>\n"
                + "                                <property action=\"set\" name=\"OUT_ONLY\" value=\"true\"/>\n"
                + "                                 <log level=\"full\"/>" + "                                <send>\n"
                + "                                        <endpoint>\n"
                + "                                                <address uri=\"vfs:file://" + pathToVfsDir + "test"
                + File.separator + proxyName + File.separator + "invalid" + File.separator + "out.xml\"/>"
                + "                                        </endpoint>\n" + "                                </send>\n"
                + "                        </outSequence>\n" + "                </target>\n" + "        </proxy>");
        addProxy(proxy, proxyName);
    }
 
Example 19
Source Project: cougar   Source File: SimpleSoapIdentityTokenResolver.java    License: Apache License 2.0 6 votes vote down vote up
@Override
  public List<IdentityToken> resolve(OMElement input, X509Certificate[] certificateChain) {
      List<IdentityToken> tokens = new ArrayList<IdentityToken>();
if (input != null) {
	for (Iterator i = input.getChildElements(); i.hasNext();) {
		OMElement element = (OMElement) i.next();
              for (SimpleIdentityTokenName t: SimpleIdentityTokenName.values()) {
                  if (element.getLocalName().equalsIgnoreCase(t.name())) {
                      tokens.add(new IdentityToken(t.name(), element.getText()));
                      break;

                  }
              }
	}
}
      return tokens;
  }
 
Example 20
protected void nestedQuery2ForDateTime(){
	TestUtils.showMessage(this.epr + " - nestedQuery2ForDateTime");
	try {
           TestUtils.checkForService(this.epr);
		OMElement result = TestUtils.callOperation(this.epr,
				"order_details_for_date_time_op", null);
		assertTrue(TestUtils.validateResultStructure(result,
				TestUtils.ORDER_DETAILS_NESTED_WITH_DATETIME_XSD_PATH));
	} catch (Exception e) {
		e.printStackTrace();
		fail(e.getMessage());
	}
}
 
Example 21
private void readCacheTimeOut(OMElement cacheTimeoutElem, String value) {
    Integer timeout;

    try {
        timeout = Integer.valueOf(value);
        cacheTimeouts.put(cacheTimeoutElem.getLocalName(), timeout);
    } catch (NumberFormatException e) {
        log.warn(cacheTimeoutElem.getLocalName() + "doesn't have a numeric value specified." +
                 "Entry is ignored");
    }
}
 
Example 22
Source Project: carbon-apimgt   Source File: APIManagerConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * To populate Monetization Additional Attributes
 *
 * @param element
 */
private void setMonetizationAdditionalAttributes(OMElement element) {

    Iterator iterator = element.getChildrenWithLocalName(APIConstants.Monetization.ATTRIBUTE);
    while (iterator.hasNext()) {
        OMElement omElement = (OMElement) iterator.next();
        Iterator attributes = omElement.getChildElements();
        JSONObject monetizationAttribute = new JSONObject();
        boolean isHidden = Boolean.parseBoolean(
                omElement.getAttributeValue(new QName(APIConstants.Monetization.IS_ATTRIBUTE_HIDDEN)));
        boolean isRequired = Boolean.parseBoolean(
                omElement.getAttributeValue(new QName(APIConstants.Monetization.IS_ATTRIBITE_REQUIRED)));
        monetizationAttribute.put(APIConstants.Monetization.IS_ATTRIBUTE_HIDDEN, isHidden);
        while (attributes.hasNext()) {
            OMElement attribute = (OMElement) attributes.next();
            if (attribute.getLocalName().equals(APIConstants.Monetization.ATTRIBUTE_NAME)) {
                monetizationAttribute.put(APIConstants.Monetization.ATTRIBUTE, attribute.getText());
            } else if (attribute.getLocalName().equals(APIConstants.Monetization.ATTRIBUTE_DISPLAY_NAME)) {
                monetizationAttribute.put(APIConstants.Monetization.ATTRIBUTE_DISPLAY_NAME, attribute.getText());
            } else if (attribute.getLocalName().equals(APIConstants.Monetization.ATTRIBUTE_DESCRIPTION)) {
                monetizationAttribute.put(APIConstants.Monetization.ATTRIBUTE_DESCRIPTION, attribute.getText());
            } else if (attribute.getLocalName().equals(APIConstants.Monetization.ATTRIBUTE_DEFAULT) && isRequired) {
                monetizationAttribute.put(APIConstants.Monetization.ATTRIBUTE_DEFAULT, attribute.getText());
            }
        }
        if (isHidden && isRequired && !monetizationAttribute
                .containsKey(APIConstants.Monetization.ATTRIBUTE_DEFAULT)) {
            log.error("A default value needs to be given for required, hidden monetization attributes.");
        }
        monetizationAttribute.put(APIConstants.Monetization.IS_ATTRIBITE_REQUIRED, isRequired);
        monetizationAttributes.add(monetizationAttribute);
    }
}
 
Example 23
Source Project: product-ei   Source File: LocalEntryWhiteSpaceTestCase.java    License: Apache License 2.0 5 votes vote down vote up
@Test(groups = "wso2.esb", description = "Test local entry value retrieval for endpoint url")
public void testLocalEntryProxy() throws Exception {
    OMElement response = axis2Client.sendSimpleStockQuoteRequest("http://localhost:8480/services/LocalEntryTestProxy", null, "IBM");
    String lastPrice = response.getFirstElement()
            .getFirstChildWithName(new QName("http://services.samples/xsd", "last")).getText();
    assertNotNull(lastPrice, "Fault: response message 'last' price null");
}
 
Example 24
Source Project: openxds   Source File: RetrieveDocumentSetTest.java    License: Apache License 2.0 5 votes vote down vote up
private String getDocumentId(List extrinsicObjects) {
	String documentId = null;
	for (Iterator<OMElement> it = extrinsicObjects.iterator(); it.hasNext();) {
		OMElement ele = it.next();
		if (ele.getAttributeValue(new QName("identificationScheme"))
				.equals("urn:uuid:2e82c1f6-a085-4c72-9da3-8640a32e42ab")) {
			documentId = ele.getAttributeValue(new QName("value"));
		}
	}
	return documentId;
}
 
Example 25
@Test(groups = "wso2.esb", description = "Set action as \"value\" and type STRING (default scope)")
public void testStringValue() throws Exception {
    OMElement response = axis2Client
            .sendSimpleStockQuoteRequest(getProxyServiceURLHttp("stringValProperty"), null, "WSO2");
    Assert.assertTrue(
            response.getFirstElement().getFirstChildWithName(new QName("http://services.samples/xsd", "name"))
                    .toString().contains("WSO2 Company"));

}
 
Example 26
Source Project: developer-studio   Source File: ProjectWizardSettings.java    License: Apache License 2.0 5 votes vote down vote up
private void updateSelectedRegistryOptionType(OMElement dataElement, ProjectOptionData projectOptionData)
                                                                                                         throws CoreException {
	Map<String, String> controlData = getControlData(dataElement);
	String registyPathBindingProperty = null;
	if (controlData.containsKey("path.binding.property")) {
		registyPathBindingProperty = controlData.get("path.binding.property");
	}

	if (controlData.containsKey("registry.selection.type")) {
		String value = controlData.get("registry.selection.type");
		if (value != null) {
			if (value.equals("collection")) {
				projectOptionData.setRegistyResourceSelectionType(RegistryOptionsConstants.SELECTED_REGISTRY_PATH);
			} else if (value.equals("resource")) {
				projectOptionData.setRegistyResourceSelectionType(RegistryOptionsConstants.SELECTED_REGISTRY_RESOURCE);
			} else if (value.equals("resource+collection")) {
				projectOptionData.setRegistyResourceSelectionType(RegistryOptionsConstants.SELECTED_REGISTRY_RESOURCE |
				                                                  RegistryOptionsConstants.SELECTED_REGISTRY_PATH);
			} else if (value.equals("registy")) {
				projectOptionData.setRegistyResourceSelectionType(RegistryOptionsConstants.SELECTED_REGISTRY);
			}
		}
	} else {
		projectOptionData.setRegistyResourceSelectionType(RegistryOptionsConstants.SELECTED_REGISTRY);
	}
	projectOptionData.setRegistyPathBindingProperty(registyPathBindingProperty);
}
 
Example 27
Source Project: openxds   Source File: TestkitWalker.java    License: Apache License 2.0 5 votes vote down vote up
void walkTestPlan(File testPlanFile) throws FactoryConfigurationError, Exception {
	OMElement testplanEle = Util.parse_xml(testPlanFile);

	List<OMElement> steps = MetadataSupport.childrenWithLocalName(testplanEle, "TestStep");

	for(int i=0; i<steps.size(); i++) {
		OMElement stepEle = steps.get(i);
		doStep(stepEle.getLocalName());
	}

}
 
Example 28
Source Project: micro-integrator   Source File: IterateClient.java    License: Apache License 2.0 5 votes vote down vote up
private OMElement createMultipleCustomQuoteRequestBody(String symbol, int iterations) {
    SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
    OMNamespace omNs = fac.createOMNamespace("http://services.samples", "ns");
    OMElement method = fac.createOMElement("getQuote", omNs);

    for (int i = 0; i < iterations; i++) {
        OMElement chkPrice = fac.createOMElement("CheckPriceRequest", omNs);
        OMElement code = fac.createOMElement("Code", omNs);
        chkPrice.addChild(code);
        code.setText(symbol);
        method.addChild(chkPrice);
    }
    return method;
}
 
Example 29
@Test(groups = { "wso2.esb" }, description = "Do XSLT transformation  by selecting the xslt file from file system")
public void xsltTransformationFromFileSystem() throws AxisFault {
    OMElement response;

    response = axis2Client.sendCustomQuoteRequest(getProxyServiceURLHttp("xsltInFileSystemTestProxy"), null, "IBM");
    assertNotNull(response, "Response message null");
    assertTrue(response.toString().contains("Code"), "Response does not contain the key word: Code");
    assertTrue(response.toString().contains("IBM"), "Response does not contain the key word: IBM");

}
 
Example 30
@Test(groups = { "wso2.dss" }, enabled = false)
public void securityPolicy4() throws Exception {
    final int policyId = 4;
    this.secureService(policyId);
    SecureAxisServiceClient secureAxisServiceClient = new SecureAxisServiceClient();
    OMElement response;
    for (int i = 0; i < 5; i++) {
        response = secureAxisServiceClient
                .sendReceive(userInfo.getUserName(), userInfo.getPassword(), getServiceUrlHttp(serviceName),
                        "showAllOffices", getPayload(), policyId);
        verifyResponce(response);
    }
    log.info("Confidentiality verified");
}