Examples of EProperties


Examples of net.jmatrix.eproperties.EProperties

* Tests for DatabasePropertyResourceBundle.
*/
public class DatabasePropertyResourceBundleTest extends TestCase {

  public void testEPropertyConstructor() {
    EProperties props = new EProperties();
    props.setProperty("test.property", "test");

    DatabasePropertyResourceBundle bundle =
        new DatabasePropertyResourceBundle(props);
    assertEquals("test", bundle.getString("test.property"));
  }
View Full Code Here

Examples of net.jmatrix.eproperties.EProperties

        new DatabasePropertyResourceBundle(props);
    assertEquals("test", bundle.getString("test.property"));
  }

  public void testGetString() {
    EProperties props = new EProperties();
    props.setProperty("test.property", "test");

    DatabasePropertyResourceBundle bundle =
        new DatabasePropertyResourceBundle(props);
    assertEquals("test", bundle.getString("test.property"));
View Full Code Here

Examples of net.jmatrix.eproperties.EProperties

    assertNull(bundle.getString("bogus"));
  }

  public void testGetStringAsArray() {
    EProperties props = new EProperties();
    props.setProperty("test.property", "test");

    DatabasePropertyResourceBundle bundle =
        new DatabasePropertyResourceBundle(props);
    String[] values =  bundle.getStringArray("test.property");
    assertEquals(1, values.length);
View Full Code Here

Examples of net.jmatrix.eproperties.EProperties

  public void testGetStringArray() throws Exception {
    String propString = "test.property=( \"Hello\" , \"World\" )\n";
    ByteArrayInputStream bais =
        new ByteArrayInputStream(propString.getBytes("ISO-8859-1"));

    EProperties props = new EProperties();
    props.load(bais);

    DatabasePropertyResourceBundle bundle =
        new DatabasePropertyResourceBundle(props);
    String[] values =  bundle.getStringArray("test.property");
    assertEquals(2, values.length);
View Full Code Here

Examples of net.jmatrix.eproperties.EProperties

    String propString =
        "test.property=( \"Hello, Bonjour, Buenos Dias\" , \"World\" )\n";
    ByteArrayInputStream bais =
        new ByteArrayInputStream(propString.getBytes("ISO-8859-1"));

    EProperties props = new EProperties();
    props.load(bais);

    DatabasePropertyResourceBundle bundle =
        new DatabasePropertyResourceBundle(props);
    String[] values =  bundle.getStringArray("test.property");
    assertEquals(2, values.length);
View Full Code Here

Examples of net.jmatrix.eproperties.EProperties

    String propString = "test.property=( \"Hello (I Love You)\" ,"
      + "\"Won't you tell me your name?\" )\n";
    ByteArrayInputStream bais =
        new ByteArrayInputStream(propString.getBytes("ISO-8859-1"));

    EProperties props = new EProperties();
    props.load(bais);

    DatabasePropertyResourceBundle bundle =
        new DatabasePropertyResourceBundle(props);
    String[] values =  bundle.getStringArray("test.property");
    assertEquals(2, values.length);
View Full Code Here

Examples of net.jmatrix.eproperties.EProperties

    assertEquals("Hello (I Love You)", values[0]);
    assertEquals("Won't you tell me your name?", values[1]);
  }

  public void testSubstitution() {
    EProperties props = new EProperties();
    props.setProperty("substitution.property", "Hello");
    props.setProperty("test.property", "${substitution.property} World");

    DatabasePropertyResourceBundle bundle =
        new DatabasePropertyResourceBundle(props);
    assertEquals("Hello World", bundle.getString("test.property"));
  }
View Full Code Here

Examples of net.jmatrix.eproperties.EProperties

    String propString = "hello=Hello\n" + "world=World\n"
        + "helloworld=( \"${hello}\", \"${world}\" )\n";
    ByteArrayInputStream bais =
        new ByteArrayInputStream(propString.getBytes("ISO-8859-1"));

    EProperties props = new EProperties();
    props.load(bais);

    DatabasePropertyResourceBundle bundle =
        new DatabasePropertyResourceBundle(props);
    String[] values =  bundle.getStringArray("helloworld");
    assertEquals(2, values.length);
View Full Code Here

Examples of net.jmatrix.eproperties.EProperties

    assertEquals("Hello", values[0]);
    assertEquals("World", values[1]);
  }

  public void testSetGetParent() {
    EProperties props = new EProperties();
    props.setProperty("test.property", "test");

    DatabasePropertyResourceBundle bundle =
        new DatabasePropertyResourceBundle(props);
    assertEquals("test", bundle.getString("test.property"));
    assertNull(bundle.getString("parent.property"));

    EProperties parentProps = new EProperties();
    parentProps.setProperty("parent.property", "parent");
    DatabasePropertyResourceBundle parentBundle =
        new DatabasePropertyResourceBundle(parentProps);

    bundle.setParent(parentBundle);
View Full Code Here

Examples of net.jmatrix.eproperties.EProperties

    assertSame(parentBundle, bundle.getParent());
    assertEquals("parent", bundle.getString("parent.property"));
  }

  public void testParentSubstitution() {
    EProperties props = new EProperties();
    props.setProperty("test.property", "${substitution.property} World");
    DatabasePropertyResourceBundle bundle =
        new DatabasePropertyResourceBundle(props);

    EProperties parentProps = new EProperties();
    props.setProperty("substitution.property", "Hello");
    DatabasePropertyResourceBundle parentBundle =
        new DatabasePropertyResourceBundle(parentProps);

    bundle.setParent(parentBundle);
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.