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 2009/09/23 17:49:44 UTC
svn commit: r818146 - in /camel/trunk:
camel-core/src/main/java/org/apache/camel/util/
camel-core/src/test/java/org/apache/camel/
camel-core/src/test/java/org/apache/camel/component/browse/
camel-core/src/test/java/org/apache/camel/util/ components/cam...
Author: davsclaus
Date: Wed Sep 23 15:49:43 2009
New Revision: 818146
URL: http://svn.apache.org/viewvc?rev=818146&view=rev
Log:
Added more unit tests. Removed stuff not used or needed.
Added:
camel/trunk/camel-core/src/test/java/org/apache/camel/util/DefaultTimeoutMapTest.java (with props)
camel/trunk/camel-core/src/test/java/org/apache/camel/util/KeyValueHolderTest.java (with props)
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/util/CamelContextHelper.java
camel/trunk/camel-core/src/main/java/org/apache/camel/util/DefaultTimeoutMap.java
camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
camel/trunk/camel-core/src/main/java/org/apache/camel/util/URISupport.java
camel/trunk/camel-core/src/test/java/org/apache/camel/ContextTestSupport.java
camel/trunk/camel-core/src/test/java/org/apache/camel/component/browse/BrowseTest.java
camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java
camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/TestSupport.java
camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/CamelContextHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/CamelContextHelper.java?rev=818146&r1=818145&r2=818146&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/CamelContextHelper.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/CamelContextHelper.java Wed Sep 23 15:49:43 2009
@@ -67,45 +67,6 @@
}
/**
- * Returns a list of all endpoints of the given type
- *
- * @param camelContext the camel context
- * @param type the type of the endpoints requested
- * @return a list which may be empty of all the endpoint instances of the
- * given type
- */
- public <T> List<T> getEndpoints(CamelContext camelContext, Class<T> type) {
- return getEndpointsImpl(camelContext, type, false);
- }
-
- /**
- * Returns a list of all singleton endpoints of the given type
- *
- * @param camelContext the camel context
- * @param type the type of the endpoints requested
- * @return a list which may be empty of all the endpoint instances of the
- * given type
- */
- public static <T> List<T> getSingletonEndpoints(CamelContext camelContext, Class<T> type) {
- return getEndpointsImpl(camelContext, type, true);
- }
-
- /**
- * Returns a list of all singleton or regular endpoints of the given type
- */
- private static <T> List<T> getEndpointsImpl(CamelContext camelContext, Class<T> type, boolean singleton) {
- List<T> answer = new ArrayList<T>();
- Collection<Endpoint> endpoints = singleton ? camelContext.getSingletonEndpoints() : camelContext.getEndpoints();
- for (Endpoint endpoint : endpoints) {
- if (type.isInstance(endpoint)) {
- T value = type.cast(endpoint);
- answer.add(value);
- }
- }
- return answer;
- }
-
- /**
* Converts the given value to the requested type
*/
public static <T> T convertTo(CamelContext context, Class<T> type, Object value) {
@@ -170,35 +131,6 @@
}
/**
- * Resolves the given language name into a {@link Language} or throws an exception if it could not be converted
- */
- public static Language resolveMandatoryLanguage(CamelContext camelContext, String languageName) {
- notNull(camelContext, "camelContext");
- notNull(languageName, "languageName");
-
- Language language = camelContext.resolveLanguage(languageName);
- if (language == null) {
- throw new IllegalArgumentException("Could not resolve language: " + languageName);
- }
- return language;
- }
-
- /**
- * Resolves the mandatory language name and expression text into a {@link Expression} instance
- * throwing an exception if it could not be created
- */
- public static Expression resolveMandatoryExpression(CamelContext camelContext, String languageName, String expressionText) {
- notNull(expressionText, "expressionText");
-
- Language language = resolveMandatoryLanguage(camelContext, languageName);
- Expression expression = language.createExpression(expressionText);
- if (expression == null) {
- throw new IllegalArgumentException("Could not create expression: " + expressionText + " with language: " + language);
- }
- return expression;
- }
-
- /**
* Evaluates the @EndpointInject annotation using the given context
*/
public static Endpoint getEndpointInjection(CamelContext camelContext, String uri, String name, String injectionPointName, boolean mandatory) {
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/DefaultTimeoutMap.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/DefaultTimeoutMap.java?rev=818146&r1=818145&r2=818146&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/DefaultTimeoutMap.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/DefaultTimeoutMap.java Wed Sep 23 15:49:43 2009
@@ -139,28 +139,15 @@
// Properties
// -------------------------------------------------------------------------
+
public long getPurgePollTime() {
return purgePollTime;
}
- /**
- * Sets the next purge poll time in milliseconds
- */
- public void setPurgePollTime(long purgePollTime) {
- this.purgePollTime = purgePollTime;
- }
-
public ScheduledExecutorService getExecutor() {
return executor;
}
- /**
- * Sets the executor used to schedule purge events of inactive requests
- */
- public void setExecutor(ScheduledExecutorService executor) {
- this.executor = executor;
- }
-
// Implementation methods
// -------------------------------------------------------------------------
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java?rev=818146&r1=818145&r2=818146&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java Wed Sep 23 15:49:43 2009
@@ -50,26 +50,6 @@
private IntrospectionSupport() {
}
- /**
- * Copies the properties from the source to the target
- * @param source source object
- * @param target target object
- * @param optionPrefix optional option preifx (can be null)
- * @return true if properties is copied, false if something went wrong
- */
- public static boolean copyProperties(Object source, Object target, String optionPrefix) {
- Map properties = new LinkedHashMap();
- if (!getProperties(source, properties, optionPrefix)) {
- return false;
- }
- try {
- return setProperties(target, properties, optionPrefix);
- } catch (Exception e) {
- LOG.debug("Cannot copy properties to target: " + target, e);
- return false;
- }
- }
-
@SuppressWarnings("unchecked")
public static boolean getProperties(Object target, Map properties, String optionPrefix) {
ObjectHelper.notNull(target, "target");
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/URISupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/URISupport.java?rev=818146&r1=818145&r2=818146&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/URISupport.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/URISupport.java Wed Sep 23 15:49:43 2009
@@ -40,78 +40,6 @@
// Helper class
}
- /**
- * Holder to get parts of the URI.
- */
- public static class CompositeData {
- public String host;
-
- String scheme;
- String path;
- URI components[];
- Map parameters;
- String fragment;
-
- public URI[] getComponents() {
- return components;
- }
-
- public String getFragment() {
- return fragment;
- }
-
- public Map getParameters() {
- return parameters;
- }
-
- public String getScheme() {
- return scheme;
- }
-
- public String getPath() {
- return path;
- }
-
- public String getHost() {
- return host;
- }
-
- public URI toURI() throws URISyntaxException {
- StringBuffer sb = new StringBuffer();
- if (scheme != null) {
- sb.append(scheme);
- sb.append(':');
- }
-
- if (host != null && host.length() != 0) {
- sb.append(host);
- } else {
- sb.append('(');
- for (int i = 0; i < components.length; i++) {
- if (i != 0) {
- sb.append(',');
- }
- sb.append(components[i].toString());
- }
- sb.append(')');
- }
-
- if (path != null) {
- sb.append('/');
- sb.append(path);
- }
- if (!parameters.isEmpty()) {
- sb.append("?");
- sb.append(createQueryString(parameters));
- }
- if (fragment != null) {
- sb.append("#");
- sb.append(fragment);
- }
- return new URI(sb.toString());
- }
- }
-
@SuppressWarnings("unchecked")
public static Map parseQuery(String uri) throws URISyntaxException {
try {
@@ -155,13 +83,6 @@
}
/**
- * Removes any URI query from the given uri
- */
- public static URI removeQuery(URI uri) throws URISyntaxException {
- return createURIWithQuery(uri, null);
- }
-
- /**
* Creates a URI with the given query
*/
public static URI createURIWithQuery(URI uri, String query) throws URISyntaxException {
@@ -169,99 +90,6 @@
query, uri.getFragment());
}
- public static CompositeData parseComposite(URI uri) throws URISyntaxException {
-
- CompositeData rc = new CompositeData();
- rc.scheme = uri.getScheme();
- String ssp = stripPrefix(uri.getSchemeSpecificPart().trim(), "//").trim();
-
- parseComposite(uri, rc, ssp);
-
- rc.fragment = uri.getFragment();
- return rc;
- }
-
- private static void parseComposite(URI uri, CompositeData rc, String ssp) throws URISyntaxException {
- String componentString;
- String params;
-
- if (!checkParenthesis(ssp)) {
- throw new URISyntaxException(uri.toString(), "Not a matching number of '(' and ')' parenthesis");
- }
-
- int p;
- int intialParen = ssp.indexOf('(');
- if (intialParen == 0) {
- rc.host = ssp.substring(0, intialParen);
- p = rc.host.indexOf("/");
- if (p >= 0) {
- rc.path = rc.host.substring(p);
- rc.host = rc.host.substring(0, p);
- }
- p = ssp.lastIndexOf(')');
- componentString = ssp.substring(intialParen + 1, p);
- params = ssp.substring(p + 1).trim();
- } else {
- componentString = ssp;
- params = "";
- }
-
- String components[] = splitComponents(componentString);
- rc.components = new URI[components.length];
- for (int i = 0; i < components.length; i++) {
- rc.components[i] = new URI(components[i].trim());
- }
-
- p = params.indexOf('?');
- if (p >= 0) {
- if (p > 0) {
- rc.path = stripPrefix(params.substring(0, p), "/");
- }
- rc.parameters = parseQuery(params.substring(p + 1));
- } else {
- if (params.length() > 0) {
- rc.path = stripPrefix(params, "/");
- }
- rc.parameters = Collections.EMPTY_MAP;
- }
- }
-
- @SuppressWarnings("unchecked")
- private static String[] splitComponents(String str) {
- ArrayList l = new ArrayList();
-
- int last = 0;
- int depth = 0;
- char chars[] = str.toCharArray();
- for (int i = 0; i < chars.length; i++) {
- switch (chars[i]) {
- case '(':
- depth++;
- break;
- case ')':
- depth--;
- break;
- case ',':
- if (depth == 0) {
- String s = str.substring(last, i);
- l.add(s);
- last = i + 1;
- }
- break;
- default:
- }
- }
-
- String s = str.substring(last);
- if (s.length() != 0) {
- l.add(s);
- }
-
- String rc[] = new String[l.size()];
- l.toArray(rc);
- return rc;
- }
-
public static String stripPrefix(String value, String prefix) {
if (value.startsWith(prefix)) {
return value.substring(prefix.length());
@@ -269,10 +97,6 @@
return value;
}
- public static URI stripScheme(URI uri) throws URISyntaxException {
- return new URI(stripPrefix(uri.getSchemeSpecificPart().trim(), "//"));
- }
-
public static String createQueryString(Map options) throws URISyntaxException {
try {
if (options.size() > 0) {
@@ -307,6 +131,8 @@
/**
* Creates a URI from the original URI and the remaining parameters
+ * <p/>
+ * Used by various Camel components
*/
public static URI createRemainingURI(URI originalURI, Map params) throws URISyntaxException {
String s = createQueryString(params);
@@ -316,32 +142,6 @@
return createURIWithQuery(originalURI, s);
}
- public static URI changeScheme(URI bindAddr, String scheme) throws URISyntaxException {
- return new URI(scheme, bindAddr.getUserInfo(), bindAddr.getHost(), bindAddr.getPort(), bindAddr
- .getPath(), bindAddr.getQuery(), bindAddr.getFragment());
- }
-
- public static boolean checkParenthesis(String str) {
- boolean result = true;
- if (str != null) {
- int open = 0;
- int closed = 0;
-
- int i = 0;
- while ((i = str.indexOf('(', i)) >= 0) {
- i++;
- open++;
- }
- i = 0;
- while ((i = str.indexOf(')', i)) >= 0) {
- i++;
- closed++;
- }
- result = open == closed;
- }
- return result;
- }
-
/**
* Normalizes the uri by reordering the parameters so they are sorted and thus
* we can use the uris for endpoint matching.
Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/ContextTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/ContextTestSupport.java?rev=818146&r1=818145&r2=818146&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/ContextTestSupport.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/ContextTestSupport.java Wed Sep 23 15:49:43 2009
@@ -291,10 +291,6 @@
assertNotNull("No context found!", context);
}
- protected <T> List<T> getSingletonEndpoints(Class<T> type) {
- return CamelContextHelper.getSingletonEndpoints(context, type);
- }
-
protected <T extends Endpoint> T getMandatoryEndpoint(String uri, Class<T> type) {
T endpoint = context.getEndpoint(uri, type);
assertNotNull("No endpoint found for uri: " + uri, endpoint);
Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/browse/BrowseTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/browse/BrowseTest.java?rev=818146&r1=818145&r2=818146&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/browse/BrowseTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/browse/BrowseTest.java Wed Sep 23 15:49:43 2009
@@ -16,13 +16,13 @@
*/
package org.apache.camel.component.browse;
+import java.util.Collection;
import java.util.List;
import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.spi.BrowsableEndpoint;
-import org.apache.camel.util.CamelContextHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -39,13 +39,14 @@
template.sendBody("browse:foo", body1);
template.sendBody("browse:foo", body2);
- List<BrowsableEndpoint> list = CamelContextHelper.getSingletonEndpoints(context, BrowsableEndpoint.class);
+ Collection<Endpoint> list = context.getEndpoints();
assertEquals("number of endpoints", 2, list.size());
Thread.sleep(2000);
- for (BrowsableEndpoint endpoint : list) {
- List<Exchange> exchanges = endpoint.getExchanges();
+ for (Endpoint endpoint : list) {
+
+ List<Exchange> exchanges = ((BrowseEndpoint) endpoint).getExchanges();
LOG.debug(">>>> " + endpoint + " has: " + exchanges);
Added: camel/trunk/camel-core/src/test/java/org/apache/camel/util/DefaultTimeoutMapTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/util/DefaultTimeoutMapTest.java?rev=818146&view=auto
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/util/DefaultTimeoutMapTest.java (added)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/util/DefaultTimeoutMapTest.java Wed Sep 23 15:49:43 2009
@@ -0,0 +1,121 @@
+/**
+ * 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.util;
+
+import java.util.concurrent.ScheduledExecutorService;
+
+import junit.framework.TestCase;
+import org.apache.camel.util.concurrent.ExecutorServiceHelper;
+
+/**
+ * @version $Revision$
+ */
+public class DefaultTimeoutMapTest extends TestCase {
+
+ public void testDefaultTimeoutMap() {
+ DefaultTimeoutMap map = new DefaultTimeoutMap();
+ assertTrue(map.currentTime() > 0);
+
+ assertEquals(0, map.size());
+ }
+
+ public void testDefaultTimeoutMapPurge() throws Exception {
+ DefaultTimeoutMap map = new DefaultTimeoutMap();
+ assertTrue(map.currentTime() > 0);
+
+ assertEquals(0, map.size());
+
+ map.put("A", 123, 500);
+ assertEquals(1, map.size());
+
+ Thread.sleep(2000);
+
+ // will purge and remove old entries
+ map.purge();
+
+ assertEquals(0, map.size());
+ }
+
+ public void testDefaultTimeoutMapGetPurge() throws Exception {
+ DefaultTimeoutMap map = new DefaultTimeoutMap();
+ assertTrue(map.currentTime() > 0);
+
+ assertEquals(0, map.size());
+
+ map.put("A", 123, 500);
+ assertEquals(1, map.size());
+
+ Thread.sleep(2000);
+
+ assertEquals(123, map.get("A"));
+
+ // will purge and remove old entries
+ map.purge();
+
+ // but we just used get to get it so its refreshed
+ assertEquals(1, map.size());
+ }
+
+ public void testDefaultTimeoutMapGetRemove() throws Exception {
+ DefaultTimeoutMap map = new DefaultTimeoutMap();
+ assertTrue(map.currentTime() > 0);
+
+ assertEquals(0, map.size());
+
+ map.put("A", 123, 500);
+ assertEquals(1, map.size());
+
+ assertEquals(123, map.get("A"));
+
+ map.remove("A");
+ assertEquals(null, map.get("A"));
+ assertEquals(0, map.size());
+ }
+
+ public void testDefaultTimeoutMapGetKeys() throws Exception {
+ DefaultTimeoutMap map = new DefaultTimeoutMap();
+ assertTrue(map.currentTime() > 0);
+
+ assertEquals(0, map.size());
+
+ map.put("A", 123, 500);
+ map.put("B", 456, 500);
+ assertEquals(2, map.size());
+
+ Object[] keys = map.getKeys();
+ assertNotNull(keys);
+ assertEquals(2, keys.length);
+ }
+
+ public void testExecutor() throws Exception {
+ ScheduledExecutorService e = ExecutorServiceHelper.newScheduledThreadPool(1, "foo", true);
+
+ DefaultTimeoutMap map = new DefaultTimeoutMap(e, 500);
+ assertEquals(500, map.getPurgePollTime());
+
+ map.put("A", 123, 1000);
+ assertEquals(1, map.size());
+
+ Thread.sleep(2000);
+
+ // should be gone now
+ assertEquals(0, map.size());
+
+ assertSame(e, map.getExecutor());
+ }
+
+}
Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/util/DefaultTimeoutMapTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/util/DefaultTimeoutMapTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/camel-core/src/test/java/org/apache/camel/util/KeyValueHolderTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/util/KeyValueHolderTest.java?rev=818146&view=auto
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/util/KeyValueHolderTest.java (added)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/util/KeyValueHolderTest.java Wed Sep 23 15:49:43 2009
@@ -0,0 +1,43 @@
+/**
+ * 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.util;
+
+import junit.framework.TestCase;
+
+/**
+ * @version $Revision$
+ */
+public class KeyValueHolderTest extends TestCase {
+
+ @SuppressWarnings("unchecked")
+ public void testKeyValueHolder() {
+ KeyValueHolder foo = new KeyValueHolder("foo", 123);
+
+ assertEquals("foo", foo.getKey());
+ assertEquals(123, foo.getValue());
+
+ KeyValueHolder bar = new KeyValueHolder("bar", 456);
+
+ assertFalse("Should not be equals", foo.equals(bar));
+
+ KeyValueHolder bar2 = new KeyValueHolder("bar", 456);
+ assertTrue("Should be equals", bar.equals(bar2));
+
+ assertEquals("foo -> 123", foo.toString());
+ }
+
+}
Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/util/KeyValueHolderTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/util/KeyValueHolderTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java?rev=818146&r1=818145&r2=818146&view=diff
==============================================================================
--- camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java (original)
+++ camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/CamelTestSupport.java Wed Sep 23 15:49:43 2009
@@ -326,10 +326,6 @@
assertNotNull("No context found!", context);
}
- protected <T> List<T> getSingletonEndpoints(Class<T> type) {
- return CamelContextHelper.getSingletonEndpoints(context, type);
- }
-
protected <T extends Endpoint> T getMandatoryEndpoint(String uri, Class<T> type) {
T endpoint = context.getEndpoint(uri, type);
assertNotNull("No endpoint found for uri: " + uri, endpoint);
Modified: camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/TestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/TestSupport.java?rev=818146&r1=818145&r2=818146&view=diff
==============================================================================
--- camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/TestSupport.java (original)
+++ camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/TestSupport.java Wed Sep 23 15:49:43 2009
@@ -141,7 +141,7 @@
public static void assertEndpointUri(Endpoint endpoint, String uri) {
assertNotNull("Endpoint is null when expecting endpoint for: " + uri, endpoint);
- assertEquals("Endoint uri for: " + endpoint, uri, endpoint.getEndpointUri());
+ assertEquals("Endpoint uri for: " + endpoint, uri, endpoint.getEndpointUri());
}
/**
Modified: camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java?rev=818146&r1=818145&r2=818146&view=diff
==============================================================================
--- camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java (original)
+++ camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java Wed Sep 23 15:49:43 2009
@@ -325,10 +325,6 @@
assertNotNull("No context found!", context);
}
- protected <T> List<T> getSingletonEndpoints(Class<T> type) {
- return CamelContextHelper.getSingletonEndpoints(context, type);
- }
-
protected <T extends Endpoint> T getMandatoryEndpoint(String uri, Class<T> type) {
T endpoint = context.getEndpoint(uri, type);
assertNotNull("No endpoint found for uri: " + uri, endpoint);