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


Java Resource類代碼示例

本文整理匯總了Java中org.crsh.vfs.Resource的典型用法代碼示例。如果您正苦於以下問題:Java Resource類的具體用法?Java Resource怎麽用?Java Resource使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Resource類屬於org.crsh.vfs包,在下文中一共展示了Resource類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testCommandResolution

import org.crsh.vfs.Resource; //導入依賴的package包/類
@Test
public void testCommandResolution() {
	load();
	PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);
	int count = 0;
	Iterator<Resource> resources = lifeCycle.getContext()
			.loadResources("login", ResourceKind.LIFECYCLE).iterator();
	while (resources.hasNext()) {
		count++;
		resources.next();
	}
	assertThat(count).isEqualTo(1);
	count = 0;
	resources = lifeCycle.getContext()
			.loadResources("sleep.groovy", ResourceKind.COMMAND).iterator();
	while (resources.hasNext()) {
		count++;
		resources.next();
	}
	assertThat(count).isEqualTo(1);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:22,代碼來源:CrshAutoConfigurationTests.java

示例2: testCommandResolution

import org.crsh.vfs.Resource; //導入依賴的package包/類
@Test
public void testCommandResolution() {
	this.context = new AnnotationConfigWebApplicationContext();
	this.context.register(CrshAutoConfiguration.class);
	this.context.refresh();

	PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);

	int count = 0;
	Iterator<Resource> resources = lifeCycle.getContext()
			.loadResources("login", ResourceKind.LIFECYCLE).iterator();
	while (resources.hasNext()) {
		count++;
		resources.next();
	}
	assertEquals(1, count);

	count = 0;
	resources = lifeCycle.getContext()
			.loadResources("sleep.groovy", ResourceKind.COMMAND).iterator();
	while (resources.hasNext()) {
		count++;
		resources.next();
	}
	assertEquals(1, count);
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:27,代碼來源:CrshAutoConfigurationTests.java

示例3: testDisabledCommandResolution

import org.crsh.vfs.Resource; //導入依賴的package包/類
@Test
public void testDisabledCommandResolution() {
	this.context = new AnnotationConfigWebApplicationContext();
	this.context.register(CrshAutoConfiguration.class);
	this.context.refresh();

	PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);

	int count = 0;
	Iterator<Resource> resources = lifeCycle.getContext()
			.loadResources("jdbc.groovy", ResourceKind.COMMAND).iterator();
	while (resources.hasNext()) {
		count++;
		resources.next();
	}
	assertEquals(0, count);
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:18,代碼來源:CrshAutoConfigurationTests.java

示例4: testDisabledCommandResolution

import org.crsh.vfs.Resource; //導入依賴的package包/類
@Test
public void testDisabledCommandResolution() {
	load();
	PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);
	int count = 0;
	Iterator<Resource> resources = lifeCycle.getContext()
			.loadResources("jdbc.groovy", ResourceKind.COMMAND).iterator();
	while (resources.hasNext()) {
		count++;
		resources.next();
	}
	assertThat(count).isEqualTo(0);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:14,代碼來源:CrshAutoConfigurationTests.java


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