Package org.jnetpcap.util.config

Examples of org.jnetpcap.util.config.ConfigString


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

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


  /**
   * Test quotes twice.
   */
  public void testQuotesTwice() {
    ConfigString string = new ConfigString("'${A.A}' and '@{a.${b}}'", variables, properties);
    assertTrue("sub failed in expand", string.expand("", variables,
        properties));
    assertEquals("'${A.A}' and '@{a.${b}}'", string.toString());

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

 
  /**
   * Test quotes with escaped sub quote.
   */
  public void testQuotesWithEscapedSubQuote() {
    ConfigString string = new ConfigString("'${A.\\'A}' and '@{a.${b}}'", variables, properties);
    assertTrue("sub failed in expand", string.expand("", variables,
        properties));
    assertEquals("'${A.\\'A}' and '@{a.${b}}'", string.toString());

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

    "'File(@{user.home}/@{${resolver}.subdir}/${name}@{${resolver}.suffix})' \\\r\n" +
    "'File(@{java.io.tmpdir}/${name}@{${resolver}.suffix})' \\\r\n" +
    "'Classpath(${name}@{${resolver}.suffix})'\r\n" +
    "";
   
    ConfigString string = new ConfigString(s, variables, properties);
    string.expand("mark", variables,
        properties);
   
    string.remove("\r\n"); // won't remove escaped \r\n
    string.remove("\\\r\n");
   
//    System.out.println("\"" + string.toString() + "\"");
  }
View Full Code Here

  /**
   * Test name.
   */
  public void testName() {
    ConfigString string = new ConfigString("${name}", variables, properties);
    assertTrue("sub failed in expand", string.expand("mark"));
    assertEquals("mark", string.toString());

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

  /**
   * Test name twice.
   */
  public void testNameTwice() {
    ConfigString string = new ConfigString("${name}${name}", variables, properties);
    assertTrue("sub failed in expand", string.expand("mark"));
    assertEquals("markmark", string.toString());

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

  /**
   * Test name trice.
   */
  public void testNameTrice() {
    ConfigString string = new ConfigString("${name}${name}-.sdfo.${name}", variables, properties);
    assertTrue("sub failed in expand", string.expand("mark"));
    assertEquals("markmark-.sdfo.mark", string.toString());

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

  /**
   * Test one variable.
   */
  public void testOneVariable() {
    ConfigString string = new ConfigString("${jnp}", variables, properties);
    assertTrue("sub failed in expand", string.expand("mark", variables));
    assertEquals(JNP, string.toString());

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

  /**
   * Test name and one variable.
   */
  public void testNameAndOneVariable() {
    ConfigString string = new ConfigString("${jnp}.${name}", variables, properties);
    assertTrue("sub failed in expand", string.expand("mark", variables));
    assertEquals(JNP + ".mark", string.toString());

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

  /**
   * Test name and two variables.
   */
  public void testNameAndTwoVariables() {
    ConfigString string = new ConfigString("${jnp}.${name}_${company}", variables, properties);
    assertTrue("sub failed in expand", string.expand("mark", variables));
    assertEquals(JNP + ".mark_" + COMPANY, 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.