Package org.apache.servicemix.components.mps

Examples of org.apache.servicemix.components.mps.PropertySet.applyProperties()


    Document propertySet = makeDocument(xmlConfig);
    try {
      PropertySet ps = new PropertySet("somename",propertySet.getDocumentElement());
      NormalizedMessage inMessage = makeTestMessage(null);
      NormalizedMessage outMessage = makeTestMessage(null);
      ps.applyProperties(inMessage,outMessage);
     
      assertTrue(TEST_STRING.equals(outMessage.getProperty("testSimpleStaticValue.property")));
    } catch (ConfigNotSupportedException e) {
      fail(e.getLocalizedMessage());
    } catch (JBIException e) {
View Full Code Here


    Document propertySet = makeDocument(xmlConfig);
    try {
      PropertySet ps = new PropertySet("somename",propertySet.getDocumentElement());
      NormalizedMessage inMessage = makeTestMessage(null);
      NormalizedMessage outMessage = makeTestMessage(null);
      ps.applyProperties(inMessage,outMessage);
     
      assertTrue(TEST_STRING.equals(outMessage.getProperty("testSimpleExistingPropInvalidXPath.property")));
    } catch (ConfigNotSupportedException e) {
      fail(e.getLocalizedMessage());
    } catch (JBIException e) {
View Full Code Here

    Document propertySet = makeDocument(xmlConfig);
    try {
      PropertySet ps = new PropertySet("somename",propertySet.getDocumentElement());
      NormalizedMessage inMessage = makeTestMessage(null);
      NormalizedMessage outMessage = makeTestMessage(null);
      ps.applyProperties(inMessage,outMessage);
     
      assertTrue("myvalue".equals(outMessage.getProperty("testStaticValueDefaultWithBadXpath.property")));
    } catch (ConfigNotSupportedException e) {
      fail(e.getLocalizedMessage());
    } catch (JBIException e) {
View Full Code Here

    Document propertySet = makeDocument(xmlConfig);
    try {
      PropertySet ps = new PropertySet("somename",propertySet.getDocumentElement());
      NormalizedMessage inMessage = makeTestMessage("<this><is><some attr='1234'>xml123</some></is></this>");
      NormalizedMessage outMessage = makeTestMessage(null);
      ps.applyProperties(inMessage,outMessage);
     
      assertTrue(outMessage.getProperty("testSimpleValidXPath.property").toString().equals("1234"));
    } catch (ConfigNotSupportedException e) {
      e.printStackTrace();
      fail(e.getLocalizedMessage());
View Full Code Here

    Document propertySet = makeDocument(xmlConfig);
    try {
      PropertySet ps = new PropertySet("somename",propertySet.getDocumentElement());
      NormalizedMessage inMessage = makeTestMessage("<this><is><some attr='1234'>xml123</some></is></this>");
      NormalizedMessage outMessage = makeTestMessage(null);
      ps.applyProperties(inMessage,outMessage);
     
      assertTrue("Node is not null",outMessage.getProperty("testInvalidXPathSingle.property") == null);
    } catch (ConfigNotSupportedException e) {
      e.printStackTrace();
      fail(e.getLocalizedMessage());
View Full Code Here

     
      NormalizedMessage inMessage2 = makeTestMessage("<this><is><some>xml123</some></is></this>");
      // inMessage2 will have a property1=TEST_STRING     
      NormalizedMessage outMessage = makeTestMessage(null);

      ps.applyProperties(inMessage,outMessage);
      assertTrue(outMessage.getProperty("testXPATH2MessagesOneHasOneHasnt.property").toString().equals("1234"));

      ps.applyProperties(inMessage2,outMessage);
      assertTrue(outMessage.getProperty("testXPATH2MessagesOneHasOneHasnt.property").toString().equals(TEST_STRING));
View Full Code Here

      NormalizedMessage outMessage = makeTestMessage(null);

      ps.applyProperties(inMessage,outMessage);
      assertTrue(outMessage.getProperty("testXPATH2MessagesOneHasOneHasnt.property").toString().equals("1234"));

      ps.applyProperties(inMessage2,outMessage);
      assertTrue(outMessage.getProperty("testXPATH2MessagesOneHasOneHasnt.property").toString().equals(TEST_STRING));

    } catch (ConfigNotSupportedException e) {
      e.printStackTrace();
      fail(e.getLocalizedMessage());
View Full Code Here

    try {
      PropertySet ps = new PropertySet("somename",propertySet.getDocumentElement());
      NormalizedMessage inMessage = makeTestMessage("<this><is><some attr='1234'>xml123</some></is></this>");
      inMessage.setProperty("testProperty","value123");
      NormalizedMessage outMessage = makeTestMessage(null);
      ps.applyProperties(inMessage,outMessage);
     
      assertTrue("newProperty1 was not set to expected value",outMessage.getProperty("newProperty1").toString().equals("1234"));
      assertTrue("newProperty2 was not set to expected value",outMessage.getProperty("newProperty2").toString().equals("Some String I expect to be Set"));
      assertTrue("newProperty3 was not set to expected value",outMessage.getProperty("newProperty3").toString().equals("Some String I expect to be Set"));
      assertTrue("newProperty4 was not set to expected value",outMessage.getProperty("newProperty4").toString().equals("value123"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.