Package org.apache.servicemix.components.mps

Examples of org.apache.servicemix.components.mps.PropertySet


                          .append("<existing-property name='property1'/>")
                          .append("</property>")
                          .append("</property-set>").toString();
    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


                          .append("<existing-property name='property1'/>")
                          .append("</property>")
                          .append("</property-set>").toString();
    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

                          .append("<static-value>myvalue</static-value>")
                          .append("</property>")
                          .append("</property-set>").toString();
    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

                          .append("<existing-property name='property1'/>")
                          .append("</property>")
                          .append("</property-set>").toString();
    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

                          .append("<xpath-expression><![CDATA[/NoNode]]></xpath-expression>")
                          .append("</property>")
                          .append("</property-set>").toString();
    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

                          .append("<existing-property name='property1'/>")
                          .append("</property>")
                          .append("</property-set>").toString();
    Document propertySet = makeDocument(xmlConfig);
    try {
      PropertySet ps = new PropertySet("somename",propertySet.getDocumentElement());
      NormalizedMessage inMessage = makeTestMessage("<this><is><some attr='1234'>xml123</some></is></this>");
      // inMessage will have a property1=TEST_STRING
     
      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));

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

                             .append("<xpath-expression><![CDATA[/this//some/@attrNoExisting]]></xpath-expression>")
                             .append("</property>")                         
                          .append("</property-set>").toString();
    Document propertySet = makeDocument(xmlConfig);
    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

Related Classes of org.apache.servicemix.components.mps.PropertySet

Copyright © 2018 www.massapicom. 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.