OK - I think I get it - Make the changes, create a
patch, and just mail it in? I attached a patch.
Cheers,
- Ole
--- "Alex Karasulu (JIRA)"
<[EMAIL PROTECTED]> wrote:
> [
>
http://issues.apache.org/jira/browse/DIR-188?page=comments#action_12420668
> ]
>
> Alex Karasulu commented on DIR-188:
> -----------------------------------
>
> Failed to generate the new project. Here's my
> output:
>
>
[EMAIL PROTECTED]:~/projects/apache/directory/sandbox/oersoy$
> mvn archetype:create -DarchetypeVersion=1.0-SNAPSHOT
> -DarchetypeGroupId=org.apache.ads.archetypes
>
-DgroupId=mavenComplainsIfWeDontGiveOneButWeDontNeedOne
> -DarchetypeArtifactId=ads.performance.testing
> -DartifactId=ads.sample.performance.testing
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix:
> 'archetype'.
> [INFO]
>
----------------------------------------------------------------------------
> [INFO] Building Maven Default Project
> [INFO] task-segment: [archetype:create]
> (aggregator-style)
> [INFO]
>
----------------------------------------------------------------------------
> [INFO] Setting property:
> classpath.resource.loader.class =>
>
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
> [INFO] Setting property: resource.loader =>
> 'classpath'.
> [INFO]
>
**************************************************************
> [INFO] Starting Jakarta Velocity v1.4
> [INFO] RuntimeInstance initializing.
> [INFO] Default Properties File:
>
org/apache/velocity/runtime/defaults/velocity.properties
> [INFO] Default ResourceManager initializing. (class
>
org.apache.velocity.runtime.resource.ResourceManagerImpl)
> [INFO] Resource Loader Instantiated:
>
org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
> [INFO] ClasspathResourceLoader : initialization
> starting.
> [INFO] ClasspathResourceLoader : initialization
> complete.
> [INFO] ResourceCache : initialized. (class
>
org.apache.velocity.runtime.resource.ResourceCacheImpl)
> [INFO] Default ResourceManager initialization
> complete.
> [INFO] Loaded System Directive:
> org.apache.velocity.runtime.directive.Literal
> [INFO] Loaded System Directive:
> org.apache.velocity.runtime.directive.Macro
> [INFO] Loaded System Directive:
> org.apache.velocity.runtime.directive.Parse
> [INFO] Loaded System Directive:
> org.apache.velocity.runtime.directive.Include
> [INFO] Loaded System Directive:
> org.apache.velocity.runtime.directive.Foreach
> [INFO] Created: 20 parsers.
> [INFO] Velocimacro : initialization starting.
> [INFO] Velocimacro : adding VMs from VM library
> template : VM_global_library.vm
> [ERROR] ResourceManager : unable to find resource
> 'VM_global_library.vm' in any resource loader.
> [INFO] Velocimacro : error using VM library
> template VM_global_library.vm :
>
org.apache.velocity.exception.ResourceNotFoundException:
> Unable to find resource 'VM_global_library.vm'
> [INFO] Velocimacro : VM library template macro
> registration complete.
> [INFO] Velocimacro : allowInline = true : VMs can be
> defined inline in templates[INFO] Velocimacro :
> allowInlineToOverride = false : VMs defined inline
> may NOT replace previous VM definitions
> [INFO] Velocimacro : allowInlineLocal = false : VMs
> defined inline will be global in scope if allowed.
> [INFO] Velocimacro : messages on : VM system will
> output logging messages
> [INFO] Velocimacro : autoload off : VM system will
> not automatically reload global library macros
> [INFO] Velocimacro : initialization complete.
> [INFO] Velocity successfully started.
> [INFO] [archetype:create]
> [INFO] Defaulting package to group ID:
> mavenComplainsIfWeDontGiveOneButWeDontNeedOne
> [INFO]
>
----------------------------------------------------------------------------
> [INFO] Using following parameters for creating
> Archetype: ads.performance.testing:1.0-SNAPSHOT
> [INFO]
>
----------------------------------------------------------------------------
> [INFO] Parameter: groupId, Value:
> mavenComplainsIfWeDontGiveOneButWeDontNeedOne
> [INFO] Parameter: outputDirectory, Value:
>
/home/akarasulu/projects/apache/directory/sandbox/oersoy/ads.sample.performance.testing
> [INFO] Parameter: packageName, Value:
> mavenComplainsIfWeDontGiveOneButWeDontNeedOne
> [INFO] Parameter: package, Value:
> mavenComplainsIfWeDontGiveOneButWeDontNeedOne
> [INFO] Parameter: version, Value: 1.0-SNAPSHOT
> [INFO] Parameter: artifactId, Value:
> ads.sample.performance.testing
> [INFO]
>
------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
>
------------------------------------------------------------------------
> [INFO] Error creating from archetype
>
> Embedded error: Error reading the
> META-INF/archetype.xml descriptor.
> The META-INF/archetype.xml descriptor cannot be
> found.
> [INFO]
>
------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e
> switch
> [INFO]
>
------------------------------------------------------------------------
> [INFO] Total time: 2 seconds
> [INFO] Finished at: Wed Jul 12 12:33:23 EDT 2006
> [INFO] Final Memory: 4M/7M
> [INFO]
>
------------------------------------------------------------------------
>
>
> > Maven Archetype for Performance Testing
> > ---------------------------------------
> >
> > Key: DIR-188
> > URL:
> http://issues.apache.org/jira/browse/DIR-188
> > Project: Directory
> > Type: New Feature
>
> > Environment: Java
> > Reporter: Ole Ersoy
> > Assignee: Alex Karasulu
> > Priority: Minor
> > Attachments: ads.performance.testing.zip,
> documentation.apt
> >
> > OK - Here's the ADS Performance Testing archetype
> > start (server.xml and performance.ldif need data).
> > For this to work maven has to be installed of
> coarse.
> > Just unzip, cd into ads.performance.testing and
> type
> > maven install
> > The archetype is now installed in your local maven
> > repository.
> > For the documentation on how this archetype was
> > created see the directory
> > src/site/apt/documentation.
> > This is the documentation in apt format.
> > For the html version see the directory
> > target/site/documentation.html
> > Maven generated this file from the apt document.
> > Now run this command:
> > mvn archetype:create
> -DarchetypeVersion=1.0-SNAPSHOT
> -DarchetypeGroupId=org.apache.ads.archetypes
>
-DgroupId=mavenComplainsIfWeDontGiveOneButWeDontNeedOne
> -DarchetypeArtifactId=ads.performance.testing
> -DartifactId=ads.sample.performance.testing
> > This will create the project
> > ads.sample.performance.testing
> > cd into it and type mvn eclipse:eclipse
> > Now you can import it into eclipse.
> > There's a todo in the documentation.
> > This is just the baseline starting point I talked
> > about in the other emails.
> > One future enhancement that could easily be added
> is a
> > directory containing a configuration file for
> > generating the performance.ldif file. Once the
> > documentation is reviewed, everyone should know
> how to
> > add that.
> > Cheers,
> > - Ole
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of
> the administrators:
>
>
http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
> http://www.atlassian.com/software/jira
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Index:
/home/ole/workspace/ads.performance.testing/src/main/resources/META-INF/maven/archetype.xml
===================================================================
---
/home/ole/workspace/ads.performance.testing/src/main/resources/META-INF/maven/archetype.xml
(revision 421358)
+++
/home/ole/workspace/ads.performance.testing/src/main/resources/META-INF/maven/archetype.xml
(working copy)
@@ -1,10 +0,0 @@
-<archetype>
- <id>ads.performance.testing</id>
- <testSources>
- <testSource>src/test/java/ADSPerformanceTest.java</testSource>
- </testSources>
- <resources>
- <resource>inputs/configuration/server.xml</resource>
- <resource>inputs/ldif/performance.ldif</resource>
- </resources>
-</archetype>
Index:
/home/ole/workspace/ads.performance.testing/src/site/apt/documentation.apt
===================================================================
--- /home/ole/workspace/ads.performance.testing/src/site/apt/documentation.apt
(revision 421358)
+++ /home/ole/workspace/ads.performance.testing/src/site/apt/documentation.apt
(working copy)
@@ -62,7 +62,7 @@
Modify it so that in contains the baseline testing setup
and tests for ADS.
-* Edit src/main/resources/META-INF/maven/archetype.xml
+* Edit src/main/resources/META-INF/archetype.xml
The archetype.xml file tells maven which resources to include
when creating projects of this type.
@@ -125,3 +125,137 @@
mvn eclipse:eclipse
Now just import using eclipse's File > Import
+
+* Next Steps
+
+** Update the dependencies on the ads.performance.archetype testing
+
+ Add the ADS api project dependencies to the dependencies list of the
performance.testing.archetype pom.
+
+ This is so the unit tests can access the API.
+
+** Create one or more baseline LDIF file(s)
+
+ The performance.ldif file in the input directory is currently empty.
+ One or more of these files should be created, such that the unit
+ tests can run them.
+
+ We were also discussing creating a mojo that can generate these files, or
+ using SLAMD. It would be great to have a mojo that just wrapped SLAMD,
+ that way the we can just create another input directory for the file
+ SLAMD uses to generate the LDIF files, and this would automatically
+ be run during the generate sources phase of the maven lifecycle.
+
+** Create the ADS Testing Setup
+
+ The following setup should be done in the public void SetUp() method of
each unit test contained in the peformance.testing.archetype archetype.
+
+ * Create an instance of the server.xml configuration contained in the
archetype input directory
+ * Create an instance of ADS.
+ * Configure the ADS instance with the server.xml instance.
+ * Configure the ADS instance with the server.xml instance.
+ * Run each unit test with the configured ADS instance.
+
+** Write the ADS Unit Tests
+
+ I think there are unit tests already, so now we just need to sanitize them
so that they provide a suitable
+ starting point, and put them in the archetype's unit testing directory,
along with ADSPerformanceTest.java,
+ which is currently just the default test that comes with any generic maven
project.
+
+** SLAMD LDIF Generation mojo Command
+
+ The command below will create a baseline for the ldif generation mojo:
+
+ mvn archetype:create
-DgroupId=org.apache.ads.peformance.testing.ldif.generation.mojo
-DartifactId=ldif.generation.mojo -DarchetypeArtifactId=maven-archetype-mojo
+
+** Completing the Mojo
+
+ The mojo needs to perform the following activities (This is rough):
+
+ * Read the configuration file for generating the ldif files (Delegate to
SLAMD)
+
+ * Generate the files (Delegate to SLAMD)
+
+
+*** Creating another directory for the SLAMD configuration file(s)
+
+ Please see the general instructions for creating the performance testing
archetype.
+
+ For now we'll assume we have the directory inputs/slamd/configuration
+ available, and that it contains a baseline configuration file for
generating ldif file(s)
+ called "slamd.cfg".
+
+*** Specify the location of the SLAMD configuration files in the mojo
+
+-----------------------------------------------------------------
+ private static final String SLAMD_CONFIGURATION_FILE_LOCATION =
"inputs/slamd/slamd.cfg";
+ private static final String SLAMD_GENERATION_OUTPUT_DIRECTORY =
"inputs/ldif/;
+-----------------------------------------------------------------
+
+*** Binding the Mojo to the maven lifecycle in the
performance.testing.archetype archetype
+
+ The ldif.generation.mojo now needs to be bound to the maven lifecycle's
generate source phase.
+
+ This is done in the code of the mojo:
+
+-----------------------------------------------------------------------------------------------------------
+
+ /**
+ * @goal generate
+ * @phase generate-sources
+ * @description Generates the ldif file(s) and puts them in the ldif input
directory
+ */
+-----------------------------------------------------------------------------------------------------------
+
+** Updating the pom of the performance.testing.archetype archetype
+
+ Open the src/main/resources/archetype-resources/pom.xml and add the
following build section right under the dependencies section
+ (I think ADS is using JDK 1.5, so I added that to the configuration of the
compiler plugin - this should be set to the
+ version of the JDK used):
+
+---------------------------------------------------------------------------------------------------------
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+
<groupId>org.apache.ads.peformance.testing.ldif.generation.mojo</groupId>
+ <artifactId>ldif.generation.mojo</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>generate</id>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+---------------------------------------------------------------------------------------------------------
+
+* Testing the Mojo with the performance testing archetype
+
+ The process is the same as before. We do:
+
+ mvn archetype:create -DarchetypeVersion=1.0-SNAPSHOT
-DarchetypeGroupId=org.apache.ads.archetypes
-DgroupId=mavenComplainsIfWeDontGiveOneButWeDontNeedOne
-DarchetypeArtifactId=ads.performance.testing
-DartifactId=ads.sample.performance.testing
+
+ However, now before we run tests the mojo will create the ldif files for
us.
+
+ Thus the file names that the mojo creates, must be used in the setup of
the
+ tests.
+
+ This would make it attractive to perhaps create multiple archetypes for
+ specific tests, that are just slight variations of eachother.
+
+ That way we don't need to change too much stuff in the setup section
+ of each testing project.
+
+
\ No newline at end of file