You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by ToivoAdams <gi...@git.apache.org> on 2016/04/03 15:54:21 UTC

[GitHub] nifi pull request: Nifi 1214

GitHub user ToivoAdams opened a pull request:

    https://github.com/apache/nifi/pull/321

    Nifi 1214

    NiFi-1214 Mock Framework should allow order-independent assumptions on FlowFiles, First version

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ToivoAdams/nifi nifi-1214

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/321.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #321
    
----
commit 95525e12a6ada4e48f170a30aacf1cc2f3da6bd3
Author: Toivo Adams <to...@gmail.com>
Date:   2016-04-02T17:58:43Z

    nifi-1214 Initial version

commit 5e704af5763685fd5ad7577a6f69650bcf738e9f
Author: Toivo Adams <to...@gmail.com>
Date:   2016-04-03T13:31:02Z

    nifi-1214 Mock Framework should allow order-independent assumptions on FlowFiles, First version

commit f9265071883a03da42541eaae40a0730ec94f492
Author: Toivo Adams <to...@gmail.com>
Date:   2016-04-03T13:44:09Z

    nifi-1214 Mock Framework should allow order-independent assumptions on FlowFiles, First version

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request: Nifi 1214

Posted by olegz <gi...@git.apache.org>.
Github user olegz commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/321#discussion_r59995770
  
    --- Diff: nifi-mock/src/main/java/org/apache/nifi/util/verifier/ConditionsBuilder.java ---
    @@ -0,0 +1,52 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.nifi.util.verifier;
    +
    +import java.util.ArrayList;
    +
    +public class ConditionsBuilder {
    +
    +    protected final ArrayList<Condition> conditions = new ArrayList<>();
    +
    +    public ConditionsBuilder(Condition condition) {
    +        conditions.add(condition);
    +    }
    +
    +    static public ConditionsBuilder attributeEqual(String name, String value) {
    +        return new ConditionsBuilder(new AttributeEqual(name,value));
    +    }
    +
    +    static public ConditionsBuilder contentEqual(String content) {
    +        return new ConditionsBuilder(new ContentEqual(content));
    +    }
    +
    +    public ConditionsBuilder andAttributeEqual(String name, String value) {
    +        conditions.add(new AttributeEqual(name,value));
    +        return this;
    +    }
    +
    +    public ConditionsBuilder andContentEqual(String content) {
    +        conditions.add(new ContentEqual(content));
    +        return this;
    +    }
    +
    +    public ArrayList<Condition> getConditions() {
    +        return conditions;
    +    }
    +
    --- End diff --
    
    Given this is a public class, should there be null checks on operations that take arguments?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request: Nifi 1214

Posted by ToivoAdams <gi...@git.apache.org>.
Github user ToivoAdams commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/321#discussion_r60099883
  
    --- Diff: nifi-mock/src/main/java/org/apache/nifi/util/verifier/ConditionsBuilder.java ---
    @@ -0,0 +1,52 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.nifi.util.verifier;
    +
    +import java.util.ArrayList;
    +
    +public class ConditionsBuilder {
    +
    +    protected final ArrayList<Condition> conditions = new ArrayList<>();
    +
    +    public ConditionsBuilder(Condition condition) {
    +        conditions.add(condition);
    +    }
    +
    +    static public ConditionsBuilder attributeEqual(String name, String value) {
    +        return new ConditionsBuilder(new AttributeEqual(name,value));
    +    }
    +
    +    static public ConditionsBuilder contentEqual(String content) {
    +        return new ConditionsBuilder(new ContentEqual(content));
    +    }
    +
    +    public ConditionsBuilder andAttributeEqual(String name, String value) {
    +        conditions.add(new AttributeEqual(name,value));
    +        return this;
    +    }
    +
    +    public ConditionsBuilder andContentEqual(String content) {
    +        conditions.add(new ContentEqual(content));
    +        return this;
    +    }
    +
    +    public ArrayList<Condition> getConditions() {
    +        return conditions;
    +    }
    +
    --- End diff --
    
    You are right.
    But we are moving to Java 8 and Predicate will be used instead of ConditionsBuilder.
    So this code is not relevant anymore.
    
    Thanks
    toivo


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #321: Nifi 1214

Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on the issue:

    https://github.com/apache/nifi/pull/321
  
    Hey @ToivoAdams,
    
    This is replaced by #388, correct?  If so, could we please close this one out?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #321: Nifi 1214

Posted by ToivoAdams <gi...@git.apache.org>.
Github user ToivoAdams closed the pull request at:

    https://github.com/apache/nifi/pull/321


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #321: Nifi 1214

Posted by ToivoAdams <gi...@git.apache.org>.
Github user ToivoAdams commented on the issue:

    https://github.com/apache/nifi/pull/321
  
    Yes, this replaced by  #388 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Re: [GitHub] nifi pull request: Nifi 1214

Posted by Toivo Adams <to...@gmail.com>.
To move on and clean a mess I created new pull request.

https://github.com/apache/nifi/pull/388

nifi-1214b Mock Framework should allow order-independent assumptions on
FlowFiles. This replaces previous nifi-1214 

thanks
toivo



--
View this message in context: http://apache-nifi-developer-list.39713.n7.nabble.com/GitHub-nifi-pull-request-Nifi-1214-tp8733p9682.html
Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.

Re: [GitHub] nifi pull request: Nifi 1214

Posted by Toivo Adams <to...@gmail.com>.
Apiri,

I am doing something wrong but I am unable to resolve conflicts permanently.

toivo@oPlex:~/git/nifi$ git checkout master
warning: unable to rmdir nifi: Directory not empty
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 84 commits.
toivo@oPlex:~/git/nifi$ git fetch upstream
toivo@oPlex:~/git/nifi$ git merge upstream/master
Already up-to-date.
toivo@oPlex:~/git/nifi$ git checkout nifi-1214
Switched to branch 'nifi-1214'
toivo@oPlex:~/git/nifi$ git rebase master

It seems that there is already a rebase-apply directory, and
I wonder if you are in the middle of another rebase.  If that is the
case, please try
	git rebase (--continue | --abort | --skip)
If that is not the case, please
	rm -fr /home/toivo/git/nifi/.git/rebase-apply
and run me again.  I am stopping in case you still have something
valuable there.
toivo@oPlex:~/git/nifi$ rm -fr /home/toivo/git/nifi/.git/rebase-apply
toivo@oPlex:~/git/nifi$ 
toivo@oPlex:~/git/nifi$ git rebase master
First, rewinding head to replay your work on top of it...
warning: unable to rmdir nifi: Directory not empty
Applying: nifi-1214 Initial version
Applying: nifi-1214 Mock Framework should allow order-independent
assumptions on FlowFiles, First version
Applying: nifi-1214 Mock Framework should allow order-independent
assumptions on FlowFiles, First version
Applying: nifi-1214 Initial version
Using index info to reconstruct a base tree...
<stdin>:42: trailing whitespace.
        
<stdin>:43: trailing whitespace.
        
<stdin>:64: trailing whitespace.
    
<stdin>:81: trailing whitespace.
    
<stdin>:120: trailing whitespace.
    
warning: squelched 7 whitespace errors
warning: 12 lines add whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging
nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java
CONFLICT (content): Merge conflict in
nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java
Auto-merging
nifi-mock/src/main/java/org/apache/nifi/util/verifier/FlowFileVerifierBuilder.java
CONFLICT (add/add): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/verifier/FlowFileVerifierBuilder.java
Auto-merging
nifi-mock/src/main/java/org/apache/nifi/util/verifier/ContentEqual.java
CONFLICT (add/add): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/verifier/ContentEqual.java
Auto-merging
nifi-mock/src/main/java/org/apache/nifi/util/verifier/ConditionsBuilder.java
CONFLICT (add/add): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/verifier/ConditionsBuilder.java
Auto-merging
nifi-mock/src/main/java/org/apache/nifi/util/verifier/Conditions.java
CONFLICT (add/add): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/verifier/Conditions.java
Auto-merging
nifi-mock/src/main/java/org/apache/nifi/util/verifier/Condition.java
CONFLICT (add/add): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/verifier/Condition.java
Auto-merging
nifi-mock/src/main/java/org/apache/nifi/util/verifier/AttributeEqual.java
CONFLICT (add/add): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/verifier/AttributeEqual.java
Auto-merging nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java
CONFLICT (content): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java
Auto-merging
nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java
CONFLICT (content): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java
Failed to merge in the changes.
Patch failed at 0004 nifi-1214 Initial version

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To check out the original branch and stop rebasing run "git rebase –abort".

After editing some files:
--------------------------------

toivo@oPlex:~/git/nifi$ git status
# Not currently on any branch.
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	deleted:   
nifi-mock/src/main/java/org/apache/nifi/util/verifier/AttributeEqual.java
#	deleted:   
nifi-mock/src/main/java/org/apache/nifi/util/verifier/Condition.java
#	deleted:   
nifi-mock/src/main/java/org/apache/nifi/util/verifier/Conditions.java
#	deleted:   
nifi-mock/src/main/java/org/apache/nifi/util/verifier/ConditionsBuilder.java
#	deleted:   
nifi-mock/src/main/java/org/apache/nifi/util/verifier/ContentEqual.java
#	deleted:   
nifi-mock/src/main/java/org/apache/nifi/util/verifier/FlowFileVerifierBuilder.java
#
# Unmerged paths:
#   (use "git reset HEAD <file>..." to unstage)
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#	both modified:     
nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java
#	both modified:     
nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java
#	both modified:     
nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working
directory)
#
#	modified:   nifi-mock/src/main/java/org/apache/nifi/util/MockFlowFile.java
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	nifi/
toivo@oPlex:~/git/nifi$ git rm
nifi-mock/src/main/java/org/apache/nifi/util/verifier/*.java
fatal: pathspec
'nifi-mock/src/main/java/org/apache/nifi/util/verifier/*.java' did not match
any files
toivo@oPlex:~/git/nifi$ git add
nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java
toivo@oPlex:~/git/nifi$ git add
nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java
toivo@oPlex:~/git/nifi$ git add
nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java
toivo@oPlex:~/git/nifi$ git commit -m "resolving conflicts"
[detached HEAD 39c3099] resolving conflicts
 9 files changed, 54 insertions(+), 292 deletions(-)
 delete mode 100644
nifi-mock/src/main/java/org/apache/nifi/util/verifier/AttributeEqual.java
 delete mode 100644
nifi-mock/src/main/java/org/apache/nifi/util/verifier/Condition.java
 delete mode 100644
nifi-mock/src/main/java/org/apache/nifi/util/verifier/Conditions.java
 delete mode 100644
nifi-mock/src/main/java/org/apache/nifi/util/verifier/ConditionsBuilder.java
 delete mode 100644
nifi-mock/src/main/java/org/apache/nifi/util/verifier/ContentEqual.java
 delete mode 100644
nifi-mock/src/main/java/org/apache/nifi/util/verifier/FlowFileVerifierBuilder.java
toivo@oPlex:~/git/nifi$ git rebase --continue
nifi-mock/src/main/java/org/apache/nifi/util/MockFlowFile.java: needs update
You must edit all merge conflicts and then
mark them as resolved using git add
toivo@oPlex:~/git/nifi$ git add
nifi-mock/src/main/java/org/apache/nifi/util/MockFlowFile.java
toivo@oPlex:~/git/nifi$ git commit -m "resolving conflicts"
[detached HEAD 5e5cce3] resolving conflicts
 1 file changed, 15 insertions(+)
toivo@oPlex:~/git/nifi$ git rebase --continue
Applying: nifi-1214 Initial version
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this patch.

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To check out the original branch and stop rebasing run "git rebase --abort".

toivo@oPlex:~/git/nifi$ 

toivo@oPlex:~/git/nifi$ git status
# Not currently on any branch.
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	nifi/
nothing added to commit but untracked files present (use "git add" to track)
toivo@oPlex:~/git/nifi$ git checkout nifi-1214
Warning: you are leaving 5 commits behind, not connected to
any of your branches:

  5e5cce3 resolving conflicts
  39c3099 resolving conflicts
  9002842 nifi-1214 Mock Framework should allow order-independent
assumptions on FlowFiles, First version
  43ccf4b nifi-1214 Mock Framework should allow order-independent
assumptions on FlowFiles, First version
  9e8e110 nifi-1214 Initial version

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch new_branch_name 5e5cce3e4b179366abee91ac83be862ceaf2f837

Switched to branch 'nifi-1214'
toivo@oPlex:~/git/nifi$ 
toivo@oPlex:~/git/nifi$ git push origin nifi-1214 
Username for 'https://github.com': ToivoAdams
Password for 'https://ToivoAdams@github.com': 
fatal: Authentication failed
toivo@oPlex:~/git/nifi$ git push origin nifi-1214 
Username for 'https://github.com': ToivoAdams
Password for 'https://ToivoAdams@github.com': 
Everything up-to-date
toivo@oPlex:~/git/nifi$ 

toivo@oPlex:~/git/nifi$ git checkout nifi-1214
Warning: you are leaving 5 commits behind, not connected to
any of your branches:

  5e5cce3 resolving conflicts
  39c3099 resolving conflicts
  9002842 nifi-1214 Mock Framework should allow order-independent
assumptions on FlowFiles, First version
  43ccf4b nifi-1214 Mock Framework should allow order-independent
assumptions on FlowFiles, First version
  9e8e110 nifi-1214 Initial version

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch new_branch_name 5e5cce3e4b179366abee91ac83be862ceaf2f837

Switched to branch 'nifi-1214'
toivo@oPlex:~/git/nifi$ 
toivo@oPlex:~/git/nifi$ git push origin nifi-1214 
Username for 'https://github.com': ToivoAdams
Password for 'https://ToivoAdams@github.com': 
fatal: Authentication failed
toivo@oPlex:~/git/nifi$ git push origin nifi-1214 
Username for 'https://github.com': ToivoAdams
Password for 'https://ToivoAdams@github.com': 
Everything up-to-date
toivo@oPlex:~/git/nifi$ 
toivo@oPlex:~/git/nifi$ git checkout master
warning: unable to rmdir nifi: Directory not empty
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 84 commits.
toivo@oPlex:~/git/nifi$ git fetch upstream
toivo@oPlex:~/git/nifi$ git merge upstream/master
Already up-to-date.
toivo@oPlex:~/git/nifi$ git checkout nifi-1214
Switched to branch 'nifi-1214'
toivo@oPlex:~/git/nifi$ git rebase master

It seems that there is already a rebase-apply directory, and
I wonder if you are in the middle of another rebase.  If that is the
case, please try
	git rebase (--continue | --abort | --skip)
If that is not the case, please
	rm -fr /home/toivo/git/nifi/.git/rebase-apply
and run me again.  I am stopping in case you still have something
valuable there.
toivo@oPlex:~/git/nifi$ git rebase --continue
Applying: nifi-1214 Initial version
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this patch.

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To check out the original branch and stop rebasing run "git rebase --abort".

toivo@oPlex:~/git/nifi$ 

toivo@oPlex:~/git/nifi$ git rebase master

It seems that there is already a rebase-apply directory, and
I wonder if you are in the middle of another rebase.  If that is the
case, please try
	git rebase (--continue | --abort | --skip)
If that is not the case, please
	rm -fr /home/toivo/git/nifi/.git/rebase-apply
and run me again.  I am stopping in case you still have something
valuable there.
toivo@oPlex:~/git/nifi$ rm -fr /home/toivo/git/nifi/.git/rebase-apply
toivo@oPlex:~/git/nifi$ 
toivo@oPlex:~/git/nifi$ git rebase master
First, rewinding head to replay your work on top of it...
warning: unable to rmdir nifi: Directory not empty
Applying: nifi-1214 Initial version
Applying: nifi-1214 Mock Framework should allow order-independent
assumptions on FlowFiles, First version
Applying: nifi-1214 Mock Framework should allow order-independent
assumptions on FlowFiles, First version
Applying: nifi-1214 Initial version
Using index info to reconstruct a base tree...
<stdin>:42: trailing whitespace.
        
<stdin>:43: trailing whitespace.
        
<stdin>:64: trailing whitespace.
    
<stdin>:81: trailing whitespace.
    
<stdin>:120: trailing whitespace.
    
warning: squelched 7 whitespace errors
warning: 12 lines add whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging
nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java
CONFLICT (content): Merge conflict in
nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java
Auto-merging
nifi-mock/src/main/java/org/apache/nifi/util/verifier/FlowFileVerifierBuilder.java
CONFLICT (add/add): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/verifier/FlowFileVerifierBuilder.java
Auto-merging
nifi-mock/src/main/java/org/apache/nifi/util/verifier/ContentEqual.java
CONFLICT (add/add): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/verifier/ContentEqual.java
Auto-merging
nifi-mock/src/main/java/org/apache/nifi/util/verifier/ConditionsBuilder.java
CONFLICT (add/add): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/verifier/ConditionsBuilder.java
Auto-merging
nifi-mock/src/main/java/org/apache/nifi/util/verifier/Conditions.java
CONFLICT (add/add): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/verifier/Conditions.java
Auto-merging
nifi-mock/src/main/java/org/apache/nifi/util/verifier/Condition.java
CONFLICT (add/add): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/verifier/Condition.java
Auto-merging
nifi-mock/src/main/java/org/apache/nifi/util/verifier/AttributeEqual.java
CONFLICT (add/add): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/verifier/AttributeEqual.java
Auto-merging nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java
CONFLICT (content): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java
Auto-merging
nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java
CONFLICT (content): Merge conflict in
nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java
Failed to merge in the changes.
Patch failed at 0004 nifi-1214 Initial version

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To check out the original branch and stop rebasing run "git rebase --abort".

Thanks
Toivo



--
View this message in context: http://apache-nifi-developer-list.39713.n7.nabble.com/GitHub-nifi-pull-request-Nifi-1214-tp8733p9579.html
Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.

[GitHub] nifi pull request: Nifi 1214

Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on the pull request:

    https://github.com/apache/nifi/pull/321#issuecomment-213663078
  
    Hey @ToivoAdams!  Sorry for the delays on reviewing.  It looks like this was originally done on what is now 0.x and has many of the commits from what is now master incorporated.  Would it be possible to please get your commits/branch rebased against master?  Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request: Nifi 1214

Posted by ToivoAdams <gi...@git.apache.org>.
Github user ToivoAdams commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/321#discussion_r60382818
  
    --- Diff: nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java ---
    @@ -865,4 +866,21 @@
          * @return the State Manager that is used to store and retrieve state for the given controller service
          */
         MockStateManager getStateManager(ControllerService service);
    +
    +    /**
    +     *  Maybe we should add possibility to be more precise:
    +     *      "All FlowFiles must meet all conditions"
    +     *  or
    +     *      "At least one FlowFile must meet all conditions"
    +     *  or
    +     *      "Each FlowFile should meet at least one condition"
    +     *
    +     *  Current functionality is: "Each FlowFile should meet at least one condition"
    +     *  So instead of assertAllConditionsMet we should use something like assertFlowFileMeetAnyCondition
    +     *  Or add extra parameter which specifies how FlowFile must meet conditions.
    +     *
    +     */
    +    void assertAllConditionsMet(final String relationshipName, ConditionsBuilder... andContentEqual);
    --- End diff --
    
    Predicates is a good idea.
    
    “a very valuable method/test would be to indicate that all conditions are met exactly once.”
    You mean exactly one (only one) FlowFile meets all conditions.
    runner.assertExactlyOnceAllConditionsMet(MY_RELATIONSHIP, ...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request: Nifi 1214

Posted by markap14 <gi...@git.apache.org>.
Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/321#discussion_r59908921
  
    --- Diff: nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java ---
    @@ -865,4 +866,21 @@
          * @return the State Manager that is used to store and retrieve state for the given controller service
          */
         MockStateManager getStateManager(ControllerService service);
    +
    +    /**
    +     *  Maybe we should add possibility to be more precise:
    +     *      "All FlowFiles must meet all conditions"
    +     *  or
    +     *      "At least one FlowFile must meet all conditions"
    +     *  or
    +     *      "Each FlowFile should meet at least one condition"
    +     *
    +     *  Current functionality is: "Each FlowFile should meet at least one condition"
    +     *  So instead of assertAllConditionsMet we should use something like assertFlowFileMeetAnyCondition
    +     *  Or add extra parameter which specifies how FlowFile must meet conditions.
    +     *
    +     */
    +    void assertAllConditionsMet(final String relationshipName, ConditionsBuilder... andContentEqual);
    --- End diff --
    
    I wonder if rather than using a ConditionsBuilder, perhaps we should be taking in a Predicate here instead?
    We could then supply isXX() Methods on FlowFile, such as isContentEqual()
    
    For instance,
    `void assertAllConditionsMet(String relationshipName, Predicate<MockFlowFile> predicate);`
    
    This way, we can easily chain together conditions if we want by using one of:
    ```
    runner.assertAllConditionsMet(MY_RELATIONSHIP, mff -> mff.isAttributeEqual("aa", "bb")
          && mff.isContentEqual("hello"));
    ```
    
    Additionally, if we needed to combine these programmatically, we could do so with something like:
    
    ```
    Predicate<MockFlowFile> firstPredicate = mff -> mff.isAttributeEqual("aa", "bb");
    Predicate<MockFlowFile> secondPredicate = mff -> mff.isContentEqual("hello");
    Predicate<MockFlowFile> all = firstPredicate.and(secondPredicate);
    Predicate<MockFlowFile> any = firstPredicate.or(secondPredicate);
    ```
    
    In addition to asserting that all conditions are met, I think a very valuable method/test would be to indicate that all conditions are met exactly once.
    
    Thoughts?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #321: Nifi 1214

Posted by ToivoAdams <gi...@git.apache.org>.
Github user ToivoAdams commented on the issue:

    https://github.com/apache/nifi/pull/321
  
    This closes #321 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---