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/30 11:18:32 UTC
svn commit: r836578 - in /websites/staging/openejb/trunk: cgi-bin/ content/
content/examples-trunk/
content/examples-trunk/rest-applicationcomposer-mockito/
content/examples-trunk/rest-applicationcomposer-mockito/src/
content/examples-trunk/rest-applic...
Author: buildbot
Date: Tue Oct 30 10:18:31 2012
New Revision: 836578
Log:
Staging update by buildbot for openejb
Added:
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/pom.xml (with props)
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/java/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/java/org/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/java/org/superbiz/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/GreetingService.java
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/Messager.java
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/resources/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/resources/META-INF/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/resources/META-INF/beans.xml (with props)
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/test/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/test/java/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/test/java/org/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/test/java/org/superbiz/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/test/java/org/superbiz/composed/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/test/java/org/superbiz/composed/rest/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/test/java/org/superbiz/composed/rest/GreetingServiceTest.java
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/test/resources/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/test/resources/META-INF/
websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/test/resources/META-INF/beans.xml (with props)
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 Tue Oct 30 10:18:31 2012
@@ -1 +1 @@
-1402407
+1403653
Propchange: websites/staging/openejb/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Oct 30 10:18:31 2012
@@ -1 +1 @@
-1402407
+1403653
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 Tue Oct 30 10:18:31 2012
@@ -17,7 +17,7 @@
limitations under the License.
-->
<!--test 2-->
-<!-- $Rev: 1399967 $ $Date: 2012-10-19 05:20:53 +0000 (Fri, 19 Oct 2012) $ -->
+<!-- $Rev: 1403653 $ $Date: 2012-10-30 10:18:16 +0000 (Tue, 30 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>
@@ -98,6 +98,7 @@
<module>realm-in-tomee</module>
<module>reload-persistence-unit-properties</module>
<module>resources-declared-in-webapp</module>
+ <module>rest-applicationcomposer-mockito</module>
<module>rest-on-ejb</module>
<module>rest-example</module>
<module>rest-example-with-application</module>
Added: websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/pom.xml
==============================================================================
Binary file - no diff available.
Propchange: websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/pom.xml
------------------------------------------------------------------------------
svn:mime-type = application/xml
Added: websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/GreetingService.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/GreetingService.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/GreetingService.java Tue Oct 30 10:18:31 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.
+ */
+package org.superbiz.composed.rest;
+
+import javax.ejb.Singleton;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Singleton
+@Path("/greeting")
+public class GreetingService {
+ @Inject
+ private Messager messager;
+
+ @GET
+ public String message() {
+ return messager.message();
+ }
+}
Added: websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/Messager.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/Messager.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/Messager.java Tue Oct 30 10:18:31 2012
@@ -0,0 +1,21 @@
+/**
+ * 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.composed.rest;
+
+public interface Messager {
+ String message();
+}
Added: websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/resources/META-INF/beans.xml
==============================================================================
Binary file - no diff available.
Propchange: websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/main/resources/META-INF/beans.xml
------------------------------------------------------------------------------
svn:mime-type = application/xml
Added: websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/test/java/org/superbiz/composed/rest/GreetingServiceTest.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/test/java/org/superbiz/composed/rest/GreetingServiceTest.java (added)
+++ websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/test/java/org/superbiz/composed/rest/GreetingServiceTest.java Tue Oct 30 10:18:31 2012
@@ -0,0 +1,68 @@
+/**
+ * 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.composed.rest;
+
+import org.apache.openejb.OpenEjbContainer;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.junit.Configuration;
+import org.apache.openejb.junit.Module;
+import org.apache.openejb.loader.IO;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import javax.enterprise.inject.Produces;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Properties;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.when;
+
+@RunWith(ApplicationComposer.class)
+public class GreetingServiceTest {
+ @Mock
+ @Produces
+ public static Messager messager;
+
+ @Before
+ public void injectMocks() {
+ MockitoAnnotations.initMocks(this);
+ }
+
+ @Configuration
+ public Properties configuration() {
+ return new Properties() {{
+ setProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, Boolean.TRUE.toString());
+ }};
+ }
+
+ @Module
+ public Class<?>[] app() {
+ return new Class<?>[] { GreetingService.class, Messager.class };
+ }
+
+ @Test
+ public void checkMockIsUsed() throws IOException {
+ when(messager.message()).thenReturn("mockito");
+
+ final String message = IO.slurp(new URL("http://localhost:4204/GreetingServiceTest/greeting/"));
+ assertEquals("mockito", message);
+ }
+}
Added: websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/test/resources/META-INF/beans.xml
==============================================================================
Binary file - no diff available.
Propchange: websites/staging/openejb/trunk/content/examples-trunk/rest-applicationcomposer-mockito/src/test/resources/META-INF/beans.xml
------------------------------------------------------------------------------
svn:mime-type = application/xml