You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/03/04 12:15:42 UTC
camel git commit: Skip test which cannot test on windows.
Repository: camel
Updated Branches:
refs/heads/master d84f9b6e4 -> 658dcff5f
Skip test which cannot test on windows.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/658dcff5
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/658dcff5
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/658dcff5
Branch: refs/heads/master
Commit: 658dcff5f824d790eba9d69b02910355d4d5a79f
Parents: d84f9b6
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Mar 4 12:16:30 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Mar 4 12:17:01 2015 +0100
----------------------------------------------------------------------
.../file/FileProducerChmodOptionTest.java | 25 ++++++++++++++++----
1 file changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/658dcff5/camel-core/src/test/java/org/apache/camel/component/file/FileProducerChmodOptionTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerChmodOptionTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerChmodOptionTest.java
index ad49541..f30ba95 100644
--- a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerChmodOptionTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerChmodOptionTest.java
@@ -39,17 +39,27 @@ public class FileProducerChmodOptionTest extends ContextTestSupport {
super.setUp();
}
+ private boolean canTest() {
+ // can not run on windows
+ return !isPlatform("windows");
+ }
public void testWriteValidChmod0755() throws Exception {
+ if (!canTest()) {
+ return;
+ }
+
runChmodCheck("0755", "rwxr-xr-x");
}
-
public void testWriteValidChmod666() throws Exception {
+ if (!canTest()) {
+ return;
+ }
+
runChmodCheck("666", "rw-rw-rw-");
}
-
private void runChmodCheck(String routeSuffix, String expectedPermissions) throws Exception {
MockEndpoint mock = getMockEndpoint("mock:chmod" + routeSuffix);
mock.expectedMessageCount(1);
@@ -68,8 +78,11 @@ public class FileProducerChmodOptionTest extends ContextTestSupport {
assertMockEndpointsSatisfied();
}
-
public void testInvalidChmod() throws Exception {
+ if (!canTest()) {
+ return;
+ }
+
try {
context.addRoutes(new RouteBuilder() {
@@ -87,12 +100,15 @@ public class FileProducerChmodOptionTest extends ContextTestSupport {
}
}
-
/**
* Write a file without chmod set, should work normally and not throw an exception for invalid chmod value
* @throws Exception
*/
public void testWriteNoChmod() throws Exception {
+ if (!canTest()) {
+ return;
+ }
+
MockEndpoint mock = getMockEndpoint("mock:noChmod");
mock.expectedMessageCount(1);
String testFileName = "noChmod.txt";
@@ -103,7 +119,6 @@ public class FileProducerChmodOptionTest extends ContextTestSupport {
assertMockEndpointsSatisfied();
}
-
@Override
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {