You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by ge...@apache.org on 2009/10/17 23:07:59 UTC

svn commit: r826310 - in /incubator/openwebbeans/trunk/atinject-tck: ./ src/ src/main/ src/site/ src/site/apt/ src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/webbeans/ src/test/java/org/apache/webbeans/at...

Author: gerdogdu
Date: Sat Oct 17 21:07:58 2009
New Revision: 826310

URL: http://svn.apache.org/viewvc?rev=826310&view=rev
Log:
Adding atinject tck suite. I did not find atinject tck from maven site, so I create using mvn install:install
file command. Tests are not passed succesfully.

Added:
    incubator/openwebbeans/trunk/atinject-tck/   (with props)
    incubator/openwebbeans/trunk/atinject-tck/pom.xml   (with props)
    incubator/openwebbeans/trunk/atinject-tck/src/
    incubator/openwebbeans/trunk/atinject-tck/src/main/
    incubator/openwebbeans/trunk/atinject-tck/src/site/
    incubator/openwebbeans/trunk/atinject-tck/src/site/apt/
    incubator/openwebbeans/trunk/atinject-tck/src/site/apt/index.apt   (with props)
    incubator/openwebbeans/trunk/atinject-tck/src/site/site.xml   (with props)
    incubator/openwebbeans/trunk/atinject-tck/src/test/
    incubator/openwebbeans/trunk/atinject-tck/src/test/java/
    incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/
    incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/
    incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/
    incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/
    incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/
    incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/OpenWebBeansAtInjectTck.java   (with props)
    incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/container/
    incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/container/AtInjectContainer.java   (with props)
    incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/
    incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/DriverBinding.java   (with props)
    incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/SpareBinding.java   (with props)
    incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/SpecificProducer.java   (with props)
    incubator/openwebbeans/trunk/atinject-tck/src/test/resources/

Propchange: incubator/openwebbeans/trunk/atinject-tck/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Oct 17 21:07:58 2009
@@ -0,0 +1,4 @@
+.settings
+target
+.classpath
+.project

Added: incubator/openwebbeans/trunk/atinject-tck/pom.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/atinject-tck/pom.xml?rev=826310&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/atinject-tck/pom.xml (added)
+++ incubator/openwebbeans/trunk/atinject-tck/pom.xml Sat Oct 17 21:07:58 2009
@@ -0,0 +1,61 @@
+<?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 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>
+    <parent>
+        <groupId>org.apache.openwebbeans</groupId>
+        <artifactId>openwebbeans</artifactId>
+        <version>1.0.0-incubating-SNAPSHOT</version>
+    </parent>
+    <artifactId>atinject-tck</artifactId>
+    <name>Apache OpenWebBeans :: OpenWebBeans JSR-330 TCK</name>
+    <packaging>jar</packaging>
+    <description>JSR-330 TCK Suite</description>
+    
+    <properties>
+    	<atinject.tck.version>1.0.0</atinject.tck.version>    	
+    </properties>
+    
+    <dependencies>
+       <dependency>
+         <groupId>javax.atinject.tck</groupId>
+         <artifactId>atinject-tck</artifactId>
+         <version>${atinject.tck.version}</version>
+         <scope>test</scope>
+      </dependency>
+
+        <dependency>
+            <groupId>org.apache.openwebbeans</groupId>
+            <artifactId>atinject-api</artifactId>
+            <scope>test</scope>            
+        </dependency>
+        
+		 <dependency>
+            <groupId>org.apache.openwebbeans</groupId>
+            <artifactId>openwebbeans-porting</artifactId>
+        </dependency>
+                
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+        
+        
+    </dependencies>
+</project>

Propchange: incubator/openwebbeans/trunk/atinject-tck/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/atinject-tck/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/atinject-tck/src/site/apt/index.apt?rev=826310&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/atinject-tck/src/site/apt/index.apt (added)
+++ incubator/openwebbeans/trunk/atinject-tck/src/site/apt/index.apt Sat Oct 17 21:07:58 2009
@@ -0,0 +1,16 @@
+~~ 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.
+OpenWebBeans API
+
+  Application Programming Interface for the JSR-299 
+  Java Contexts and Dependency Injection.
+

