[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

2016-08-17 Thread asfgit
Github user asfgit closed the pull request at:

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


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

2016-08-17 Thread alopresto
Github user alopresto commented on a diff in the pull request:

https://github.com/apache/nifi/pull/872#discussion_r75161822
  
--- Diff: 
nifi-commons/nifi-hadoop-utils/src/test/java/org/apache/nifi/hadoop/TestKerberosProperties.java
 ---
@@ -19,25 +19,20 @@
 import org.apache.hadoop.conf.Configuration;
 import org.apache.nifi.components.ValidationResult;
 import org.apache.nifi.logging.ComponentLog;
-import org.apache.nifi.util.NiFiProperties;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
 
 import java.io.File;
 import java.util.List;
 
-import static org.mockito.Mockito.when;
-
 public class TestKerberosProperties {
 
 @Test
 public void testWithKerberosConfigFile() {
 final File file = new File("src/test/resources/krb5.conf");
-final NiFiProperties niFiProperties = 
Mockito.mock(NiFiProperties.class);
-
when(niFiProperties.getKerberosConfigurationFile()).thenReturn(file);
 
-final KerberosProperties kerberosProperties = 
KerberosProperties.create(niFiProperties);
+final KerberosProperties kerberosProperties = new 
KerberosProperties(file);
 Assert.assertNotNull(kerberosProperties);
--- End diff --

I think there were some weird things happening during the transition from 
static initialization so these are sanity checks. 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

2016-08-17 Thread alopresto
Github user alopresto commented on a diff in the pull request:

https://github.com/apache/nifi/pull/872#discussion_r75161684
  
--- Diff: 
nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
 ---
@@ -29,17 +26,22 @@
 import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-
-public class NiFiProperties extends Properties {
-
-private static final long serialVersionUID = 2119177359005492702L;
-
-private static final Logger LOG = 
LoggerFactory.getLogger(NiFiProperties.class);
-private static NiFiProperties instance = null;
+import java.util.Set;
+
+/**
+ * The NiFiProperties class holds all properties which are needed for 
various
+ * values to be available at runtime. It is strongly tied to the startup
+ * properties needed and is often refer to as the 'nifi.properties' file. 
The
--- End diff --

I fixed this in NIFI-1831 (PR 834). 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

2016-08-17 Thread markap14
Github user markap14 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/872#discussion_r75158697
  
--- Diff: 
nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
 ---
@@ -29,17 +26,22 @@
 import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-
-public class NiFiProperties extends Properties {
-
-private static final long serialVersionUID = 2119177359005492702L;
-
-private static final Logger LOG = 
LoggerFactory.getLogger(NiFiProperties.class);
-private static NiFiProperties instance = null;
+import java.util.Set;
+
+/**
+ * The NiFiProperties class holds all properties which are needed for 
various
+ * values to be available at runtime. It is strongly tied to the startup
+ * properties needed and is often refer to as the 'nifi.properties' file. 
The
--- End diff --

should be "and is often referred to"


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

2016-08-17 Thread markap14
Github user markap14 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/872#discussion_r75158602
  
--- Diff: 
nifi-commons/nifi-hadoop-utils/src/test/java/org/apache/nifi/hadoop/TestKerberosProperties.java
 ---
@@ -19,25 +19,20 @@
 import org.apache.hadoop.conf.Configuration;
 import org.apache.nifi.components.ValidationResult;
 import org.apache.nifi.logging.ComponentLog;
-import org.apache.nifi.util.NiFiProperties;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
 
 import java.io.File;
 import java.util.List;
 
-import static org.mockito.Mockito.when;
-
 public class TestKerberosProperties {
 
 @Test
 public void testWithKerberosConfigFile() {
 final File file = new File("src/test/resources/krb5.conf");
-final NiFiProperties niFiProperties = 
Mockito.mock(NiFiProperties.class);
-
when(niFiProperties.getKerberosConfigurationFile()).thenReturn(file);
 
-final KerberosProperties kerberosProperties = 
KerberosProperties.create(niFiProperties);
+final KerberosProperties kerberosProperties = new 
KerberosProperties(file);
 Assert.assertNotNull(kerberosProperties);
--- End diff --

This is an odd assertion... given that it was just created using a 
constructor above. Same thing happens in #testWithoutKerberosConfigFile()


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

2016-08-16 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/872#discussion_r74981298
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-security/src/test/groovy/org/apache/nifi/web/security/x509/ocsp/OcspCertificateValidatorGroovyTest.groovy
 ---
@@ -65,7 +65,8 @@ public class OcspCertificateValidatorGroovyTest {
 
 @Before
 public void setUp() throws Exception {
-mockProperties = [getProperty: { String propertyName -> return 
"value_for_${propertyName}" }] as NiFiProperties
+mockProperties = [getProperty: { String propertyName -> return 
"value_for_${propertyName}"
+,getPropertyKeys: { -> return ["A", "set"] as Set}] as 
NiFiProperties
--- End diff --

Actually I'm getting weird errors, doesn't look like map coercion likes the 
getProperty method, possibly because that method is used all over Groovy 
meta-classes and such. This could replace the above:

mockProperties = new NiFiProperties() {
@Override
String getProperty(String key) {
return 'value_for_' + key
}

@Override
Set getPropertyKeys() {
return ["A", "set"]
}
}


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

2016-08-16 Thread mattyb149
Github user mattyb149 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/872#discussion_r74976276
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-security/src/test/groovy/org/apache/nifi/web/security/x509/ocsp/OcspCertificateValidatorGroovyTest.groovy
 ---
@@ -65,7 +65,8 @@ public class OcspCertificateValidatorGroovyTest {
 
 @Before
 public void setUp() throws Exception {
-mockProperties = [getProperty: { String propertyName -> return 
"value_for_${propertyName}" }] as NiFiProperties
+mockProperties = [getProperty: { String propertyName -> return 
"value_for_${propertyName}"
+,getPropertyKeys: { -> return ["A", "set"] as Set}] as 
NiFiProperties
--- End diff --

Just needs a brace at the end of line 68


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request #872: NIFI-2574 checkpoint commit to allow 1831 progress

2016-08-15 Thread joewitt
GitHub user joewitt opened a pull request:

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

NIFI-2574 checkpoint commit to allow 1831 progress

Builds fine.  Just cannot run tests.

mvn clean install -DskipTests

But this lets NIFI-1831 work continue while i clean up NiFiProperties 
static singleton usage

Will remove getInstance() method altogether and will remove BOGUS_INSTANCE 
and will not extend Properties

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

$ git pull https://github.com/joewitt/incubator-nifi NIFI-2574

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

https://github.com/apache/nifi/pull/872.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 #872


commit c3f406de785eb2dcdc1c0ab9a8b574b3ddac1f4a
Author: joewitt 
Date:   2016-08-16T03:18:47Z

NIFI-2574 checkpoint commit to allow 1831 progress




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---