geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From viol...@apache.org
Subject svn commit: r1080495 [2/2] - in /geronimo/server/trunk/testsuite/aries-testsuite: ./ ds-jndi/ ds-jndi/ds-db/ ds-jndi/ds-db/src/ ds-jndi/ds-db/src/main/ ds-jndi/ds-db/src/main/resources/ ds-jndi/ds-db/src/main/resources/OSGI-INF/ ds-jndi/ds-db/src/main/...
Date Fri, 11 Mar 2011 09:27:11 GMT
Added: geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/mail-wab/src/main/resources/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/mail-wab/src/main/resources/WEB-INF/web.xml?rev=1080495&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/mail-wab/src/main/resources/WEB-INF/web.xml
(added)
+++ geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/mail-wab/src/main/resources/WEB-INF/web.xml
Fri Mar 11 09:27:06 2011
@@ -0,0 +1,38 @@
+<?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.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="3.0"
+    metadata-complete="true">
+
+       <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+        <welcome-file>index.htm</welcome-file>
+        <welcome-file>index.jsp</welcome-file>
+    </welcome-file-list>
+    
+    <servlet>
+        <display-name>MailServlet</display-name>
+        <servlet-name>MailServlet</servlet-name>
+        <servlet-class>org.apache.geronimo.testsuite.aries.mail.web.MailServlet</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>MailServlet</servlet-name>
+        <url-pattern>/MailServlet</url-pattern>
+       
+    </servlet-mapping>
+</web-app>

Added: geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/pom.xml?rev=1080495&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/pom.xml (added)
+++ geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/pom.xml Fri Mar 11 09:27:06
2011
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+  <parent>
+    <artifactId>aries-testsuite</artifactId>
+    <groupId>org.apache.geronimo.testsuite</groupId>
+    <version>3.0-SNAPSHOT</version>
+  </parent>  
+  
+  <artifactId>mail-osgi-service</artifactId>
+  
+  <name>Geronimo TestSuite :: Aries Testsuite :: mail-osgi-service</name>
+  
+  <packaging>pom</packaging>
+  
+  <modules>
+    <module>mail-wab</module>
+    <module>mail-eba</module>
+  </modules>
+</project>
\ No newline at end of file

Added: geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/src/main/java/org/apache/geronimo/testsuite/App.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/src/main/java/org/apache/geronimo/testsuite/App.java?rev=1080495&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/src/main/java/org/apache/geronimo/testsuite/App.java
(added)
+++ geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/src/main/java/org/apache/geronimo/testsuite/App.java
Fri Mar 11 09:27:06 2011
@@ -0,0 +1,13 @@
+package org.apache.geronimo.testsuite;
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}

Added: geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/src/test/java/org/apache/geronimo/testsuite/AppTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/src/test/java/org/apache/geronimo/testsuite/AppTest.java?rev=1080495&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/src/test/java/org/apache/geronimo/testsuite/AppTest.java
(added)
+++ geronimo/server/trunk/testsuite/aries-testsuite/mail-osgi-service/src/test/java/org/apache/geronimo/testsuite/AppTest.java
Fri Mar 11 09:27:06 2011
@@ -0,0 +1,38 @@
+package org.apache.geronimo.testsuite;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest 
+    extends TestCase
+{
+    /**
+     * Create the test case
+     *
+     * @param testName name of the test case
+     */
+    public AppTest( String testName )
+    {
+        super( testName );
+    }
+
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite()
+    {
+        return new TestSuite( AppTest.class );
+    }
+
+    /**
+     * Rigourous Test :-)
+     */
+    public void testApp()
+    {
+        assertTrue( true );
+    }
+}

Added: geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-api/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-api/pom.xml?rev=1080495&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-api/pom.xml
(added)
+++ geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-api/pom.xml
Fri Mar 11 09:27:06 2011
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>osgi-service-custom</artifactId>
+    <groupId>org.apache.geronimo.testsuite</groupId>
+    <version>3.0-SNAPSHOT</version>
+  </parent>
+  
+  <artifactId>custom-api</artifactId>
+ 
+  <name>Geronimo TestSuite :: Aries Testsuite :: custom-api</name>
+  
+   <packaging>bundle</packaging>
+  
+  <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>                        
+                        <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Added: geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-api/src/main/java/org/apache/geronimo/testsuite/aries/custom/api/HelloService.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-api/src/main/java/org/apache/geronimo/testsuite/aries/custom/api/HelloService.java?rev=1080495&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-api/src/main/java/org/apache/geronimo/testsuite/aries/custom/api/HelloService.java
(added)
+++ geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-api/src/main/java/org/apache/geronimo/testsuite/aries/custom/api/HelloService.java
Fri Mar 11 09:27:06 2011
@@ -0,0 +1,26 @@
+/**
+ *  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.apache.geronimo.testsuite.aries.custom.api;
+
+/**
+ * Hello world!
+ *
+ */
+public interface HelloService 
+{
+  String sayHello();
+}

