avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Gargan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-890) Maven archetype for creating Avro service projects
Date Mon, 19 Sep 2011 23:41:09 GMT

    [ https://issues.apache.org/jira/browse/AVRO-890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13108240#comment-13108240

Stephen Gargan commented on AVRO-890:


It turns out there is a pretty nifty integration-test goal in the archetypes plugin that will
generate and build a sample project. I've updated the build to use this.

The reason the test doesn't run in the test phase is that its an integration test. Its run
with the failsafe plugin and executes in the integration-test phase of the build. The idea
is that you'd test the service classes as normal (in isolation, with unit tests and mocks)
in the test phase and then test the entire service end to end in the integration-test phase.
If you run hte build with mvn integration-test, you should see the test run.

The way the failsafe plugin splits up the testing is very flexible; it makes it easy to start
a server once in the the pre-itegration test phase and then run a large test suite against
the single server instance. This can save a lot of time if the service is complex and expensive
to setup. I didn't want to muddy the sample with this kind of detail but its simple enough
to modify the build to do it.

I've changed the names in the poms and uploaded a patch (twice it seems! both are the same)
with the changes.  

> Maven archetype for creating Avro service projects 
> ---------------------------------------------------
>                 Key: AVRO-890
>                 URL: https://issues.apache.org/jira/browse/AVRO-890
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.5.4
>            Reporter: Stephen Gargan
>            Assignee: Stephen Gargan
>            Priority: Minor
>              Labels: archetype, maven
>             Fix For: 1.6.0
>         Attachments: archetypes.patch, archetypes.patch, archetypes.patch
> I've put together the beginnings of an maven archetypes subproject in the java module
to help folks kickstart avro projects. The first archetype creates a simple avro based ordering
service using the netty transport and includes an integration test for the service. The service
is very naive, though its really only the plumbing that is important and the example is illustrative
enough to get people going.
> Once built, it can be added to the local archetypes catalog via
> mvn archetype:crawl
> and then will be available via the generate plugin
> mvn archetype:generate
> or it can be invoked directly as follows
> mvn archetype:generate -DarchetypeArtifactId=avro-service-archetype -DarchetypeGroupId=org.apache.avro
-DgroupId=org.simple -DartifactId=simple-service -Dversion=1.0-SNAPSHOT   
> The parent pom contains common config for generating a pom for the archetype that references
the current avro build version. This takes some slight of hand with maven resources to insert
the version and will be reusable for other archetypes in the future.
> I intend putting together a map-reduce archetype soon and am open to suggestions for
other archetypes that might be useful. Perhaps one that included the code from AVRO-883 to
kick start a basic serialization project?  

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message