nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcgil...@apache.org
Subject incubator-nifi git commit: NIFI-239: - Updating deprecated method usage.
Date Fri, 09 Jan 2015 13:15:38 GMT
Repository: incubator-nifi
Updated Branches:
  refs/heads/develop d08cda1b6 -> b98819e5a


NIFI-239:
- Updating deprecated method usage.

Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/b98819e5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/b98819e5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/b98819e5

Branch: refs/heads/develop
Commit: b98819e5af0e93d157d9b92e2034a5c22f749a73
Parents: d08cda1
Author: Matt Gilman <matt.c.gilman@gmail.com>
Authored: Fri Jan 9 08:10:04 2015 -0500
Committer: Matt Gilman <matt.c.gilman@gmail.com>
Committed: Fri Jan 9 08:10:04 2015 -0500

----------------------------------------------------------------------
 .../controller/util/RemoteProcessGroupUtils.java    |  4 ++--
 .../framework/web/nifi-web-api/pom.xml              |  3 ++-
 .../org/apache/nifi/integration/NiFiWebApiTest.java | 16 ++++++++--------
 .../accesscontrol/AdminAccessControlTest.java       |  2 +-
 .../accesscontrol/ReadOnlyAccessControlTest.java    |  2 +-
 .../nifi/web/security/UntrustedProxyException.java  |  4 ----
 .../x509/ocsp/OcspCertificateValidator.java         |  2 +-
 .../apache/nifi/processors/hadoop/GetHDFSTest.java  |  4 +---
 .../prioritizer/NewestFirstPrioritizerTest.java     |  3 +--
 .../prioritizer/OldestFirstPrioritizerTest.java     |  3 +--
 10 files changed, 18 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b98819e5/nar-bundles/framework-bundle/framework/site-to-site/src/main/java/org/apache/nifi/controller/util/RemoteProcessGroupUtils.java
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/site-to-site/src/main/java/org/apache/nifi/controller/util/RemoteProcessGroupUtils.java
b/nar-bundles/framework-bundle/framework/site-to-site/src/main/java/org/apache/nifi/controller/util/RemoteProcessGroupUtils.java
index 562442a..10208f8 100644
--- a/nar-bundles/framework-bundle/framework/site-to-site/src/main/java/org/apache/nifi/controller/util/RemoteProcessGroupUtils.java
+++ b/nar-bundles/framework-bundle/framework/site-to-site/src/main/java/org/apache/nifi/controller/util/RemoteProcessGroupUtils.java
@@ -185,12 +185,12 @@ public class RemoteProcessGroupUtils {
     private ControllerDTO getController(final URI uri, final int timeoutMillis) throws IOException
{
         final ClientResponse response = get(uri, timeoutMillis);
         
-        if (Status.OK.equals(response.getClientResponseStatus())) {
+        if (Status.OK.getStatusCode() == response.getStatusInfo().getStatusCode()) {
             final ControllerEntity entity = response.getEntity(ControllerEntity.class);
             return entity.getController();
         } else {
             final String responseMessage = response.getEntity(String.class);
-            throw new IOException("Got HTTP response Code " + response.getClientResponseStatus().getStatusCode()
+ ": " + response.getClientResponseStatus().getReasonPhrase() + " with explanation: " + responseMessage);
+            throw new IOException("Got HTTP response Code " + response.getStatusInfo().getStatusCode()
+ ": " + response.getStatusInfo().getReasonPhrase() + " with explanation: " + responseMessage);
         }
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b98819e5/nar-bundles/framework-bundle/framework/web/nifi-web-api/pom.xml
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-api/pom.xml b/nar-bundles/framework-bundle/framework/web/nifi-web-api/pom.xml
index 8a9b2d1..518cb0c 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-api/pom.xml
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-api/pom.xml
@@ -86,7 +86,8 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <argLine>-Xms512m -Xmx512m</argLine>
-                    <forkMode>always</forkMode>
+                    <forkCount>1</forkCount>
+                    <reuseForks>false</reuseForks>
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b98819e5/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/test/java/org/apache/nifi/integration/NiFiWebApiTest.java
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/test/java/org/apache/nifi/integration/NiFiWebApiTest.java
b/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/test/java/org/apache/nifi/integration/NiFiWebApiTest.java
index 8170589..b81863b 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/test/java/org/apache/nifi/integration/NiFiWebApiTest.java
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/test/java/org/apache/nifi/integration/NiFiWebApiTest.java
@@ -78,7 +78,7 @@ public class NiFiWebApiTest {
         ClientResponse response = dfm.testPost(baseUrl + "/controller/process-groups/root/processors",
processorEntity);
 
         // ensure a successful response
-        if (!Status.CREATED.equals(response.getClientResponseStatus())) {
+        if (Status.CREATED.getStatusCode() != response.getStatusInfo().getStatusCode()) {
             // since it was unable to create the component attempt to extract an
             // error message from the response body
             final String responseEntity = response.getEntity(String.class);
@@ -107,7 +107,7 @@ public class NiFiWebApiTest {
         response = dfm.testPost(baseUrl + "/controller/process-groups/root/processors", processorEntity);
 
         // ensure a successful response
-        if (!Status.CREATED.equals(response.getClientResponseStatus())) {
+        if (Status.CREATED.getStatusCode() != response.getStatusInfo().getStatusCode()) {
             // since it was unable to create the component attempt to extract an
             // error message from the response body
             final String responseEntity = response.getEntity(String.class);
@@ -149,7 +149,7 @@ public class NiFiWebApiTest {
         response = dfm.testPost(baseUrl + "/controller/process-groups/root/connections",
connectionEntity);
 
         // ensure a successful response
-        if (!Status.CREATED.equals(response.getClientResponseStatus())) {
+        if (Status.CREATED.getStatusCode() != response.getStatusInfo().getStatusCode()) {
             // since it was unable to create the component attempt to extract an
             // error message from the response body
             final String responseEntity = response.getEntity(String.class);
@@ -172,7 +172,7 @@ public class NiFiWebApiTest {
         response = dfm.testPost(baseUrl + "/controller/process-groups/root/labels", labelEntity);
 
         // ensure a successful response
-        if (!Status.CREATED.equals(response.getClientResponseStatus())) {
+        if (Status.CREATED.getStatusCode() != response.getStatusInfo().getStatusCode()) {
             // since it was unable to create the component attempt to extract an
             // error message from the response body
             final String responseEntity = response.getEntity(String.class);
@@ -195,7 +195,7 @@ public class NiFiWebApiTest {
         response = dfm.testPost(baseUrl + "/controller/process-groups/root/process-group-references",
processGroupEntity);
 
         // ensure a successful response
-        if (!Status.CREATED.equals(response.getClientResponseStatus())) {
+        if (Status.CREATED.getStatusCode() != response.getStatusInfo().getStatusCode()) {
             // since it was unable to create the component attempt to extract an
             // error message from the response body
             final String responseEntity = response.getEntity(String.class);
@@ -218,7 +218,7 @@ public class NiFiWebApiTest {
         response = dfm.testPost(baseUrl + "/controller/process-groups/root/input-ports",
inputPortEntity);
 
         // ensure a successful response
-        if (!Status.CREATED.equals(response.getClientResponseStatus())) {
+        if (Status.CREATED.getStatusCode() != response.getStatusInfo().getStatusCode()) {
             // since it was unable to create the component attempt to extract an
             // error message from the response body
             final String responseEntity = response.getEntity(String.class);
@@ -241,7 +241,7 @@ public class NiFiWebApiTest {
         response = dfm.testPost(baseUrl + "/controller/process-groups/root/output-ports",
outputPortEntity);
 
         // ensure a successful response
-        if (!Status.CREATED.equals(response.getClientResponseStatus())) {
+        if (Status.CREATED.getStatusCode() != response.getStatusInfo().getStatusCode()) {
             // since it was unable to create the component attempt to extract an
             // error message from the response body
             final String responseEntity = response.getEntity(String.class);
@@ -266,7 +266,7 @@ public class NiFiWebApiTest {
 //        response = dfm.testPost(baseUrl + "/controller/process-groups/root/remote-process-groups",
remoteProcessGroupEntity);
 //        
 //        // ensure a successful response
-//        if (!Status.CREATED.equals(response.getClientResponseStatus())) {
+//        if (Status.CREATED.getStatusCode() != response.getStatusInfo().getStatusCode())
{
 //            throw new Exception("Unable to populate initial flow.");
 //        }
     }

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b98819e5/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/AdminAccessControlTest.java
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/AdminAccessControlTest.java
b/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/AdminAccessControlTest.java
index c21d512..ac554a7 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/AdminAccessControlTest.java
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/AdminAccessControlTest.java
@@ -20,7 +20,6 @@ import com.sun.jersey.api.client.ClientResponse;
 import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
-import junit.framework.Assert;
 import org.apache.nifi.integration.NiFiWebApiTest;
 import org.apache.nifi.integration.util.NiFiTestServer;
 import org.apache.nifi.integration.util.NiFiTestUser;
@@ -52,6 +51,7 @@ import org.apache.nifi.web.api.entity.UserEntity;
 import org.apache.nifi.web.api.entity.UsersEntity;
 import org.apache.commons.collections4.CollectionUtils;
 import org.junit.AfterClass;
+import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b98819e5/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ReadOnlyAccessControlTest.java
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ReadOnlyAccessControlTest.java
b/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ReadOnlyAccessControlTest.java
index 0d47133..6ac8b47 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ReadOnlyAccessControlTest.java
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ReadOnlyAccessControlTest.java
@@ -20,7 +20,6 @@ import com.sun.jersey.api.client.ClientResponse;
 import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
-import junit.framework.Assert;
 import org.apache.nifi.integration.NiFiWebApiTest;
 import org.apache.nifi.integration.util.NiFiTestServer;
 import org.apache.nifi.integration.util.NiFiTestUser;
@@ -48,6 +47,7 @@ import org.apache.nifi.web.api.entity.ProcessorEntity;
 import org.apache.nifi.web.api.entity.ProcessorTypesEntity;
 import org.apache.nifi.web.api.entity.ProcessorsEntity;
 import org.junit.AfterClass;
+import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b98819e5/nar-bundles/framework-bundle/framework/web/web-security/src/main/java/org/apache/nifi/web/security/UntrustedProxyException.java
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/web-security/src/main/java/org/apache/nifi/web/security/UntrustedProxyException.java
b/nar-bundles/framework-bundle/framework/web/web-security/src/main/java/org/apache/nifi/web/security/UntrustedProxyException.java
index 80d42c8..1a993e8 100644
--- a/nar-bundles/framework-bundle/framework/web/web-security/src/main/java/org/apache/nifi/web/security/UntrustedProxyException.java
+++ b/nar-bundles/framework-bundle/framework/web/web-security/src/main/java/org/apache/nifi/web/security/UntrustedProxyException.java
@@ -23,10 +23,6 @@ import org.springframework.security.core.AuthenticationException;
  */
 public class UntrustedProxyException extends AuthenticationException {
 
-    public UntrustedProxyException(String msg, Object extraInformation) {
-        super(msg, extraInformation);
-    }
-
     public UntrustedProxyException(String msg) {
         super(msg);
     }

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b98819e5/nar-bundles/framework-bundle/framework/web/web-security/src/main/java/org/apache/nifi/web/security/x509/ocsp/OcspCertificateValidator.java
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/web-security/src/main/java/org/apache/nifi/web/security/x509/ocsp/OcspCertificateValidator.java
b/nar-bundles/framework-bundle/framework/web/web-security/src/main/java/org/apache/nifi/web/security/x509/ocsp/OcspCertificateValidator.java
index 81eb89b..8d2c318 100644
--- a/nar-bundles/framework-bundle/framework/web/web-security/src/main/java/org/apache/nifi/web/security/x509/ocsp/OcspCertificateValidator.java
+++ b/nar-bundles/framework-bundle/framework/web/web-security/src/main/java/org/apache/nifi/web/security/x509/ocsp/OcspCertificateValidator.java
@@ -302,7 +302,7 @@ public class OcspCertificateValidator {
             final ClientResponse response = resource.header(CONTENT_TYPE_HEADER, OCSP_REQUEST_CONTENT_TYPE).post(ClientResponse.class,
ocspRequest.getEncoded());
 
             // ensure the request was completed successfully
-            if (!ClientResponse.Status.OK.equals(response.getClientResponseStatus())) {
+            if (ClientResponse.Status.OK.getStatusCode() != response.getStatusInfo().getStatusCode())
{
                 logger.warn(String.format("OCSP request was unsuccessful (%s).", response.getStatus()));
                 return ocspStatus;
             }

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b98819e5/nar-bundles/hadoop-bundle/hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/GetHDFSTest.java
----------------------------------------------------------------------
diff --git a/nar-bundles/hadoop-bundle/hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/GetHDFSTest.java
b/nar-bundles/hadoop-bundle/hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/GetHDFSTest.java
index 4b495f4..d6015e0 100644
--- a/nar-bundles/hadoop-bundle/hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/GetHDFSTest.java
+++ b/nar-bundles/hadoop-bundle/hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/GetHDFSTest.java
@@ -16,8 +16,6 @@
  */
 package org.apache.nifi.processors.hadoop;
 
-import org.apache.nifi.processors.hadoop.GetHDFS;
-import org.apache.nifi.processors.hadoop.PutHDFS;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
@@ -25,7 +23,6 @@ import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 
-import junit.framework.Assert;
 import org.apache.nifi.components.ValidationResult;
 import org.apache.nifi.flowfile.attributes.CoreAttributes;
 import org.apache.nifi.processor.ProcessContext;
@@ -35,6 +32,7 @@ import org.apache.nifi.util.TestRunner;
 import org.apache.nifi.util.TestRunners;
 
 import org.apache.hadoop.fs.Path;
+import org.junit.Assert;
 import org.junit.Test;
 
 public class GetHDFSTest {

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b98819e5/nar-bundles/standard-bundle/standard-prioritizers/src/test/java/org/apache/nifi/prioritizer/NewestFirstPrioritizerTest.java
----------------------------------------------------------------------
diff --git a/nar-bundles/standard-bundle/standard-prioritizers/src/test/java/org/apache/nifi/prioritizer/NewestFirstPrioritizerTest.java
b/nar-bundles/standard-bundle/standard-prioritizers/src/test/java/org/apache/nifi/prioritizer/NewestFirstPrioritizerTest.java
index 934c5af..1b75734 100644
--- a/nar-bundles/standard-bundle/standard-prioritizers/src/test/java/org/apache/nifi/prioritizer/NewestFirstPrioritizerTest.java
+++ b/nar-bundles/standard-bundle/standard-prioritizers/src/test/java/org/apache/nifi/prioritizer/NewestFirstPrioritizerTest.java
@@ -16,10 +16,8 @@
  */
 package org.apache.nifi.prioritizer;
 
-import org.apache.nifi.prioritizer.NewestFlowFileFirstPrioritizer;
 import java.util.concurrent.atomic.AtomicLong;
 
-import junit.framework.Assert;
 import org.apache.nifi.processor.AbstractProcessor;
 import org.apache.nifi.processor.ProcessContext;
 import org.apache.nifi.processor.ProcessSession;
@@ -28,6 +26,7 @@ import org.apache.nifi.processor.exception.ProcessException;
 import org.apache.nifi.util.MockFlowFile;
 import org.apache.nifi.util.MockProcessSession;
 import org.apache.nifi.util.SharedSessionState;
+import org.junit.Assert;
 
 import org.junit.Test;
 

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b98819e5/nar-bundles/standard-bundle/standard-prioritizers/src/test/java/org/apache/nifi/prioritizer/OldestFirstPrioritizerTest.java
----------------------------------------------------------------------
diff --git a/nar-bundles/standard-bundle/standard-prioritizers/src/test/java/org/apache/nifi/prioritizer/OldestFirstPrioritizerTest.java
b/nar-bundles/standard-bundle/standard-prioritizers/src/test/java/org/apache/nifi/prioritizer/OldestFirstPrioritizerTest.java
index 2d581dd..e46711d 100644
--- a/nar-bundles/standard-bundle/standard-prioritizers/src/test/java/org/apache/nifi/prioritizer/OldestFirstPrioritizerTest.java
+++ b/nar-bundles/standard-bundle/standard-prioritizers/src/test/java/org/apache/nifi/prioritizer/OldestFirstPrioritizerTest.java
@@ -16,10 +16,8 @@
  */
 package org.apache.nifi.prioritizer;
 
-import org.apache.nifi.prioritizer.OldestFlowFileFirstPrioritizer;
 import java.util.concurrent.atomic.AtomicLong;
 
-import junit.framework.Assert;
 import org.apache.nifi.processor.AbstractProcessor;
 import org.apache.nifi.processor.ProcessContext;
 import org.apache.nifi.processor.ProcessSession;
@@ -28,6 +26,7 @@ import org.apache.nifi.processor.exception.ProcessException;
 import org.apache.nifi.util.MockFlowFile;
 import org.apache.nifi.util.MockProcessSession;
 import org.apache.nifi.util.SharedSessionState;
+import org.junit.Assert;
 
 import org.junit.Test;
 


Mime
View raw message