You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2008/05/29 04:50:52 UTC

svn commit: r661188 - in /incubator/tuscany/java/sca/itest: ./ policy-security/ policy-security/src/ policy-security/src/main/ policy-security/src/main/java/ policy-security/src/main/java/helloworld/ policy-security/src/main/resources/ policy-security/...

Author: lresende
Date: Wed May 28 19:50:51 2008
New Revision: 661188

URL: http://svn.apache.org/viewvc?rev=661188&view=rev
Log:
iTests for policy-security focusing on testing support Authorization and Security Identity Policy 

Added:
    incubator/tuscany/java/sca/itest/policy-security/
    incubator/tuscany/java/sca/itest/policy-security/pom.xml   (with props)
    incubator/tuscany/java/sca/itest/policy-security/src/
    incubator/tuscany/java/sca/itest/policy-security/src/main/
    incubator/tuscany/java/sca/itest/policy-security/src/main/java/
    incubator/tuscany/java/sca/itest/policy-security/src/main/java/helloworld/
    incubator/tuscany/java/sca/itest/policy-security/src/main/java/helloworld/HelloWorldImpl.java   (with props)
    incubator/tuscany/java/sca/itest/policy-security/src/main/java/helloworld/HelloWorldService.java   (with props)
    incubator/tuscany/java/sca/itest/policy-security/src/main/resources/
    incubator/tuscany/java/sca/itest/policy-security/src/main/resources/definitions.xml   (with props)
    incubator/tuscany/java/sca/itest/policy-security/src/main/resources/helloworld.composite   (with props)
    incubator/tuscany/java/sca/itest/policy-security/src/test/
    incubator/tuscany/java/sca/itest/policy-security/src/test/java/
    incubator/tuscany/java/sca/itest/policy-security/src/test/java/org/
    incubator/tuscany/java/sca/itest/policy-security/src/test/java/org/apache/
    incubator/tuscany/java/sca/itest/policy-security/src/test/java/org/apache/tuscany/
    incubator/tuscany/java/sca/itest/policy-security/src/test/java/org/apache/tuscany/sca/
    incubator/tuscany/java/sca/itest/policy-security/src/test/java/org/apache/tuscany/sca/itest/
    incubator/tuscany/java/sca/itest/policy-security/src/test/java/org/apache/tuscany/sca/itest/PolicyIdentityTestCase.java   (with props)
Modified:
    incubator/tuscany/java/sca/itest/pom.xml

Added: incubator/tuscany/java/sca/itest/policy-security/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/policy-security/pom.xml?rev=661188&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/policy-security/pom.xml (added)
+++ incubator/tuscany/java/sca/itest/policy-security/pom.xml Wed May 28 19:50:51 2008
@@ -0,0 +1,68 @@
+<?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>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-itest</artifactId>
+        <version>2.0-incubating-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>itest-policy-security</artifactId>
+    <name>Apache Tuscany SCA Policy Framework Integration Tests</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-embedded</artifactId>
+            <version>2.0-incubating-SNAPSHOT</version>
+            <scope>compile</scope>            
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>2.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-ws-axis2</artifactId>
+            <version>2.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-tomcat</artifactId>
+            <version>2.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>   
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.2</version>
+        </dependency>
+
+
+    </dependencies>
+</project>