Added: geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-eba/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-eba/pom.xml?rev=1080495&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-eba/pom.xml
(added)
+++ geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-eba/pom.xml
Fri Mar 11 09:27:06 2011
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>osgi-service-custom</artifactId>
+    <groupId>org.apache.geronimo.testsuite</groupId>
+    <version>3.0-SNAPSHOT</version>
+  </parent>
+  
+  <artifactId>custom-eba</artifactId>
+  
+  <name>Geronimo TestSuite :: Aries Testsuite :: custom-eba</name>
+  
+  
+  <packaging>eba</packaging>
+  
+  <dependencies>     
+        <dependency>
+            <groupId>org.apache.geronimo.testsuite</groupId>
+            <artifactId>custom-api</artifactId>
+            <version>${project.version}</version>            
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.testsuite</groupId>
+            <artifactId>custom-impl</artifactId>
+            <version>${project.version}</version>            
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.testsuite</groupId>
+            <artifactId>custom-wab</artifactId>
+            <version>${project.version}</version>            
+        </dependency>       
+    </dependencies>
+  
+   <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.aries</groupId>
+                <artifactId>eba-maven-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <generateManifest>true</generateManifest>
+                    <instructions>
+                        <Application-Version>1.0.0</Application-Version>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    
+     <profiles>
+        <profile>
+            <id>it</id>
+            <activation>
+                <property>
+                    <name>it</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>
+                        <configuration>                            
+                            <systemPropertyVariables>           
+                                <webAppName>custom</webAppName>             
             
+                            </systemPropertyVariables>
+                        </configuration>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.geronimo.buildsupport</groupId>
+                        <artifactId>geronimo-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>deploy-eba</id>
+                                <phase>pre-integration-test</phase>
+                                <goals>
+                                    <goal>deploy-module</goal>
+                                </goals>
+                                <configuration>
+                                    <moduleArchive>${project.build.directory}/${project.artifactId}-${project.version}.eba</moduleArchive>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>undeploy-eba-as-moduleId</id>
+                                <phase>post-integration-test</phase>
+                                <goals>
+                                    <goal>undeploy-module</goal>
+                                </goals>
+                                <configuration>
+                                    <moduleId>${project.groupId}/${project.artifactId}/1.0.0/eba</moduleId>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>

Added: geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-eba/src/test/java/org/apache/geronimo/testsuite/aries/custom/test/CustomOSGIServiceTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-eba/src/test/java/org/apache/geronimo/testsuite/aries/custom/test/CustomOSGIServiceTest.java?rev=1080495&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-eba/src/test/java/org/apache/geronimo/testsuite/aries/custom/test/CustomOSGIServiceTest.java
(added)
+++ geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-eba/src/test/java/org/apache/geronimo/testsuite/aries/custom/test/CustomOSGIServiceTest.java
Fri Mar 11 09:27:06 2011
@@ -0,0 +1,67 @@
+/**
+ *  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.apache.geronimo.testsuite.aries.custom.test;
+
+import org.apache.geronimo.testsupport.TestSupport;
+import org.testng.annotations.Test;
+import org.apache.geronimo.testsupport.HttpUtils;
+
+import java.net.URL;
+import java.io.IOException;
+/**
+ * Unit test for simple App.
+ */
+public class CustomOSGIServiceTest extends TestSupport{
+    private String baseURL = "http://localhost:8080/";
+
+    @Test
+    public void testServlet() throws Exception {
+        checkReply("/CustomServlet");
+    }
+
+
+    private void checkReply(String address)
+        throws Exception {
+        String warName = System.getProperty("webAppName");
+        assertNotNull(warName);
+        URL url = new URL(baseURL + warName + address);
+       
+        String reply = doGET(url, 6, 10 * 1000);
+        assertTrue("Custom OSGI Service", 
+                   reply.contains("Hello!"));
+        
+        
+        
+    }
+  
+    private String doGET(URL url, int repeat, long delay) {
+        for (int i = 0; i < repeat; i++) {
+            try {
+                return HttpUtils.doGET(url); 
+            } catch (IOException e) {
+                // ignore
+                try {
+                    Thread.sleep(delay);
+                } catch (Exception ee) {
+                    break;
+                }
+            }
+        }
+        fail("Did not get servlet response in time");
+        return "";
+    }
+}
\ No newline at end of file

