Author: rmannibucau
Date: Tue Jun 26 21:22:07 2012
New Revision: 1354242

URL: http://svn.apache.org/viewvc?rev=1354242&view=rev
Log:
adding groovy sample

Added:
    openejb/trunk/openejb/examples/groovy-sample/
    openejb/trunk/openejb/examples/groovy-sample/pom.xml
    openejb/trunk/openejb/examples/groovy-sample/src/
    openejb/trunk/openejb/examples/groovy-sample/src/main/
    openejb/trunk/openejb/examples/groovy-sample/src/main/java/
    openejb/trunk/openejb/examples/groovy-sample/src/main/java/org/
    openejb/trunk/openejb/examples/groovy-sample/src/main/java/org/superbiz/
    
openejb/trunk/openejb/examples/groovy-sample/src/main/java/org/superbiz/groovy/
    
openejb/trunk/openejb/examples/groovy-sample/src/main/java/org/superbiz/groovy/Hello.groovy
    openejb/trunk/openejb/examples/groovy-sample/src/main/resources/
    openejb/trunk/openejb/examples/groovy-sample/src/main/resources/META-INF/
    
openejb/trunk/openejb/examples/groovy-sample/src/main/resources/META-INF/beans.xml
    openejb/trunk/openejb/examples/groovy-sample/src/test/
    openejb/trunk/openejb/examples/groovy-sample/src/test/java/
    openejb/trunk/openejb/examples/groovy-sample/src/test/java/org/
    openejb/trunk/openejb/examples/groovy-sample/src/test/java/org/superbiz/
    
openejb/trunk/openejb/examples/groovy-sample/src/test/java/org/superbiz/groovy/
    
openejb/trunk/openejb/examples/groovy-sample/src/test/java/org/superbiz/groovy/HelloTest.groovy
Modified:
    openejb/trunk/openejb/examples/pom.xml

Added: openejb/trunk/openejb/examples/groovy-sample/pom.xml
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/examples/groovy-sample/pom.xml?rev=1354242&view=auto
==============================================================================
--- openejb/trunk/openejb/examples/groovy-sample/pom.xml (added)
+++ openejb/trunk/openejb/examples/groovy-sample/pom.xml Tue Jun 26 21:22:07 
2012
@@ -0,0 +1,114 @@
+<?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/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.superbiz</groupId>
+  <artifactId>groovy-sample</artifactId>
+  <packaging>jar</packaging>
+  <version>1.1-SNAPSHOT</version>
+  <name>OpenEJB :: Examples :: Groovy</name>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <defaultGoal>install</defaultGoal>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.4</version>
+        <configuration>
+          <compilerId>groovy-eclipse-compiler</compilerId>
+          <verbose>true</verbose>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+        <dependencies>
+          <dependency>
+            <groupId>org.codehaus.groovy</groupId>
+            <artifactId>groovy-eclipse-compiler</artifactId>
+            <version>2.6.0-01</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+    </plugins>
+  </build>
+
+  <repositories>
+    <repository>
+      <id>apache-m2-snapshot</id>
+      <name>Apache Snapshot Repository</name>
+      <url>http://repository.apache.org/snapshots</url>
+    </repository>
+  </repositories>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.openejb</groupId>
+      <artifactId>javaee-api</artifactId>
+      <version>6.0-4</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.codehaus.groovy</groupId>
+      <artifactId>groovy-all</artifactId>
+      <version>2.0.0-rc-4</version>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.10</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.openejb</groupId>
+      <artifactId>arquillian-openejb-embedded-4</artifactId>
+      <version>4.1.0-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.openejb</groupId>
+      <artifactId>ziplock</artifactId>
+      <version>1.1.0-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <!-- This section allows you to configure where to publish libraries for
+    sharing. It is not required and may be deleted. For more information see:
+    http://maven.apache.org/plugins/maven-deploy-plugin/ -->
+  <distributionManagement>
+    <repository>
+      <id>localhost</id>
+      <url>file://${basedir}/target/repo/</url>
+    </repository>
+    <snapshotRepository>
+      <id>localhost</id>
+      <url>file://${basedir}/target/snapshot-repo/</url>
+    </snapshotRepository>
+  </distributionManagement>
+
+</project>
+

