You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by zo...@apache.org on 2011/02/27 21:50:51 UTC

svn commit: r1075143 [23/23] - in /aries/tags/blueprint-0.2.1: ./ blueprint-annotation-api/ blueprint-annotation-api/src/ blueprint-annotation-api/src/main/ blueprint-annotation-api/src/main/java/ blueprint-annotation-api/src/main/java/org/ blueprint-a...

Added: aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/Activator.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/Activator.java?rev=1075143&view=auto
==============================================================================
--- aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/Activator.java (added)
+++ aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/Activator.java Sun Feb 27 20:50:38 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.aries.blueprint.testbundleb;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+    public void start(BundleContext context) {
+    }
+
+    public void stop(BundleContext context) {
+    }
+   
+}

Added: aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/BeanForBeanProcessorTest.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/BeanForBeanProcessorTest.java?rev=1075143&view=auto
==============================================================================
--- aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/BeanForBeanProcessorTest.java (added)
+++ aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/BeanForBeanProcessorTest.java Sun Feb 27 20:50:38 2011
@@ -0,0 +1,75 @@
+/**
+ *  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.aries.blueprint.testbundleb;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.aries.blueprint.BeanProcessor;
+import org.apache.aries.blueprint.testbundlea.ProcessableBean;
+
+public class BeanForBeanProcessorTest implements ProcessableBean{
+
+    Set<BeanProcessor> bps = new HashSet<BeanProcessor>();
+    Set<BeanProcessor> ad_bps = new HashSet<BeanProcessor>();
+    Set<BeanProcessor> ai_bps = new HashSet<BeanProcessor>();
+    Set<BeanProcessor> bd_bps = new HashSet<BeanProcessor>();
+    Set<BeanProcessor> bi_bps = new HashSet<BeanProcessor>();
+    
+    private List<BeanProcessor> toList(Set<BeanProcessor> s){
+        List<BeanProcessor> lbps = new ArrayList<BeanProcessor>();
+        lbps.addAll(s);
+        return lbps;
+    }
+    
+    public List<BeanProcessor> getProcessedBy() {
+        return toList(bps);
+    }
+    
+    public List<BeanProcessor> getProcessedBy(Phase p) {
+        switch(p){
+          case BEFORE_INIT : return toList(bi_bps);
+          case AFTER_INIT : return toList(ai_bps);
+          case BEFORE_DESTROY : return toList(bd_bps);
+          case AFTER_DESTROY : return toList(ad_bps);
+          default: return null;
+        }
+    }    
+
+    public void processAfterDestroy(BeanProcessor bp) {
+        bps.add(bp);
+        ad_bps.add(bp);
+    }
+
+    public void processAfterInit(BeanProcessor bp) {
+        bps.add(bp);
+        ai_bps.add(bp);
+    }
+
+    public void processBeforeDestroy(BeanProcessor bp) {
+        bps.add(bp);
+        bd_bps.add(bp);
+    }
+
+    public void processBeforeInit(BeanProcessor bp) {
+        bps.add(bp);
+        bi_bps.add(bp);
+    }
+
+}

Added: aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/OtherBean.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/OtherBean.java?rev=1075143&view=auto
==============================================================================
--- aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/OtherBean.java (added)
+++ aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/OtherBean.java Sun Feb 27 20:50:38 2011
@@ -0,0 +1,47 @@
+/**
+ *  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.aries.blueprint.testbundleb;
+
+public class OtherBean {
+  private TestBean testBean;
+  private String testValue;
+
+public String getTestValue() {
+    return testValue;
+}
+
+public void setTestValue(String testValue) {
+    this.testValue = testValue;
+}
+
+public TestBean getTestBean() {
+    return testBean;
+}
+
+public void setTestBean(TestBean testBean) {
+    this.testBean = testBean;
+}
+
+public void init(){
+    try{
+      this.testBean.methodToInvoke(testValue);
+    }catch(Throwable t){
+      //ignore error.
+    }
+}
+
+}

Added: aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/TestBean.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/TestBean.java?rev=1075143&view=auto
==============================================================================
--- aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/TestBean.java (added)
+++ aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/TestBean.java Sun Feb 27 20:50:38 2011
@@ -0,0 +1,60 @@
+/**
+ *  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.aries.blueprint.testbundleb;
+
+public class TestBean {
+    private String red;
+    private String green;
+    private String blue;
+    
+    public void init(){
+        setRed("EMPTY");
+        setGreen("EMPTY");
+        setBlue("EMPTY");
+    }
+    
+    public String getRed() {
+        return red;
+    }
+    public void setRed(String red) {
+        this.red = red;
+    }
+    public String getGreen() {
+        return green;
+    }
+    public void setGreen(String green) {
+        this.green = green;
+    }
+    public String getBlue() {
+        return blue;
+    }
+    public void setBlue(String blue) {
+        this.blue = blue;
+    }
+    
+    public boolean methodToInvoke(String argument){
+        if(argument!=null){
+            if(argument.equals(red)){
+                return true;
+            }
+            if(argument.equals(green)){
+                throw new RuntimeException("MATCHED ON GREEN ("+green+")");
+            }
+        }
+        return false;
+    }
+}

Added: aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/resources/OSGI-INF/blueprint/config.xml
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/resources/OSGI-INF/blueprint/config.xml?rev=1075143&view=auto
==============================================================================
--- aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/resources/OSGI-INF/blueprint/config.xml (added)
+++ aries/tags/blueprint-0.2.1/blueprint-testbundleb/src/main/resources/OSGI-INF/blueprint/config.xml Sun Feb 27 20:50:38 2011
@@ -0,0 +1,66 @@
+<?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"
+           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+           xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
+           xmlns:one="http://ns.handler.one"
+           xmlns:two="http://ns.handler.two"
+           xmlns:three="http://ns.handler.three"
+           default-availability="optional">
+
+  <!-- Default test.. no other ns interaction. -->
+  <bean id="TestBeanA" class="org.apache.aries.blueprint.testbundleb.TestBean" scope="singleton">
+     <property name="red" value="RED"/>
+     <property name="green" value="GREEN"/>
+     <property name="blue" value="BLUE"/>
+  </bean>
+
+  <!-- NShandler one test, custom element, component injection, metadata modification, passthrumetadata -->
+  <one:nshandlerone one:attribone="ONE" one:attribtwo="ONE_VALUE"/>
+  <bean id="TestBeanB" class="org.apache.aries.blueprint.testbundleb.TestBean" scope="singleton" one:attribone="red" one:attribtwo="ONE" >     
+     <property name="green" value="GREEN"/>
+     <property name="blue" value="BLUE"/>
+  </bean>
+  
+  <!-- Nshandler two test, interceptors -->
+  <bean id="TestBeanC" class="org.apache.aries.blueprint.testbundleb.TestBean" scope="singleton" two:attribone="dummy">
+     <property name="red" value="RED"/>
+     <property name="green" value="GREEN"/>
+     <property name="blue" value="BLUE"/>
+  </bean>
+  
+  <!--  drives a method on intercepted TestBeanC expects true as response -->
+  <bean id="OtherBeanA" class="org.apache.aries.blueprint.testbundleb.OtherBean" init-method="init">
+     <property name="testBean" ref="TestBeanC" />
+     <property name="testValue" value="RED"/>
+  </bean>
+  
+  <!--  drives a method on intercepted TestBeanC expects false as response -->
+    <bean id="OtherBeanB" class="org.apache.aries.blueprint.testbundleb.OtherBean" init-method="init">
+     <property name="testBean" ref="TestBeanC" />
+     <property name="testValue" value="BLUE"/>
+  </bean>
+  
+  <!--  causes injection of a bean processor, which understands this sort of bean.. -->
+  <bean id="ProcessedBean" class="org.apache.aries.blueprint.testbundleb.BeanForBeanProcessorTest" three:attribone="true"/>
+  
+  <reference activation="eager" 
+    availability="optional" 
+    interface="org.apache.aries.blueprint.testbundlea.InterfaceWithDependency" />
+</blueprint>
+

Added: aries/tags/blueprint-0.2.1/pom.xml
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.2.1/pom.xml?rev=1075143&view=auto
==============================================================================
--- aries/tags/blueprint-0.2.1/pom.xml (added)
+++ aries/tags/blueprint-0.2.1/pom.xml Sun Feb 27 20:50:38 2011
@@ -0,0 +1,187 @@
+<!--
+ 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">
+
+    <parent>
+        <groupId>org.apache.aries</groupId>
+        <artifactId>java5-parent</artifactId>
+        <version>0.2-incubating</version>
+    </parent>  
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.aries.blueprint</groupId>
+    <artifactId>blueprint</artifactId>
+    <name>Apache Aries Blueprint</name>
+    <version>0.2.1</version>
+    <packaging>pom</packaging>
+
+    <description>
+        Implementation of the Blueprint Container Specification
+    </description>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/aries/tags/blueprint-0.2.1</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/aries/tags/blueprint-0.2.1</developerConnection>
+        <url>http://svn.apache.org/viewvc/incubator/aries/tags/blueprint-0.2.1</url>
+    </scm>
+    
+    <dependencyManagement>
+        <dependencies>
+            <!-- internal dependencies -->
+            <dependency>
+                <groupId>org.apache.aries.blueprint</groupId>
+                <artifactId>org.apache.aries.blueprint.api</artifactId>
+                <version>${version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.aries.blueprint</groupId>
+                <artifactId>org.apache.aries.blueprint.core</artifactId>
+                <version>${version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.aries.blueprint</groupId>
+                <artifactId>org.apache.aries.blueprint.cm</artifactId>
+                <version>${version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.aries.blueprint</groupId>
+                <artifactId>org.apache.aries.blueprint</artifactId>
+                <version>${version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.aries.blueprint</groupId>
+                <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
+                <version>${version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.aries.blueprint</groupId>
+                <artifactId>org.apache.aries.blueprint.annotation.impl</artifactId>
+                <version>${version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.aries.blueprint</groupId>
+                <artifactId>org.apache.aries.blueprint.sample</artifactId>
+                <version>${version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.aries.blueprint</groupId>
+                <artifactId>org.apache.aries.blueprint.testbundlea</artifactId>
+                <version>${version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.aries.blueprint</groupId>
+                <artifactId>org.apache.aries.blueprint.testbundleb</artifactId>
+                <version>${version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.aries.blueprint</groupId>
+                <artifactId>org.apache.aries.blueprint.itests</artifactId>
+                <version>${version}</version>
+            </dependency>
+
+            <!-- external dependencies -->
+            <dependency>
+                <groupId>org.apache.aries</groupId>
+                <artifactId>org.apache.aries.util</artifactId>
+                <version>0.2-incubating</version> 
+            </dependency>
+            <!-- Use an OSGi enabled cglib version, so that BND can find the version information
+                 and we can use it in integration tests -->
+            <dependency>
+                <groupId>org.apache.servicemix.bundles</groupId>
+                <artifactId>org.apache.servicemix.bundles.cglib</artifactId>
+                <version>2.1_3_4</version>
+            </dependency>
+            <!-- TODO: We need felix 2.0.0 which is not supported by pax exam yet,
+                 so tests are only enabled on equinox for now
+            <dependency>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>org.apache.felix.main</artifactId>
+                <version>2.0.0</version>
+            </dependency>-->
+            <dependency>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>org.apache.felix.configadmin</artifactId>
+                <version>1.2.4</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>org.apache.felix</groupId>
+                        <artifactId>org.osgi.core</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.apache.felix</groupId>
+                        <artifactId>org.osgi.compendium</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+            <dependency>
+                <groupId>asm</groupId>
+                <artifactId>asm-all</artifactId>
+                <version>3.2</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.xbean</groupId>
+                <artifactId>xbean-finder</artifactId>
+                <version>3.7</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-release-plugin</artifactId>
+                    <version>2.0</version>
+                    <configuration>
+                        <useReleaseProfile>false</useReleaseProfile>
+                        <goals>deploy</goals>
+                        <arguments>-Papache-release -DskipTests=true</arguments>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+
+    <modules>
+        <module>blueprint-api</module>
+        <module>blueprint-core</module>
+        <module>blueprint-cm</module>
+        <module>blueprint-bundle</module>
+        <module>blueprint-sample</module>
+        <module>blueprint-annotation-api</module>
+        <module>blueprint-annotation-impl</module>
+        <module>blueprint-sample-annotation</module>
+        <module>blueprint-annotation-itest</module>
+        <module>blueprint-testbundlea</module>
+        <module>blueprint-testbundleb</module>
+        <module>blueprint-itests</module>
+    </modules>
+
+</project>
+