Package org.jnetpcap.util.config

Examples of org.jnetpcap.util.config.ConfigString


  /**
   * Test two names and two variables.
   */
  public void testTwoNamesAndTwoVariables() {
    ConfigString string =
        new ConfigString("${jnp}.${name}_${company} ${name}", variables, properties);
    assertTrue("sub failed in expand", string.expand("mark", variables));
    assertEquals(JNP + ".mark_" + COMPANY + " mark", string.toString());

    string.reset(); // Reintialize
  }
View Full Code Here


  /**
   * Test one property.
   */
  public void testOneProperty() {
    ConfigString string = new ConfigString("before @{a.b} after", variables, properties);
    assertTrue("sub failed in expand", string
        .expand("mark", properties));
    assertEquals("before A.B after", string.toString());

    string.reset(); // Reintialize
  }
View Full Code Here

  /**
   * Test two properties.
   */
  public void testTwoProperties() {
    ConfigString string =
        new ConfigString("before @{a.b} after @{a.b.c}", variables, properties);
    assertTrue("sub failed in expand", string
        .expand("mark", properties));
    assertEquals("before A.B after A.B.C", string.toString());

    string.reset(); // Reintialize
  }
View Full Code Here

  /**
   * Test two same properties.
   */
  public void testTwoSameProperties() {
    ConfigString string = new ConfigString("before @{a.b} after @{a.b}", variables, properties);
    assertTrue("sub failed in expand", string
        .expand("mark", properties));
    assertEquals("before A.B after A.B", string.toString());

    string.reset(); // Reintialize
  }
View Full Code Here

  /**
   * Test one name and two properties.
   */
  public void testOneNameAndTwoProperties() {
    ConfigString string =
        new ConfigString("before @{a.b} ${name} @{a.b.c}", variables, properties);
    assertTrue("sub failed in expand", string
        .expand("mark", properties));
    assertEquals("before A.B mark A.B.C", string.toString());

    string.reset(); // Reintialize
  }
View Full Code Here

  /**
   * Test name within a property.
   */
  public void testNameWithinAProperty() {
    ConfigString string = new ConfigString("@{a.${name}.c}", variables, properties);
    assertTrue("sub failed in expand", string.expand("b", properties));
    assertEquals("A.B.C", string.toString());

    string.reset(); // Reintialize
  }
View Full Code Here

  /**
   * Test suffix variable within a property.
   */
  public void testSUFFIXVariableWithinAProperty() {
    ConfigString string = new ConfigString("@{a.${name}${suffix}}", variables, properties);
    assertTrue("sub failed in expand", string.expand("b", variables,
        properties));
    assertEquals("A.B.gotcha", string.toString());

    string.reset(); // Reintialize
  }
View Full Code Here

  /**
   * Test recursive properties.
   */
  public void testRecursiveProperties() {
    ConfigString string = new ConfigString("@{a.a}", variables, properties);
    assertTrue("sub failed in expand", string.expand("", variables,
        properties));
    assertEquals("c.c", string.toString());

    string.reset(); // Reintialize
  }
View Full Code Here

 
  /**
   * Test recursive variables.
   */
  public void testRecursiveVariables() {
    ConfigString string = new ConfigString("${A.A}", variables, properties);
    assertTrue("sub failed in expand", string.expand("", variables,
        properties));
    assertEquals("C.C", string.toString());

    string.reset(); // Reintialize
  }
View Full Code Here

TOP

Related Classes of org.jnetpcap.util.config.ConfigString

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.