本文整理匯總了Java中com.sandwich.koan.path.xmltransformation.XmlVariableInjector類的典型用法代碼示例。如果您正苦於以下問題:Java XmlVariableInjector類的具體用法?Java XmlVariableInjector怎麽用?Java XmlVariableInjector使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
XmlVariableInjector類屬於com.sandwich.koan.path.xmltransformation包,在下文中一共展示了XmlVariableInjector類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: construction_nullMethod
import com.sandwich.koan.path.xmltransformation.XmlVariableInjector; //導入依賴的package包/類
@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!
}
}
示例2: injectInputVariables_filePath
import com.sandwich.koan.path.xmltransformation.XmlVariableInjector; //導入依賴的package包/類
@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"));
assertTrue(result.indexOf("sandwich") < result.indexOf("koan"));
assertTrue(result.indexOf("koan") < result.indexOf("suite"));
}
示例3: injectInputVariables_fileName
import com.sandwich.koan.path.xmltransformation.XmlVariableInjector; //導入依賴的package包/類
@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);
}
示例4: injectInputVariables_methodName
import com.sandwich.koan.path.xmltransformation.XmlVariableInjector; //導入依賴的package包/類
@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);
}
示例5: nothingToInject
import com.sandwich.koan.path.xmltransformation.XmlVariableInjector; //導入依賴的package包/類
@Test
public void nothingToInject() throws Exception {
String lesson = " meh ea asdwdw s ";
assertSame(lesson, new XmlVariableInjector(lesson,
OneFailingKoan.class.getDeclaredMethod("koanMethod")).injectLessonVariables());
}