You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by cs...@apache.org on 2011/09/19 12:55:28 UTC
svn commit: r1172565 - in
/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi:
hazelcast/HazelcastTest.java hazelcast/SimpleObject.java
jpa/JpaBlueprintRouteTest.java jpa/JpaRouteTest.java jpa/SendEmail.java
Author: cschneider
Date: Mon Sep 19 10:55:28 2011
New Revision: 1172565
URL: http://svn.apache.org/viewvc?rev=1172565&view=rev
Log:
Fix for checkstyle errors
Modified:
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/hazelcast/HazelcastTest.java
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/hazelcast/SimpleObject.java
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaBlueprintRouteTest.java
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaRouteTest.java
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/SendEmail.java
Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/hazelcast/HazelcastTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/hazelcast/HazelcastTest.java?rev=1172565&r1=1172564&r2=1172565&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/hazelcast/HazelcastTest.java (original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/hazelcast/HazelcastTest.java Mon Sep 19 10:55:28 2011
@@ -1,13 +1,29 @@
+/**
+ * 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.
+ */
package org.apache.camel.itest.osgi.hazelcast;
import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.hazelcast.HazelcastConstants;
import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.apache.camel.component.hazelcast.HazelcastConstants;
import static org.ops4j.pax.exam.OptionUtils.combine;
import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures;
@@ -20,54 +36,51 @@ public class HazelcastTest extends OSGiI
String reply = template.requestBody("direct:getatomic", null, String.class);
assertNotNull(reply);
long value = Long.parseLong(reply);
- assertEquals("Should be 0",0L,value);
-
+ assertEquals("Should be 0", 0L, value);
template.sendBody("direct:setatomic", 100L);
reply = template.requestBody("direct:getatomic", null, String.class);
assertNotNull(reply);
value = Long.parseLong(reply);
- assertEquals("Should be 100",100L,value);
+ assertEquals("Should be 100", 100L, value);
}
@Test
public void testMap() throws Exception {
- SimpleObject item1 = new SimpleObject(1L,"Some value");
- SimpleObject item2 = new SimpleObject(2L,"Some other value");
+ SimpleObject item1 = new SimpleObject(1L, "Some value");
+ SimpleObject item2 = new SimpleObject(2L, "Some other value");
- template.sendBodyAndHeader("direct:mapput", item1,HazelcastConstants.OBJECT_ID,"1");
- template.sendBodyAndHeader("direct:mapput", item2,HazelcastConstants.OBJECT_ID,"2");
+ template.sendBodyAndHeader("direct:mapput", item1, HazelcastConstants.OBJECT_ID, "1");
+ template.sendBodyAndHeader("direct:mapput", item2, HazelcastConstants.OBJECT_ID, "2");
- Object result2 = template.requestBodyAndHeader("direct:mapget", null,HazelcastConstants.OBJECT_ID,"2");
+ Object result2 = template.requestBodyAndHeader("direct:mapget", null, HazelcastConstants.OBJECT_ID, "2");
assertNotNull(result2);
- assertEquals("Should be equal",item2,result2);
- Object result1 = template.requestBodyAndHeader("direct:mapget", null,HazelcastConstants.OBJECT_ID,"1");
+ assertEquals("Should be equal", item2, result2);
+ Object result1 = template.requestBodyAndHeader("direct:mapget", null, HazelcastConstants.OBJECT_ID, "1");
assertNotNull(result1);
- assertEquals("Should be equal",item1,result1);
- Object resul3 = template.requestBodyAndHeader("direct:mapget", null,HazelcastConstants.OBJECT_ID,"3");
+ assertEquals("Should be equal", item1, result1);
+ Object resul3 = template.requestBodyAndHeader("direct:mapget", null, HazelcastConstants.OBJECT_ID, "3");
assertNull(resul3);
}
-
- @Test
+ @Test
public void testQueue() throws Exception {
- SimpleObject item1 = new SimpleObject(1L,"Some value");
- SimpleObject item2 = new SimpleObject(2L,"Some other value");
+ SimpleObject item1 = new SimpleObject(1L, "Some value");
+ SimpleObject item2 = new SimpleObject(2L, "Some other value");
- template.sendBodyAndHeader("direct:queueput", item1,HazelcastConstants.OPERATION,HazelcastConstants.ADD_OPERATION);
- template.sendBodyAndHeader("direct:queueput", item2,HazelcastConstants.OPERATION,HazelcastConstants.ADD_OPERATION);
+ template.sendBodyAndHeader("direct:queueput", item1, HazelcastConstants.OPERATION, HazelcastConstants.ADD_OPERATION);
+ template.sendBodyAndHeader("direct:queueput", item2, HazelcastConstants.OPERATION, HazelcastConstants.ADD_OPERATION);
- Object result1 = template.requestBody("direct:queuepoll",new Object());
+ Object result1 = template.requestBody("direct:queuepoll", new Object());
assertNotNull(result1);
- assertEquals("Should be equal",item1,result1);
- Object result2 = template.requestBody("direct:queuepoll",new Object());
+ assertEquals("Should be equal", item1, result1);
+ Object result2 = template.requestBody("direct:queuepoll", new Object());
assertNotNull(result2);
- assertEquals("Should be equal",item1,result1);
- Object resul3 = template.requestBody("direct:queuepoll",new Object());
+ assertEquals("Should be equal", item1, result1);
+ Object resul3 = template.requestBody("direct:queuepoll", new Object());
assertNull(resul3);
}
-
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
@@ -111,4 +124,4 @@ public class HazelcastTest extends OSGiI
return options;
}
-}
\ No newline at end of file
+}
Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/hazelcast/SimpleObject.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/hazelcast/SimpleObject.java?rev=1172565&r1=1172564&r2=1172565&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/hazelcast/SimpleObject.java (original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/hazelcast/SimpleObject.java Mon Sep 19 10:55:28 2011
@@ -1,3 +1,19 @@
+/**
+ * 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.
+ */
package org.apache.camel.itest.osgi.hazelcast;
import java.io.Serializable;
@@ -34,12 +50,18 @@ public class SimpleObject implements Ser
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
SimpleObject that = (SimpleObject) o;
- if (!id.equals(that.id)) return false;
+ if (!id.equals(that.id)) {
+ return false;
+ }
return true;
}
Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaBlueprintRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaBlueprintRouteTest.java?rev=1172565&r1=1172564&r2=1172565&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaBlueprintRouteTest.java (original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaBlueprintRouteTest.java Mon Sep 19 10:55:28 2011
@@ -17,6 +17,8 @@
package org.apache.camel.itest.osgi.jpa;
+import java.io.InputStream;
+
import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.component.mock.MockEndpoint;
@@ -30,8 +32,6 @@ import org.ops4j.pax.exam.junit.JUnit4Te
import org.osgi.framework.Constants;
import org.osgi.service.blueprint.container.BlueprintContainer;
-import java.io.InputStream;
-
import static org.ops4j.pax.exam.CoreOptions.equinox;
import static org.ops4j.pax.exam.CoreOptions.felix;
import static org.ops4j.pax.exam.OptionUtils.combine;
@@ -52,8 +52,8 @@ public class JpaBlueprintRouteTest exten
mock.expectedMessageCount(1);
ProducerTemplate template = ctx.createProducerTemplate();
- template.sendBody("direct:start", new SendEmail(1L,"someone@somewhere.org"));
- template.sendBody("direct:start", new SendEmail(2L,"someoneelse@somewhere.org"));
+ template.sendBody("direct:start", new SendEmail(1L, "someone@somewhere.org"));
+ template.sendBody("direct:start", new SendEmail(2L, "someoneelse@somewhere.org"));
assertMockEndpointsSatisfied();
}
Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaRouteTest.java?rev=1172565&r1=1172564&r2=1172565&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaRouteTest.java (original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaRouteTest.java Mon Sep 19 10:55:28 2011
@@ -16,6 +16,10 @@
*/
package org.apache.camel.itest.osgi.jpa;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+
import org.apache.camel.CamelContext;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport;
@@ -41,10 +45,6 @@ import org.springframework.transaction.T
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-
import static org.ops4j.pax.exam.CoreOptions.equinox;
import static org.ops4j.pax.exam.CoreOptions.felix;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
@@ -68,7 +68,7 @@ public class JpaRouteTest extends OSGiIn
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(1);
- template.sendBody("direct:start", new SendEmail(1L,"someone@somewhere.org"));
+ template.sendBody("direct:start", new SendEmail(1L, "someone@somewhere.org"));
assertMockEndpointsSatisfied();
assertEntityInDB();
Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/SendEmail.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/SendEmail.java?rev=1172565&r1=1172564&r2=1172565&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/SendEmail.java (original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/SendEmail.java Mon Sep 19 10:55:28 2011
@@ -34,7 +34,7 @@ public class SendEmail {
public SendEmail() {
}
- public SendEmail(Long id,String address) {
+ public SendEmail(Long id, String address) {
setId(id);
setAddress(address);
}