You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by wi...@apache.org on 2014/03/26 09:19:29 UTC

[21/50] [abbrv] git commit: MARMOTTA-395: fixed and updated Marmotta-Module Archetype: - added Logging - added ExceptionMapper example - fixed generation errors - fixed compile warnings in the generated code

MARMOTTA-395: fixed and updated Marmotta-Module Archetype:
- added Logging
- added ExceptionMapper example
- fixed generation errors
- fixed compile warnings in the generated code


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

Branch: refs/heads/ldp
Commit: d6cebf97d9c97bef6c9f579b0d5ffcfd84f48474
Parents: b9f7df3
Author: Jakob Frank <ja...@apache.org>
Authored: Wed Mar 19 11:39:29 2014 +0100
Committer: Jakob Frank <ja...@apache.org>
Committed: Wed Mar 19 16:47:32 2014 +0100

----------------------------------------------------------------------
 .../marmotta-archetype-module/pom.xml           | 17 +++++
 .../META-INF/maven/archetype-metadata.xml       |  4 +-
 .../main/resources/archetype-resources/pom.xml  | 56 ++++++++++----
 .../src/main/java/api/MyService.java            |  2 +-
 .../main/java/exceptions/DoThisException.java   | 38 ++++++++++
 .../main/java/jaxrs/DoThisExceptionMapper.java  | 39 ++++++++++
 .../java/logging/MyServiceLoggingModule.java    | 76 +++++++++++++++++++
 .../src/main/java/services/MyServiceImpl.java   |  2 +-
 .../src/main/java/webservices/MyWebService.java | 16 +++-
 .../src/main/resources/META-INF/beans.xml       |  6 +-
 .../src/test/java/services/MyServiceTest.java   |  4 +-
 .../test/java/webservices/MyWebServiceTest.java | 80 +++++++++++---------
 .../projects/basic/archetype.properties         |  2 +-
 .../src/test/resources/projects/basic/goal.txt  |  1 +
 .../HttpErrorExceptionMapper.java               |  1 -
 15 files changed, 280 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/pom.xml b/build/archetypes/marmotta-archetype-module/pom.xml
index eb8a49b..0b9a2fd 100644
--- a/build/archetypes/marmotta-archetype-module/pom.xml
+++ b/build/archetypes/marmotta-archetype-module/pom.xml
@@ -33,13 +33,24 @@
 
     <properties>
         <marmottaVersion>${project.version}</marmottaVersion>
+        <sesameVersion>${sesame.version}</sesameVersion>
+
         <junitVersion>${junit.version}</junitVersion>
+        <weldVersion>${weld.version}</weldVersion>
         <weldCoreVersion>${weld.core.version}</weldCoreVersion>
         <h2Version>${h2.version}</h2Version>
         <restAssuredVersion>${rest.assured.version}</restAssuredVersion>
         <hamcrestVersion>${hamcrest.version}</hamcrestVersion>
         <tempusFugitVersion>${tempus.fugit.version}</tempusFugitVersion>
         <jatlVersion>${jatl.version}</jatlVersion>
+        <servletApiVersion>${servlet.api.version}</servletApiVersion>
+        <javax-elVersion>${javax.el.version}</javax-elVersion>
+        <postgresqlVersion>${postgresql.version}</postgresqlVersion>
+        <mysqlVersion>${mysql.version}</mysqlVersion>
+        <jettyVersion>${jetty.version}</jettyVersion>
+        <resteasyVersion>${resteasy.version}</resteasyVersion>
+        <jacksonVersion>${jackson.version}</jacksonVersion>
+        <titanVersion>${titan.version}</titanVersion>
     </properties>
 
     <build>
@@ -83,6 +94,12 @@
 
         <plugins>
             <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <configuration>
+                    <escapeString>\</escapeString>
+                </configuration>
+            </plugin>
+            <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-site-plugin</artifactId>
                 <configuration>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/META-INF/maven/archetype-metadata.xml b/build/archetypes/marmotta-archetype-module/src/main/resources/META-INF/maven/archetype-metadata.xml
index b34231e..135f8e4 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -19,7 +19,7 @@
 
 -->
 <archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd
-http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 " name="LMF Module"
+http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 " name="Apache Marmotta Module"
                       xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                       
@@ -27,7 +27,7 @@ http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.
         <requiredProperty key="moduleKey" />
         <requiredProperty key="moduleName" />
     </requiredProperties>
-    
+
     <fileSets>
         <fileSet filtered="true" packaged="true" encoding="UTF-8">
             <directory>src/main/java</directory>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/pom.xml b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/pom.xml
