Package gov.nasa.arc.mct.services.config.impl.properties

Examples of gov.nasa.arc.mct.services.config.impl.properties.ArrayProperty


    assertTrue(s.contains("<entry value=\"hello\""));
  }
 
  @Test
  public void testArrayMarshalling() throws JAXBException {
    ArrayProperty array = new ArrayProperty("people");
    array.addEntry("john");
    array.addEntry("martha");
   
    String s = marshalObject(array);
    assertTrue(s.contains("<array name=\"people\""));
    assertTrue(s.contains("<entry value=\"john\""));
    assertTrue(s.contains("<entry value=\"martha\""));
View Full Code Here


  @Test
  public void testServiceMarshalling() throws JAXBException {
    Service service = new Service();
    service.setServiceID("myPID");
    service.getSimpleProps().add(new SimpleProperty("x", "y"));
    ArrayProperty array = new ArrayProperty("people");
    array.addEntry("john");
    array.addEntry("martha");
    service.getArrayProps().add(array);
   
    String s = marshalObject(service);
    assertTrue(s.contains("<service pid=\"myPID\""));
    assertTrue(s.contains("<property"));
View Full Code Here

        "    <property name='port' value='7654' type='Integer' />\n" +
        "  </service>\n" +
        "</service-configuration>\n"
    );

    s.getArrayProps().add(new ArrayProperty("angles", "Integer"));
    s.getArrayProps().get(0).addEntry("90");
    s.getArrayProps().get(0).addEntry("45");
    xml = toXML(config);
    assertEqualsXML(
        xml,
        "<service-configuration>\n" +
        "  <service pid='servicePID'>\n" +
        "    <property name='host' value='localhost' />\n" +
        "    <property name='port' value='7654' type='Integer' />\n" +
        "    <array name='angles' type='Integer'>\n" +
        "      <entry value='90' />\n" +
        "      <entry value='45' />\n" +
        "    </array>\n" +
        "  </service>\n" +
        "</service-configuration>\n"
    );

    config.getServices().clear();

    ServiceFactory f = new ServiceFactory();
    config.getFactories().add(f);
    xml = toXML(config);
    assertEqualsXML(xml, "<service-configuration><service-factory/></service-configuration>");

    Service s2 = new Service();
    s2.setServiceID("servicePID");
    s2.getArrayProps().add(new ArrayProperty("colors"));
    s2.getArrayProps().get(0).addEntry("blue");
    config.getServices().add(s2);
   
    f.setFactoryID("factoryPID");
    s.setServiceID(null);
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.services.config.impl.properties.ArrayProperty

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.