This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 67cf3a537b0db7b77d5b7703796e5058e474dab8
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Thu May 2 12:36:11 2019 +0200

    CAMEL-13474: Move dataformats out of camel-core.
---
 .../deflater}/GzipDataFormatFileDeleteTest.java        | 18 ++++++++++++------
 .../GzipDataFormatFileUnmarshalDeleteTest.java         | 12 +++++++-----
 2 files changed, 19 insertions(+), 11 deletions(-)

diff --git 
a/core/camel-core/src/test/java/org/apache/camel/impl/GzipDataFormatFileDeleteTest.java
 
b/components/camel-zip-deflater/src/test/java/org/apache/camel/dataformat/deflater/GzipDataFormatFileDeleteTest.java
similarity index 76%
rename from 
core/camel-core/src/test/java/org/apache/camel/impl/GzipDataFormatFileDeleteTest.java
rename to 
components/camel-zip-deflater/src/test/java/org/apache/camel/dataformat/deflater/GzipDataFormatFileDeleteTest.java
index b86ae93..1097b4a 100644
--- 
a/core/camel-core/src/test/java/org/apache/camel/impl/GzipDataFormatFileDeleteTest.java
+++ 
b/components/camel-zip-deflater/src/test/java/org/apache/camel/dataformat/deflater/GzipDataFormatFileDeleteTest.java
@@ -14,16 +14,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.impl;
+package org.apache.camel.dataformat.deflater;
+
 import java.io.File;
 
-import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
+import org.apache.camel.builder.NotifyBuilder;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class GzipDataFormatFileDeleteTest extends ContextTestSupport {
+public class GzipDataFormatFileDeleteTest extends CamelTestSupport {
 
     @Override
     @Before
@@ -34,19 +37,22 @@ public class GzipDataFormatFileDeleteTest extends 
ContextTestSupport {
 
     @Test
     public void testGzipFileDelete() throws Exception {
+        NotifyBuilder oneExchangeDone = new 
NotifyBuilder(context).whenDone(1).create();
+
         getMockEndpoint("mock:result").expectedMessageCount(1);
 
         template.sendBodyAndHeader("file:target/data/gzip", "Hello World", 
Exchange.FILE_NAME, "hello.txt");
 
         assertMockEndpointsSatisfied();
 
-        oneExchangeDone.matchesMockWaitTime();
+        // wait till the exchange is done which means the file should then 
have been deleted
+        oneExchangeDone.matchesWaitTime();
 
         File in = new File("target/data/gzip/hello.txt");
-        assertFalse("Should have been deleted " + in, in.exists());
+        Assert.assertFalse("Should have been deleted " + in, in.exists());
 
         File out = new File("target/data/gzip/out/hello.txt.gz");
-        assertTrue("Should have been created " + out, out.exists());
+        Assert.assertTrue("Should have been created " + out, out.exists());
     }
 
     @Override
diff --git 
a/core/camel-core/src/test/java/org/apache/camel/impl/GzipDataFormatFileUnmarshalDeleteTest.java
 
b/components/camel-zip-deflater/src/test/java/org/apache/camel/dataformat/deflater/GzipDataFormatFileUnmarshalDeleteTest.java
similarity index 86%
rename from 
core/camel-core/src/test/java/org/apache/camel/impl/GzipDataFormatFileUnmarshalDeleteTest.java
rename to 
components/camel-zip-deflater/src/test/java/org/apache/camel/dataformat/deflater/GzipDataFormatFileUnmarshalDeleteTest.java
index 7750723..8327abd 100644
--- 
a/core/camel-core/src/test/java/org/apache/camel/impl/GzipDataFormatFileUnmarshalDeleteTest.java
+++ 
b/components/camel-zip-deflater/src/test/java/org/apache/camel/dataformat/deflater/GzipDataFormatFileUnmarshalDeleteTest.java
@@ -14,17 +14,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.impl;
+package org.apache.camel.dataformat.deflater;
+
 import java.io.File;
 
-import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.NotifyBuilder;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class GzipDataFormatFileUnmarshalDeleteTest extends ContextTestSupport {
+public class GzipDataFormatFileUnmarshalDeleteTest extends CamelTestSupport {
 
     @Override
     @Before
@@ -45,10 +47,10 @@ public class GzipDataFormatFileUnmarshalDeleteTest extends 
ContextTestSupport {
         notify.matchesMockWaitTime();
 
         File in = new File("target/gzip/hello.txt");
-        assertFalse("Should have been deleted " + in, in.exists());
+        Assert.assertFalse("Should have been deleted " + in, in.exists());
 
         File out = new File("target/gzip/out/hello.txt.gz");
-        assertFalse("Should have been deleted " + out, out.exists());
+        Assert.assertFalse("Should have been deleted " + out, out.exists());
     }
 
     @Override

Reply via email to