camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bvah...@apache.org
Subject svn commit: r1366129 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/component/bean/ camel-core/src/test/java/org/apache/camel/builder/ camel-core/src/test/java/org/apache/camel/converter/ camel-core/src/test/java/org/apache/camel/processo...
Date Thu, 26 Jul 2012 18:25:10 GMT
Author: bvahdat
Date: Thu Jul 26 18:25:10 2012
New Revision: 1366129

URL: http://svn.apache.org/viewvc?rev=1366129&view=rev
Log:
Removed the obsolete usage of the CastUtils.cast(Map<?, ?> p) utility.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfoCache.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExpressionBuilderTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanMethodHeartbeatTest.java
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/CharsetTest.java
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedTest.java
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithNoDescriptorTest.java
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithUnmarshalTest.java
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.java
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthWithUnmarshalTest.java
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackDelimitedDataFormatTest.java
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthDataFormatTest.java
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthWithHeaderAndTrailerDataFormatTest.java
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java
    camel/trunk/components/camel-testng/src/main/java/org/apache/camel/testng/CamelSpringTestSupport.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfoCache.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfoCache.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfoCache.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfoCache.java
Thu Jul 26 18:25:10 2012
@@ -20,7 +20,6 @@ import java.lang.reflect.Method;
 import java.util.Map;
 
 import org.apache.camel.CamelContext;