Propchange: incubator/tuscany/java/sca/itest/policy-security/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/policy-security/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/itest/policy-security/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/tuscany/java/sca/itest/policy-security/src/main/java/helloworld/HelloWorldImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/policy-security/src/main/java/helloworld/HelloWorldImpl.java?rev=661188&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/policy-security/src/main/java/helloworld/HelloWorldImpl.java (added)
+++ incubator/tuscany/java/sca/itest/policy-security/src/main/java/helloworld/HelloWorldImpl.java Wed May 28 19:50:51 2008
@@ -0,0 +1,33 @@
+/*
+ * 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 helloworld;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the HelloWorld service.
+ */
+@Service(HelloWorldService.class)
+public class HelloWorldImpl implements HelloWorldService {
+
+    public String getGreetings(String name) {
+        return "Hello " + name;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/itest/policy-security/src/main/java/helloworld/HelloWorldImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/policy-security/src/main/java/helloworld/HelloWorldImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/policy-security/src/main/java/helloworld/HelloWorldService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/policy-security/src/main/java/helloworld/HelloWorldService.java?rev=661188&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/policy-security/src/main/java/helloworld/HelloWorldService.java (added)
+++ incubator/tuscany/java/sca/itest/policy-security/src/main/java/helloworld/HelloWorldService.java Wed May 28 19:50:51 2008
@@ -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 helloworld;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * This is the business interface of the HelloWorld greetings service.
+ */
+@Remotable
+public interface HelloWorldService {
+
+    public String getGreetings(String name);
+}

Propchange: incubator/tuscany/java/sca/itest/policy-security/src/main/java/helloworld/HelloWorldService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/policy-security/src/main/java/helloworld/HelloWorldService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/policy-security/src/main/resources/definitions.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/policy-security/src/main/resources/definitions.xml?rev=661188&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/policy-security/src/main/resources/definitions.xml (added)
+++ incubator/tuscany/java/sca/itest/policy-security/src/main/resources/definitions.xml Wed May 28 19:50:51 2008
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+    * 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.    
+-->
+<definitions xmlns="http://www.osoa.org/xmlns/sca/1.0" 
+             targetNamespace="http://itest/policy"
+    		 xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" 
+    		 xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+             xmlns:ip="http://itest/policy" >
+
+    <policySet name="allowed_users" appliesTo="sca:implementation.java">
+    	<permitAll/>
+    </policySet>
+</definitions>
\ No newline at end of file

Propchange: incubator/tuscany/java/sca/itest/policy-security/src/main/resources/definitions.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/policy-security/src/main/resources/definitions.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/itest/policy-security/src/main/resources/definitions.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/tuscany/java/sca/itest/policy-security/src/main/resources/helloworld.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/policy-security/src/main/resources/helloworld.composite?rev=661188&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/policy-security/src/main/resources/helloworld.composite (added)
+++ incubator/tuscany/java/sca/itest/policy-security/src/main/resources/helloworld.composite Wed May 28 19:50:51 2008
@@ -0,0 +1,33 @@
+<?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.    
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" 
+           targetNamespace="http://itest/policy"
+           xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+           xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+           xmlns:ip="http://itest/policy"
+           name="Helloworld">
+
+    <component name="HelloWorldServiceComponent">
+        <implementation.java class="helloworld.HelloWorldImpl" policySets="ip:allowed_users"/>
+        <service name="HelloWorldService">
+        	<interface.java interface="helloworld.HelloWorldService"/>
+        </service>
+    </component>
+</composite>

Propchange: incubator/tuscany/java/sca/itest/policy-security/src/main/resources/helloworld.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/policy-security/src/main/resources/helloworld.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/itest/policy-security/src/main/resources/helloworld.composite
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/tuscany/java/sca/itest/policy-security/src/test/java/org/apache/tuscany/sca/itest/PolicyIdentityTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/policy-security/src/test/java/org/apache/tuscany/sca/itest/PolicyIdentityTestCase.java?rev=661188&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/policy-security/src/test/java/org/apache/tuscany/sca/itest/PolicyIdentityTestCase.java (added)
+++ incubator/tuscany/java/sca/itest/policy-security/src/test/java/org/apache/tuscany/sca/itest/PolicyIdentityTestCase.java Wed May 28 19:50:51 2008
@@ -0,0 +1,54 @@
+/*
+ * 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.tuscany.sca.itest;
+
+import helloworld.HelloWorldService;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class PolicyIdentityTestCase {
+    private static SCADomain domain;
+    private static HelloWorldService service;
+
+    @Test
+    public void testPolicies() {
+        //TODO
+        String greetings = service.getGreetings("Luciano");
+        System.out.println(">>>" + greetings);
+    }
+
+    @BeforeClass
+    public static void init() throws Exception {
+        try {
+            domain = SCADomain.newInstance("helloworld.composite");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        service = domain.getService(HelloWorldService.class, "HelloWorldServiceComponent");
+    }
+
+    @AfterClass
+    public static void destroy() throws Exception {
+        domain.close();
+    }
+}

Propchange: incubator/tuscany/java/sca/itest/policy-security/src/test/java/org/apache/tuscany/sca/itest/PolicyIdentityTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/policy-security/src/test/java/org/apache/tuscany/sca/itest/PolicyIdentityTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/itest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/pom.xml?rev=661188&r1=661187&r2=661188&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/pom.xml (original)
+++ incubator/tuscany/java/sca/itest/pom.xml Wed May 28 19:50:51 2008
@@ -96,6 +96,7 @@
                 <module>osgi-implementation</module>
                 <module>osgi-contribution</module>
 		<module>policy</module>
+		<module>policy-security</module>
                 <module>properties</module>
                 <module>recursive</module>
                 <module>recursive-ws</module>