Package eu.mosaic_cloud.platform.core.configuration

Examples of eu.mosaic_cloud.platform.core.configuration.ConfigurationIdentifier


public class PropertyTypeConfigurationTest
{
  @Test
  public void testConfigurationIdentifierResolve ()
  {
    final ConfigurationIdentifier id0 = ConfigurationIdentifier.resolveAbsolute ("mosaic");
    Assert.assertNotNull (id0);
    Assert.assertEquals ("Absolute for root resolve absolute failed", "/mosaic", id0.getIdentifier ());
    final ConfigurationIdentifier id1 = ConfigurationIdentifier.resolveAbsolute ("mosaic/int");
    Assert.assertNotNull (id1);
    Assert.assertEquals ("Absolute for non-root resolve absolute failed", "/mosaic/int", id1.getIdentifier ());
    final ConfigurationIdentifier id2 = ConfigurationIdentifier.resolveRelative ("boolean");
    Assert.assertNotNull (id2);
    Assert.assertEquals ("Relative for non-root resolve relative failed", "boolean", id2.getIdentifier ());
    final ConfigurationIdentifier id3 = ConfigurationIdentifier.resolveRelative (id0, "boolean");
    Assert.assertNotNull (id3);
    Assert.assertEquals ("Absolute for non-root resolve relative with absolute path failed", "/mosaic/boolean", id3.getIdentifier ());
    final ConfigurationIdentifier id4 = id0.resolve (id2);
    Assert.assertNotNull (id4);
    Assert.assertEquals ("Absolute for instance resolve failed", "/mosaic/boolean", id4.getIdentifier ());
    final ConfigurationIdentifier id5 = id0.resolve ("real");
    Assert.assertNotNull (id5);
    Assert.assertEquals ("Absolute for instance resolve failed", "/mosaic/real", id5.getIdentifier ());
  }
View Full Code Here


  }
 
  @Test
  public void testGetParameter ()
  {
    ConfigurationIdentifier id;
    id = ConfigurationIdentifier.resolveAbsolute ("mosaic/int");
    final Integer value = PropertyTypeConfigurationTest.configuration.getParameter (id, Integer.class).getValue (0);
    Assert.assertEquals (1, value.intValue ());
    id = ConfigurationIdentifier.resolveAbsolute ("mosaic/real");
    final Double dvalue = PropertyTypeConfigurationTest.configuration.getParameter (id, Double.class).getValue (0.0);
View Full Code Here

TOP

Related Classes of eu.mosaic_cloud.platform.core.configuration.ConfigurationIdentifier

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.