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/01/31 10:47:36 UTC

[1/2] camel git commit: CAMEL-7999: Fixed wrong default value for timer

Repository: camel
Updated Branches:
  refs/heads/master 484789537 -> 869de0d21


CAMEL-7999: Fixed wrong default value for timer


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4fdf55e3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4fdf55e3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4fdf55e3

Branch: refs/heads/master
Commit: 4fdf55e3b39ffe60e012436333b155928ac6add1
Parents: 4847895
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Jan 31 10:30:13 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Jan 31 10:30:13 2015 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/camel/component/timer/TimerEndpoint.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4fdf55e3/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
index 2f38c2c..f46b22b 100644
--- a/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
@@ -54,7 +54,7 @@ public class TimerEndpoint extends DefaultEndpoint implements MultipleConsumersS
     private boolean daemon = true;
     @UriParam
     private Timer timer;
-    @UriParam(defaultValue = "false")
+    @UriParam(defaultValue = "0")
     private long repeatCount;
 
     public TimerEndpoint() {


[2/2] camel git commit: CAMEL-7999: Fixed name on mock endpoint

Posted by da...@apache.org.
CAMEL-7999: Fixed name on mock endpoint


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/869de0d2
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/869de0d2
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/869de0d2

Branch: refs/heads/master
Commit: 869de0d216db1488cf236883543d60516ced2653
Parents: 4fdf55e
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Jan 31 10:34:54 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Jan 31 10:47:23 2015 +0100

----------------------------------------------------------------------
 .../camel/component/mock/MockComponent.java     |  2 +
 .../camel/component/mock/MockEndpoint.java      | 46 ++++++++++++--------
 ...ponentConfigurationAndDocumentationTest.java | 12 +++++
 3 files changed, 41 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/869de0d2/camel-core/src/main/java/org/apache/camel/component/mock/MockComponent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/mock/MockComponent.java b/camel-core/src/main/java/org/apache/camel/component/mock/MockComponent.java
index b0b264c..152e686 100644
--- a/camel-core/src/main/java/org/apache/camel/component/mock/MockComponent.java
+++ b/camel-core/src/main/java/org/apache/camel/component/mock/MockComponent.java
@@ -38,6 +38,8 @@ public class MockComponent extends UriEndpointComponent {
     @Override
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
         MockEndpoint endpoint = new MockEndpoint(uri, this);
+        endpoint.setName(remaining);
+
         Integer value = getAndRemoveParameter(parameters, "reportGroup", Integer.class);
         if (value != null) {
             Processor reporter = new ThroughputLogger(new CamelLogger("org.apache.camel.component.mock:" + remaining), value);

http://git-wip-us.apache.org/repos/asf/camel/blob/869de0d2/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
index fca583b..54fb021 100644
--- a/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
@@ -94,9 +94,6 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint {
     // and the threads which process the exchanges when routing messages in Camel
     protected volatile Processor reporter;
     
-    @UriParam(defaultValue = "true")
-    protected boolean copyOnExchange = true;
-
     private volatile Processor defaultProcessor;
     private volatile Map<Integer, Processor> processors;
     private volatile List<Exchange> receivedExchanges;
@@ -111,24 +108,26 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint {
     private volatile Map<String, Object> expectedPropertyValues;
     private volatile Map<String, Object> actualPropertyValues;
 
+    private volatile int counter;
+
     @UriPath(description = "Name of mock endpoint")
     private String name;
-    @UriParam
-    private volatile int expectedCount;
-    @UriParam
-    private volatile long sleepForEmptyTest;
-    @UriParam
-    private volatile long resultWaitTime;
-    @UriParam
-    private volatile long resultMinimumWaitTime;
-    @UriParam
-    private volatile long assertPeriod;
-    @UriParam
-    private volatile int counter;
-    @UriParam
-    private volatile int retainFirst;
-    @UriParam
-    private volatile int retainLast;
+    @UriParam(defaultValue = "-1")
+    private int expectedCount;
+    @UriParam(defaultValue = "0")
+    private long sleepForEmptyTest;
+    @UriParam(defaultValue = "0")
+    private long resultWaitTime;
+    @UriParam(defaultValue = "0")
+    private long resultMinimumWaitTime;
+    @UriParam(defaultValue = "0")
+    private long assertPeriod;
+    @UriParam(defaultValue = "-1")
+    private int retainFirst;
+    @UriParam(defaultValue = "-1")
+    private int retainLast;
+    @UriParam(defaultValue = "true")
+    protected boolean copyOnExchange = true;
 
     public MockEndpoint(String endpointUri, Component component) {
         super(endpointUri, component);
@@ -992,6 +991,15 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint {
 
     // Properties
     // -------------------------------------------------------------------------
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
     public List<Throwable> getFailures() {
         return failures;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/869de0d2/camel-core/src/test/java/org/apache/camel/component/mock/MockComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/mock/MockComponentConfigurationAndDocumentationTest.java b/camel-core/src/test/java/org/apache/camel/component/mock/MockComponentConfigurationAndDocumentationTest.java
index ed790c5..2cab36c 100644
--- a/camel-core/src/test/java/org/apache/camel/component/mock/MockComponentConfigurationAndDocumentationTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/mock/MockComponentConfigurationAndDocumentationTest.java
@@ -41,6 +41,18 @@ public class MockComponentConfigurationAndDocumentationTest extends ContextTestS
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
+        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"type\": \"string\""));
+        assertTrue(json.contains("\"expectedCount\": { \"kind\": \"parameter\", \"type\": \"integer\""));
+        assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"type\": \"integer\""));
+    }
+
+    @Test
+    public void testEndpointExplain() throws Exception {
+        String json = context.explainEndpointJson("mock:foo?retainFirst=10", true);
+        assertNotNull(json);
+
+        assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"type\": \"string\", \"javaType\": \"java.lang.String\","
+                + " \"deprecated\": \"false\", \"value\": \"foo\", \"description\": \"Name of mock endpoint\""));
         assertTrue(json.contains("\"expectedCount\": { \"kind\": \"parameter\", \"type\": \"integer\""));
         assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"type\": \"integer\""));
     }