本文整理汇总了Java中azkaban.project.Project.setVersion方法的典型用法代码示例。如果您正苦于以下问题:Java Project.setVersion方法的具体用法?Java Project.setVersion怎么用?Java Project.setVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类azkaban.project.Project
的用法示例。
在下文中一共展示了Project.setVersion方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareExecDir
import azkaban.project.Project; //导入方法依赖的package包/类
private ExecutableFlow prepareExecDir(File execDir, String flowName,
int execId) throws IOException {
synchronized (this) {
FileUtils.copyDirectory(execDir, workingDir);
}
File jsonFlowFile = new File(workingDir, flowName + ".flow");
@SuppressWarnings("unchecked")
HashMap<String, Object> flowObj =
(HashMap<String, Object>) JSONUtils.parseJSONFromFile(jsonFlowFile);
Project project = new Project(1, "myproject");
project.setVersion(2);
Flow flow = Flow.flowFromObject(flowObj);
ExecutableFlow execFlow = new ExecutableFlow(project, flow);
execFlow.setExecutionId(execId);
execFlow.setExecutionPath(workingDir.getPath());
return execFlow;
}
示例2: testProjectProperties
import azkaban.project.Project; //导入方法依赖的package包/类
@Test
public void testProjectProperties() throws ProjectManagerException {
ProjectLoader loader = createLoader();
((JdbcProjectLoader)loader).setDefaultEncodingType(JdbcProjectLoader.EncodingType.PLAIN);
String projectName = "testProjectProperties";
String projectDescription = "This is my new project";
User user = new User("testUser");
Project project = loader.createNewProject(projectName, projectDescription, user);
project.setVersion(5);
Props props = new Props();
props.put("a", "abc");
props.put("b", "bcd");
props.put("c", "cde");
props.setSource("mysource");
loader.uploadProjectProperty(project, props);
Props retProps = loader.fetchProjectProperty(project, "mysource");
Assert.assertEquals(retProps.getSource(), props.getSource());
Assert.assertEquals(retProps.getKeySet(), props.getKeySet());
Assert.assertEquals(PropsUtils.toStringMap(retProps, true), PropsUtils.toStringMap(props, true));
}
示例3: prepareExecDir
import azkaban.project.Project; //导入方法依赖的package包/类
private ExecutableFlow prepareExecDir(File execDir, String flowName, int execId) throws IOException {
synchronized ( this) {
FileUtils.copyDirectory(execDir, workingDir);
}
File jsonFlowFile = new File(workingDir, flowName + ".flow");
@SuppressWarnings("unchecked")
HashMap<String, Object> flowObj = (HashMap<String, Object>) JSONUtils.parseJSONFromFile(jsonFlowFile);
Project project = new Project(1, "myproject");
project.setVersion(2);
Flow flow = Flow.flowFromObject(flowObj);
ExecutableFlow execFlow = new ExecutableFlow(project, flow);
execFlow.setExecutionId(execId);
execFlow.setExecutionPath(workingDir.getPath());
return execFlow;
}
示例4: setUp
import azkaban.project.Project; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
project = new Project(11, "myTestProject");
Logger logger = Logger.getLogger(this.getClass());
DirectoryFlowLoader loader = new DirectoryFlowLoader(new Props(), logger);
loader.loadProjectFlow(project, TestExecutions.getFlowDir("embedded"));
Assert.assertEquals(0, loader.getErrors().size());
project.setFlows(loader.getFlowMap());
project.setVersion(123);
}
示例5: testFlowUpload
import azkaban.project.Project; //导入方法依赖的package包/类
@Test
public void testFlowUpload() throws ProjectManagerException {
ProjectLoader loader = createLoader();
((JdbcProjectLoader)loader).setDefaultEncodingType(JdbcProjectLoader.EncodingType.GZIP);
String projectName = "mytestFlowUpload1";
String projectDescription = "This is my new project";
User user = new User("testUser");
Project project = loader.createNewProject(projectName, projectDescription, user);
Flow flow = new Flow("MyNewFlow");
flow.addNode(new Node("A"));
flow.addNode(new Node("B"));
flow.addNode(new Node("C"));
flow.addNode(new Node("D"));
flow.addEdge(new Edge("A", "B"));
flow.addEdge(new Edge("A", "C"));
flow.addEdge(new Edge("B", "D"));
flow.addEdge(new Edge("C", "D"));
flow.initialize();
loader.uploadFlow(project, 4, flow);
project.setVersion(4);
Flow newFlow = loader.fetchFlow(project, flow.getId());
Assert.assertTrue(newFlow != null);
Assert.assertEquals(flow.getId(), newFlow.getId());
Assert.assertEquals(flow.getEdges().size(), newFlow.getEdges().size());
Assert.assertEquals(flow.getNodes().size(), newFlow.getNodes().size());
}
示例6: testFlowUploadPlain
import azkaban.project.Project; //导入方法依赖的package包/类
@Test
public void testFlowUploadPlain() throws ProjectManagerException {
ProjectLoader loader = createLoader();
((JdbcProjectLoader)loader).setDefaultEncodingType(JdbcProjectLoader.EncodingType.PLAIN);
String projectName = "mytestFlowUpload2";
String projectDescription = "This is my new project";
User user = new User("testUser");
Project project = loader.createNewProject(projectName, projectDescription, user);
Flow flow = new Flow("MyNewFlow2");
flow.addNode(new Node("A1"));
flow.addNode(new Node("B1"));
flow.addNode(new Node("C1"));
flow.addNode(new Node("D1"));
flow.addEdge(new Edge("A1", "B1"));
flow.addEdge(new Edge("A1", "C1"));
flow.addEdge(new Edge("B1", "D1"));
flow.addEdge(new Edge("C1", "D1"));
flow.initialize();
loader.uploadFlow(project, 4, flow);
project.setVersion(4);
Flow newFlow = loader.fetchFlow(project, flow.getId());
Assert.assertTrue(newFlow != null);
Assert.assertEquals(flow.getId(), newFlow.getId());
Assert.assertEquals(flow.getEdges().size(), newFlow.getEdges().size());
Assert.assertEquals(flow.getNodes().size(), newFlow.getNodes().size());
List<Flow> flows = loader.fetchAllProjectFlows(project);
Assert.assertTrue(flows.size() == 1);
}
示例7: setUp
import azkaban.project.Project; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
Logger logger = Logger.getLogger(this.getClass());
DirectoryFlowLoader loader = new DirectoryFlowLoader(logger);
loader.loadProjectFlow(new File("unit/executions/embedded"));
Assert.assertEquals(0, loader.getErrors().size());
project = new Project(11, "myTestProject");
project.setFlows(loader.getFlowMap());
project.setVersion(123);
}