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


Java Profile.setParent方法代码示例

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


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

示例1: createBundle

import org.apache.taverna.scufl2.api.profiles.Profile; //导入方法依赖的package包/类
/**
 * Create a new WorkflowBundle with a default workflow and profile.
 * <p>
 * Unlike the {@link WorkflowBundle} constructor, this method will also make
 * a {@link WorkflowBundle#getMainWorkflow()} and
 * {@link WorkflowBundle#getMainProfile()}, simplifying construction of
 * workflow bundles from scratch.
 * <p>
 * Each of the bundle, workflow and profile will also have a revision set
 * using {@link Revisioned#newRevision()} and their names set to short
 * default values.
 * 
 * @return A template {@link WorkflowBundle} which has a main workflow and
 *         main profile
 */
public WorkflowBundle createBundle() {
	WorkflowBundle wb = new WorkflowBundle();
	wb.setName("bundle1");

	Workflow workflow = new Workflow();
	workflow.setName("workflow1");
	workflow.setParent(wb);
	workflow.newRevision();

	Profile profile = new Profile();
	profile.setName("profile1");
	profile.setParent(wb);
	profile.newRevision();

	wb.setMainWorkflow(workflow);
	wb.setMainProfile(profile);
	wb.newRevision();
	return wb;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:35,代码来源:WorkflowBundleIO.java

示例2: testCorrectnessOfOutOfScopeBoundProcessor1

import org.apache.taverna.scufl2.api.profiles.Profile; //导入方法依赖的package包/类
@Test
public void testCorrectnessOfOutOfScopeBoundProcessor1() {
	WorkflowBundle wb = new WorkflowBundle();
	Profile profile = new Profile();
	profile.setParent(wb);
	ProcessorBinding pb = new ProcessorBinding();
	Processor orphanProcessor = new Processor();
	pb.setBoundProcessor(orphanProcessor);
	pb.setParent(profile);
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(pb, false, rcvl);
	
	Set<OutOfScopeValueProblem> outOfScopeValueProblems = rcvl.getOutOfScopeValueProblems();
	assertFalse(outOfScopeValueProblems.isEmpty());
	boolean problem = false;
	for (OutOfScopeValueProblem nlp : outOfScopeValueProblems) {
		if (nlp.getBean().equals(pb) && nlp.getFieldName().equals("boundProcessor") && nlp.getValue().equals(orphanProcessor)) {
			problem = true;
		}
	}
	assertTrue(problem);	
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:25,代码来源:TestProcessorBinding.java

示例3: testCorrectnessOfOutOfScopeBoundActivity

import org.apache.taverna.scufl2.api.profiles.Profile; //导入方法依赖的package包/类
@Test
public void testCorrectnessOfOutOfScopeBoundActivity() {
	WorkflowBundle wb = new WorkflowBundle();
	Profile profile = new Profile();
	profile.setParent(wb);
	ProcessorBinding pb = new ProcessorBinding();
	Activity orphanActivity = new Activity();
	pb.setBoundActivity(orphanActivity);
	pb.setParent(profile);
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(pb, false, rcvl);
	
	Set<OutOfScopeValueProblem> outOfScopeValueProblems = rcvl.getOutOfScopeValueProblems();
	assertFalse(outOfScopeValueProblems.isEmpty());
	boolean problem = false;
	for (OutOfScopeValueProblem nlp : outOfScopeValueProblems) {
		if (nlp.getBean().equals(pb) && nlp.getFieldName().equals("boundActivity") && nlp.getValue().equals(orphanActivity)) {
			problem = true;
		}
	}
	assertTrue(problem);	
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:25,代码来源:TestProcessorBinding.java

示例4: testCorrectnessOfInScopeBoundActivity1

import org.apache.taverna.scufl2.api.profiles.Profile; //导入方法依赖的package包/类
@Test
public void testCorrectnessOfInScopeBoundActivity1() {
	// Test when in same profile
	WorkflowBundle wb = new WorkflowBundle();
	Profile profile = new Profile();
	profile.setParent(wb);
	ProcessorBinding pb = new ProcessorBinding();
	Activity activity = new Activity();
	activity.setParent(profile); 
	pb.setBoundActivity(activity);
	pb.setParent(profile);
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(pb, false, rcvl);
	
	Set<OutOfScopeValueProblem> outOfScopeValueProblems = rcvl.getOutOfScopeValueProblems();
	boolean problem = false;
	for (OutOfScopeValueProblem nlp : outOfScopeValueProblems) {
		if (nlp.getBean().equals(pb) && nlp.getFieldName().equals("boundActivity") && nlp.getValue().equals(activity)) {
			problem = true;
		}
	}
	assertFalse(problem);	
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:26,代码来源:TestProcessorBinding.java

示例5: makeWorkflowBundle

import org.apache.taverna.scufl2.api.profiles.Profile; //导入方法依赖的package包/类
public WorkflowBundle makeWorkflowBundle() {
	// Based on
	// uk.org.taverna.scufl2.scufl2-usecases/src/main/resources/workflows/example/workflowBundle.rdf

	workflowBundle = new WorkflowBundle();
	workflowBundle.setName("HelloWorld");
	// NOTE: setSameBaseAs should only be called when loading a workflow
	// bundle
	// which already has an ID
	workflowBundle
			.setGlobalBaseURI(URI
					.create("http://ns.taverna.org.uk/2010/workflowBundle/28f7c554-4f35-401f-b34b-516e9a0ef731/"));
	Workflow workflow = makeMainWorkflow();
	workflow.setParent(workflowBundle);
	workflowBundle.setMainWorkflow(workflow);
	Profile profile = makeMainProfile();
	profile.setParent(workflowBundle);
	workflowBundle.setMainProfile(profile);
	Profile secondaryProfile = makeSecondaryProfile();
	secondaryProfile.setParent(workflowBundle);
	
	Scufl2Tools scufl2Tools = new Scufl2Tools();
	scufl2Tools.setParents(workflowBundle);
	
	return workflowBundle;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:27,代码来源:ExampleWorkflow.java

示例6: configurationNotAddedTwice

import org.apache.taverna.scufl2.api.profiles.Profile; //导入方法依赖的package包/类
/**
 * Similar bug to {@link DataLinkCompareTest#dataLinkNotAddedTwice()}
 */
@Test
public void configurationNotAddedTwice() throws Exception {
	Configuration c1a = new Configuration("c1");
	Profile p1 = new Profile("p1");
	p1.getConfigurations().add(c1a);		
	c1a.setParent(p1);
	p1.getConfigurations().add(c1a);
	
	
	Configuration c1b = new Configuration("c1");
	Profile p2 = new Profile("p2");
	p2.getConfigurations().add(c1b);		
	c1b.setParent(p2);
	p2.getConfigurations().add(c1b);
	
	
	WorkflowBundle bundle = new WorkflowBundle();
	p1.setParent(bundle);
	p2.setParent(bundle);
	new Scufl2Tools().setParents(bundle);
	assertEquals(1, p1.getConfigurations().size());
	assertEquals(1, p2.getConfigurations().size());
	
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:28,代码来源:ConfigurationTest.java

示例7: setParents

import org.apache.taverna.scufl2.api.profiles.Profile; //导入方法依赖的package包/类
@Test
public void setParents() throws Exception {
	// Deliberately orphan a profile and a processor
	Profile profile = workflowBundle.getProfiles().getByName("tavernaWorkbench");
	profile.setParent(null);		
	workflowBundle.getProfiles().add(profile);		
	processor.setParent(null);
	workflow.getProcessors().add(processor);
	
	assertNull(processor.getParent());
	assertNull(profile.getParent());		
	scufl2Tools.setParents(workflowBundle);
	assertNotNull(processor.getParent());
	assertNotNull(profile.getParent());				

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

示例8: writeBundleFileSetParents

import org.apache.taverna.scufl2.api.profiles.Profile; //导入方法依赖的package包/类
@Ignore
@Test
public void writeBundleFileSetParents() throws Exception {
	File bundleFile = tempFile();
	// Deliberately orphan a profile and a processor
	Profile profile = wfBundle.getProfiles().getByName("tavernaWorkbench");
	profile.setParent(null);		
	wfBundle.getProfiles().add(profile);		
	processor.setParent(null);
	workflow.getProcessors().add(processor);		
	
	assertNull(processor.getParent());
	assertNull(profile.getParent());		
	bundleIO.writeBundle(wfBundle, bundleFile,
			TEXT_VND_TAVERNA_SCUFL2_STRUCTURE);
	assertNotNull(processor.getParent());
	assertNotNull(profile.getParent());				
	String bundleTxt = FileUtils.readFileToString(bundleFile, UTF_8);
	assertTrue(bundleTxt.contains("Processor 'Hello'"));
	assertTrue(bundleTxt.contains("Profile 'tavernaWorkbench'"));		
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:22,代码来源:TestWorkflowBundleIO.java

示例9: testCorrectnessOfOutOfScopeBoundProcessor2

import org.apache.taverna.scufl2.api.profiles.Profile; //导入方法依赖的package包/类
@Test
public void testCorrectnessOfOutOfScopeBoundProcessor2() {
	WorkflowBundle wb = new WorkflowBundle();
	Profile profile = new Profile();
	profile.setParent(wb);
	ProcessorBinding pb = new ProcessorBinding();
	
	Workflow w = new Workflow();
	Processor processor = new Processor();
	processor.setParent(w);
	
	pb.setBoundProcessor(processor);
	pb.setParent(profile);
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(pb, false, rcvl);
	
	Set<OutOfScopeValueProblem> outOfScopeValueProblems = rcvl.getOutOfScopeValueProblems();
	assertFalse(outOfScopeValueProblems.isEmpty());
	boolean problem = false;
	for (OutOfScopeValueProblem nlp : outOfScopeValueProblems) {
		if (nlp.getBean().equals(pb) && nlp.getFieldName().equals("boundProcessor") && nlp.getValue().equals(processor)) {
			problem = true;
		}
	}
	assertTrue(problem);	
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:29,代码来源:TestProcessorBinding.java

示例10: testCorrectnessOfInScopeBoundProcessor

import org.apache.taverna.scufl2.api.profiles.Profile; //导入方法依赖的package包/类
@Test
	public void testCorrectnessOfInScopeBoundProcessor() {
		WorkflowBundle wb = new WorkflowBundle();
		Profile profile = new Profile();
		profile.setParent(wb);
		ProcessorBinding pb = new ProcessorBinding();
		
		Workflow w = new Workflow();
		Processor processor = new Processor();
		processor.setParent(w);
		w.setParent(wb);
		
		pb.setBoundProcessor(processor);
		pb.setParent(profile);
		CorrectnessValidator cv = new CorrectnessValidator();
		ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
		
		cv.checkCorrectness(pb, false, rcvl);
		
		Set<OutOfScopeValueProblem> outOfScopeValueProblems = rcvl.getOutOfScopeValueProblems();
//		assertFalse(outOfScopeValueProblems.isEmpty());
		boolean problem = false;
		for (OutOfScopeValueProblem nlp : outOfScopeValueProblems) {
			if (nlp.getBean().equals(pb) && nlp.getFieldName().equals("boundProcessor") && nlp.getValue().equals(processor)) {
				problem = true;
			}
		}
		assertFalse(problem);	
	}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:30,代码来源:TestProcessorBinding.java

示例11: testCorrectnessOfInScopeBoundActivity2

import org.apache.taverna.scufl2.api.profiles.Profile; //导入方法依赖的package包/类
@Test
public void testCorrectnessOfInScopeBoundActivity2() {
	// Test when in same profile
	WorkflowBundle wb = new WorkflowBundle();
	Profile profile = new Profile();
	profile.setParent(wb);
	ProcessorBinding pb = new ProcessorBinding();
	
	Profile otherProfile = new Profile();
	otherProfile.setParent(wb);
	Activity activity = new Activity();
	activity.setParent(otherProfile); 
	pb.setBoundActivity(activity);
	pb.setParent(profile);
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(pb, false, rcvl);
	
	Set<OutOfScopeValueProblem> outOfScopeValueProblems = rcvl.getOutOfScopeValueProblems();
	boolean problem = false;
	for (OutOfScopeValueProblem nlp : outOfScopeValueProblems) {
		if (nlp.getBean().equals(pb) && nlp.getFieldName().equals("boundActivity") && nlp.getValue().equals(activity)) {
			problem = true;
		}
	}
	assertFalse(problem);	
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:29,代码来源:TestProcessorBinding.java

示例12: makeProfile

import org.apache.taverna.scufl2.api.profiles.Profile; //导入方法依赖的package包/类
protected void makeProfile(org.apache.taverna.scufl2.xml.t2flow.jaxb.Workflow wf) {
	// TODO: What should the default be? Should there be one? Who knows
	Profile profile = new Profile(
			wf.getProducedBy() == null ? DEFAULT_PRODUCED_BY
					: wf.getProducedBy());
	profile.setParent(parserState.get().getCurrentWorkflowBundle());
	parserState.get().getCurrentWorkflowBundle().setMainProfile(profile);
	parserState.get().setCurrentProfile(profile);
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:10,代码来源:T2FlowParser.java

示例13: makeProfile

import org.apache.taverna.scufl2.api.profiles.Profile; //导入方法依赖的package包/类
private void makeProfile(ScuflType wf) {
	Profile profile = new Profile(SCUFL + "-" + wf.getVersion());
	profile.setParent(parserState.get().getCurrentWorkflowBundle());
	parserState.get().getCurrentWorkflowBundle().setMainProfile(profile);
	parserState.get().setCurrentProfile(profile);
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:7,代码来源:ScuflParser.java


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