-import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.LRUSoftCache;
 
 /**
@@ -76,16 +75,16 @@ public class MethodInfoCache {
         return new BeanInfo(camelContext, declaringClass);
     }
 
-    protected static Map<Object, Object> createLruCache(int size) {
+    protected static <K, V> Map<K, V> createLruCache(int size) {
         // use a soft cache
-        return new LRUSoftCache<Object, Object>(size);
+        return new LRUSoftCache<K, V>(size);
     }
 
     private static Map<Class<?>, BeanInfo> createClassCache(int size) {
-        return CastUtils.cast(createLruCache(size));
+        return createLruCache(size);
     }
 
     private static Map<Method, MethodInfo> createMethodCache(int size) {
-        return CastUtils.cast(createLruCache(size));
+        return createLruCache(size);
     }
 }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExpressionBuilderTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExpressionBuilderTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExpressionBuilderTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExpressionBuilderTest.java
Thu Jul 26 18:25:10 2012
@@ -30,7 +30,6 @@ import org.apache.camel.Predicate;
 import org.apache.camel.TestSupport;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.impl.DefaultExchange;
-import org.apache.camel.util.CastUtils;
 
 import static org.apache.camel.builder.ExpressionBuilder.*;
 import static org.apache.camel.builder.PredicateBuilder.contains;
@@ -101,7 +100,7 @@ public class ExpressionBuilderTest exten
         Expression expression = camelContextPropertyExpression("CamelTestKey");
         assertExpression(expression, exchange, "CamelTestValue");        
         expression = camelContextPropertiesExpression();
-        Map<String, String> properties = CastUtils.cast(expression.evaluate(exchange,
Map.class));
+        Map<?, ?> properties = expression.evaluate(exchange, Map.class);
         assertEquals("Get a wrong properties size", properties.size(), 1);
     }
 

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/converter/ConverterTest.java Thu
Jul 26 18:25:10 2012
@@ -38,7 +38,6 @@ import org.apache.camel.impl.DefaultExch
 import org.apache.camel.impl.DefaultFactoryFinderResolver;
 import org.apache.camel.impl.DefaultPackageScanClassResolver;
 import org.apache.camel.impl.converter.DefaultTypeConverter;
-import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ReflectionInjector;
 import org.apache.camel.util.ServiceHelper;
@@ -111,15 +110,15 @@ public class ConverterTest extends TestC
     public void testArrayToListAndSetConversion() throws Exception {
         String[] array = new String[]{"one", "two"};
 
-        List<String> list = CastUtils.cast(converter.convertTo(List.class, array));
+        List<?> list = converter.convertTo(List.class, array);
         assertEquals("List size: " + list, 2, list.size());
 
-        Collection<String> collection = CastUtils.cast(converter.convertTo(Collection.class,
array));
+        Collection<?> collection = converter.convertTo(Collection.class, array);
         assertEquals("Collection size: " + collection, 2, collection.size());
 
-        Set<String> set = CastUtils.cast(converter.convertTo(Set.class, array));
+        Set<?> set = converter.convertTo(Set.class, array);
         assertEquals("Set size: " + set, 2, set.size());
-        set = CastUtils.cast(converter.convertTo(Set.class, list));
+        set = converter.convertTo(Set.class, list);
         assertEquals("Set size: " + set, 2, set.size());
     }
 
@@ -152,7 +151,7 @@ public class ConverterTest extends TestC
         assertEquals("long[] length", 2, longArray.length);
 
         // now lets go back to a List again
-        List<Integer> resultList = CastUtils.cast(converter.convertTo(List.class, intArray));
+        List<?> resultList = converter.convertTo(List.class, intArray);
         assertEquals("List size", 2, resultList.size());
         LOG.debug("From primitive type array we've created the list: " + resultList);
     }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanMethodHeartbeatTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanMethodHeartbeatTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanMethodHeartbeatTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanMethodHeartbeatTest.java
Thu Jul 26 18:25:10 2012
@@ -28,7 +28,6 @@ import org.apache.camel.ContextTestSuppo
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.util.CastUtils;
 
 /**
  * This test shows we can poll a bean for a method and send the POJO over some transport
@@ -50,7 +49,7 @@ public class BeanMethodHeartbeatTest ext
         Exchange exchange = list.get(0);
         log.debug("In: " + exchange.getIn());
         log.debug("Out: " + exchange.getOut());
-        Map<String, Object> map = CastUtils.cast(assertIsInstanceOf(Map.class, exchange.getIn().getBody()));
+        Map<?, ?> map = assertIsInstanceOf(Map.class, exchange.getIn().getBody());
         log.debug("Received: " + map);
     }
 

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/CharsetTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/CharsetTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/CharsetTest.java
(original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/CharsetTest.java
Thu Jul 26 18:25:10 2012
@@ -23,7 +23,6 @@ import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -56,7 +55,7 @@ public class CharsetTest extends Abstrac
         List<Exchange> list = results.getReceivedExchanges();
         for (Exchange exchange : list) {
             Message in = exchange.getIn();
-            Map<String, String> body = CastUtils.cast(in.getBody(Map.class));
+            Map<?, ?> body = in.getBody(Map.class);
             assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()),
body);
             assertEquals("ITEM_DESC", expectedItemDesc[counter], body.get("ITEM_DESC"));
             LOG.info("Result: " + counter + " = " + body);

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedTest.java
(original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedTest.java
Thu Jul 26 18:25:10 2012
@@ -23,7 +23,6 @@ import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -56,7 +55,7 @@ public class DelimitedTest extends Abstr
         List<Exchange> list = results.getReceivedExchanges();
         for (Exchange exchange : list) {
             Message in = exchange.getIn();
-            Map<String, String> body = CastUtils.cast(in.getBody(Map.class));
+            Map<?, ?> body = in.getBody(Map.class);
             assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()),
body);
             assertEquals("ITEM_DESC", expectedItemDesc[counter], body.get("ITEM_DESC"));
             LOG.info("Result: " + counter + " = " + body);

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithNoDescriptorTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithNoDescriptorTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithNoDescriptorTest.java
(original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithNoDescriptorTest.java
Thu Jul 26 18:25:10 2012
@@ -23,7 +23,6 @@ import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -55,7 +54,7 @@ public class DelimitedWithNoDescriptorTe
         List<Exchange> list = results.getReceivedExchanges();
         for (Exchange exchange : list) {
             Message in = exchange.getIn();
-            Map<String, String> body = CastUtils.cast(in.getBody(Map.class));
+            Map<?, ?> body = in.getBody(Map.class);
             assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()),
body);
             assertEquals("NAME", expectedItemDesc[counter], body.get("NAME"));
             LOG.info("Result: " + counter + " = " + body);

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithUnmarshalTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithUnmarshalTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithUnmarshalTest.java
(original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithUnmarshalTest.java
Thu Jul 26 18:25:10 2012
@@ -23,7 +23,6 @@ import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -56,7 +55,7 @@ public class DelimitedWithUnmarshalTest 
         List<Exchange> list = results.getReceivedExchanges();
         for (Exchange exchange : list) {
             Message in = exchange.getIn();
-            Map<String, String> body = CastUtils.cast(in.getBody(Map.class));
+            Map<?, ?> body = in.getBody(Map.class);
             assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()),
body);
             assertEquals("ITEM_DESC result(" + counter + ")", expectedItemDesc[counter],
body.get("ITEM_DESC"));
             LOG.info("Result: " + counter + " = " + body);

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java
(original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java
Thu Jul 26 18:25:10 2012
@@ -23,7 +23,6 @@ import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -56,7 +55,7 @@ public class FixedLengthAllowLongTest ex
         for (Exchange exchange : list) {
             Message in = exchange.getIn();
             assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter);
-            Map<String, String> body = CastUtils.cast(in.getBody(Map.class));
+            Map<?, ?> body = in.getBody(Map.class);
             assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()),
body);
             assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME"));
             LOG.info("Result: " + counter + " = " + body);

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java
(original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java
Thu Jul 26 18:25:10 2012
@@ -23,7 +23,6 @@ import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -56,7 +55,7 @@ public class FixedLengthAllowShortAndLon
         for (Exchange exchange : list) {
             Message in = exchange.getIn();
             assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter);
-            Map<String, String> body = CastUtils.cast(in.getBody(Map.class));
+            Map<?, ?> body = in.getBody(Map.class);
             assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()),
body);
             assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME"));
             LOG.info("Result: " + counter + " = " + body);

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java
(original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java
Thu Jul 26 18:25:10 2012
@@ -23,7 +23,6 @@ import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -56,7 +55,7 @@ public class FixedLengthAllowShortTest e
         for (Exchange exchange : list) {
             Message in = exchange.getIn();
             assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter);
-            Map<String, String> body = CastUtils.cast(in.getBody(Map.class));
+            Map<?, ?> body = in.getBody(Map.class);
             assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()),
body);
             assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME"));
             LOG.info("Result: " + counter + " = " + body);

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.java
(original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.java
Thu Jul 26 18:25:10 2012
@@ -23,7 +23,6 @@ import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -55,7 +54,7 @@ public class FixedLengthTest extends Abs
         for (Exchange exchange : list) {
             Message in = exchange.getIn();
             assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter);
-            Map<String, String> body = CastUtils.cast(in.getBody(Map.class));
+            Map<?, ?> body = in.getBody(Map.class);
             assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()),
body);
             assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME"));
             LOG.info("Result: " + counter + " = " + body);

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthWithUnmarshalTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthWithUnmarshalTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthWithUnmarshalTest.java
(original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthWithUnmarshalTest.java
Thu Jul 26 18:25:10 2012
@@ -23,7 +23,6 @@ import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -54,7 +53,7 @@ public class FixedLengthWithUnmarshalTes
         List<Exchange> list = results.getReceivedExchanges();
         for (Exchange exchange : list) {
             Message in = exchange.getIn();
-            Map<String, String> body = CastUtils.cast(in.getBody(Map.class));
+            Map<?, ?> body = in.getBody(Map.class);
             assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()),
body);
             assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME"));
             LOG.info("Result: " + counter + " = " + body);

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackDelimitedDataFormatTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackDelimitedDataFormatTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackDelimitedDataFormatTest.java
(original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackDelimitedDataFormatTest.java
Thu Jul 26 18:25:10 2012
@@ -26,7 +26,6 @@ import org.apache.camel.builder.RouteBui
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.converter.IOConverter;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.apache.camel.util.CastUtils;
 import org.junit.Test;
 
 /**
@@ -48,7 +47,7 @@ public class FlatpackDelimitedDataFormat
 
         DataSetList list = mock.getExchanges().get(0).getIn().getBody(DataSetList.class);
         assertEquals(4, list.size());
-        Map<String, String> row = CastUtils.cast(list.get(0));
+        Map<?, ?> row = list.get(0);
         assertEquals("SOME VALVE", row.get("ITEM_DESC"));
     }
 

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthDataFormatTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthDataFormatTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthDataFormatTest.java
(original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthDataFormatTest.java
Thu Jul 26 18:25:10 2012
@@ -26,7 +26,6 @@ import org.apache.camel.builder.RouteBui
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.converter.IOConverter;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.apache.camel.util.CastUtils;
 import org.junit.Test;
 
 /**
@@ -48,7 +47,7 @@ public class FlatpackFixedLengthDataForm
 
         DataSetList list = mock.getExchanges().get(0).getIn().getBody(DataSetList.class);
         assertEquals(4, list.size());
-        Map<String, String> row = CastUtils.cast(list.get(0));
+        Map<?, ?> row = list.get(0);
         assertEquals("JOHN", row.get("FIRSTNAME"));
     }
 

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthWithHeaderAndTrailerDataFormatTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthWithHeaderAndTrailerDataFormatTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthWithHeaderAndTrailerDataFormatTest.java
(original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FlatpackFixedLengthWithHeaderAndTrailerDataFormatTest.java
Thu Jul 26 18:25:10 2012
@@ -23,7 +23,6 @@ import org.apache.camel.builder.RouteBui
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.converter.IOConverter;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.apache.camel.util.CastUtils;
 import org.junit.Test;
 
 /**
@@ -49,16 +48,16 @@ public class FlatpackFixedLengthWithHead
         assertEquals(6, list.size());
 
         // assert header
-        Map<String, String> header = CastUtils.cast(list.get(0));
+        Map<?, ?> header = list.get(0);
         assertEquals("HBT", header.get("INDICATOR"));
         assertEquals("20080817", header.get("DATE"));
 
         // assert data
-        Map<String, String> row = CastUtils.cast(list.get(1));
+        Map<?, ?> row = list.get(1);
         assertEquals("JOHN", row.get("FIRSTNAME"));
 
         // assert trailer
-        Map<String, String> trailer = CastUtils.cast(list.get(5));
+        Map<?, ?> trailer = list.get(5);
         assertEquals("FBT", trailer.get("INDICATOR"));
         assertEquals("SUCCESS", trailer.get("STATUS"));
     }

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java
(original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java
Thu Jul 26 18:25:10 2012
@@ -23,7 +23,6 @@ import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -55,14 +54,14 @@ public class HeaderAndTrailerTest extend
         List<Exchange> list = results.getReceivedExchanges();
 
         // assert header
-        Map<String, String> header = CastUtils.cast(list.get(0).getIn().getBody(Map.class));
+        Map<?, ?> header = list.get(0).getIn().getBody(Map.class);
         assertEquals("HBT", header.get("INDICATOR"));
         assertEquals("20080817", header.get("DATE"));
 
         // assert body
         for (Exchange exchange : list.subList(1, 5)) {
             Message in = exchange.getIn();
-            Map<String, String> body = CastUtils.cast(in.getBody(Map.class));
+            Map<?, ?> body = in.getBody(Map.class);
             assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()),
body);
             assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME"));
             LOG.info("Result: " + counter + " = " + body);
@@ -70,7 +69,7 @@ public class HeaderAndTrailerTest extend
         }
 
         // assert trailer
-        Map<String, String> trailer = CastUtils.cast(list.get(5).getIn().getBody(Map.class));
+        Map<?, ?> trailer = list.get(5).getIn().getBody(Map.class);
         assertEquals("FBT", trailer.get("INDICATOR"));
         assertEquals("SUCCESS", trailer.get("STATUS"));
     }

Modified: camel/trunk/components/camel-testng/src/main/java/org/apache/camel/testng/CamelSpringTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-testng/src/main/java/org/apache/camel/testng/CamelSpringTestSupport.java?rev=1366129&r1=1366128&r2=1366129&view=diff
==============================================================================
--- camel/trunk/components/camel-testng/src/main/java/org/apache/camel/testng/CamelSpringTestSupport.java
(original)
+++ camel/trunk/components/camel-testng/src/main/java/org/apache/camel/testng/CamelSpringTestSupport.java
Thu Jul 26 18:25:10 2012
@@ -24,7 +24,6 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.spring.CamelBeanPostProcessor;
 import org.apache.camel.spring.SpringCamelContext;
 import org.apache.camel.test.ExcludingPackageScanClassResolver;
-import org.apache.camel.util.CastUtils;
 import org.springframework.beans.factory.support.RootBeanDefinition;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.AbstractApplicationContext;
@@ -33,10 +32,10 @@ import org.testng.annotations.AfterClass
 import org.testng.annotations.AfterTest;
 
 public abstract class CamelSpringTestSupport extends CamelTestSupport {
-    protected static ThreadLocal<AbstractApplicationContext> threadAppContext
-        = new ThreadLocal<AbstractApplicationContext>();
+    protected static ThreadLocal<AbstractApplicationContext> threadAppContext = new
ThreadLocal<AbstractApplicationContext>();
     protected static Object lock = new Object();
     protected static AbstractApplicationContext applicationContext;
+
     protected abstract AbstractApplicationContext createApplicationContext();
 
     @Override
@@ -128,7 +127,7 @@ public abstract class CamelSpringTestSup
         routeExcludingContext.refresh();
 
         ExcludingPackageScanClassResolver excludingResolver = routeExcludingContext.getBean("excludingResolver",
ExcludingPackageScanClassResolver.class);
-        List<Class<?>> excluded = CastUtils.cast(Arrays.asList(excludeRoutes()));
+        List<Class<?>> excluded = Arrays.asList(excludeRoutes());
         excludingResolver.setExcludedClasses(new HashSet<Class<?>>(excluded));
 
         return routeExcludingContext;



Mime
View raw message