You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@tomee.apache.org by bu...@apache.org on 2012/10/31 14:20:57 UTC
svn commit: r836722 - in /websites/staging/openejb/trunk: cgi-bin/ content/
content/examples-trunk/ content/examples-trunk/scala-basic/
content/examples-trunk/scala-basic/src/
content/examples-trunk/scala-basic/src/main/
content/examples-trunk/scala-ba...
Author: buildbot
Date: Wed Oct 31 13:20:56 2012
New Revision: 836722
Log:
Staging update by buildbot for openejb
Added:
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/build.sbt
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/pom.xml (with props)
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/main/
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/main/resources/
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/main/resources/META-INF/
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/main/resources/META-INF/beans.xml
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/main/scala/
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/main/scala/org/
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/main/scala/org/superbiz/
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/main/scala/org/superbiz/GreetingService.scala
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/test/
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/test/scala/
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/test/scala/org/
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/test/scala/org/superbiz/
websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/test/scala/org/superbiz/GreetingServiceTest.scala
Modified:
websites/staging/openejb/trunk/cgi-bin/ (props changed)
websites/staging/openejb/trunk/content/ (props changed)
websites/staging/openejb/trunk/content/examples-trunk/pom.xml
Propchange: websites/staging/openejb/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Oct 31 13:20:56 2012
@@ -1 +1 @@
-1403755
+1404128
Propchange: websites/staging/openejb/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Oct 31 13:20:56 2012
@@ -1 +1 @@
-1403755
+1404128
Modified: websites/staging/openejb/trunk/content/examples-trunk/pom.xml
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/pom.xml (original)
+++ websites/staging/openejb/trunk/content/examples-trunk/pom.xml Wed Oct 31 13:20:56 2012
@@ -17,7 +17,7 @@
limitations under the License.
-->
<!--test 2-->
-<!-- $Rev: 1403755 $ $Date: 2012-10-30 15:59:23 +0000 (Tue, 30 Oct 2012) $ -->
+<!-- $Rev: 1404128 $ $Date: 2012-10-31 13:20:40 +0000 (Wed, 31 Oct 2012) $ -->
<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">
<parent>
@@ -103,6 +103,7 @@
<module>rest-on-ejb</module>
<module>rest-example</module>
<module>rest-example-with-application</module>
+ <module>scala-basic</module>
<module>schedule-expression</module>
<module>schedule-events</module>
<module>schedule-methods-meta</module>
Added: websites/staging/openejb/trunk/content/examples-trunk/scala-basic/build.sbt
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/scala-basic/build.sbt (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/scala-basic/build.sbt Wed Oct 31 13:20:56 2012
@@ -0,0 +1,34 @@
+//
+// 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.
+//
+
+name := "scala-basic"
+
+version := "1.1-SNAPSHOT"
+
+scalaVersion := "2.9.1"
+
+resolvers ++= Seq(
+ "Local Maven Repository" at "file://" + Path.userHome.absolutePath + "/.m2/repository",
+ "Apache Snapshots" at "https://repository.apache.org/content/groups/snapshots/"
+)
+
+libraryDependencies ++= Seq(
+ "org.apache.openejb" % "javaee-api" % "6.0-4",
+ "org.apache.openejb" % "openejb-core" % "4.5.1-SNAPSHOT" % "test",
+ "org.scalatest" %% "scalatest" % "1.6.1" % "test"
+)
+
Added: websites/staging/openejb/trunk/content/examples-trunk/scala-basic/pom.xml
==============================================================================
Binary file - no diff available.
Propchange: websites/staging/openejb/trunk/content/examples-trunk/scala-basic/pom.xml
------------------------------------------------------------------------------
svn:mime-type = application/xml
Added: websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/main/resources/META-INF/beans.xml
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/main/resources/META-INF/beans.xml (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/main/resources/META-INF/beans.xml Wed Oct 31 13:20:56 2012
@@ -0,0 +1,18 @@
+<!--
+
+ 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 />
Added: websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/main/scala/org/superbiz/GreetingService.scala
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/main/scala/org/superbiz/GreetingService.scala (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/main/scala/org/superbiz/GreetingService.scala Wed Oct 31 13:20:56 2012
@@ -0,0 +1,36 @@
+/**
+ * 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.superbiz
+
+import javax.ejb.{Singleton, LocalBean, Lock, LockType}
+
+object GreetingService {
+ val DefaultName = "Scala"
+}
+
+@LocalBean
+@Singleton
+@Lock(LockType.READ)
+class GreetingService {
+ def hi(name: String = GreetingService.DefaultName) = {
+ if (name != null) {
+ "hi " + name
+ } else {
+ "hi " + GreetingService.DefaultName
+ }
+ }
+}
Added: websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/test/scala/org/superbiz/GreetingServiceTest.scala
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/test/scala/org/superbiz/GreetingServiceTest.scala (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/scala-basic/src/test/scala/org/superbiz/GreetingServiceTest.scala Wed Oct 31 13:20:56 2012
@@ -0,0 +1,63 @@
+/**
+ * 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.superbiz
+
+import org.scalatest._
+
+import javax.ejb.embeddable.EJBContainer
+import javax.inject.Inject
+
+class GreetingServiceTest extends FunSuite with BeforeAndAfterAll with BeforeAndAfterEach {
+ @Inject
+ private var service: GreetingService = null
+
+ test ("Hi scala") {
+ val message = service hi "scala"
+ assert (message == "hi scala")
+ }
+
+ test ("Default Hi") {
+ val message = service.hi()
+ assert (message == "hi Scala")
+ }
+
+ test ("Hi null") {
+ val message = service.hi(null)
+ assert (message == "hi Scala") // when called with null we use default name
+ }
+
+ /***************************************************************/
+ /** the OpenEJB Hook to be able to inject beans in this class **/
+ /** kind of internal of this test class, "hidden" being last **/
+ /***************************************************************/
+
+ private var container: EJBContainer = null
+
+ override def beforeAll () {
+ container = EJBContainer.createEJBContainer ()
+ }
+
+ override def beforeEach () {
+ container.getContext().bind ("inject", this)
+ }
+
+ override def afterAll () {
+ if (container != null) {
+ container.close()
+ }
+ }
+}