index 6c11e80..1185ee5 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/pom.xml
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/pom.xml
@@ -18,12 +18,35 @@
 <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>${groupId}</groupId>
-    <artifactId>${artifactId}</artifactId>
+    <groupId>\${groupId}</groupId>
+    <artifactId>\${artifactId}</artifactId>
 
     <name>Marmotta Module: ${moduleName}</name>
-    <description></description>
-    <version>${version}</version>
+    <description>The ${moduleName} Module</description>
+    <version>\${version}</version>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+
+        <marmotta.version>${marmottaVersion}</marmotta.version>
+        <sesame.version>${sesameVersion}</sesame.version>
+        <junit.version>${junitVersion}</junit.version>
+        <weld.version>${weldVersion}</weld.version>
+        <weld.core.version>${weldCoreVersion}</weld.core.version>
+        <rest.assured.version>${restAssuredVersion}</rest.assured.version>
+        <hamcrest.version>${hamcrestVersion}</hamcrest.version>
+        <tempus.fugit.version>${tempusFugitVersion}</tempus.fugit.version>
+        <jatl.version>${jatlVersion}</jatl.version>
+        <servlet.api.version>${servletApiVersion}</servlet.api.version>
+        <javax.el.version>${javax-elVersion}</javax.el.version>
+        <h2.version>${h2Version}</h2.version>
+        <postgresql.version>${postgresqlVersion}</postgresql.version>
+        <mysql.version>${mysqlVersion}</mysql.version>
+        <jetty.version>${jettyVersion}</jetty.version>
+        <resteasy.version>${resteasyVersion}</resteasy.version>
+        <jackson.version>${jacksonVersion}</jackson.version>
+        <titan.version>${titanVersion}</titan.version>
+    </properties>
 
     <build>
         <plugins>
@@ -34,6 +57,7 @@
                 <configuration>
                     <source>1.7</source>
                     <target>1.7</target>
+                    <encoding>utf-8</encoding>
                 </configuration>
             </plugin>
             <plugin>
@@ -52,76 +76,76 @@
         <dependency>
             <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-core</artifactId>
-            <version>${marmottaVersion}</version>
+            <version>\${marmotta.version}</version>
         </dependency>
 
         <!-- Test dependencies -->
         <dependency>
             <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-core</artifactId>
-            <version>${marmottaVersion}</version>
+            <version>\${marmotta.version}</version>
             <type>test-jar</type>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.eclipse.jetty</groupId>
             <artifactId>jetty-server</artifactId>