Added: geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-impl/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-impl/pom.xml?rev=1080495&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-impl/pom.xml
(added)
+++ geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-impl/pom.xml
Fri Mar 11 09:27:06 2011
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>osgi-service-custom</artifactId>
+    <groupId>org.apache.geronimo.testsuite</groupId>
+    <version>3.0-SNAPSHOT</version>
+  </parent>
+  
+  <artifactId>custom-impl</artifactId>
+  
+  <name>Geronimo TestSuite :: Aries Testsuite :: custom-impl</name>
+  
+  <packaging>bundle</packaging>
+  
+  <dependencies>     
+        <dependency>
+            <groupId>org.apache.geronimo.testsuite</groupId>
+            <artifactId>custom-api</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+  
+  <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>                        
+                        <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+  
+</project>

Added: geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-impl/src/main/java/org/apache/geronimo/testsuite/aries/custom/impl/HelloImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-impl/src/main/java/org/apache/geronimo/testsuite/aries/custom/impl/HelloImpl.java?rev=1080495&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-impl/src/main/java/org/apache/geronimo/testsuite/aries/custom/impl/HelloImpl.java
(added)
+++ geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-impl/src/main/java/org/apache/geronimo/testsuite/aries/custom/impl/HelloImpl.java
Fri Mar 11 09:27:06 2011
@@ -0,0 +1,30 @@
+/**
+ *  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.apache.geronimo.testsuite.aries.custom.impl;
+
+import org.apache.geronimo.testsuite.aries.custom.api.HelloService;
+/**
+ * Hello world!
+ *
+ */
+public class HelloImpl implements HelloService
+{
+     public String sayHello() {      
+       return "Hello!";
+    }
+    
+}

Added: geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-impl/src/main/resources/OSGI-INF/blueprint/blueprint.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-impl/src/main/resources/OSGI-INF/blueprint/blueprint.xml?rev=1080495&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-impl/src/main/resources/OSGI-INF/blueprint/blueprint.xml
(added)
+++ geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-impl/src/main/resources/OSGI-INF/blueprint/blueprint.xml
Fri Mar 11 09:27:06 2011
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+        <!--
+                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.
+        -->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+        <bean id="customservice"
+                class="org.apache.geronimo.testsuite.aries.custom.impl.HelloImpl">
+        </bean>
+
+        <service ref="customservice"
+                interface="org.apache.geronimo.testsuite.aries.custom.api.HelloService" />
+
+</blueprint>

Added: geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-wab/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-wab/pom.xml?rev=1080495&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-wab/pom.xml
(added)
+++ geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-wab/pom.xml
Fri Mar 11 09:27:06 2011
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>osgi-service-custom</artifactId>
+    <groupId>org.apache.geronimo.testsuite</groupId>
+    <version>3.0-SNAPSHOT</version>
+  </parent>
+  
+  <artifactId>custom-wab</artifactId>
+  
+  <name>Geronimo TestSuite :: Aries Testsuite :: custom-wab</name>
+  
+  <packaging>bundle</packaging>
+  
+  <dependencies>
+     <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.testsuite</groupId>
+            <artifactId>custom-api</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.testsuite</groupId>
+            <artifactId>custom-impl</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-servlet_3.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+  <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                       <Web-ContextPath>/custom</Web-ContextPath>           
        