Propchange: incubator/openwebbeans/trunk/atinject-tck/src/site/apt/index.apt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/atinject-tck/src/site/site.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/atinject-tck/src/site/site.xml?rev=826310&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/atinject-tck/src/site/site.xml (added)
+++ incubator/openwebbeans/trunk/atinject-tck/src/site/site.xml Sat Oct 17 21:07:58 2009
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--
+	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 name="OpenWebBeans-API">
+<!--
+    <bannerLeft>
+        <name>Apache OpenWebBeans</name>
+        <src>http://incubator.apache.org/openwebbeans/images/openwebbeans.png</src>
+        <href>http://incubator.apache.org/openwebbeans</href>
+    </bannerLeft>
+    
+    <bannerRight>
+        <name>Apache Banner</name>
+        <src>http://incubator.apache.org/openwebbeans/images/apache-incubator-logo.png</src>
+        <href>http://incubator.apache.org/openwebbeans</href>
+    </bannerRight>
+ -->
+    <publishDate format="dd MMM yyyy" />
+    <version position="left"/>
+    
+    <body>
+        <breadcrumbs>
+        <item name="Incubator" href="http://incubator.apache.org"/>
+        <item name="OpenWebBeans" href="http://incubator.apache.org/openwebbeans"/>
+        <item name="API" href="http://incubator.apache.org/openwebbeans/${project.version}/openwebbeans-api"/>
+        </breadcrumbs>
+
+        <menu name="Overview">
+            <item name="Introduction" href="index.html" />
+        </menu>
+    
+    	<menu ref="reports"/>
+    </body>
+</project>
+