Added: 
openejb/trunk/openejb/examples/groovy-sample/src/main/java/org/superbiz/groovy/Hello.groovy
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/examples/groovy-sample/src/main/java/org/superbiz/groovy/Hello.groovy?rev=1354242&view=auto
==============================================================================
--- 
openejb/trunk/openejb/examples/groovy-sample/src/main/java/org/superbiz/groovy/Hello.groovy
 (added)
+++ 
openejb/trunk/openejb/examples/groovy-sample/src/main/java/org/superbiz/groovy/Hello.groovy
 Tue Jun 26 21:22:07 2012
@@ -0,0 +1,7 @@
+package org.superbiz.groovy
+
+public class Hello {
+    def hi() {
+        "hi"
+    }
+}

Added: 
openejb/trunk/openejb/examples/groovy-sample/src/main/resources/META-INF/beans.xml
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/examples/groovy-sample/src/main/resources/META-INF/beans.xml?rev=1354242&view=auto
==============================================================================
--- 
openejb/trunk/openejb/examples/groovy-sample/src/main/resources/META-INF/beans.xml
 (added)
+++ 
openejb/trunk/openejb/examples/groovy-sample/src/main/resources/META-INF/beans.xml
 Tue Jun 26 21:22:07 2012
@@ -0,0 +1,19 @@
+<!--
+
+    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.
+-->
+<beans>
+</beans>
\ No newline at end of file

Added: 
openejb/trunk/openejb/examples/groovy-sample/src/test/java/org/superbiz/groovy/HelloTest.groovy
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/examples/groovy-sample/src/test/java/org/superbiz/groovy/HelloTest.groovy?rev=1354242&view=auto
==============================================================================
--- 
openejb/trunk/openejb/examples/groovy-sample/src/test/java/org/superbiz/groovy/HelloTest.groovy
 (added)
+++ 
openejb/trunk/openejb/examples/groovy-sample/src/test/java/org/superbiz/groovy/HelloTest.groovy
 Tue Jun 26 21:22:07 2012
@@ -0,0 +1,35 @@
+package org.superbiz.groovy
+
+import org.junit.runner.RunWith
+import org.jboss.arquillian.junit.Arquillian
+import org.jboss.arquillian.container.test.api.Deployment
+import org.jboss.shrinkwrap.api.spec.WebArchive
+import org.jboss.shrinkwrap.api.ShrinkWrap
+import org.apache.ziplock.JarLocation
+import javax.inject.Inject
+import org.junit.Test
+
+import static org.junit.Assert.assertEquals
+import static org.junit.Assert.assertNotNull
+import org.jboss.shrinkwrap.api.asset.EmptyAsset
+import org.jboss.shrinkwrap.api.ArchivePaths
+
+@RunWith(Arquillian.class)
+class HelloTest {
+    @Inject
+    private Hello hello
+
+    @Deployment
+    static WebArchive war() {
+        ShrinkWrap.create(WebArchive.class)
+            .addAsLibraries(JarLocation.jarLocation(GroovyObject.class))
+            .addAsWebInfResource(EmptyAsset.INSTANCE, 
ArchivePaths.create("beans.xml"))
+            .addClasses(Hello.class)
+    }
+
+    @Test
+    void hello() {
+        assertNotNull hello
+        assertEquals "hi", hello.hi()
+    }
+}

Modified: openejb/trunk/openejb/examples/pom.xml
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/examples/pom.xml?rev=1354242&r1=1354241&r2=1354242&view=diff
==============================================================================
--- openejb/trunk/openejb/examples/pom.xml (original)
+++ openejb/trunk/openejb/examples/pom.xml Tue Jun 26 21:22:07 2012
@@ -59,6 +59,7 @@
     <module>dynamic-implementation</module>
     <module>dynamic-proxy-to-access-mbean</module>
     <module>ear-testing</module>
+    <module>groovy-sample</module>
     <module>helloworld-weblogic</module>
     <module>injection-of-connectionfactory</module>
     <module>injection-of-datasource</module>


Reply via email to