當前位置: 首頁>>代碼示例>>Java>>正文


Java XmlVariableInjector類代碼示例

本文整理匯總了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!
	}
}
 
開發者ID:nkalupahana,項目名稱:completed-koans,代碼行數:10,代碼來源:XmlVariableInjectorTest.java

示例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"));
}
 
開發者ID:nkalupahana,項目名稱:completed-koans,代碼行數:13,代碼來源:XmlVariableInjectorTest.java

示例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);
}
 
開發者ID:nkalupahana,項目名稱:completed-koans,代碼行數:8,代碼來源:XmlVariableInjectorTest.java

示例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);
}
 
開發者ID:nkalupahana,項目名稱:completed-koans,代碼行數:8,代碼來源:XmlVariableInjectorTest.java

示例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());
}
 
開發者ID:nkalupahana,項目名稱:completed-koans,代碼行數:7,代碼來源:XmlVariableInjectorTest.java


注:本文中的com.sandwich.koan.path.xmltransformation.XmlVariableInjector類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。