You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2015/01/06 20:59:50 UTC
[1/2] incubator-nifi git commit: NIFI-227: Added a method run(int,
boolean,
boolean) to TestRunner where the second boolean indicates whether or not to
run Processor methods annoated with @OnScheduled
Repository: incubator-nifi
Updated Branches:
refs/heads/develop 33ad7934e -> 4b322b8f5
NIFI-227: Added a method run(int, boolean, boolean) to TestRunner where the second boolean indicates whether or not to run Processor methods annoated with @OnScheduled
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/142d19a5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/142d19a5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/142d19a5
Branch: refs/heads/develop
Commit: 142d19a519357577c5cec1e921707bcff15d8df2
Parents: 2d0b163
Author: Mark Payne <ma...@hotmail.com>
Authored: Tue Jan 6 14:54:23 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Tue Jan 6 14:54:23 2015 -0500
----------------------------------------------------------------------
.../nifi/util/StandardProcessorTestRunner.java | 17 ++++++++++++-----
.../main/java/org/apache/nifi/util/TestRunner.java | 15 +++++++++++++--
2 files changed, 25 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/142d19a5/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java
----------------------------------------------------------------------
diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java b/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java
index 7def3eb..54b611d 100644
--- a/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java
+++ b/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java
@@ -121,6 +121,11 @@ public class StandardProcessorTestRunner implements TestRunner {
@Override
public void run(final int iterations, final boolean stopOnFinish) {
+ run(iterations, stopOnFinish, true);
+ }
+
+ @Override
+ public void run(final int iterations, final boolean stopOnFinish, final boolean initialize) {
if (iterations < 1) {
throw new IllegalArgumentException();
}
@@ -128,11 +133,13 @@ public class StandardProcessorTestRunner implements TestRunner {
context.assertValid();
context.enableExpressionValidation();
try {
- try {
- ReflectionUtils.invokeMethodsWithAnnotation(OnScheduled.class, processor, context);
- } catch (Exception e) {
- e.printStackTrace();
- Assert.fail("Could not invoke methods annotated with @OnScheduled annotation due to: " + e);
+ if ( initialize ) {
+ try {
+ ReflectionUtils.invokeMethodsWithAnnotation(OnScheduled.class, processor, context);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Could not invoke methods annotated with @OnScheduled annotation due to: " + e);
+ }
}
final ExecutorService executorService = Executors.newFixedThreadPool(numThreads);
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/142d19a5/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java
----------------------------------------------------------------------
diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java b/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java
index fcc6234..a539cab 100644
--- a/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java
+++ b/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java
@@ -79,11 +79,20 @@ public interface TestRunner {
void run(int iterations);
/**
+ * performs the same operation as calling {@link #run(int, boolean, int)} with a value
+ * of {@code iterations}, {@code stopOnFinish}, {@code true}
+ *
+ * @param iterations
+ * @param stopOnFinish
+ */
+ void run(int iterations, boolean stopOnFinish);
+
+ /**
* This method runs the {@link Processor} <code>iterations</code> times,
* using the sequence of steps below:
* <ul>
* <li>
- * Run all methods on the Processor that are annotated with the
+ * If {@code initialize} is true, run all methods on the Processor that are annotated with the
* {@link nifi.processor.annotation.OnScheduled @OnScheduled} annotation. If
* any of these methods throws an Exception, the Unit Test will fail.
* </li>
@@ -117,8 +126,10 @@ public interface TestRunner {
* @param stopOnFinish whether or not to run the Processor methods that are
* annotated with {@link nifi.processor.annotation.OnStopped @OnStopped}
*/
- void run(int iterations, boolean stopOnFinish);
+ void run(int iterations, boolean stopOnFinish, final boolean initialize);
+
+
/**
* Invokes all methods on the Processor that are annotated with the
* {@link nifi.processor.annotation.OnShutdown @OnShutdown} annotation. If
[2/2] incubator-nifi git commit: Merge branch 'develop' of
https://git-wip-us.apache.org/repos/asf/incubator-nifi into develop
Posted by ma...@apache.org.
Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/incubator-nifi into develop
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/4b322b8f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/4b322b8f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/4b322b8f
Branch: refs/heads/develop
Commit: 4b322b8f50a59ef098189efc410754cb69237eb2
Parents: 142d19a 33ad793
Author: Mark Payne <ma...@hotmail.com>
Authored: Tue Jan 6 14:59:45 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Tue Jan 6 14:59:45 2015 -0500
----------------------------------------------------------------------
assembly/pom.xml | 114 +-
assembly/src/main/assembly/dependencies.xml | 121 +-
.../src/main/webapp/WEB-INF/pages/canvas.jsp | 1 +
.../src/main/webapp/css/message-pane.css | 2 +-
.../js/jquery/nfeditor/languages/nfel.css | 51 +
.../webapp/js/jquery/nfeditor/languages/nfel.js | 1081 +++++++++++-------
.../canvas/nf-processor-property-nfel-editor.js | 2 +-
.../asciidoc/expression-language-guide.adoc | 1 -
8 files changed, 811 insertions(+), 562 deletions(-)
----------------------------------------------------------------------