[webbeans-commits] Webbeans SVN: r2919 - ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr and 9 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Sun Jun 28 13:34:44 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-06-28 13:34:44 -0400 (Sun, 28 Jun 2009)
New Revision: 2919

Added:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/Alligator.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/EpochScoped.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/RomanEmpire.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/Tame.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/AddingNormalScopeTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/BeforeBeanDiscoveryObserver.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/EpochScoped.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/RomanEmpire.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/AddingPassivatingScopeTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/BeforeBeanDiscoveryObserver.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/EpochScoped.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/RomanEmpire.java
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/javax.enterprise.inject.spi.Extension
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/
   tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/javax.enterprise.inject.spi.Extension
Modified:
   ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/BeforeBeanDiscoveryObserver.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ExtensionsTest.java
   tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Add tests for scope types

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java	2009-06-28 17:32:47 UTC (rev 2918)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -87,6 +87,19 @@
       return new AnnotationStore(buildAnnotationMap(annotatedElement.getAnnotations()), buildAnnotationMap(annotatedElement.getDeclaredAnnotations()), typeStore);
    }
    
+   public static AnnotationStore of(AnnotatedElement annotatedElement, Set<Annotation> extraAnnotations, Set<Annotation> extraDeclaredAnnotations, TypeStore typeStore)
+   {
+      Map<Class<? extends Annotation>, Annotation> annotationMap = new HashMap<Class<? extends Annotation>, Annotation>();
+      annotationMap.putAll(buildAnnotationMap(annotatedElement.getAnnotations()));
+      annotationMap.putAll(buildAnnotationMap(extraAnnotations));
+      
+      Map<Class<? extends Annotation>, Annotation> declaredAnnotationMap = new HashMap<Class<? extends Annotation>, Annotation>();
+      declaredAnnotationMap.putAll(buildAnnotationMap(annotatedElement.getDeclaredAnnotations()));
+      declaredAnnotationMap.putAll(buildAnnotationMap(extraDeclaredAnnotations));
+      
+      return new AnnotationStore(annotationMap, declaredAnnotationMap, typeStore);
+   }
+   
    public static AnnotationStore of(Annotation[] annotations, Annotation[] declaredAnnotations, TypeStore typeStore)
    {
       return new AnnotationStore(buildAnnotationMap(annotations), buildAnnotationMap(declaredAnnotations), typeStore);

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java	2009-06-28 17:32:47 UTC (rev 2918)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -70,7 +70,7 @@
     */
    protected WBAnnotationImpl(Class<T> annotationType, ClassTransformer classTransformer)
    {
-      super(AnnotationStore.of(annotationType, classTransformer.getTypeStore()), annotationType, annotationType, classTransformer);
+      super(AnnotationStore.of(annotationType, classTransformer.getTypeStore().get(annotationType), classTransformer.getTypeStore().get(annotationType), classTransformer.getTypeStore()), annotationType, annotationType, classTransformer);
       this.clazz = annotationType;
       members = new HashSet<WBMethod<?>>();
       annotatedMembers = new SetHashMultiMap<Class<? extends Annotation>, WBMethod<?>>();

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/Alligator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/Alligator.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/Alligator.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.jsr299.tck.tests.deployment.lifecycle;
+
+/**
+ * @author pmuir
+ *
+ */
+ at Tame
+public class Alligator
+{
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/Alligator.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/BeforeBeanDiscoveryObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/BeforeBeanDiscoveryObserver.java	2009-06-28 17:32:47 UTC (rev 2918)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/BeforeBeanDiscoveryObserver.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -22,13 +22,13 @@
 
 /**
  * @author pmuir
- *
+ * 
  */
 public class BeforeBeanDiscoveryObserver implements Extension
 {
-   
+
    private static boolean observed;
-   
+
    /**
     * @return the observed
     */
@@ -36,7 +36,7 @@
    {
       return observed;
    }
-   
+
    /**
     * @param observed the observed to set
     */
@@ -44,11 +44,12 @@
    {
       BeforeBeanDiscoveryObserver.observed = observed;
    }
-   
 
    public void observe(@Observes BeforeBeanDiscovery beforeBeanDiscovery)
    {
       setObserved(true);
+      beforeBeanDiscovery.addBindingType(Tame.class);
+      beforeBeanDiscovery.addScopeType(EpochScoped.class, false, false);
    }
-   
+
 }

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/EpochScoped.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/EpochScoped.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/EpochScoped.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed 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.jboss.jsr299.tck.tests.deployment.lifecycle;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+
+ at Target( { TYPE, METHOD, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+public @interface EpochScoped
+{
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/EpochScoped.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ExtensionsTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ExtensionsTest.java	2009-06-28 17:32:47 UTC (rev 2918)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ExtensionsTest.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -16,6 +16,10 @@
  */
 package org.jboss.jsr299.tck.tests.deployment.lifecycle;
 
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.spi.Bean;
+
+import org.hibernate.tck.annotations.SpecAssertion;
 import org.jboss.jsr299.tck.AbstractJSR299Test;
 import org.jboss.testharness.impl.packaging.Artifact;
 import org.jboss.testharness.impl.packaging.IntegrationTest;
@@ -36,9 +40,29 @@
 {
    
    @Test
+   @SpecAssertion(section="11.5.1", id="a")
    public void testBeforeBeanDiscoveryEventIsCalled()
    {
       assert BeforeBeanDiscoveryObserver.isObserved();
    }
+   
+   @Test
+   @SpecAssertion(section="11.5.1", id="ba")
+   public void testAddingBindingType()
+   {
+      assert BeforeBeanDiscoveryObserver.isObserved();
+      assert getBeans(Alligator.class).size() == 0;
+      assert getBeans(Alligator.class, new AnnotationLiteral<Tame>() {}).size() == 1;
+   }
+   
+   @Test
+   @SpecAssertion(section="11.5.1", id="bb")
+   public void testAddingScopeType()
+   {
+      assert BeforeBeanDiscoveryObserver.isObserved();
+      assert getBeans(RomanEmpire.class).size() == 1;
+      Bean<RomanEmpire> bean = getBeans(RomanEmpire.class).iterator().next();
+      assert bean.getScopeType().equals(EpochScoped.class);
+   }
 
 }

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/RomanEmpire.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/RomanEmpire.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/RomanEmpire.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.jsr299.tck.tests.deployment.lifecycle;
+
+/**
+ * @author pmuir
+ *
+ */
+ at EpochScoped
+public class RomanEmpire
+{
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/RomanEmpire.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/Tame.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/Tame.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.deployment.lifecycle;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+ at Target( { TYPE, METHOD, PARAMETER, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at interface Tame
+{
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/Tame.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/AddingNormalScopeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/AddingNormalScopeTest.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/AddingNormalScopeTest.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.jsr299.tck.tests.deployment.lifecycle.broken.normalScope;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import org.testng.annotations.Test;
+
+/**
+ * @author pmuir
+ *
+ */
+ at Artifact
+ at Resources({
+   @Resource(source="javax.enterprise.inject.spi.Extension", destination="WEB-INF/classes/META-INF/services/javax.enterprise.inject.spi.Extension")
+})
+ at IntegrationTest
+ at ExpectedDeploymentException(DeploymentError.class)
+public class AddingNormalScopeTest extends AbstractJSR299Test
+{
+   
+   @Test
+   @SpecAssertion(section="11.5.1", id="bb")
+   public void testAddingScopeType()
+   {
+      assert false;
+   }
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/AddingNormalScopeTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/BeforeBeanDiscoveryObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/BeforeBeanDiscoveryObserver.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/BeforeBeanDiscoveryObserver.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.jsr299.tck.tests.deployment.lifecycle.broken.normalScope;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
+
+/**
+ * @author pmuir
+ * 
+ */
+public class BeforeBeanDiscoveryObserver implements Extension
+{
+
+   public void observe(@Observes BeforeBeanDiscovery beforeBeanDiscovery)
+   {
+      beforeBeanDiscovery.addScopeType(EpochScoped.class, true, false);
+   }
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/BeforeBeanDiscoveryObserver.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/EpochScoped.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/EpochScoped.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/EpochScoped.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed 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.jboss.jsr299.tck.tests.deployment.lifecycle.broken.normalScope;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+
+ at Target( { TYPE, METHOD, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+public @interface EpochScoped
+{
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/EpochScoped.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/RomanEmpire.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/RomanEmpire.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/RomanEmpire.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.jsr299.tck.tests.deployment.lifecycle.broken.normalScope;
+
+/**
+ * @author pmuir
+ *
+ */
+ at EpochScoped
+public final class RomanEmpire
+{
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/RomanEmpire.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/AddingPassivatingScopeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/AddingPassivatingScopeTest.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/AddingPassivatingScopeTest.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.jsr299.tck.tests.deployment.lifecycle.broken.passivatingScope;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DefinitionError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import org.testng.annotations.Test;
+
+/**
+ * @author pmuir
+ *
+ */
+ at Artifact
+ at Resources({
+   @Resource(source="javax.enterprise.inject.spi.Extension", destination="WEB-INF/classes/META-INF/services/javax.enterprise.inject.spi.Extension")
+})
+ at IntegrationTest
+// TODO This *should be* DeploymentError 
+ at ExpectedDeploymentException(DefinitionError.class)
+public class AddingPassivatingScopeTest extends AbstractJSR299Test
+{
+   
+   @Test
+   @SpecAssertion(section="11.5.1", id="bb")
+   public void testAddingScopeType()
+   {
+      assert false;
+   }
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/AddingPassivatingScopeTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/BeforeBeanDiscoveryObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/BeforeBeanDiscoveryObserver.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/BeforeBeanDiscoveryObserver.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.jsr299.tck.tests.deployment.lifecycle.broken.passivatingScope;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
+
+/**
+ * @author pmuir
+ * 
+ */
+public class BeforeBeanDiscoveryObserver implements Extension
+{
+
+   public void observe(@Observes BeforeBeanDiscovery beforeBeanDiscovery)
+   {
+      beforeBeanDiscovery.addScopeType(EpochScoped.class, false, true);
+   }
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/BeforeBeanDiscoveryObserver.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/EpochScoped.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/EpochScoped.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/EpochScoped.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed 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.jboss.jsr299.tck.tests.deployment.lifecycle.broken.passivatingScope;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+
+ at Target( { TYPE, METHOD, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+public @interface EpochScoped
+{
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/EpochScoped.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/RomanEmpire.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/RomanEmpire.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/RomanEmpire.java	2009-06-28 17:34:44 UTC (rev 2919)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.jsr299.tck.tests.deployment.lifecycle.broken.passivatingScope;
+
+/**
+ * @author pmuir
+ *
+ */
+ at EpochScoped
+public class RomanEmpire
+{
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/RomanEmpire.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/javax.enterprise.inject.spi.Extension
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/javax.enterprise.inject.spi.Extension	                        (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/normalScope/javax.enterprise.inject.spi.Extension	2009-06-28 17:34:44 UTC (rev 2919)
@@ -0,0 +1 @@
+org.jboss.jsr299.tck.tests.deployment.lifecycle.broken.normalScope.BeforeBeanDiscoveryObserver

Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/javax.enterprise.inject.spi.Extension
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/javax.enterprise.inject.spi.Extension	                        (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/passivatingScope/javax.enterprise.inject.spi.Extension	2009-06-28 17:34:44 UTC (rev 2919)
@@ -0,0 +1 @@
+org.jboss.jsr299.tck.tests.deployment.lifecycle.broken.passivatingScope.BeforeBeanDiscoveryObserver

Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml	2009-06-28 17:32:47 UTC (rev 2918)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml	2009-06-28 17:34:44 UTC (rev 2919)
@@ -4731,10 +4731,22 @@
       <text>The container must fire an event before it begins the bean discovery process. The event object must be of type |javax.enterprise.inject.spi.BeforeBeanDiscovery|.</text>
     </assertion>
     
-    <assertion id="b">
-      <text>The operations of the |BeforeBeanDiscovery| instance allow a portable extension to declare that any annotation as a binding type, scope type, stereotype or interceptor binding type.</text>
+    <assertion id="ba">
+      <text>The operations of the |BeforeBeanDiscovery| instance allow a portable extension to declare that any annotation as a _binding type_, scope type, stereotype or interceptor binding type.</text>
     </assertion>
     
+    <assertion id="bb">
+      <text>The operations of the |BeforeBeanDiscovery| instance allow a portable extension to declare that any annotation as a binding type, _scope type_, stereotype or interceptor binding type.</text>
+    </assertion>
+    
+    <assertion id="bc">
+      <text>The operations of the |BeforeBeanDiscovery| instance allow a portable extension to declare that any annotation as a binding type, scope type, _stereotype_ or interceptor binding type.</text>
+    </assertion>
+    
+    <assertion id="bd">
+      <text>The operations of the |BeforeBeanDiscovery| instance allow a portable extension to declare that any annotation as a binding type, scope type, stereotype or _interceptor binding type_.</text>
+    </assertion>
+    
     <assertion id="c">
       <text>If any observer method of the |BeforeBeanDiscovery| event throws an exception, the exception is treated as a definition error by the container.</text>
     </assertion>




More information about the weld-commits mailing list