CollectionTestEnvironment env = new CollectionTestEnvironment(); env.setAsContext(); this.latestExecutionResult = env.getLastJobExecutionResult();
@Override public JobExecutionResult execute() throws Exception { return execute("test job"); }
protected void setAsContext() { ExecutionEnvironmentFactory factory = new ExecutionEnvironmentFactory() { @Override public ExecutionEnvironment createExecutionEnvironment() { lastEnv = new CollectionTestEnvironment(); return lastEnv; } }; initializeContextEnvironment(factory); }
CollectionTestEnvironment env = new CollectionTestEnvironment(); env.setAsContext(); this.latestExecutionResult = env.getLastJobExecutionResult(); Assert.fail("Error while calling the test program: " + e.getMessage()); } finally { CollectionTestEnvironment.unsetAsContext();
@Before public void setupEnvironment() { TestEnvironment testEnvironment; switch(mode){ case CLUSTER: // This only works because of the quirks we built in the TestEnvironment. // We should refactor this in the future!!! testEnvironment = miniClusterResource.getTestEnvironment(); testEnvironment.getConfig().disableObjectReuse(); testEnvironment.setAsContext(); break; case CLUSTER_OBJECT_REUSE: // This only works because of the quirks we built in the TestEnvironment. // We should refactor this in the future!!! testEnvironment = miniClusterResource.getTestEnvironment(); testEnvironment.getConfig().enableObjectReuse(); testEnvironment.setAsContext(); break; case COLLECTION: new CollectionTestEnvironment().setAsContext(); break; } }
@Override public ExecutionEnvironment createExecutionEnvironment() { lastEnv = new CollectionTestEnvironment(); return lastEnv; } };
protected static void unsetAsContext() { resetContextEnvironment(); } }
@After public void teardownEnvironment() { switch(mode) { case CLUSTER: case CLUSTER_OBJECT_REUSE: TestEnvironment.unsetAsContext(); break; case COLLECTION: CollectionTestEnvironment.unsetAsContext(); break; } }
@Override public JobExecutionResult getLastJobExecutionResult() { if (lastEnv == null) { return this.lastJobExecutionResult; } else { return lastEnv.getLastJobExecutionResult(); } }
@Before public void setupEnvironment() { switch(mode){ case CLUSTER: new TestEnvironment(cluster, 4, false).setAsContext(); break; case CLUSTER_OBJECT_REUSE: new TestEnvironment(cluster, 4, true).setAsContext(); break; case COLLECTION: new CollectionTestEnvironment().setAsContext(); break; } }
@Override public ExecutionEnvironment createExecutionEnvironment() { lastEnv = new CollectionTestEnvironment(); return lastEnv; } };
protected static void unsetAsContext() { resetContextEnvironment(); } }
@After public void teardownEnvironment() { switch(mode) { case CLUSTER: case CLUSTER_OBJECT_REUSE: TestEnvironment.unsetAsContext(); break; case COLLECTION: CollectionTestEnvironment.unsetAsContext(); break; } }
@Override public JobExecutionResult getLastJobExecutionResult() { if (lastEnv == null) { return this.lastJobExecutionResult; } else { return lastEnv.getLastJobExecutionResult(); } }
CollectionTestEnvironment env = new CollectionTestEnvironment(); env.setAsContext(); this.latestExecutionResult = env.getLastJobExecutionResult();
@Before public void setupEnvironment() { TestEnvironment testEnvironment; switch(mode){ case CLUSTER: // This only works because of the quirks we built in the TestEnvironment. // We should refactor this in the future!!! testEnvironment = miniClusterResource.getTestEnvironment(); testEnvironment.getConfig().disableObjectReuse(); testEnvironment.setAsContext(); break; case CLUSTER_OBJECT_REUSE: // This only works because of the quirks we built in the TestEnvironment. // We should refactor this in the future!!! testEnvironment = miniClusterResource.getTestEnvironment(); testEnvironment.getConfig().enableObjectReuse(); testEnvironment.setAsContext(); break; case COLLECTION: new CollectionTestEnvironment().setAsContext(); break; } }
@Override public ExecutionEnvironment createExecutionEnvironment() { lastEnv = new CollectionTestEnvironment(); return lastEnv; } };
@Override public JobExecutionResult execute() throws Exception { return execute("test job"); }
protected void setAsContext() { ExecutionEnvironmentFactory factory = new ExecutionEnvironmentFactory() { @Override public ExecutionEnvironment createExecutionEnvironment() { lastEnv = new CollectionTestEnvironment(); return lastEnv; } }; initializeContextEnvironment(factory); }
protected static void unsetAsContext() { resetContextEnvironment(); } }