nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marka...@apache.org
Subject [1/2] incubator-nifi git commit: NIFI-25: Added AWS processors
Date Sat, 14 Mar 2015 21:08:28 GMT
Repository: incubator-nifi
Updated Branches:
  refs/heads/NIFI-25 [created] 373f470b6


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/373f470b/nifi/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/sqs/TestPutSQS.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/sqs/TestPutSQS.java
b/nifi/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/sqs/TestPutSQS.java
new file mode 100644
index 0000000..a90a4ce
--- /dev/null
+++ b/nifi/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/sqs/TestPutSQS.java
@@ -0,0 +1,35 @@
+package org.apache.nifi.processors.aws.sqs;
+
+import java.io.IOException;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.nifi.processors.aws.sns.PutSNS;
+import org.apache.nifi.util.TestRunner;
+import org.apache.nifi.util.TestRunners;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+
+@Ignore("For local testing only - interacts with S3 so the credentials file must be configured
and all necessary buckets created")
+public class TestPutSQS {
+    private final String CREDENTIALS_FILE = System.getProperty("user.home") + "/aws-credentials.properties";
+
+    @Test
+    public void testSimplePut() throws IOException {
+        final TestRunner runner = TestRunners.newTestRunner(new PutSQS());
+        runner.setProperty(PutSNS.CREDENTAILS_FILE, CREDENTIALS_FILE);
+        runner.setProperty(PutSQS.TIMEOUT, "30 secs");
+        runner.setProperty(PutSQS.QUEUE_URL, "https://sqs.us-west-2.amazonaws.com/100515378163/test-queue-000000000");
+        Assert.assertTrue( runner.setProperty("x-custom-prop", "hello").isValid() );
+        
+        final Map<String, String> attrs = new HashMap<>();
+        attrs.put("filename", "1.txt");
+        runner.enqueue(Paths.get("src/test/resources/hello.txt"), attrs);
+        runner.run(1);
+        
+        runner.assertAllFlowFilesTransferred(PutSQS.REL_SUCCESS, 1);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/373f470b/nifi/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/resources/hello.txt
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/resources/hello.txt
b/nifi/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/resources/hello.txt
new file mode 100644
index 0000000..ee13cb7
--- /dev/null
+++ b/nifi/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/resources/hello.txt
@@ -0,0 +1 @@
+Hello, World!!
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/373f470b/nifi/nifi-nar-bundles/nifi-aws-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-aws-bundle/pom.xml b/nifi/nifi-nar-bundles/nifi-aws-bundle/pom.xml
new file mode 100644
index 0000000..81a54e4
--- /dev/null
+++ b/nifi/nifi-nar-bundles/nifi-aws-bundle/pom.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.nifi</groupId>
+        <artifactId>nifi-nar-bundles</artifactId>
+        <version>0.0.2-incubating-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>nifi-aws-bundle</artifactId>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>nifi-aws-processors</module>
+        <module>nifi-aws-nar</module>
+    </modules>
+
+	<dependencyManagement>
+		<dependencies>
+			<dependency>
+				<groupId>com.amazonaws</groupId>
+				<artifactId>aws-java-sdk</artifactId>
+				<version>1.9.24</version>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/373f470b/nifi/nifi-nar-bundles/pom.xml
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/pom.xml b/nifi/nifi-nar-bundles/pom.xml
index 2890351..374304a 100644
--- a/nifi/nifi-nar-bundles/pom.xml
+++ b/nifi/nifi-nar-bundles/pom.xml
@@ -12,8 +12,7 @@
   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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
@@ -35,7 +34,8 @@
         <module>nifi-update-attribute-bundle</module>
         <module>nifi-kafka-bundle</module>
 		<module>nifi-kite-bundle</module>
-    </modules>
+		<module>nifi-aws-bundle</module>
+  </modules>
     <dependencyManagement>
         <dependencies>
             <dependency>
@@ -120,4 +120,4 @@
             </dependency>
         </dependencies>
     </dependencyManagement>
-</project>
+</project>
\ No newline at end of file


Mime
View raw message