You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mc...@apache.org on 2015/02/26 04:54:21 UTC

[18/51] [abbrv] incubator-nifi git commit: NIFI-333 - Adding failure test for DecompressContent

NIFI-333 - Adding failure test for DecompressContent

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

Branch: refs/heads/NIFI-353
Commit: 361ac1f1e5c8ee943220b337c92cd49616a02194
Parents: 0f8d00d
Author: danbress <db...@onyxconsults.com>
Authored: Sun Feb 15 09:08:22 2015 -0500
Committer: danbress <db...@onyxconsults.com>
Committed: Sun Feb 15 09:08:22 2015 -0500

----------------------------------------------------------------------
 .../processors/standard/TestCompressContent.java  | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/361ac1f1/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestCompressContent.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestCompressContent.java b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestCompressContent.java
index 71c8583..df1d506 100644
--- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestCompressContent.java
+++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestCompressContent.java
@@ -109,4 +109,22 @@ public class TestCompressContent {
         flowFile.assertAttributeEquals("filename", "SampleFile.txt.gz");
 
     }
+    
+    @Test
+    public void testDecompressFailure() throws IOException {
+    	final TestRunner runner = TestRunners.newTestRunner(CompressContent.class);
+        runner.setProperty(CompressContent.MODE, "decompress");
+        runner.setProperty(CompressContent.COMPRESSION_FORMAT, "gzip");
+        
+        byte[] data = new byte[]{1,2,3,4,5,6,7,8,9,10};
+        runner.enqueue(data);
+        
+        
+        assertTrue(runner.setProperty(CompressContent.UPDATE_FILENAME, "true").isValid());
+        runner.run();
+        runner.assertQueueEmpty();
+        runner.assertAllFlowFilesTransferred(CompressContent.REL_FAILURE, 1);
+        
+        runner.getFlowFilesForRelationship(CompressContent.REL_FAILURE).get(0).assertContentEquals(data);
+    }
 }