Examples of XmlVariableInjector


Examples of com.sandwich.koan.path.xmltransformation.XmlVariableInjector

public class XmlVariableInjectorTest {

  @Test
  public void construction_nullMethod() throws Exception {
    try{
      new XmlVariableInjector("", null);
      fail("why construct w/ null method?");
    }catch(IllegalArgumentException t){
      // this is ok - we want this!
    }
  }
View Full Code Here

Examples of com.sandwich.koan.path.xmltransformation.XmlVariableInjector

//  }
 
  @Test
  public void injectInputVariables_filePath() throws Exception {
    String lesson = "meh ${file_path}";
    String result = new XmlVariableInjector(lesson, OneFailingKoan.class.getDeclaredMethod("koanMethod"))
      .injectLessonVariables();
    String firstPkgName = "com";
    // just inspect anything beyond the root of the project
    result = result.substring(result.indexOf(firstPkgName)+firstPkgName.length(), result.length());
    assertTrue(result.indexOf(firstPkgName) < result.indexOf("sandwich"));
View Full Code Here

Examples of com.sandwich.koan.path.xmltransformation.XmlVariableInjector

  }
 
  @Test
  public void injectInputVariables_fileName() throws Exception {
    String lesson = "meh ${file_name}";
    String result = new XmlVariableInjector(lesson, OneFailingKoan.class.getDeclaredMethod("koanMethod"))
      .injectLessonVariables();
    assertEquals("meh OneFailingKoan", result);
  }
View Full Code Here

Examples of com.sandwich.koan.path.xmltransformation.XmlVariableInjector

  }
 
  @Test
  public void injectInputVariables_methodName() throws Exception {
    String lesson = "meh ${method_name}";
    String result = new XmlVariableInjector(lesson, OneFailingKoan.class.getDeclaredMethod("koanMethod"))
      .injectLessonVariables();
    assertEquals("meh koanMethod", result);
  }
View Full Code Here

Examples of com.sandwich.koan.path.xmltransformation.XmlVariableInjector

  }
 
  @Test
  public void nothingToInject() throws Exception {
    String lesson = " meh ea asdwdw s ";
    assertSame(lesson, new XmlVariableInjector(lesson,
      OneFailingKoan.class.getDeclaredMethod("koanMethod")).injectLessonVariables());
  }
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.