camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhira...@apache.org
Subject [24/35] git commit: Added support for creating endpoint configuration from ApiCollection, added method aliases to tests, minor refactoring
Date Tue, 10 Jun 2014 19:51:52 GMT
Added support for creating endpoint configuration from ApiCollection, added method aliases
to tests, minor refactoring


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

Branch: refs/heads/master
Commit: 5bf87ed423ec661b190792e721453248fe48984f
Parents: a056dfa
Author: Dhiraj Bokde <dhirajsb@yahoo.com>
Authored: Tue Jun 3 21:39:35 2014 -0700
Committer: Dhiraj Bokde <dhirajsb@yahoo.com>
Committed: Tue Jun 10 12:48:33 2014 -0700

----------------------------------------------------------------------
 .../camel/util/component/ApiCollection.java     | 18 ++++++-
 .../src/it/all-it/pom.xml                       | 10 ++++
 .../maven/AbstractApiMethodGeneratorMojo.java   |  7 +--
 .../camel/maven/AbstractGeneratorMojo.java      | 22 ++++++++-
 .../camel/maven/ApiComponentGeneratorMojo.java  |  6 ++-
 .../org/apache/camel/maven/ApiMethodAlias.java  | 50 ++++++++++++++++++++
 .../java/org/apache/camel/maven/ApiProxy.java   | 13 +++--
 .../src/main/resources/api-collection.vm        | 24 ++++++++--
 .../src/main/resources/api-endpoint-config.vm   |  6 +--
 .../src/main/resources/api-route-test.vm        |  4 +-
 .../src/main/resources/log4j.properties         | 36 ++++++++++++++
 .../maven/ApiComponentGeneratorMojoTest.java    |  7 ++-
 .../src/test/resources/log4j.properties         | 36 --------------
 13 files changed, 184 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java b/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
index 1183591..a1fd2b7 100644
--- a/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
+++ b/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
@@ -26,14 +26,23 @@ import java.util.Set;
  * Base class for a collection of ApiMethods. Meant to be extended by Components to create
the api name map.
  */
 @SuppressWarnings("unused")
