当前位置: 首页>>代码示例>>Java>>正文


Java Activity.setType方法代码示例

本文整理汇总了Java中org.apache.taverna.scufl2.api.activity.Activity.setType方法的典型用法代码示例。如果您正苦于以下问题:Java Activity.setType方法的具体用法?Java Activity.setType怎么用?Java Activity.setType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.taverna.scufl2.api.activity.Activity的用法示例。


在下文中一共展示了Activity.setType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testIdenticalConfigurableTypes

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Test
public void testIdenticalConfigurableTypes() {
	Configuration configuration = new Configuration();
	Activity a = new Activity();
	URI tavernaUri = null;
	try {
		tavernaUri = new URI("http://www.taverna.org.uk");
	} catch (URISyntaxException e) {
		return;
	}
	configuration.setConfigures(a);
	configuration.setType(tavernaUri);
	a.setType(tavernaUri);
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(configuration, false, rcvl);
	
	Set<MismatchConfigurableTypeProblem> mismatchConfigurableTypeProblems = rcvl.getMismatchConfigurableTypeProblems();
	assertEquals(0, mismatchConfigurableTypeProblems.size());
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:23,代码来源:TestConfiguration.java

示例2: testEqualConfigurableTypes

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Ignore
public void testEqualConfigurableTypes() {
	Configuration configuration = new Configuration();
	Activity a = new Activity();
	URI tavernaUri = null;
	URI tavernaUri2 = null;
	try {
		tavernaUri = new URI("http://www.taverna.org.uk");
		tavernaUri2 = new URI("http://www.taverna.org.uk");
	} catch (URISyntaxException e) {
		return;
	}
	configuration.setConfigures(a);
	configuration.setType(tavernaUri);
	a.setType(tavernaUri2);
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(configuration, false, rcvl);
	
	Set<MismatchConfigurableTypeProblem> mismatchConfigurableTypeProblems = rcvl.getMismatchConfigurableTypeProblems();
	assertEquals(0, mismatchConfigurableTypeProblems.size());
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:25,代码来源:TestConfiguration.java

示例3: testCompletenessOfMissingConfigurableType

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Test
public void testCompletenessOfMissingConfigurableType() {
	Activity a = new Activity();
	a.setType(null);
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(a, true, rcvl);
	
	Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
	assertFalse(nullFieldProblems.isEmpty());
	boolean problem = false;
	for (NullFieldProblem nlp : nullFieldProblems) {
		if (nlp.getBean().equals(a) && nlp.getFieldName().equals("configurableType")) {
			problem = true;
		}
	}
	assertTrue(problem);
	
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:22,代码来源:TestTyped.java

示例4: testCompletenessOfConfigurableType

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Test
public void testCompletenessOfConfigurableType() throws URISyntaxException {
	Activity a = new Activity();
	a.setType(new URI("http://www.taverna.org.uk"));
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(a, true, rcvl);
	
	Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
	boolean problem = false;
	for (NullFieldProblem nlp : nullFieldProblems) {
		if (nlp.getBean().equals(a) && nlp.getFieldName().equals("configurableType")) {
			problem = true;
		}
	}
	assertFalse(problem);
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:20,代码来源:TestTyped.java

示例5: testNonAbsoluteURI

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Test
public void testNonAbsoluteURI() throws URISyntaxException {
	Activity a = new Activity();
	URI type = new URI("fred/soup");
	a.setType(type);
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(a, false, rcvl);
	
	Set<NonAbsoluteURIProblem> problems = rcvl.getNonAbsoluteURIProblems();
	boolean problem = false;
	for (NonAbsoluteURIProblem p : problems) {
		if (p.getBean().equals(a) && p.getFieldName().equals("configurableType") && p.getFieldValue().equals(type)) {
			problem = true;
		}
	}
	assertTrue(problem);
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:21,代码来源:TestTyped.java

示例6: testFileURI

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Test
public void testFileURI() throws URISyntaxException {
	Activity a = new Activity();
	URI type = new URI("file:///fred/soup");
	a.setType(type);
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(a, false, rcvl);
	
	Set<NonAbsoluteURIProblem> problems = rcvl.getNonAbsoluteURIProblems();
	boolean problem = false;
	for (NonAbsoluteURIProblem p : problems) {
		if (p.getBean().equals(a) && p.getFieldName().equals("configurableType") && p.getFieldValue().equals(type)) {
			problem = true;
		}
	}
	assertTrue(problem);
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:21,代码来源:TestTyped.java

示例7: parseScuflObject

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Override
public void parseScuflObject(Object o) {
	StringconstantType sc = (StringconstantType) o;
	Configuration configuration = new Configuration();
	configuration.setParent(getParserState().getCurrentProfile());
	configuration.setType(CONSTANT.resolve("#Config"));
	((ObjectNode) configuration.getJson()).put("string", sc.getValue());

	Activity activity = new Activity();
	getParserState().setCurrentActivity(activity);
	activity.setParent(getParserState().getCurrentProfile());
	activity.setType(CONSTANT);
	OutputActivityPort valuePort = new OutputActivityPort(activity, VALUE);
	valuePort.setDepth(0);
	valuePort.setGranularDepth(0);
	configuration.setConfigures(activity);

	ProcessorBinding pb = new ProcessorBinding();
	pb.setParent(getParserState().getCurrentProfile());
	pb.setBoundProcessor(getParserState().getCurrentProcessor());
	pb.setBoundActivity(activity);
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:23,代码来源:StringConstantExtensionParser.java

示例8: parseActivity

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
protected void parseActivity(
		org.apache.taverna.scufl2.xml.Activity original) {
	Activity activity = new Activity();

	getParserState().push(activity);
	try {
		mapBean(original.getAbout(), activity);
		if (original.getName() != null)
			activity.setName(original.getName());
		activity.setParent(getParserState().getCurrent(
				org.apache.taverna.scufl2.api.profiles.Profile.class));
		if (original.getType() != null)
			activity.setType(resolve(original.getType().getResource()));
		for (org.apache.taverna.scufl2.xml.Activity.InputActivityPort inputActivityPort : original
				.getInputActivityPort())
			parseInputActivityPort(inputActivityPort.getInputActivityPort());
		for (org.apache.taverna.scufl2.xml.Activity.OutputActivityPort outputActivityPort : original
				.getOutputActivityPort())
			parseOutputActivityPort(outputActivityPort
					.getOutputActivityPort());
	} finally {
		getParserState().pop();
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:25,代码来源:ProfileParser.java

示例9: createConstant

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
public Processor createConstant(Workflow workflow, Profile profile,
		String name) {
	Processor processor = new Processor(null, name);
	workflow.getProcessors().addWithUniqueName(processor);
	processor.setParent(workflow);
	OutputProcessorPort valuePort = new OutputProcessorPort(processor,
			CONSTANT_VALUE_PORT);
	valuePort.setDepth(0);
	valuePort.setGranularDepth(0);

	Activity activity = createActivityFromProcessor(processor, profile);
	activity.setType(CONSTANT);
	createConfigurationFor(activity, CONSTANT_CONFIG);
	return processor;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:16,代码来源:Scufl2Tools.java

示例10: testMismatchingConfigurableTypes

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Ignore
public void testMismatchingConfigurableTypes() {
	Configuration configuration = new Configuration();
	Activity a = new Activity();
	URI tavernaUri = null;
	URI myGridUri = null;
	try {
		tavernaUri = new URI("http://www.taverna.org.uk");
		myGridUri = new URI("http://www.mygrid.org.uk");
	} catch (URISyntaxException e) {
		return;
	}
	configuration.setConfigures(a);
	configuration.setType(tavernaUri);
	a.setType(myGridUri);
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(configuration, false, rcvl);
	
	Set<MismatchConfigurableTypeProblem> mismatchConfigurableTypeProblems = rcvl.getMismatchConfigurableTypeProblems();
	assertEquals(1, mismatchConfigurableTypeProblems.size());
	boolean mismatchProblem = false;
	for (MismatchConfigurableTypeProblem nlp : mismatchConfigurableTypeProblems) {
		if (nlp.getBean().equals(configuration) && nlp.getConfigurable().equals(a)) {
			mismatchProblem = true;
		}
	}
	assertTrue(mismatchProblem);
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:32,代码来源:TestConfiguration.java

示例11: testCorrectnessOfMissingConfigurableType

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Test
public void testCorrectnessOfMissingConfigurableType() {
	Activity a = new Activity();
	a.setType(null);
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(a, false, rcvl);
	
	Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
	assertEquals(Collections.EMPTY_SET, nullFieldProblems);
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:14,代码来源:TestTyped.java

示例12: makeActivity

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
public Activity makeActivity() {
	activity = new Activity();
	activity.setName("HelloScript");
	activity.setType(URI
			.create("http://ns.taverna.org.uk/2010/activity/beanshell"));

	personName = new InputActivityPort(activity, "personName");
	personName.setDepth(0);
	hello = new OutputActivityPort(activity, "hello");
	hello.setDepth(0);
	hello.setGranularDepth(0);
	return activity;

}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:15,代码来源:ExampleWorkflow.java

示例13: generateActivity

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
protected Activity generateActivity() {
	Activity beanshell = new Activity();
	beanshell.setType(BEANSHELL_ACTIVITY);
	Configuration config = generateBeanshellConfig(beanshell);
	// TODO: Where to put the config?
	return beanshell;
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:8,代码来源:ActivityGenerator.java

示例14: makeExampleWorkflow

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Test
public void makeExampleWorkflow() throws Exception {

	ro = new WorkflowBundle();
	Workflow wf1 = new Workflow();
	ro.setWorkflows(Collections.singleton(wf1));
	ro.setMainWorkflow(wf1);

	assertEquals("Non-empty input ports", Collections.EMPTY_SET, wf1.getInputPorts());

	InputWorkflowPort i = new InputWorkflowPort(wf1, "I");
	assertEquals("Did not add input port 'I'", Collections.singleton(i), wf1
			.getInputPorts());

	OutputWorkflowPort wf1_out1 = new OutputWorkflowPort(wf1, "out1");
	assertTrue("Did not add 'out1' to list of output ports", wf1
			.getOutputPorts().contains(wf1_out1));

	new OutputWorkflowPort(wf1, "out1");

	assertTrue("Unexpected processors", wf1.getProcessors().isEmpty());
	Processor p1 = new Processor(wf1, "p1");
	assertTrue("Did not add processor", wf1.getProcessors().contains(p1));

	InputProcessorPort p1_y1 = new InputProcessorPort(p1, "Y1");
	OutputProcessorPort p1_y2 = new OutputProcessorPort(p1, "Y2");
	p1.getOutputPorts().add(p1_y2);

	Processor p4 = new Processor(wf1, "p4");
	wf1.getProcessors().add(p4);
	InputProcessorPort p4_x2 = new InputProcessorPort(p4, "X2");
	p4.getInputPorts().add(p4_x2);
	p4.getInputPorts().add(new InputProcessorPort(p4, "Y1"));
	OutputProcessorPort p4_y = new OutputProcessorPort(p4, "Y");
	p4.getOutputPorts().add(p4_y);

	Processor pNested = new Processor(wf1, "PNested");
	wf1.getProcessors().add(pNested);

	InputProcessorPort pNested_i = new InputProcessorPort(pNested, "I");
	pNested.getInputPorts().add(pNested_i);
	OutputProcessorPort pNested_o = new OutputProcessorPort(pNested, "O");
	pNested.getOutputPorts().add(pNested_o);

	wf1.getDataLinks().add(new DataLink(wf1, p1_y2, pNested_i));

	wf1.getDataLinks().add(new DataLink(wf1, p1_y2, p4_x2));

	wf1.getDataLinks().add(new DataLink(wf1, pNested_o, p1_y1));

	wf1.getDataLinks().add(new DataLink(wf1, p4_y, wf1_out1));

	Activity activity = new Activity("act0");
	Profile p = new Profile();
	ro.getProfiles().add(p);
	p.getActivities().add(activity);

	activity.setType(URI
			.create("http://taverna.sf.net/2009/2.1/activity/beanshell#wrongURI"));
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:61,代码来源:TestAPICreation.java

示例15: testName

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Test
public void testName() throws Exception {
	// Workflow
	WorkflowBundle wb = new WorkflowBundleIO().createBundle();
	
	Workflow wf = wb.getMainWorkflow();
	wf.setName("test_wf");
	InputWorkflowPort raw = new InputWorkflowPort(wf, "RAW");
	OutputWorkflowPort msconvert_log = new OutputWorkflowPort(wf, "MSCONVERT_LOG");
	OutputWorkflowPort cmd = new OutputWorkflowPort(wf, "cmd");
	
	// processor
	Processor msconvert = new Processor(wf, "MSCONVERT");
	InputProcessorPort ms_raw = new InputProcessorPort(msconvert, "raw");
	OutputProcessorPort ms_out = new OutputProcessorPort(msconvert, "out");
	OutputProcessorPort ms_cmd = new OutputProcessorPort(msconvert, "cmd");
	
	// links
	new DataLink(wf, raw, ms_raw);
	new DataLink(wf, ms_out, msconvert_log);
	new DataLink(wf, ms_cmd, cmd);
	
	// Beanshell script
	Activity script = new Activity("msconvert");
	script.setType(BEANSHELL);

	Profile profile = wb.getMainProfile();
	script.setParent(profile);
	profile.getActivities().add(script);
	
	scufl2Tools.createActivityPortsFromProcessor(script, msconvert);
	scufl2Tools.bindActivityToProcessorByMatchingPorts(script, msconvert);
	
	Configuration config = new Configuration();
	config.setConfigures(script);
	config.setType(BEANSHELL.resolve("#Config"));
	((ObjectNode)config.getJson()).put("script", 
			"blablalbal");
	profile.getConfigurations().add(config);
	
	// Save to file (or System.out ? )
	File file = File.createTempFile("test", ".wfbundle");
	bundleIo.writeBundle(wb, file, bundleType);
	System.out.println(file);
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:46,代码来源:TestSimpleWf.java


注:本文中的org.apache.taverna.scufl2.api.activity.Activity.setType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。