+                        <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+        <Private-Package>org.apache.geronimo.testsuite.aries.custom.web</Private-Package>
+         <Export-Package>!org.apache.geronimo.testsuite.aries.custom.web</Export-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Added: geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-wab/src/main/java/org/apache/geronimo/testsuite/aries/custom/web/CustomServlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-wab/src/main/java/org/apache/geronimo/testsuite/aries/custom/web/CustomServlet.java?rev=1080495&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-wab/src/main/java/org/apache/geronimo/testsuite/aries/custom/web/CustomServlet.java
(added)
+++ geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-wab/src/main/java/org/apache/geronimo/testsuite/aries/custom/web/CustomServlet.java
Fri Mar 11 09:27:06 2011
@@ -0,0 +1,119 @@
+/**
+ *  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.apache.geronimo.testsuite.aries.custom.web;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.*;
+
+import java.io.PrintWriter;
+import java.io.IOException;
+import javax.servlet.annotation.WebServlet;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+import org.apache.geronimo.testsuite.aries.custom.api.HelloService;
+/**
+ * Call Custom OSGI Registered Service
+ *
+ */
+@WebServlet("/customservlet")
+public class CustomServlet extends HttpServlet
+{
+    private ServletContext sc;
+    private BundleContext bundleContext;   
+    private static final String OSGI_SERVICE_PREFIX = "osgi:service/";
+    
+    /**
+     * @see Servlet#init(ServletConfig)
+     */
+    public void init(ServletConfig config) throws ServletException {
+       sc = config.getServletContext();       
+    }
+    
+    /**
+     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
+     */
+    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
+        performTask(request, response);
+    }
+
+    /**
+     * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
+     */
+    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
+        performTask(request, response);
+    }
+    
+    protected void performTask(HttpServletRequest request, HttpServletResponse response){
+        try {
+            bundleContext = (BundleContext) sc.getAttribute("osgi-bundlecontext");
+            PrintWriter pw = response.getWriter();
+            if (bundleContext != null) {
+                ServiceReference sr = bundleContext.getServiceReference(HelloService.class.getName());
+                if (sr != null) {
+                    HelloService sm = (HelloService) bundleContext.getService(sr);
+                    pw.println(sm.sayHello());
+                    bundleContext.ungetService(sr);
+                }
+            } else {
+                pw.println("Bundle Context is Null");
+            }
+          
+            //JNDI Lookup via osgi:service
+            HelloService sm = (HelloService) getOSGIService(HelloService.class.getName(),null);
+            if(sm != null){
+                pw.println(sm.sayHello()); 
+            }else {
+                pw.println("Service Lookup is Null");
+            }
+            
+           
+        } catch (IOException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } 
+        
+    } 
+    
+    /**
+     * Lookup and return an osgi service
+     * 
+     * @return Object
+     * 
+     */
+    public static final Object getOSGIService(String serviceName, String filter) {
+        
+        String name = OSGI_SERVICE_PREFIX + serviceName;
+        if (filter != null) {
+            name = name + "/" + filter;
+        }
+
+        try {
+            InitialContext ic = new InitialContext();
+            return ic.lookup(name);
+        } catch (NamingException e) {            
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+}

Added: geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-wab/src/main/resources/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-wab/src/main/resources/WEB-INF/web.xml?rev=1080495&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-wab/src/main/resources/WEB-INF/web.xml
(added)
+++ geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/custom-wab/src/main/resources/WEB-INF/web.xml
Fri Mar 11 09:27:06 2011
@@ -0,0 +1,38 @@
+<?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.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="3.0"
+    metadata-complete="true">
+
+       <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+        <welcome-file>index.htm</welcome-file>
+        <welcome-file>index.jsp</welcome-file>
+    </welcome-file-list>
+    
+    <servlet>
+        <display-name>CustomServlet</display-name>
+        <servlet-name>CustomServlet</servlet-name>
+        <servlet-class>org.apache.geronimo.testsuite.aries.custom.web.CustomServlet</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>CustomServlet</servlet-name>
+        <url-pattern>/CustomServlet</url-pattern>
+       
+    </servlet-mapping>
+</web-app>

Added: geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/pom.xml?rev=1080495&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/pom.xml (added)
+++ geronimo/server/trunk/testsuite/aries-testsuite/osgi-service-custom/pom.xml Fri Mar 11
09:27:06 2011
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+  <parent>
+    <artifactId>aries-testsuite</artifactId>
+    <groupId>org.apache.geronimo.testsuite</groupId>
+    <version>3.0-SNAPSHOT</version>
+  </parent>
+  
+  <artifactId>osgi-service-custom</artifactId>
+  
+  <name>Geronimo TestSuite :: Aries Testsuite :: osgi-service-custom</name>
+  
+   <packaging>pom</packaging>
+  
+  <modules>
+    <module>custom-api</module>
+    <module>custom-impl</module>
+    <module>custom-wab</module>
+    <module>custom-eba</module>
+  </modules>
+</project>
\ No newline at end of file

Modified: geronimo/server/trunk/testsuite/aries-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/aries-testsuite/pom.xml?rev=1080495&r1=1080494&r2=1080495&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/aries-testsuite/pom.xml (original)
+++ geronimo/server/trunk/testsuite/aries-testsuite/pom.xml Fri Mar 11 09:27:06 2011
@@ -16,11 +16,7 @@
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
--->
-
-<!-- $Rev$ $Date$ -->
-
-<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">
+--><!-- $Rev$ $Date$ --><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>
 
@@ -41,8 +37,14 @@
     <modules>
         <module>simple</module>
         <module>jpa</module>
-		<module>require-bundle-test</module>
-    </modules>
+        <module>require-bundle-test</module>
+    <!--Datasource JNDI Lookup fail, so comment it
+    <module>ds-jndi</module>-->
+    <module>ejb-osgi-service</module>
+    <module>osgi-service-custom</module>    
+    <!--mail/MailSession is not bound to MailGBean, so comment it
+    <module>mail-osgi-service</module>-->
+  </modules>
 
     <build>
         <pluginManagement>
@@ -56,4 +58,4 @@
         </pluginManagement>
     </build>
 
-</project>
+</project>
\ No newline at end of file



Mime
View raw message