You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by dh...@apache.org on 2014/06/10 21:51:48 UTC
[20/35] git commit: Added support for generating endpoint config
using component-util plugin, added integration tests, refactored unit tests,
cleaned-up generated code
Added support for generating endpoint config using component-util plugin, added integration tests, refactored unit tests, cleaned-up generated code
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fad48654
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fad48654
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fad48654
Branch: refs/heads/master
Commit: fad48654b42248ddbd1125afc43a6e8b82bd0af9
Parents: 24e196b
Author: Dhiraj Bokde <dh...@yahoo.com>
Authored: Fri May 30 12:48:09 2014 -0700
Committer: Dhiraj Bokde <dh...@yahoo.com>
Committed: Tue Jun 10 12:48:32 2014 -0700
----------------------------------------------------------------------
.../camel-component-util-maven-plugin/pom.xml | 76 +++++++-
.../src/it/all-it/pom.xml | 178 +++++++++++++++++++
.../src/it/all-it/verify.groovy | 22 +++
.../src/it/settings.xml | 55 ++++++
.../maven/AbstractApiMethodGeneratorMojo.java | 64 ++++++-
.../camel/maven/AbstractGeneratorMojo.java | 18 +-
.../java/org/apache/camel/maven/ApiProxy.java | 8 +
.../maven/JavadocApiMethodGeneratorMojo.java | 23 ++-
.../org/apache/camel/maven/Substitution.java | 3 +
.../src/main/resources/api-collection.vm | 2 +-
.../src/main/resources/api-endpoint-config.vm | 47 +++++
.../src/main/resources/api-method-enum.vm | 1 +
.../src/main/resources/api-route-test.vm | 16 +-
.../apache/camel/component/test/TestConfig.java | 23 +++
.../apache/camel/component/test/TestProxy.java | 68 +++++++
.../camel/maven/AbstractGeneratorMojoTest.java | 15 +-
.../maven/ApiComponentGeneratorMojoTest.java | 15 +-
.../maven/FileApiMethodGeneratorMojoTest.java | 1 +
.../JavadocApiMethodGeneratorMojoTest.java | 3 +-
.../java/org/apache/camel/maven/TestProxy.java | 64 -------
.../test/resources/test-proxy-signatures.txt | 1 +
21 files changed, 592 insertions(+), 111 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/tooling/maven/camel-component-util-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/pom.xml b/tooling/maven/camel-component-util-maven-plugin/pom.xml
index ffda9c4..ed197ac 100644
--- a/tooling/maven/camel-component-util-maven-plugin/pom.xml
+++ b/tooling/maven/camel-component-util-maven-plugin/pom.xml
@@ -60,13 +60,6 @@
<artifactId>velocity</artifactId>
<version>${velocity-version}</version>
</dependency>
-<!--
- <dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>2.14</version>
- </dependency>
--->
<!-- add some logging to the classpath -->
<dependency>
@@ -127,6 +120,30 @@
</plugins>
</pluginManagement>
<plugins>
+ <!-- copy test utility classes to integration test project -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-it-resources</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ <overwrite>true</overwrite>
+ <outputDirectory>${project.build.directory}/it/all-it/src/main/java/org/apache/camel/component/test</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/test/java/org/apache/camel/component/test</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<!-- validate generated code after unit tests -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
@@ -140,7 +157,7 @@
</goals>
<configuration>
<sources>
- <source>${project.build.directory}/generated-test-sources/camelComponent</source>
+ <source>${project.build.directory}/generated-test-sources/camel-component</source>
</sources>
</configuration>
</execution>
@@ -156,10 +173,53 @@
<goals>
<goal>testCompile</goal>
</goals>
+ <configuration>
+ <fork>false</fork>
+ </configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
+ <!-- Plugin integration test profile -->
+ <profiles>
+ <profile>
+ <id>plugin-itest</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <version>1.8</version>
+ <configuration>
+ <debug>true</debug>
+ <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+ <pomIncludes>
+ <pomInclude>*/pom.xml</pomInclude>
+ </pomIncludes>
+ <postBuildHookScript>verify</postBuildHookScript>
+ <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+ <settingsFile>src/it/settings.xml</settingsFile>
+ <goals>
+ <goal>clean</goal>
+ <goal>verify</goal>
+ </goals>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>install</goal>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+
+ </build>
+ </profile>
+ </profiles>
</project>
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/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
new file mode 100644
index 0000000..269aefc
--- /dev/null
+++ b/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-component-util-maven-plugin-it</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <description>Integration Test to verify all goals.</description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <outPackage>org.apache.camel.component.test.internal</outPackage>
+ <componentPackage>org.apache.camel.component.test</componentPackage>
+ <scheme>testComponent</scheme>
+ <componentName>Test</componentName>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ <version>@project.version@</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity</artifactId>
+ <version>@velocity-version@</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test</artifactId>
+ <version>@project.version@</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- VelocityEngine javadoc for testing -->
+ <dependency>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity</artifactId>
+ <version>@velocity-version@</version>
+ <classifier>javadoc</classifier>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <!-- execute component-util plugin -->
+ <plugin>
+ <groupId>@project.groupId@</groupId>
+ <artifactId>@project.artifactId@</artifactId>
+ <version>@project.version@</version>
+ <executions>
+ <execution>
+ <id>generate-file-api-method</id>
+ <!-- using generate-test-sources instead of generate-sources to be able to load TestProxy.class -->
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>fromFile</goal>
+ </goals>
+ <configuration>
+ <outPackage>${outPackage}</outPackage>
+ <componentPackage>${componentPackage}</componentPackage>
+ <scheme>${scheme}</scheme>
+ <componentName>${componentName}</componentName>
+ <proxyClass>org.apache.camel.component.test.TestProxy</proxyClass>
+ <substitutions>
+ <substitution>
+ <method>.+</method>
+ <argName>(.+)</argName>
+ <argType>java.util.List</argType>
+ <replacement>$1List</replacement>
+ </substitution>
+ </substitutions>
+ <signatureFile>../../../src/test/resources/test-proxy-signatures.txt</signatureFile>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-velocity-context-api-method</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>fromJavadoc</goal>
+ </goals>
+ <configuration>
+ <outPackage>${outPackage}</outPackage>
+ <componentPackage>${componentPackage}</componentPackage>
+ <scheme>${scheme}</scheme>
+ <componentName>${componentName}</componentName>
+ <proxyClass>org.apache.velocity.VelocityContext</proxyClass>
+ <substitutions>
+ <substitution>
+ <method>.+</method>
+ <argName>key</argName>
+ <argType>java.lang.Object</argType>
+ <replacement>applicationKey</replacement>
+ </substitution>
+ </substitutions>
+ <excludeClasses>InternalContextBase</excludeClasses>
+ <excludeMethods>clone|Current|internal|icache</excludeMethods>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-test-component-classes</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>fromApis</goal>
+ </goals>
+ <configuration>
+ <outPackage>${outPackage}</outPackage>
+ <componentPackage>${componentPackage}</componentPackage>
+ <scheme>${scheme}</scheme>
+ <componentName>${componentName}</componentName>
+ <apis>
+ <api>
+ <apiName>test</apiName>
+ <proxyClass>org.apache.camel.component.test.TestProxy</proxyClass>
+ </api>
+ <api>
+ <apiName>velocity</apiName>
+ <proxyClass>org.apache.velocity.VelocityContext</proxyClass>
+ </api>
+ </apis>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- add generated source and test source to build -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>@build-helper-maven-plugin-version@</version>
+ <executions>
+ <execution>
+ <id>add-generated-sources</id>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${project.build.directory}/generated-sources/camel-component</source>
+ </sources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>add-generated-test-sources</id>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${project.build.directory}/generated-test-sources/camel-component</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/verify.groovy
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/verify.groovy b/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/verify.groovy
new file mode 100644
index 0000000..73edefd
--- /dev/null
+++ b/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/verify.groovy
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+// assert that the generated files directory exists
+File sourceDir = new File( basedir, "target/generated-sources/camel-component" );
+File testDir = new File( basedir, "target/generated-test-sources/camel-component" );
+
+assert sourceDir.isDirectory()
+assert testDir.isDirectory()
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/tooling/maven/camel-component-util-maven-plugin/src/it/settings.xml
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/it/settings.xml b/tooling/maven/camel-component-util-maven-plugin/src/it/settings.xml
new file mode 100644
index 0000000..c8f77f0
--- /dev/null
+++ b/tooling/maven/camel-component-util-maven-plugin/src/it/settings.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<settings>
+ <profiles>
+ <profile>
+ <id>it-repo</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <repositories>
+ <repository>
+ <id>local.central</id>
+ <url>@localRepositoryUrl@</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>local.central</id>
+ <url>@localRepositoryUrl@</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ </profiles>
+</settings>
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/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 3064824..8b868c4 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
@@ -20,6 +20,7 @@ import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.TreeMap;
import org.apache.camel.util.component.ApiMethodParser;
import org.apache.camel.util.component.ArgumentSubstitutionParser;
@@ -60,6 +61,9 @@ public abstract class AbstractApiMethodGeneratorMojo extends AbstractGeneratorMo
// generate enumeration from model
mergeTemplate(getApiMethodContext(models), getApiMethodFile(), "/api-method-enum.vm");
+ // generate EndpointConfiguration for this Api
+ mergeTemplate(getEndpointContext(models), getConfigurationFile(), "/api-endpoint-config.vm");
+
// generate junit test if it doesn't already exist under test source directory
// i.e. it may have been generated then moved there and populated with test values
final String testFilePath = getTestFilePath();
@@ -121,6 +125,42 @@ public abstract class AbstractApiMethodGeneratorMojo extends AbstractGeneratorMo
return getProxyType().getSimpleName() + "IntegrationTest";
}
+ private VelocityContext getEndpointContext(List<ApiMethodParser.ApiMethodModel> models) throws MojoExecutionException {
+ VelocityContext context = getCommonContext(models);
+ context.put("configName", getConfigName());
+ context.put("componentName", componentName);
+ context.put("componentPackage", componentPackage);
+
+ // generate parameter names and types for configuration, sorted by parameter name
+ Map<String, Class<?>> parameters = new TreeMap<String, Class<?>>();
+ for (ApiMethodParser.ApiMethodModel model : models) {
+ for (ApiMethodParser.Argument argument : model.getArguments()) {
+ if (!parameters.containsKey(argument.getName())) {
+ Class<?> type = argument.getType();
+ if (type.isPrimitive()) {
+ // replace primitives with wrapper classes
+ type = ClassUtils.primitiveToWrapper(type);
+ }
+ parameters.put(argument.getName(), type);
+ }
+ }
+ }
+ context.put("parameters", parameters);
+ return context;
+ }
+
+ private File getConfigurationFile() throws MojoExecutionException {
+ final StringBuilder fileName = new StringBuilder();
+ // endpoint configuration goes in component package
+ fileName.append(componentPackage.replaceAll("\\.", File.separator)).append(File.separator);
+ fileName.append(getConfigName()).append(".java");
+ return new File(generatedSrcDir, fileName.toString());
+ }
+
+ private String getConfigName() throws MojoExecutionException {
+ return getProxyType().getSimpleName() + "EndpointConfiguration";
+ }
+
private VelocityContext getCommonContext(List<ApiMethodParser.ApiMethodModel> models) throws MojoExecutionException {
VelocityContext context = new VelocityContext();
context.put("models", models);
@@ -141,9 +181,9 @@ public abstract class AbstractApiMethodGeneratorMojo extends AbstractGeneratorMo
public static String getType(Class<?> clazz) {
if (clazz.isArray()) {
// create a zero length array and get the class from the instance
- return "new " + clazz.getCanonicalName().replaceAll("\\[\\]", "[0]") + ".getClass()";
+ return "new " + getCanonicalName(clazz).replaceAll("\\[\\]", "[0]") + ".getClass()";
} else {
- return clazz.getCanonicalName() + ".class";
+ return getCanonicalName(clazz) + ".class";
}
}
@@ -172,7 +212,7 @@ public abstract class AbstractApiMethodGeneratorMojo extends AbstractGeneratorMo
if (resultType.isPrimitive()) {
return ClassUtils.primitiveToWrapper(resultType).getSimpleName();
} else {
- return resultType.getCanonicalName();
+ return getCanonicalName(resultType);
}
}
@@ -199,4 +239,22 @@ public abstract class AbstractApiMethodGeneratorMojo extends AbstractGeneratorMo
return "null";
}
}
+
+ public static String getPropertySuffix(String parameter) {
+ // capitalize first character
+ StringBuilder builder = new StringBuilder();
+ builder.append(Character.toUpperCase(parameter.charAt(0)));
+ builder.append(parameter.substring(1));
+ return builder.toString();
+ }
+
+ public static String getCanonicalName(Class<?> type) {
+ // remove java.lang prefix for default Java package
+ String canonicalName = type.getCanonicalName();
+ final int pkgEnd = canonicalName.lastIndexOf('.');
+ if (pkgEnd > 0 && canonicalName.substring(0, pkgEnd).equals("java.lang")) {
+ canonicalName = canonicalName.substring(pkgEnd + 1);
+ }
+ return canonicalName;
+ }
}
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/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 eee09ea..3979745 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
@@ -47,19 +47,16 @@ import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
public abstract class AbstractGeneratorMojo extends AbstractMojo {
protected static final String PREFIX = "org.apache.camel.";
- protected static final String OUT_PACKAGE = PREFIX + "component";
-
+ protected static final String OUT_PACKAGE = PREFIX + "component.internal";
+ protected static final String COMPONENT_PACKAGE = PREFIX + "component";
// used for velocity logging, to avoid creating velocity.log
protected final Logger LOG = Logger.getLogger(this.getClass());
- @Parameter(defaultValue = "${project}", readonly = true)
- MavenProject project;
-
- @Parameter(defaultValue = "${project.build.directory}/generated-sources/camel")
+ @Parameter(defaultValue = "${project.build.directory}/generated-sources/camel-component")
protected File generatedSrcDir;
- @Parameter(defaultValue = "${project.build.directory}/generated-test-sources/camel")
+ @Parameter(defaultValue = "${project.build.directory}/generated-test-sources/camel-component")
protected File generatedTestDir;
@Parameter(defaultValue = OUT_PACKAGE)
@@ -71,6 +68,12 @@ public abstract class AbstractGeneratorMojo extends AbstractMojo {
@Parameter(required = true, property = PREFIX + "componentName")
protected String componentName;
+ @Parameter(defaultValue = COMPONENT_PACKAGE)
+ protected String componentPackage;
+
+ @Parameter(defaultValue = "${project}", readonly = true)
+ MavenProject project;
+
private VelocityEngine engine;
private ClassLoader projectClassLoader;
@@ -101,6 +104,7 @@ public abstract class AbstractGeneratorMojo extends AbstractMojo {
for (Iterator it = classpathElements.iterator(); it.hasNext(); i++) {
try {
urls[i] = new File((String) it.next()).toURI().toURL();
+ LOG.debug("Adding project path " + urls[i]);
} catch (MalformedURLException e) {
throw new MojoExecutionException(e.getMessage(), e);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/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 5751dbd..b708e37 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
@@ -28,6 +28,14 @@ public class ApiProxy {
private Map<String, String> aliases = Collections.EMPTY_MAP;
+ public ApiProxy() {
+ }
+
+ public ApiProxy(String apiName, String proxyClass) {
+ this.apiName = apiName;
+ this.proxyClass = proxyClass;
+ }
+
public String getApiName() {
return apiName;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
index 677d400..7eea008 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
+++ b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
@@ -45,7 +45,7 @@ import org.codehaus.plexus.util.IOUtil;
/**
* Parses ApiMethod signatures from Javadoc.
*/
-@Mojo(name = "fromJavaDoc", requiresDependencyResolution = ResolutionScope.TEST, requiresProject = true,
+@Mojo(name = "fromJavadoc", requiresDependencyResolution = ResolutionScope.TEST, requiresProject = true,
defaultPhase = LifecyclePhase.GENERATE_SOURCES)
public class JavadocApiMethodGeneratorMojo extends AbstractApiMethodGeneratorMojo {
@@ -57,6 +57,9 @@ public class JavadocApiMethodGeneratorMojo extends AbstractApiMethodGeneratorMoj
@Parameter(property = "camel.component.util.excludeClasses")
protected String excludeClasses;
+ @Parameter(property = "camel.component.util.excludeMethods")
+ protected String excludeMethods;
+
@Override
protected ApiMethodParser createAdapterParser(Class proxyType) {
return new ArgumentSubstitutionParser(proxyType, getArgumentSubstitutions());
@@ -67,18 +70,23 @@ public class JavadocApiMethodGeneratorMojo extends AbstractApiMethodGeneratorMoj
// signatures as map from signature with no arg names to arg names from JavadocParser
Map<String, String> result = new HashMap<String, String>();
- final Pattern packages = Pattern.compile(excludePackages);
- Pattern classes = null;
+ final Pattern packagePatterns = Pattern.compile(excludePackages);
+ Pattern classPatterns = null;
if (excludeClasses != null) {
- classes = Pattern.compile(excludeClasses);
+ classPatterns = Pattern.compile(excludeClasses);
+ }
+ Pattern methodPatterns = null;
+ if (excludeMethods != null) {
+ methodPatterns = Pattern.compile(excludeMethods);
}
// for proxy class and super classes not matching excluded packages or classes
for (Class aClass = getProxyType();
- aClass != null && !packages.matcher(aClass.getPackage().getName()).matches() &&
- (classes == null || !classes.matcher(aClass.getSimpleName()).matches());
+ aClass != null && !packagePatterns.matcher(aClass.getPackage().getName()).matches() &&
+ (classPatterns == null || !classPatterns.matcher(aClass.getSimpleName()).matches());
aClass = aClass.getSuperclass()) {
+ LOG.debug("Processing " + aClass.getName());
final String javaDocPath = aClass.getName().replaceAll("\\.", "/") + ".html";
// read javadoc html text for class
@@ -98,7 +106,8 @@ public class JavadocApiMethodGeneratorMojo extends AbstractApiMethodGeneratorMoj
// get public method signature
final Map<String, String> methodMap = htmlParser.getMethodText();
for (String method : htmlParser.getMethods()) {
- if (!result.containsKey(method)) {
+ if (!result.containsKey(method) &&
+ (methodPatterns == null || !methodPatterns.matcher(method).find())) {
final int leftBracket = method.indexOf('(');
final String name = method.substring(0, leftBracket);
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/Substitution.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/Substitution.java b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/Substitution.java
index c0772a7..0e7b2a8 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/Substitution.java
+++ b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/Substitution.java
@@ -26,6 +26,9 @@ public class Substitution {
private String argType;
private String replacement;
+ public Substitution() {
+ }
+
public Substitution(String method, String argName, String argType, String replacement) {
this.method = method;
this.argName = argName;
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/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 a82c2c5..7529712 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
@@ -46,7 +46,7 @@ public final class $collectionName extends ApiCollection {
#end
}
- public static final synchronized $collectionName getCollection() {
+ public static synchronized $collectionName getCollection() {
if (collection == null) {
collection = new $collectionName();
}
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/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
new file mode 100644
index 0000000..ca44ad9
--- /dev/null
+++ b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-endpoint-config.vm
@@ -0,0 +1,47 @@
+## ------------------------------------------------------------------------
+## 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.
+## ------------------------------------------------------------------------
+## api-endpoint-config.vm
+/*
+ * Camel EndpointConfiguration generated by camel-component-util-maven-plugin
+ * Generated on: $generatedDate
+ */
+package ${componentPackage};
+
+/**
+ * Camel EndpointConfiguration for $proxyType.Name
+ */
+@SuppressWarnings("unused")
+public final class $configName extends ${componentName}Config {
+
+#foreach( $parameter in $parameters.entrySet() )
+ private $helper.getCanonicalName($parameter.Value) $parameter.Key;
+#end
+## getters and setters
+#foreach( $parameter in $parameters.entrySet() )
+#set ( $name = $parameter.Key )
+#set ( $type = $helper.getCanonicalName($parameter.Value) )
+#set ( $propertySuffix = $helper.getPropertySuffix($name) )
+
+ public $type get${propertySuffix}() {
+ return $name;
+ }
+
+ public void set${propertySuffix}($type $name) {
+ this.$name = $name;
+ }
+#end
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-method-enum.vm
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-method-enum.vm b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-method-enum.vm
index 9dab27c..0bc3056 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-method-enum.vm
+++ b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-method-enum.vm
@@ -32,6 +32,7 @@ import org.apache.camel.util.component.ApiMethodImpl;
/**
* Camel {@link ApiMethod} Enumeration for $proxyType.Name
*/
+@SuppressWarnings("unused")
public enum $enumName implements ApiMethod {
#foreach ( $model in $models )
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/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 160e920..d12adea 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
@@ -53,13 +53,13 @@ public class ${testName} extends CamelTestSupport {
## single argument, use as body
#if ( $args.size() == 1 )
#set ( $argType = $args.get(0).Type )
- // using $argType.CanonicalName message body for single parameter "$args.get(0).Name"
+ // using $helper.getCanonicalName($argType) message body for single parameter "$args.get(0).Name"
## multiple arguments, pass them as headers
#elseif ( $args.size() > 1 )
final HashMap<String, Object> headers = new HashMap<String, Object>();
#foreach ( $arg in $args )
#if ( !$arg.Type.isPrimitive() )
- // parameter type is $arg.Type.CanonicalName
+ // parameter type is $helper.getCanonicalName($arg.Type)
headers.put("${helper.getPropertyPrefix()}${arg.Name}", null);
#else
headers.put("${helper.getPropertyPrefix()}${arg.Name}", $helper.getDefaultArgValue($arg.Type));
@@ -70,10 +70,10 @@ public class ${testName} extends CamelTestSupport {
#if ( !$voidResult )#set ( $type = $helper.getResultDeclaration($resultType) ) $type result = (${type})#end
## actual template call
#if ( $args.isEmpty() )
-template().requestBody("direct://${model.UniqueName}", (java.lang.Object)null);
+template().requestBody("direct://${model.UniqueName}", (Object)null);
#elseif ( $args.size() == 1 )
## typecast body to avoid requestBody() conflict
-template().requestBody("direct://${model.UniqueName}", (${argType.CanonicalName}) $helper.getDefaultArgValue($argType));
+template().requestBody("direct://${model.UniqueName}", (${helper.getCanonicalName($argType)}) $helper.getDefaultArgValue($argType));
#else
template().requestBodyAndHeader("direct://${model.UniqueName}", null, headers);
#end
@@ -89,7 +89,7 @@ template().requestBodyAndHeader("direct://${model.UniqueName}", null, headers);
return new RouteBuilder() {
public void configure() {
#foreach ( $model in $models )
- // test route for $name
+ // test route for $model.Name
from("direct://${model.UniqueName}")
.to("${scheme}://${model.Name}");
@@ -97,4 +97,10 @@ template().requestBodyAndHeader("direct://${model.UniqueName}", null, headers);
}
};
}
+
+ @Override
+ public boolean isCreateCamelContextPerClass() {
+ // only create the context once for this class
+ return true;
+ }
}
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/component/test/TestConfig.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/component/test/TestConfig.java b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/component/test/TestConfig.java
new file mode 100644
index 0000000..429280e
--- /dev/null
+++ b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/component/test/TestConfig.java
@@ -0,0 +1,23 @@
+/**
+ * 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.component.test;
+
+/**
+ * Dummy component config.
+ */
+public class TestConfig {
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/component/test/TestProxy.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/component/test/TestProxy.java b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/component/test/TestProxy.java
new file mode 100644
index 0000000..48eb11b
--- /dev/null
+++ b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/component/test/TestProxy.java
@@ -0,0 +1,68 @@
+/**
+ * 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.component.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class TestProxy {
+ public String sayHi() {
+ return "Hello!";
+ }
+
+ public String sayHi(boolean hello) {
+ return hello ? "Hello!" : "Hi!";
+ }
+
+ public String sayHi(final String name) {
+ return "Hello " + name;
+ }
+
+ public final String greetMe(final String name) {
+ return "Greetings " + name;
+ }
+
+ public final String greetUs(final String name1, String name2) {
+ return "Greetings " + name1 + ", " + name2;
+ }
+
+ public final String greetAll(final String[] names) {
+ StringBuilder builder = new StringBuilder("Greetings ");
+ for (String name : names) {
+ builder.append(name).append(", ");
+ }
+ builder.delete(builder.length() - 2, builder.length());
+ return builder.toString();
+ }
+
+ public final String greetAll(List<String> names) {
+ StringBuilder builder = new StringBuilder("Greetings ");
+ for (String name : names) {
+ builder.append(name).append(", ");
+ }
+ builder.delete(builder.length() - 2, builder.length());
+ return builder.toString();
+ }
+
+ public final String[] greetTimes(String name, int times) {
+ final List<String> result = new ArrayList<String>();
+ for (int i = 0; i < times; i++) {
+ result.add("Greetings " + name);
+ }
+ return result.toArray(new String[result.size()]);
+ }
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/AbstractGeneratorMojoTest.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/AbstractGeneratorMojoTest.java b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/AbstractGeneratorMojoTest.java
index aa7f7b7..641b34e 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/AbstractGeneratorMojoTest.java
+++ b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/AbstractGeneratorMojoTest.java
@@ -30,9 +30,15 @@ import static org.junit.Assert.assertTrue;
* Base class for Generator MOJO tests.
*/
public class AbstractGeneratorMojoTest {
- protected static final String OUT_DIR = "target/generated-test-sources/camelComponent";
- protected static final String PACKAGE_PATH = AbstractGeneratorMojo.OUT_PACKAGE.replaceAll("\\.", "/") + "/";
- protected static final String COMPONENT_NAME = "TestComponent";
+ protected static final String OUT_DIR = "target/generated-test-sources/camel-component";
+
+ private static final String COMPONENT_PACKAGE = "org.apache.camel.component.test";
+ private static final String OUT_PACKAGE = COMPONENT_PACKAGE + ".internal";
+
+ protected static final String PACKAGE_PATH = OUT_PACKAGE.replaceAll("\\.", "/") + "/";
+ protected static final String COMPONENT_PACKAGE_PATH = COMPONENT_PACKAGE.replaceAll("\\.", "/") + "/";
+
+ protected static final String COMPONENT_NAME = "Test";
protected static final String SCHEME = "testComponent";
protected void assertExists(File outFile) {
@@ -44,7 +50,8 @@ public class AbstractGeneratorMojoTest {
mojo.scheme = SCHEME;
mojo.generatedSrcDir = new File(OUT_DIR);
mojo.generatedTestDir = new File(OUT_DIR);
- mojo.outPackage = AbstractGeneratorMojo.OUT_PACKAGE;
+ mojo.outPackage = OUT_PACKAGE;
+ mojo.componentPackage = COMPONENT_PACKAGE;
mojo.project = new MavenProject((Model) null) {
@Override
public List getTestClasspathElements() throws DependencyResolutionRequiredException {
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/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 fb738a1..4b4e7ee 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
@@ -18,6 +18,7 @@ package org.apache.camel.maven;
import java.io.File;
+import org.apache.camel.component.test.TestProxy;
import org.apache.velocity.VelocityContext;
import org.junit.Test;
@@ -37,17 +38,9 @@ public class ApiComponentGeneratorMojoTest extends AbstractGeneratorMojoTest {
final ApiComponentGeneratorMojo mojo = new ApiComponentGeneratorMojo();
configureMojo(mojo);
- final ApiProxy[] proxies = new ApiProxy[2];
- mojo.apis = proxies;
- ApiProxy apiProxy = new ApiProxy();
- proxies[0] = apiProxy;
- apiProxy.setApiName("test");
- apiProxy.setProxyClass(TestProxy.class.getName());
-
- apiProxy = new ApiProxy();
- proxies[1] = apiProxy;
- apiProxy.setApiName("velocity");
- apiProxy.setProxyClass(VelocityContext.class.getName());
+ mojo.apis = new ApiProxy[2];
+ mojo.apis[0] = new ApiProxy("test", TestProxy.class.getName());
+ mojo.apis[1] = new ApiProxy("velocity", VelocityContext.class.getName());
mojo.execute();
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/FileApiMethodGeneratorMojoTest.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/FileApiMethodGeneratorMojoTest.java b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/FileApiMethodGeneratorMojoTest.java
index 7a8af42..b59aed1 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/FileApiMethodGeneratorMojoTest.java
+++ b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/FileApiMethodGeneratorMojoTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.maven;
import java.io.File;
import java.io.IOException;
+import org.apache.camel.component.test.TestProxy;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojoTest.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojoTest.java b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojoTest.java
index f90b8ae..0292111 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojoTest.java
+++ b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojoTest.java
@@ -44,9 +44,10 @@ public class JavadocApiMethodGeneratorMojoTest extends AbstractGeneratorMojoTest
// use VelocityEngine javadoc
mojo.proxyClass = VelocityContext.class.getCanonicalName();
- mojo.excludePackages = JavadocApiMethodGeneratorMojo.DEFAULT_EXCLUDE_PACKAGES;
Substitution substitution = new Substitution(".*", "key", "java.lang.Object", "applicationKey");
mojo.substitutions = new Substitution[]{ substitution };
+ mojo.excludePackages = JavadocApiMethodGeneratorMojo.DEFAULT_EXCLUDE_PACKAGES;
+ mojo.excludeMethods = "clone|Current|internal|icache";
mojo.execute();
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/TestProxy.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/TestProxy.java b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/TestProxy.java
deleted file mode 100644
index ced2058..0000000
--- a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/TestProxy.java
+++ /dev/null
@@ -1,64 +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.
- */
-package org.apache.camel.maven;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class TestProxy {
- public String sayHi() {
- return "Hello!";
- }
-
- public String sayHi(final String name) {
- return "Hello " + name;
- }
-
- public final String greetMe(final String name) {
- return "Greetings " + name;
- }
-
- public final String greetUs(final String name1, String name2) {
- return "Greetings " + name1 + ", " + name2;
- }
-
- public final String greetAll(final String[] names) {
- StringBuilder builder = new StringBuilder("Greetings ");
- for (String name : names) {
- builder.append(name).append(", ");
- }
- builder.delete(builder.length() - 2, builder.length());
- return builder.toString();
- }
-
- public final String greetAll(List<String> names) {
- StringBuilder builder = new StringBuilder("Greetings ");
- for (String name : names) {
- builder.append(name).append(", ");
- }
- builder.delete(builder.length() - 2, builder.length());
- return builder.toString();
- }
-
- public final String[] greetTimes(String name, int times) {
- final List<String> result = new ArrayList<String>();
- for (int i = 0; i < times; i++) {
- result.add("Greetings " + name);
- }
- return result.toArray(new String[result.size()]);
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/tooling/maven/camel-component-util-maven-plugin/src/test/resources/test-proxy-signatures.txt
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-component-util-maven-plugin/src/test/resources/test-proxy-signatures.txt b/tooling/maven/camel-component-util-maven-plugin/src/test/resources/test-proxy-signatures.txt
index 1d5ba35..4c47474 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/test/resources/test-proxy-signatures.txt
+++ b/tooling/maven/camel-component-util-maven-plugin/src/test/resources/test-proxy-signatures.txt
@@ -1,4 +1,5 @@
public String sayHi();
+public String sayHi(boolean hello);
public String sayHi(final String name);
public final String greetMe(final String name);
public final String greetUs(final String name1, String name2);