Propchange: incubator/openwebbeans/trunk/atinject-tck/src/site/site.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/OpenWebBeansAtInjectTck.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/OpenWebBeansAtInjectTck.java?rev=826310&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/OpenWebBeansAtInjectTck.java (added)
+++ incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/OpenWebBeansAtInjectTck.java Sat Oct 17 21:07:58 2009
@@ -0,0 +1,27 @@
+/*
+ * 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.webbeans.atinject.tck;
+
+import org.apache.webbeans.atinject.tck.container.AtInjectContainer;
+
+import junit.framework.Test;
+
+public class OpenWebBeansAtInjectTck
+{
+    public static Test suite()
+    {
+        return new AtInjectContainer().start();
+    }
+
+}

Propchange: incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/OpenWebBeansAtInjectTck.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/container/AtInjectContainer.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/container/AtInjectContainer.java?rev=826310&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/container/AtInjectContainer.java (added)
+++ incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/container/AtInjectContainer.java Sat Oct 17 21:07:58 2009
@@ -0,0 +1,90 @@
+/*
+ * 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.webbeans.atinject.tck.container;
+
+import java.lang.annotation.Annotation;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+import junit.framework.Test;
+
+import org.apache.webbeans.atinject.tck.specific.SpecificProducer;
+import org.apache.webbeans.test.tck.StandaloneContainersImpl;
+import org.atinject.tck.Tck;
+import org.atinject.tck.auto.Car;
+import org.atinject.tck.auto.Convertible;
+import org.atinject.tck.auto.FuelTank;
+import org.atinject.tck.auto.Seat;
+import org.atinject.tck.auto.Tire;
+import org.atinject.tck.auto.V8Engine;
+import org.atinject.tck.auto.accessories.Cupholder;
+import org.jboss.testharness.api.DeploymentException;
+
+public class AtInjectContainer extends StandaloneContainersImpl
+{ 
+    private static Set<Class<?>> deploymentClasses = null;
+    
+    static
+    {
+        deploymentClasses = new HashSet<Class<?>>();
+        deploymentClasses.add(Convertible.class);
+        deploymentClasses.add(Seat.class);
+        deploymentClasses.add(Tire.class);
+        deploymentClasses.add(V8Engine.class);
+        deploymentClasses.add(Cupholder.class);
+        deploymentClasses.add(FuelTank.class);
+        
+        //Adding our special producer
+        deploymentClasses.add(SpecificProducer.class);
+        
+    }
+    
+    public AtInjectContainer()
+    {
+        
+    }
+    
+    public Test start()
+    {
+        try
+        {
+            deploy(deploymentClasses);
+            
+            BeanManager manager = getBeanManager(); 
+            Set<Bean<?>> beans = manager.getBeans(Car.class, new Annotation[0]);
+            Bean<?> carBean = beans.iterator().next();
+            
+            Car car = (Car)manager.getReference(carBean , Car.class , manager.createCreationalContext(carBean));
+            
+            return Tck.testsFor(car, false, true);
+            
+        }catch(DeploymentException e)
+        {
+            e.printStackTrace();
+        }
+        
+        return null;
+    }
+    
+    
+    public void stop()
+    {
+        undeploy();            
+
+    }
+    
+}

Propchange: incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/container/AtInjectContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/DriverBinding.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/DriverBinding.java?rev=826310&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/DriverBinding.java (added)
+++ incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/DriverBinding.java Sat Oct 17 21:07:58 2009
@@ -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.webbeans.atinject.tck.specific;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+
+@Qualifier
+@Retention(RetentionPolicy.RUNTIME)
+@Target( { ElementType.FIELD, ElementType.METHOD, ElementType.TYPE, ElementType.PARAMETER })
+public @interface DriverBinding 
+{
+
+}

Propchange: incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/DriverBinding.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/SpareBinding.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/SpareBinding.java?rev=826310&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/SpareBinding.java (added)
+++ incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/SpareBinding.java Sat Oct 17 21:07:58 2009
@@ -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.webbeans.atinject.tck.specific;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+
+@Qualifier
+@Retention(RetentionPolicy.RUNTIME)
+@Target( { ElementType.FIELD, ElementType.METHOD, ElementType.TYPE, ElementType.PARAMETER })
+public @interface SpareBinding 
+{
+
+}

Propchange: incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/SpareBinding.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/SpecificProducer.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/SpecificProducer.java?rev=826310&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/SpecificProducer.java (added)
+++ incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/SpecificProducer.java Sat Oct 17 21:07:58 2009
@@ -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.apache.webbeans.atinject.tck.specific;
+
+import javax.enterprise.inject.BeanTypes;
+import javax.enterprise.inject.Default;
+import javax.enterprise.inject.New;
+import javax.enterprise.inject.Produces;
+import javax.inject.Named;
+
+import org.atinject.tck.auto.Drivers;
+import org.atinject.tck.auto.DriversSeat;
+import org.atinject.tck.auto.FuelTank;
+import org.atinject.tck.auto.Seat;
+import org.atinject.tck.auto.accessories.Cupholder;
+import org.atinject.tck.auto.accessories.SpareTire;
+
+
+public class SpecificProducer
+{
+    public SpecificProducer()
+    {
+        
+    }
+    
+    @Produces @Drivers
+    public Seat produceDrivers(@New Cupholder cupHolder)
+    {
+        return new DriversSeat(cupHolder);
+    }
+    
+    
+    @Produces @DriverBinding @BeanTypes(value={DriversSeat.class})
+    public DriversSeat produceDriverSeat(@New Cupholder cupHolder)
+    {
+        return new DriversSeat(cupHolder);
+    }
+    
+    
+    @Produces @Named("spare") @SpareBinding
+    public SpareTire produceSpare(@New FuelTank forSuper, @New FuelTank forSub)
+    {
+        return new SpareTire(forSuper, forSub);
+    }
+    
+    @Produces @Default @BeanTypes(value={SpareTire.class})
+    public SpareTire produceSpareTire(@New FuelTank forSuper, @New FuelTank forSub)
+    {
+        return new SpareTire(forSuper, forSub);
+    }
+    
+}

Propchange: incubator/openwebbeans/trunk/atinject-tck/src/test/java/org/apache/webbeans/atinject/tck/specific/SpecificProducer.java
------------------------------------------------------------------------------
    svn:eol-style = native