@Override public Statement apply(Statement base, Description description) { return junit.apply(base, description); }
@Override public Statement apply(Statement base, Description description) { URL scriptUrl = findDefaultScript(description); if (scriptUrl != null) { script(scriptUrl.getFile()); } return this.temp.apply(new Statement() { @Override public void evaluate() throws Throwable { before(); try { base.evaluate(); } finally { after(); } } }, description); }
@Override public Statement apply(Statement base, Description description) { return junit.apply(base, description); }
@Override public Statement apply(Statement base, Description description) { return junit.apply(base, description); }
/** * Used by JUnit internally. */ @Override public Statement apply(Statement base, Description description) { return tmp.apply(base, description); }
/** * Uses a TemporaryFolder rule to process a given statement. The TemporaryFolder will be * used to construct staging files for loading data into Hive. * * @param base the statement to apply a TemporaryFolder to * @param description the description to apply a TemporaryFolder to * @return the output of the TemporaryFolder rule */ @Override public Statement apply(Statement base, Description description) { return stagingLocation.apply(base, description); }
@Override public Statement apply(Statement base, Description description) { return tmp.apply(base, description); }
@Override public Statement apply(final Statement base, final Description description) { return temporaryFolder.apply(new Statement() { @Override public void evaluate() throws Throwable { try (final Instances closeable = start()) { if (closeable.getException() != null) { closeable.close(); throw closeable.getException(); } base.evaluate(); } } }, description); }
@Override public Statement apply(Statement base, Description description) { return scratchDirRule.apply(super.apply(base, description), description); }
@Override public Statement apply(Statement base, Description description) { return temporaryFolder.apply(base, description); }
@Override public Statement apply(Statement base, Description description) { return temporaryFolder.apply(base, description); }
@Override public Statement apply(final Statement base, final Description description) { // Apply the TemporaryFolder on a Statement that creates a TestConfiguration and applies on base return tmpFolder.apply(new Statement() { @Override public void evaluate() throws Throwable { testConf = new TestConfiguration(getAuthConfigs(tmpFolder.newFolder())); testConf.apply(base, description).evaluate(); } }, description); }
@Override public Statement apply(final Statement base, final Description description) { // We need to set up the temporary folder, and then set up the TestPipeline based on the // chosen folder. Unfortunately, since rule evaluation order is unspecified and unrelated // to field order, and is separate from construction, that requires manually creating this // TestRule. Statement withPipeline = new Statement() { @Override public void evaluate() throws Throwable { options = TestPipeline.testingPipelineOptions(); options.as(BigQueryOptions.class).setProject("project-id"); options .as(BigQueryOptions.class) .setTempLocation(testFolder.getRoot().getAbsolutePath()); p = TestPipeline.fromOptions(options); p.apply(base, description).evaluate(); } }; return testFolder.apply(withPipeline, description); } };
@Override public Statement apply(final Statement base, final Description description) { // We need to set up the temporary folder, and then set up the TestPipeline based on the // chosen folder. Unfortunately, since rule evaluation order is unspecified and unrelated // to field order, and is separate from construction, that requires manually creating this // TestRule. Statement withPipeline = new Statement() { @Override public void evaluate() throws Throwable { options = TestPipeline.testingPipelineOptions(); options.as(BigQueryOptions.class).setProject("project-id"); options .as(BigQueryOptions.class) .setTempLocation(testFolder.getRoot().getAbsolutePath()); p = TestPipeline.fromOptions(options); p.apply(base, description).evaluate(); } }; return testFolder.apply(withPipeline, description); } };
@Override public Statement apply(Statement base, Description description) { // Wrap statement with temporary folder one // temporary folder will be executed first later, and then this class, and then base return temporaryFolder.apply(super.apply(base, description), description); }
@Override public Statement apply(Statement base, Description description) { return temporaryFolder.apply(super.apply(base, description), description); }
@Override public Statement apply(Statement base, Description description) { // This rule goes inside the TemporaryFolder rule. return temp.apply(super.apply(base, description), description); }
return temporaryFolder.apply(testWrappedWithYourCode, description);