-            <version>9.0.3.v20130506</version>
+            <version>\${jetty.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.eclipse.jetty</groupId>
             <artifactId>jetty-servlet</artifactId>
-            <version>9.0.3.v20130506</version>
+            <version>\${jetty.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>${junitVersion}</version>
+            <version>\${junit.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.jboss.weld.se</groupId>
             <artifactId>weld-se-core</artifactId>
-            <version>${weldCoreVersion}</version>
+            <version>\${weld.core.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>com.h2database</groupId>
             <artifactId>h2</artifactId>
-            <version>${h2Version}</version>
+            <version>\${h2.version}</version>
             <scope>test</scope>
         </dependency>
 
         <dependency>
             <groupId>com.jayway.restassured</groupId>
             <artifactId>rest-assured</artifactId>
-            <version>${restAssuredVersion}</version>
+            <version>\${rest.assured.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.hamcrest</groupId>
             <artifactId>hamcrest-library</artifactId>
-            <version>${hamcrestVersion}</version>
+            <version>\${hamcrest.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.hamcrest</groupId>
             <artifactId>hamcrest-core</artifactId>
-            <version>${hamcrestVersion}</version>
+            <version>\${hamcrest.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>com.google.code.tempus-fugit</groupId>
             <artifactId>tempus-fugit</artifactId>
-            <version>${tempusFugitVersion}</version>
+            <version>\${tempus.fugit.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>com.googlecode.jatl</groupId>
             <artifactId>jatl</artifactId>
-            <version>${jatlVersion}</version>
+            <version>\${jatl.version}</version>
             <scope>test</scope>
         </dependency>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/api/MyService.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/api/MyService.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/api/MyService.java
index 21ec9c1..b6c0e30 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/api/MyService.java
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/api/MyService.java
@@ -1,4 +1,4 @@
-/**
+/*
  * 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

http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/exceptions/DoThisException.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/exceptions/DoThisException.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/exceptions/DoThisException.java
new file mode 100644
index 0000000..a260d19
--- /dev/null
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/exceptions/DoThisException.java
@@ -0,0 +1,38 @@
+/*
+ * 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 ${package}.exceptions;
+
+
+public class DoThisException extends Exception {
+
+    public DoThisException() {
+        super();
+    }
+
+    public DoThisException(String message) {
+        super(message);
+    }
+
+    public DoThisException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public DoThisException(Throwable cause) {
+        super(cause);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/jaxrs/DoThisExceptionMapper.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/jaxrs/DoThisExceptionMapper.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/jaxrs/DoThisExceptionMapper.java
new file mode 100644
index 0000000..b16ab71
--- /dev/null
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/jaxrs/DoThisExceptionMapper.java
@@ -0,0 +1,39 @@
+/*
+ * 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 ${package}.jaxrs;
+
+import org.apache.marmotta.platform.core.jaxrs.exceptionmappers.CDIExceptionMapper;
+
+import javax.enterprise.context.Dependent;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Provider;
+
+import ${package}.exceptions.DoThisException;
+
+/**
+ * Map DoThisException to a HTTP Response
+ */
+@Provider
+@Dependent
+public class DoThisExceptionMapper implements CDIExceptionMapper<DoThisException> {
+
+    @Override
+    public Response toResponse(DoThisException exception) {
+        return Response.status(444).entity(exception.getMessage()).build();
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/logging/MyServiceLoggingModule.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/logging/MyServiceLoggingModule.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/logging/MyServiceLoggingModule.java
new file mode 100644
index 0000000..bc8dd66
--- /dev/null
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/logging/MyServiceLoggingModule.java
@@ -0,0 +1,76 @@
+/*
+ * 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 ${package}.logging;
+
+import ch.qos.logback.classic.Level;
+import org.apache.marmotta.platform.core.logging.BaseLoggingModule;
+
+import javax.enterprise.context.ApplicationScoped;
+import java.util.Collection;
+import java.util.Collections;
+
+/**
+ * Configure Logging for the MyService Module
+ */
+@ApplicationScoped
+public class MyServiceLoggingModule extends BaseLoggingModule {
+
+    /**
+     * Return the default (logback) level used by this logging module. Should in most cases be INFO or WARN.
+     *
+     * @return
+     */
+    @Override
+    public Level getDefaultLevel() {
+        return Level.INFO;
+    }
+
+    /**
+     * Return a unique identifier for this logging module. This identifier will e.g. be used in the configuration file
+     * to store the configuration for this module. For this reason it should only consist of alpha-numeric characters
+     * plus _ and _.
+     *
+     * @return a unique identifier for the module, suitable for use in the configuration file
+     */
+    @Override
+    public String getId() {
+        return "${moduleKey}";
+    }
+
+    /**
+     * Return a human-readable name for this logging module. This name is used for displaying information about the
+     * module to the user, e.g. in a configuration interface.
+     *
+     * @return a human-readable name for the module, suitable for displaying in a user interface
+     */
+    @Override
+    public String getName() {
+        return "${moduleName}";
+    }
+
+    /**
+     * Return a collection of packages covered by this logging module. This method should be used to group together
+     * those packages that conceptually make up the functionality described by the logging module (e.g. "SPARQL").
+     *
+     * @return a collection of package names
+     */
+    @Override
+    public Collection<String> getPackages() {
+        return Collections.singleton("${package}");
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/services/MyServiceImpl.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/services/MyServiceImpl.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/services/MyServiceImpl.java
index 062b053..31e85eb 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/services/MyServiceImpl.java
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/services/MyServiceImpl.java
@@ -1,4 +1,4 @@
-/**
+/*
  * 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

http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
index c0b0358..8c7a0e2 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
@@ -1,4 +1,4 @@
-/**
+/*
  * 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
@@ -19,6 +19,8 @@ package ${package}.webservices;
 
 import org.apache.commons.lang3.StringUtils;
 
+import org.slf4j.Logger;
+
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 import javax.ws.rs.*;
@@ -26,28 +28,38 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 
 import ${package}.api.MyService;
+import ${package}.exceptions.DoThisException;
 
 @Path("/${moduleKey}")
 @ApplicationScoped
 public class MyWebService {
 
     @Inject
+    private Logger log;
+
+    @Inject
     private MyService myService;
 
     @GET
     @Produces("text/html")
     public Response hello(@QueryParam("name") String name) {
         if (StringUtils.isEmpty(name)) {
+            log.warn("No name given");
             // No name given? Invalid request.
             return Response.status(Status.BAD_REQUEST).entity("Missing Parameter 'name'").build();
         }
 
+        log.debug("Sending regards to {}", name);
         // Return the greeting.
         return Response.ok(myService.helloWorld(name)).build();
     }
 
     @POST
-    public Response doThis(@QueryParam("turns") @DefaultValue("2") int turns) {
+    public Response doThis(@FormParam("turns") @DefaultValue("2") int turns) throws DoThisException {
+        log.debug("Request to doThis {} times", turns);
+        if (turns > 100) throw new DoThisException("At max, 100 turns are allowed");
+        if (turns < 0) throw new DoThisException("Can't undo 'This'");
+
         myService.doThis(turns);
         return Response.ok().build();
     }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
index e8a7070..3d26e8f 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
@@ -1,6 +1,3 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 
@@ -21,6 +18,9 @@
     limitations under the License.
 
 -->
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
 <beans
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/services/MyServiceTest.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/services/MyServiceTest.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/services/MyServiceTest.java
index 73a1ae3..77472a4 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/services/MyServiceTest.java
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/services/MyServiceTest.java
@@ -1,4 +1,4 @@
-/**
+/*
  * 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
@@ -17,9 +17,9 @@
  */
 package ${package}.services;
 
-import junit.framework.Assert;
 import org.apache.marmotta.platform.core.test.base.EmbeddedMarmotta;
 import org.junit.AfterClass;
+import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/webservices/MyWebServiceTest.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/webservices/MyWebServiceTest.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/webservices/MyWebServiceTest.java
index f505f07..715d218 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/webservices/MyWebServiceTest.java
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/webservices/MyWebServiceTest.java
@@ -1,4 +1,4 @@
-/**
+/*
  * 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
@@ -57,25 +57,25 @@ public class MyWebServiceTest {
         /*
          * GET ?name=<xxx>
          */
-        given()
-        .param("name", "Steve")
-        .expect()
-        .content(containsString("Hello Steve"))
-        .when()
-        .get("/${moduleKey}");
-
-        given()
-        .contentType(ContentType.HTML)
-        .param("name", "Jürgen")
-        .expect()
-        .content(containsString("Hello Jürgen"))
-        .when()
-        .get("/${moduleKey}");
-
-        expect()
-        .statusCode(400)
-        .when()
-        .get("/${moduleKey}");
+        RestAssured.given()
+                .param("name", "Steve")
+            .expect()
+                .content(containsString("Hello Steve"))
+            .when()
+                .get("/${moduleKey}");
+
+        RestAssured.given()
+                .contentType(ContentType.HTML)
+                .param("name", "Jürgen")
+            .expect()
+                .content(containsString("Hello Jürgen"))
+            .when()
+                .get("/${moduleKey}");
+
+        RestAssured.expect()
+                .statusCode(400)
+            .when()
+                .get("/${moduleKey}");
     }
 
     @Test
@@ -83,21 +83,31 @@ public class MyWebServiceTest {
         /*
          * POST ?turns=i default 2
          */
-        given()
-        .param("turns", 1)
-        .expect().statusCode(200)
-        .when()
-        .post("/${moduleKey}");
-
-        given()
-        .param("turns", 10)
-        .expect().statusCode(200)
-        .when()
-        .post("/${moduleKey}");
-
-        expect().statusCode(200)
-        .when()
-        .post("/${moduleKey}");
+        RestAssured.given()
+                .param("turns", 1)
+            .expect()
+                .statusCode(200)
+            .when()
+                .post("/${moduleKey}");
+
+        RestAssured.given()
+                .param("turns", 10)
+            .expect()
+                .statusCode(200)
+            .when()
+                .post("/${moduleKey}");
+
+        RestAssured.expect()
+                .statusCode(200)
+            .when()
+                .post("/${moduleKey}");
+
+        RestAssured.given()
+                .param("turns", 123)
+            .expect()
+                .statusCode(444)
+            .when()
+                .post("/${moduleKey}");
     }
 
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/archetype.properties b/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/archetype.properties
index d915b82..d5fd71c 100644
--- a/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/archetype.properties
+++ b/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/archetype.properties
@@ -19,6 +19,6 @@
 package=it.pkg
 version=0.1-SNAPSHOT
 groupId=archetype.it
-artifactId=basic
+artifactId=my-marmotta-module
 moduleKey=mymodule
 moduleName=My Module

http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/goal.txt
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/goal.txt b/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/goal.txt
index e69de29..597acc7 100644
--- a/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/goal.txt
+++ b/build/archetypes/marmotta-archetype-module/src/test/resources/projects/basic/goal.txt
@@ -0,0 +1 @@
+package
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/d6cebf97/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java
index 86f680d..99adeba 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.marmotta.platform.core.jaxrs.exceptionmappers;
 
 import freemarker.template.TemplateException;