-public abstract class ApiCollection<T extends Enum & ApiName> {
+public abstract class ApiCollection<T extends Enum & ApiName, C> {
 
     protected final Map<T, ApiMethodHelper> apis = new HashMap<T, ApiMethodHelper>();
 
+    /**
+     * Returns a {@link ApiMethodHelper} for a particular API.
+     * @param apiName name of the API
+     * @return helper class to work with {@link ApiMethod}
+     */
     public final ApiMethodHelper getHelper(T apiName) {
         return apis.get(apiName);
     }
 
+    /**
+     * Returns a list of API name strings.
+     * @return list of API names.
+     */
     public final Set<String> getApiNames() {
         final Set<String> result = new HashSet<String>();
         for (T api : apis.keySet()) {
@@ -41,4 +50,11 @@ public abstract class ApiCollection<T extends Enum & ApiName>
{
         }
         return Collections.unmodifiableSet(result);
     }
+
+    /**
+     * Creates an endpoint configuration for a particular API
+     * @param apiName name of the API.
+     * @return Endpoint configuration object for the API.
+     */
+    public abstract C getEndpointConfiguration(T apiName);
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml b/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
index 269aefc..5ebd269 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
+++ b/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
@@ -136,6 +136,16 @@
                 <api>
                   <apiName>velocity</apiName>
                   <proxyClass>org.apache.velocity.VelocityContext</proxyClass>
+                  <aliases>
+                    <alias>
+                      <methodPattern>get(.+)</methodPattern>
+                      <methodAlias>$1</methodAlias>
+                    </alias>
+                    <alias>
+                      <methodPattern>set(.+)</methodPattern>
+                      <methodAlias>$1</methodAlias>
+                    </alias>
+                  </aliases>
                 </api>
               </apis>
             </configuration>

http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
index 8b868c4..de70464 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
+++ b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
@@ -204,8 +204,9 @@ public abstract class AbstractApiMethodGeneratorMojo extends AbstractGeneratorMo
         return resultType == Void.TYPE;
     }
 
-    public String getPropertyPrefix() {
-        return componentName + ".";
+    public String getExchangePropertyPrefix() {
+        // exchange property prefix
+        return "Camel" + componentName + ".";
     }
 
     public static String getResultDeclaration(Class<?> resultType) {
@@ -240,7 +241,7 @@ public abstract class AbstractApiMethodGeneratorMojo extends AbstractGeneratorMo
         }
     }
 
-    public static String getPropertySuffix(String parameter) {
+    public static String getBeanPropertySuffix(String parameter) {
         // capitalize first character
         StringBuilder builder = new StringBuilder();
         builder.append(Character.toUpperCase(parameter.charAt(0)));

http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractGeneratorMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractGeneratorMojo.java
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractGeneratorMojo.java
index 3979745..faf0964 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractGeneratorMojo.java
+++ b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractGeneratorMojo.java
@@ -28,6 +28,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
 
+import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -49,6 +50,7 @@ public abstract class AbstractGeneratorMojo extends AbstractMojo {
     protected static final String PREFIX = "org.apache.camel.";
     protected static final String OUT_PACKAGE = PREFIX + "component.internal";
     protected static final String COMPONENT_PACKAGE = PREFIX + "component";
+    private static final String LOGGER_PREFIX = "log4j.logger";
 
     // used for velocity logging, to avoid creating velocity.log
     protected final Logger LOG = Logger.getLogger(this.getClass());
@@ -77,6 +79,24 @@ public abstract class AbstractGeneratorMojo extends AbstractMojo {
     private VelocityEngine engine;
     private ClassLoader projectClassLoader;
 
+    protected AbstractGeneratorMojo() {
+        // configure Log4J from system properties
+        for (String propertyName : System.getProperties().stringPropertyNames())
+        {
+            if (propertyName.startsWith(LOGGER_PREFIX)) {
+                String loggerName = propertyName.substring(LOGGER_PREFIX.length());
+                String levelName = System.getProperty(propertyName, "");
+                Level level = Level.toLevel(levelName); // defaults to DEBUG
+                if (!"".equals(levelName) && !levelName.toUpperCase().equals(level.toString()))
{
+                    LOG.warn("Skipping unrecognized log4j log level " + levelName + ": -D"
+ propertyName + "=" + levelName);
+                    continue;
+                }
+                LOG.debug("Setting " + loggerName + " => " + level.toString());
+                Logger.getLogger(loggerName).setLevel(level);
+            }
+        }
+    }
+
     public VelocityEngine getEngine() {
         if (engine == null) {
             // initialize velocity to load resources from class loader and use Log4J
@@ -84,7 +104,7 @@ public abstract class AbstractGeneratorMojo extends AbstractMojo {
             velocityProperties.setProperty(RuntimeConstants.RESOURCE_LOADER, "cloader");
             velocityProperties.setProperty("cloader.resource.loader.class", ClasspathResourceLoader.class.getName());
             velocityProperties.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
Log4JLogChute.class.getName());
-            velocityProperties.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM + ".log4j.logger",
LOG.getName());
+            velocityProperties.setProperty(Log4JLogChute.RUNTIME_LOG_LOG4J_LOGGER, LOG.getName());
             engine = new VelocityEngine(velocityProperties);
             engine.init();
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiComponentGeneratorMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiComponentGeneratorMojo.java
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiComponentGeneratorMojo.java
index d0d4b97..28d5e3b 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiComponentGeneratorMojo.java
+++ b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiComponentGeneratorMojo.java
@@ -52,7 +52,7 @@ public class ApiComponentGeneratorMojo extends AbstractGeneratorMojo {
     private VelocityContext getApiContext() {
         final VelocityContext context = new VelocityContext();
         context.put("componentName", componentName);
-        context.put("packageName", outPackage);
+        context.put("componentPackage", componentPackage);
         context.put("apis", apis);
         context.put("helper", getClass());
         context.put("collectionName", getApiCollectionName());
@@ -90,6 +90,10 @@ public class ApiComponentGeneratorMojo extends AbstractGeneratorMojo {
         return proxyClass.substring(proxyClass.lastIndexOf('.') + 1) + "ApiMethod";
     }
 
+    public static String getEndpointConfig(String proxyClass) {
+        return proxyClass.substring(proxyClass.lastIndexOf('.') + 1) + "EndpointConfiguration";
+    }
+
     public static String getEnumConstant(String enumValue) {
         if (enumValue == null || enumValue.isEmpty()) {
             return "DEFAULT";

http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiMethodAlias.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiMethodAlias.java
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiMethodAlias.java
new file mode 100644
index 0000000..71bb89e
--- /dev/null
+++ b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiMethodAlias.java
@@ -0,0 +1,50 @@
+/**
+ * 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.maven;
+
+/**
+ * Represents method alias
+ */
+public class ApiMethodAlias {
+
+    private String methodPattern;
+    private String methodAlias;
+
+    public ApiMethodAlias() {
+    }
+
+    public ApiMethodAlias(String methodPattern, String methodAlias) {
+        this.methodPattern = methodPattern;
+        this.methodAlias = methodAlias;
+    }
+
+    public String getMethodPattern() {
+        return methodPattern;
+    }
+
+    public void setMethodPattern(String methodPattern) {
+        this.methodPattern = methodPattern;
+    }
+
+    public String getMethodAlias() {
+        return methodAlias;
+    }
+
+    public void setMethodAlias(String methodAlias) {
+        this.methodAlias = methodAlias;
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiProxy.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiProxy.java
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiProxy.java
index b708e37..69a759b 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiProxy.java
+++ b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiProxy.java
@@ -17,7 +17,7 @@
 package org.apache.camel.maven;
 
 import java.util.Collections;
-import java.util.Map;
+import java.util.List;
 
 /**
  * Represents an API to use for generating Camel Component.
@@ -26,7 +26,7 @@ public class ApiProxy {
     private String apiName;
     private String proxyClass;
 
-    private Map<String, String> aliases = Collections.EMPTY_MAP;
+    private List<ApiMethodAlias> aliases = Collections.EMPTY_LIST;
 
     public ApiProxy() {
     }
@@ -36,6 +36,11 @@ public class ApiProxy {
         this.proxyClass = proxyClass;
     }
 
+    public ApiProxy(String apiName, String proxyClass, List<ApiMethodAlias> aliases)
{
+        this(apiName, proxyClass);
+        this.aliases = aliases;
+    }
+
     public String getApiName() {
         return apiName;
     }
@@ -52,11 +57,11 @@ public class ApiProxy {
         this.proxyClass = proxyClass;
     }
 
-    public Map<String, String> getAliases() {
+    public List<ApiMethodAlias> getAliases() {
         return aliases;
     }
 
-    public void setAliases(Map<String, String> aliases) {
+    public void setAliases(List<ApiMethodAlias> aliases) {
         this.aliases = aliases;
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm
b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm
index b7213c6..6596d16 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm
+++ b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm
@@ -24,13 +24,19 @@ package $packageName;
 import java.util.Map;
 import java.util.HashMap;
 
+#set( $componentConfig = "${componentName}Config" )
+import ${componentPackage}.${componentConfig};
+#foreach ( $api in $apis )
+import ${componentPackage}.${helper.getEndpointConfig($api.ProxyClass)};
+#end
+
 import org.apache.camel.util.component.ApiCollection;
 import org.apache.camel.util.component.ApiMethodHelper;
 
 /**
  * Camel {@link ApiCollection} for $componentName
  */
-public final class $collectionName extends ApiCollection<${apiNameEnum}> {
+public final class $collectionName extends ApiCollection<${apiNameEnum}, ${componentConfig}>
{
 
     private static $collectionName collection;
 
@@ -38,14 +44,26 @@ public final class $collectionName extends ApiCollection<${apiNameEnum}>
{
         final Map<String, String> aliases = new HashMap<String, String>();
 #foreach( $api in $apis )
         aliases.clear();
-#foreach( $alias in $api.Aliases.entrySet() )
-        aliases.put("$alias.Key", "$alias.Value");
+#foreach( $alias in $api.Aliases )
+        aliases.put("$alias.MethodPattern", "$alias.MethodAlias");
 #end
 #set( $apiMethod = $helper.getApiMethod($api.ProxyClass) )
         apis.put(${apiNameEnum}.${helper.getEnumConstant($api.ApiName)}, new ApiMethodHelper<$apiMethod>(${apiMethod}.class,
aliases));
 #end
     }
 
+    public $componentConfig getEndpointConfiguration(${apiNameEnum} apiName) {
+        $componentConfig result = null;
+        switch (apiName) {
+#foreach( $api in $apis )
+        case ${helper.getEnumConstant($api.ApiName)}:
+            result = new ${helper.getEndpointConfig($api.ProxyClass)}();
+            break;
+#end
+        }
+        return result;
+    }
+
     public static synchronized $collectionName getCollection() {
         if (collection == null) {
             collection = new $collectionName();

http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-endpoint-config.vm
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-endpoint-config.vm
b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-endpoint-config.vm
index ca44ad9..03ddd4b 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-endpoint-config.vm
+++ b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-endpoint-config.vm
@@ -34,13 +34,13 @@ public final class $configName extends ${componentName}Config {
 #foreach( $parameter in $parameters.entrySet() )
 #set ( $name = $parameter.Key )
 #set ( $type = $helper.getCanonicalName($parameter.Value) )
-#set ( $propertySuffix = $helper.getPropertySuffix($name) )
+#set ( $suffix = $helper.getBeanPropertySuffix($name) )
 
-    public $type get${propertySuffix}() {
+    public $type get${suffix}() {
         return $name;
     }
 
-    public void set${propertySuffix}($type $name) {
+    public void set${suffix}($type $name) {
         this.$name = $name;
     }
 #end

http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-route-test.vm
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-route-test.vm
b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-route-test.vm
index d12adea..f61ecc5 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-route-test.vm
+++ b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-route-test.vm
@@ -60,9 +60,9 @@ public class ${testName} extends CamelTestSupport {
 #foreach ( $arg in $args )
 #if ( !$arg.Type.isPrimitive() )
         // parameter type is $helper.getCanonicalName($arg.Type)
-        headers.put("${helper.getPropertyPrefix()}${arg.Name}", null);
+        headers.put("${helper.getExchangePropertyPrefix()}${arg.Name}", null);
 #else
-        headers.put("${helper.getPropertyPrefix()}${arg.Name}", $helper.getDefaultArgValue($arg.Type));
+        headers.put("${helper.getExchangePropertyPrefix()}${arg.Name}", $helper.getDefaultArgValue($arg.Type));
 #end
 #end
 #end

http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/tooling/maven/camel-component-util-maven-plugin/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/log4j.properties
b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/log4j.properties
new file mode 100644
index 0000000..3d544fc
--- /dev/null
+++ b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/log4j.properties
@@ -0,0 +1,36 @@
+#
+# 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.
+#
+
+#
+# The logging properties used
+#
+log4j.rootLogger=INFO, out
+
+# uncomment the following line to turn on Camel debugging
+#log4j.logger.org.apache.camel=DEBUG
+
+# CONSOLE appender not used by default
+log4j.appender.out=org.apache.log4j.ConsoleAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n
+#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+log4j.throwableRenderer=org.apache.log4j.EnhancedThrowableRenderer
+
+#log4j.logger.org.apache.camel.maven=DEBUG
+#log4j.logger.org.apache.http=DEBUG
+#log4j.logger.org.apache.camel.util.component=TRACE

http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/ApiComponentGeneratorMojoTest.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/ApiComponentGeneratorMojoTest.java
b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/ApiComponentGeneratorMojoTest.java
index 4b4e7ee..3e9400c 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/ApiComponentGeneratorMojoTest.java
+++ b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/ApiComponentGeneratorMojoTest.java
@@ -17,6 +17,8 @@
 package org.apache.camel.maven;
 
 import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.camel.component.test.TestProxy;
 import org.apache.velocity.VelocityContext;
@@ -40,7 +42,10 @@ public class ApiComponentGeneratorMojoTest extends AbstractGeneratorMojoTest
{
 
         mojo.apis = new ApiProxy[2];
         mojo.apis[0] = new ApiProxy("test", TestProxy.class.getName());
-        mojo.apis[1] = new ApiProxy("velocity", VelocityContext.class.getName());
+        List<ApiMethodAlias> aliases = new ArrayList<ApiMethodAlias>();
+        aliases.add(new ApiMethodAlias("get(.+)", "$1"));
+        aliases.add(new ApiMethodAlias("set(.+)", "$1"));
+        mojo.apis[1] = new ApiProxy("velocity", VelocityContext.class.getName(), aliases);
 
         mojo.execute();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/tooling/maven/camel-component-util-maven-plugin/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/test/resources/log4j.properties
b/tooling/maven/camel-component-util-maven-plugin/src/test/resources/log4j.properties
deleted file mode 100644
index 3d544fc..0000000
--- a/tooling/maven/camel-component-util-maven-plugin/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# 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.
-#
-
-#
-# The logging properties used
-#
-log4j.rootLogger=INFO, out
-
-# uncomment the following line to turn on Camel debugging
-#log4j.logger.org.apache.camel=DEBUG
-
-# CONSOLE appender not used by default
-log4j.appender.out=org.apache.log4j.ConsoleAppender
-log4j.appender.out.layout=org.apache.log4j.PatternLayout
-log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n
-#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
-
-log4j.throwableRenderer=org.apache.log4j.EnhancedThrowableRenderer
-
-#log4j.logger.org.apache.camel.maven=DEBUG
-#log4j.logger.org.apache.http=DEBUG
-#log4j.logger.org.apache.camel.util.component=TRACE


Mime
View raw message