[webbeans-commits] Webbeans SVN: r3540 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-17 14:34:04 -0400 (Mon, 17 Aug 2009)
New Revision: 3540
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/FooException.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Agent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogAgent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/TransactionalObserversTest.java
Log:
Make test pass
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Agent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Agent.java 2009-08-17 17:58:03 UTC (rev 3539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Agent.java 2009-08-17 18:34:04 UTC (rev 3540)
@@ -9,5 +9,7 @@
public abstract void sendInTransaction(Object event);
public abstract void sendOutsideTransaction(Object event);
+
+ public void sendInTransactionAndFail(Object event) throws Exception;
}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogAgent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogAgent.java 2009-08-17 17:58:03 UTC (rev 3539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogAgent.java 2009-08-17 18:34:04 UTC (rev 3540)
@@ -41,6 +41,21 @@
throw new EJBException("Transaction failure", e);
}
}
+
+ public void sendInTransactionAndFail(Object event) throws Exception
+ {
+ try
+ {
+ userTransaction.begin();
+ jsr299Manager.fireEvent(event);
+ throw new FooException();
+ }
+ finally
+ {
+ //userTransaction.commit();
+ }
+
+ }
public void sendOutsideTransaction(Object event)
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/FooException.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/FooException.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/FooException.java 2009-08-17 18:34:04 UTC (rev 3540)
@@ -0,0 +1,26 @@
+/*
+ * 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.event.observer.transactional;
+
+/**
+ * @author pmuir
+ *
+ */
+public class FooException extends Exception
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/FooException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/TransactionalObserversTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/TransactionalObserversTest.java 2009-08-17 17:58:03 UTC (rev 3539)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/TransactionalObserversTest.java 2009-08-17 18:34:04 UTC (rev 3540)
@@ -113,12 +113,19 @@
@Test(groups = { "events", "integration", "ri-broken" })
@SpecAssertion(section = "10.4.5", id = "e")
// WBRI-303
- public void testAfterTransactionFailureObserver() throws InterruptedException
+ public void testAfterTransactionFailureObserver() throws Exception
{
dog.setCorrectContext(false);
dog.setCorrectTransactionState(false);
Agent dogAgent = getInstanceByType(Agent.class);
- dogAgent.sendInTransaction(new Float(4.0));
+ try
+ {
+ dogAgent.sendInTransactionAndFail(new Float(4.0));
+ }
+ catch (Exception e)
+ {
+ // Container will complain, we failed to complete the TX!
+ }
Thread.sleep(100);
assert dog.isCorrectTransactionState();
}
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3539 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-17 13:58:03 -0400 (Mon, 17 Aug 2009)
New Revision: 3539
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/MockLoginModule.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBeanLocal.java
Log:
Initial impl for Principal for JBoss AS, add loging to test (not sure if this right)
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java 2009-08-17 17:18:21 UTC (rev 3538)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java 2009-08-17 17:58:03 UTC (rev 3539)
@@ -2,6 +2,7 @@
import java.security.Principal;
+import javax.security.auth.login.LoginException;
import javax.transaction.SystemException;
import javax.transaction.UserTransaction;
import javax.validation.Validator;
@@ -70,9 +71,11 @@
@SpecAssertions({
@SpecAssertion(section="3.6", id="b")
})
- public void testPrincipalBean() throws SystemException
+ public void testPrincipalBean() throws SystemException, LoginException
{
- Principal principal = getInstanceByType(PrincipalInjectedBeanLocal.class).getPrincipal();
+ PrincipalInjectedBeanLocal instance = getInstanceByType(PrincipalInjectedBeanLocal.class);
+ instance.login();
+ Principal principal = instance.getPrincipal();
assert principal != null;
// Check that the Principal is at least queryable
principal.getName();
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/MockLoginModule.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/MockLoginModule.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/MockLoginModule.java 2009-08-17 17:58:03 UTC (rev 3539)
@@ -0,0 +1,80 @@
+/*
+ * 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.implementation.builtin;
+
+import java.security.Principal;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.security.auth.Subject;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.login.LoginException;
+import javax.security.auth.spi.LoginModule;
+
+public class MockLoginModule implements LoginModule
+{
+
+ protected Set<String> roles = new HashSet<String>();
+
+ protected Subject subject;
+ protected Map<String,?> options;
+ protected CallbackHandler callbackHandler;
+
+ public MockLoginModule()
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+ public boolean abort() throws LoginException
+ {
+ return true;
+ }
+
+ public boolean commit() throws LoginException
+ {
+ subject.getPrincipals().add(new Principal()
+ {
+
+ @Override
+ public String getName()
+ {
+ return "default";
+ }
+ });
+ return true;
+ }
+
+ public void initialize(Subject subject, CallbackHandler callbackHandler,
+ Map<String, ?> sharedState, Map<String, ?> options)
+ {
+ this.subject = subject;
+ this.options = options;
+ this.callbackHandler = callbackHandler;
+ }
+
+ public boolean login()
+ throws LoginException
+ {
+ return true;
+ }
+
+ public boolean logout() throws LoginException
+ {
+ return true;
+ }
+}
\ No newline at end of file
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/MockLoginModule.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBean.java 2009-08-17 17:18:21 UTC (rev 3538)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBean.java 2009-08-17 17:58:03 UTC (rev 3539)
@@ -17,9 +17,15 @@
package org.jboss.jsr299.tck.tests.implementation.builtin;
import java.security.Principal;
+import java.util.HashMap;
import javax.ejb.Stateful;
import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Instance;
+import javax.security.auth.login.AppConfigurationEntry;
+import javax.security.auth.login.LoginContext;
+import javax.security.auth.login.LoginException;
+import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag;
/**
* @author pmuir
@@ -29,12 +35,46 @@
public class PrincipalInjectedBean implements PrincipalInjectedBeanLocal
{
- @Current transient Principal principal;
+ static final String DEFAULT_JAAS_CONFIG_NAME = "default";
+ @Current Instance<Principal> principal;
+
@Override
public Principal getPrincipal()
{
- return principal;
+ return principal.get();
}
+
+ public void login() throws LoginException
+ {
+ LoginContext lc = new LoginContext(DEFAULT_JAAS_CONFIG_NAME, null, null, createConfiguration());
+ lc.login();
+ }
+
+ protected AppConfigurationEntry createAppConfigurationEntry()
+ {
+ return new AppConfigurationEntry(
+ MockLoginModule.class.getName(),
+ LoginModuleControlFlag.REQUIRED,
+ new HashMap<String,String>()
+ );
+ }
+
+ protected javax.security.auth.login.Configuration createConfiguration()
+ {
+ return new javax.security.auth.login.Configuration()
+ {
+ private AppConfigurationEntry[] aces = { createAppConfigurationEntry() };
+
+ @Override
+ public AppConfigurationEntry[] getAppConfigurationEntry(String name)
+ {
+ return DEFAULT_JAAS_CONFIG_NAME.equals(name) ? aces : null;
+ }
+
+ @Override
+ public void refresh() {}
+ };
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBeanLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBeanLocal.java 2009-08-17 17:18:21 UTC (rev 3538)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBeanLocal.java 2009-08-17 17:58:03 UTC (rev 3539)
@@ -19,6 +19,7 @@
import java.security.Principal;
import javax.ejb.Local;
+import javax.security.auth.login.LoginException;
/**
* @author pmuir
@@ -29,5 +30,7 @@
{
public Principal getPrincipal();
+
+ public void login() throws LoginException;
}
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3538 - in ri/trunk: tests/src/test/java/org/jboss/webbeans/test/unit and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-17 13:18:21 -0400 (Mon, 17 Aug 2009)
New Revision: 3538
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/Bean.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/ExampleTest.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java
Log:
WBRI-368
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java 2009-08-16 21:38:40 UTC (rev 3537)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java 2009-08-17 17:18:21 UTC (rev 3538)
@@ -27,7 +27,6 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
-import java.util.Set;
import javax.enterprise.inject.spi.AnnotatedParameter;
@@ -258,7 +257,7 @@
public List<AnnotatedParameter<T>> getParameters()
{
- return new ArrayList<AnnotatedParameter<T>>((Set) parameters);
+ return Collections.unmodifiableList((List) parameters);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java 2009-08-16 21:38:40 UTC (rev 3537)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java 2009-08-17 17:18:21 UTC (rev 3538)
@@ -28,7 +28,6 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
-import java.util.Set;
import javax.enterprise.inject.spi.AnnotatedParameter;
@@ -229,7 +228,7 @@
public List<AnnotatedParameter<X>> getParameters()
{
- return new ArrayList<AnnotatedParameter<X>>((Set) parameters);
+ return Collections.unmodifiableList((List) parameters);
}
}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/Bean.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/Bean.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/Bean.java 2009-08-17 17:18:21 UTC (rev 3538)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.webbeans.test.unit.annotated;
+
+
+/**
+ *
+ * @author <a href="kabir.khan(a)jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class Bean
+{
+ int field;
+
+ public Bean(int i)
+ {
+
+ }
+
+ public void method(int i)
+ {
+
+ }
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/Bean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/ExampleTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/ExampleTest.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/ExampleTest.java 2009-08-17 17:18:21 UTC (rev 3538)
@@ -0,0 +1,63 @@
+package org.jboss.webbeans.test.unit.annotated;
+
+import javax.enterprise.inject.spi.Annotated;
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedParameter;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author <a href="kabir.khan(a)jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+@Artifact
+public class ExampleTest extends AbstractWebBeansTest
+{
+ @Test
+ public void testAnnotatedCallableGetParameters() throws Exception
+ {
+ AnnotatedType<Bean> type = getCurrentManager().createAnnotatedType(Bean.class);
+
+ assertNoAnnotations(type);
+
+ Assert.assertEquals(1, type.getConstructors().size());
+ for (AnnotatedConstructor<Bean> ctor : type.getConstructors())
+ {
+ assertNoAnnotations(ctor);
+
+ for (AnnotatedParameter<Bean> param : ctor.getParameters())
+ {
+ assertNoAnnotations(param);
+ }
+ }
+
+ Assert.assertEquals(1, type.getMethods().size());
+ for (AnnotatedMethod<? super Bean> method : type.getMethods())
+ {
+ assertNoAnnotations(method);
+
+ for (AnnotatedParameter<? super Bean> param : method.getParameters())
+ {
+ assertNoAnnotations(param);
+ }
+ }
+
+ Assert.assertEquals(1, type.getFields().size());
+ for (AnnotatedField<? super Bean> field : type.getFields())
+ {
+ assertNoAnnotations(field);
+ }
+ }
+
+ private void assertNoAnnotations(Annotated annotated)
+ {
+ Assert.assertEquals(0, annotated.getAnnotations().size());
+ }
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/annotated/ExampleTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3537 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-16 17:38:40 -0400 (Sun, 16 Aug 2009)
New Revision: 3537
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java
Log:
assign test
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java 2009-08-16 21:02:06 UTC (rev 3536)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java 2009-08-16 21:38:40 UTC (rev 3537)
@@ -66,7 +66,8 @@
@SpecAssertions({
@SpecAssertion(section = "5.2", id = "g"),
@SpecAssertion(section = "2.6.1", id = "b"),
- @SpecAssertion(section = "2.7", id = "aa")
+ @SpecAssertion(section = "2.7", id = "aa"),
+ @SpecAssertion(section = "2.7.1.4", id="a")
})
public void testAnyEnabledPolicyStereotypeMakesPolicyEnabled() throws Exception
{
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3536 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-16 17:02:06 -0400 (Sun, 16 Aug 2009)
New Revision: 3536
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Remove unecessary assertions
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-16 19:54:01 UTC (rev 3535)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-16 21:02:06 UTC (rev 3536)
@@ -3097,54 +3097,6 @@
<section id="6.7" title="Context management for built-in scopes">
<group>
<text>The built-in context object is active during servlet, web service and EJB invocations, or in the case of the conversation context object, for JSF requests.</text>
-
- <assertion id="a">
- <text>Test request, session and application for servlet service method()</text>
- </assertion>
-
- <assertion id="b">
- <text>Test request, session and application for servlet filter</text>
- </assertion>
-
- <assertion id="c">
- <text>Test request, session and application for servlet listener</text>
- </assertion>
-
- <assertion id="d">
- <text>Test request, session and application for web service</text>
- </assertion>
-
- <assertion id="e">
- <text>Test request, session and application for synchronous EJB invocation</text>
- </assertion>
-
- <assertion id="f">
- <text>Test request, session and application for asynchronous EJB invocation</text>
- </assertion>
-
- <assertion id="g">
- <text>Test request, session, application and conversation context for a JSF action method</text>
- </assertion>
-
- <assertion id="h">
- <text>Test request, session, application and conversation context for a JSF validator</text>
- </assertion>
-
- <assertion id="i">
- <text>Test request, session, application and conversation context for a JSF converter</text>
- </assertion>
-
- <assertion id="j">
- <text>Test request, session, application and conversation context for a JSF action method</text>
- </assertion>
-
- <assertion id="k">
- <text>Test request, session, application and conversation context for a JSF value change listener</text>
- </assertion>
-
- <assertion id="l">
- <text>Test request, session, application and conversation context for a JSF render</text>
- </assertion>
</group>
</section>
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3535 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/decorators/invocation/observer and 7 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-16 15:54:01 -0400 (Sun, 16 Aug 2009)
New Revision: 3535
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/DecoratorInvocationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/Foo.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/Observer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/ObserverDecorator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/ObserverImpl.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/DecoratorInvocationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/Foo.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/Producer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/ProducerDecorator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/ProducerImpl.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/observer/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/observer/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/producer/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/beans.xml
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/EJBDecoratorInvocationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/Logger.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/MockLogger.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/TimestampLogger.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Group some tests, implement some decorator tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java 2009-08-16 18:06:59 UTC (rev 3534)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/DecoratorInvocationTest.java 2009-08-16 19:54:01 UTC (rev 3535)
@@ -41,15 +41,19 @@
@SpecAssertion(section="8.5", id="b"),
@SpecAssertion(section="8.1.3", id="d"),
@SpecAssertion(section="8.1.2", id="f"),
- @SpecAssertion(section="8.1.2", id="b")
+ @SpecAssertion(section="8.1.2", id="b"),
+ @SpecAssertion(section="7.2", id="b"),
+ @SpecAssertion(section="7.2", id="ha")
})
public void testDecoratorInvocation()
{
TimestampLogger.reset();
- MockLogger.setMessage(null);
+ MockLogger.reset();
getInstanceByType(CowShed.class).milk();
assert TimestampLogger.getMessage().equals(CowShed.MESSAGE);
assert MockLogger.getMessage().equals(TimestampLogger.PREFIX + CowShed.MESSAGE);
+ assert !TimestampLogger.isInitializeCalled();
+ assert MockLogger.isInitializeCalled();
}
@Test
@@ -60,7 +64,8 @@
@SpecAssertion(section="8.4", id="a"),
@SpecAssertion(section="8.1.3", id="d"),
@SpecAssertion(section="8.1.2", id="f"),
- @SpecAssertion(section="8.1.2", id="b")
+ @SpecAssertion(section="8.1.2", id="b"),
+ @SpecAssertion(section="7.2", id="kb")
})
public void testChainedDecoratorInvocation()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/EJBDecoratorInvocationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/EJBDecoratorInvocationTest.java 2009-08-16 18:06:59 UTC (rev 3534)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/EJBDecoratorInvocationTest.java 2009-08-16 19:54:01 UTC (rev 3535)
@@ -43,12 +43,13 @@
@SpecAssertion(section="8.5", id="b"),
@SpecAssertion(section="8.1.3", id="d"),
@SpecAssertion(section="8.1.2", id="f"),
- @SpecAssertion(section="8.1.2", id="b")
+ @SpecAssertion(section="8.1.2", id="b"),
+ @SpecAssertion(section="7.2", id="d")
})
public void testDecoratorInvocation()
{
TimestampLogger.reset();
- MockLogger.setMessage(null);
+ MockLogger.reset();
getInstanceByType(PigSty.class).clean();
assert TimestampLogger.getMessage().equals(PigSty.MESSAGE);
assert MockLogger.getMessage().equals(TimestampLogger.PREFIX + PigSty.MESSAGE);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/Logger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/Logger.java 2009-08-16 18:06:59 UTC (rev 3534)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/Logger.java 2009-08-16 19:54:01 UTC (rev 3535)
@@ -25,5 +25,7 @@
{
public void log(String string);
+
+ public void initialize();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/MockLogger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/MockLogger.java 2009-08-16 18:06:59 UTC (rev 3534)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/MockLogger.java 2009-08-16 19:54:01 UTC (rev 3535)
@@ -16,6 +16,8 @@
*/
package org.jboss.jsr299.tck.tests.decorators.invocation;
+import javax.enterprise.inject.Initializer;
+
/**
* @author pmuir
*
@@ -23,7 +25,15 @@
public class MockLogger implements Logger
{
+ @Initializer
+ public void initialize()
+ {
+ initializeCalled = true;
+ }
+
private static String message = "";
+
+ private static boolean initializeCalled;
public void log(String string)
{
@@ -41,9 +51,18 @@
/**
* @param log the log to set
*/
- public static void setMessage(String log)
+ public static void reset()
{
- MockLogger.message = log;
+ MockLogger.message = null;
+ initializeCalled = false;
}
+
+ /**
+ * @return the initializeCalled
+ */
+ public static boolean isInitializeCalled()
+ {
+ return initializeCalled;
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/TimestampLogger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/TimestampLogger.java 2009-08-16 18:06:59 UTC (rev 3534)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/TimestampLogger.java 2009-08-16 19:54:01 UTC (rev 3535)
@@ -32,6 +32,8 @@
private static String message;
+ private static boolean initializeCalled;
+
@Decorates
private Logger logger;
@@ -41,6 +43,11 @@
logger.log(PREFIX + message);
}
+ public void initialize()
+ {
+ initializeCalled = true;
+ }
+
/**
* @return the message
*/
@@ -55,7 +62,16 @@
public static void reset()
{
TimestampLogger.message = null;
+ initializeCalled = false;
}
+
+ /**
+ * @return the initializeCalled
+ */
+ public static boolean isInitializeCalled()
+ {
+ return initializeCalled;
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/DecoratorInvocationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/DecoratorInvocationTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/DecoratorInvocationTest.java 2009-08-16 19:54:01 UTC (rev 3535)
@@ -0,0 +1,48 @@
+/*
+ * 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.decorators.invocation.observer;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * @author pmuir
+ *
+ */
+@Artifact
+@BeansXml("beans.xml")
+@SpecVersion("20090625")
+public class DecoratorInvocationTest extends AbstractJSR299Test
+{
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="7.2", id="if")
+ })
+ public void testDecoratorInvocation()
+ {
+ ObserverImpl.reset();
+ getCurrentManager().fireEvent(new Foo("foo!"));
+ assert ObserverImpl.isObservervedCorrectly();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/DecoratorInvocationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/Foo.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/Foo.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/Foo.java 2009-08-16 19:54:01 UTC (rev 3535)
@@ -0,0 +1,41 @@
+/*
+ * 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.decorators.invocation.observer;
+
+/**
+ * @author pmuir
+ *
+ */
+public class Foo
+{
+
+ private String foo;
+
+ public Foo(String foo)
+ {
+ this.foo = foo;
+ }
+
+ /**
+ * @return the foo
+ */
+ public String getFoo()
+ {
+ return foo;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/Foo.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/Observer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/Observer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/Observer.java 2009-08-16 19:54:01 UTC (rev 3535)
@@ -0,0 +1,29 @@
+/*
+ * 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.decorators.invocation.observer;
+
+
+/**
+ * @author pmuir
+ *
+ */
+public interface Observer
+{
+
+ public void observe(Foo foo);
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/Observer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/ObserverDecorator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/ObserverDecorator.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/ObserverDecorator.java 2009-08-16 19:54:01 UTC (rev 3535)
@@ -0,0 +1,40 @@
+/*
+ * 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.decorators.invocation.observer;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+
+
+/**
+ * @author pmuir
+ *
+ */
+@Decorator
+public class ObserverDecorator
+{
+
+ @Decorates
+ private Observer observer;
+
+ public void observe(Foo foo)
+ {
+ observer.observe(new Foo("decorated"));
+ }
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/ObserverDecorator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/ObserverImpl.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/ObserverImpl.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/ObserverImpl.java 2009-08-16 19:54:01 UTC (rev 3535)
@@ -0,0 +1,54 @@
+/*
+ * 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.decorators.invocation.observer;
+
+import javax.enterprise.event.Observes;
+
+
+
+/**
+ * @author pmuir
+ *
+ */
+public class ObserverImpl implements Observer
+{
+
+ private static boolean observervedCorrectly = false;
+
+ /**
+ * @param log the log to set
+ */
+ public static void reset()
+ {
+ observervedCorrectly = false;
+ }
+
+ @Override
+ public void observe(@Observes Foo foo)
+ {
+ observervedCorrectly = foo.getFoo().equals("decorated");
+ }
+
+ /**
+ * @return the disposedCorrectly
+ */
+ public static boolean isObservervedCorrectly()
+ {
+ return observervedCorrectly;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/ObserverImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/DecoratorInvocationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/DecoratorInvocationTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/DecoratorInvocationTest.java 2009-08-16 19:54:01 UTC (rev 3535)
@@ -0,0 +1,57 @@
+/*
+ * 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.decorators.invocation.producer.method;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * @author pmuir
+ *
+ */
+@Artifact
+@BeansXml("beans.xml")
+@SpecVersion("20090625")
+public class DecoratorInvocationTest extends AbstractJSR299Test
+{
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="7.2", id="ib"),
+ @SpecAssertion(section="7.2", id="id")
+ })
+ public void testDecoratorInvocation()
+ {
+ ProducerDecorator.reset();
+ ProducerImpl.reset();
+ Bean<Foo> bean = (Bean<Foo>) getCurrentManager().resolve(getCurrentManager().getBeans(Foo.class));
+ CreationalContext<Foo> creationalContext = getCurrentManager().createCreationalContext(bean);
+ Foo foo = bean.create(creationalContext);
+ assert foo.getFoo().equals("foo!!!");
+ bean.destroy(foo, creationalContext);
+ assert ProducerImpl.isDisposedCorrectly();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/DecoratorInvocationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/Foo.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/Foo.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/Foo.java 2009-08-16 19:54:01 UTC (rev 3535)
@@ -0,0 +1,41 @@
+/*
+ * 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.decorators.invocation.producer.method;
+
+/**
+ * @author pmuir
+ *
+ */
+public class Foo
+{
+
+ private String foo;
+
+ public Foo(String foo)
+ {
+ this.foo = foo;
+ }
+
+ /**
+ * @return the foo
+ */
+ public String getFoo()
+ {
+ return foo;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/Foo.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/Producer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/Producer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/Producer.java 2009-08-16 19:54:01 UTC (rev 3535)
@@ -0,0 +1,31 @@
+/*
+ * 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.decorators.invocation.producer.method;
+
+
+/**
+ * @author pmuir
+ *
+ */
+public interface Producer
+{
+
+ public Foo produce();
+
+ public void dispose(Foo foo);
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/Producer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/ProducerDecorator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/ProducerDecorator.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/ProducerDecorator.java 2009-08-16 19:54:01 UTC (rev 3535)
@@ -0,0 +1,53 @@
+/*
+ * 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.decorators.invocation.producer.method;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+
+
+/**
+ * @author pmuir
+ *
+ */
+@Decorator
+public class ProducerDecorator
+{
+
+ @Decorates
+ private Producer logger;
+
+ public Foo produce()
+ {
+ return new Foo(logger.produce().getFoo() + "!!");
+ }
+
+ /**
+ * @param message the message to set
+ */
+ public static void reset()
+ {
+
+ }
+
+ public void dispose(Foo foo)
+ {
+ logger.dispose(new Foo("decorated"));
+ }
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/ProducerDecorator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/ProducerImpl.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/ProducerImpl.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/ProducerImpl.java 2009-08-16 19:54:01 UTC (rev 3535)
@@ -0,0 +1,60 @@
+/*
+ * 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.decorators.invocation.producer.method;
+
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Produces;
+
+
+/**
+ * @author pmuir
+ *
+ */
+public class ProducerImpl implements Producer
+{
+
+ private static boolean disposedCorrectly = false;
+
+ /**
+ * @param log the log to set
+ */
+ public static void reset()
+ {
+ disposedCorrectly = false;
+ }
+
+ @Produces
+ public Foo produce()
+ {
+ return new Foo("foo!");
+ }
+
+ @Override
+ public void dispose(@Disposes Foo foo)
+ {
+ disposedCorrectly = foo.getFoo().equals("decorated");
+ }
+
+ /**
+ * @return the disposedCorrectly
+ */
+ public static boolean isDisposedCorrectly()
+ {
+ return disposedCorrectly;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/ProducerImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/observer/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/observer/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/observer/beans.xml 2009-08-16 19:54:01 UTC (rev 3535)
@@ -0,0 +1,5 @@
+<beans>
+ <decorators>
+ <class>org.jboss.jsr299.tck.tests.decorators.invocation.observer.ObserverDecorator</class>
+ </decorators>
+</beans>
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/observer/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/beans.xml 2009-08-16 19:54:01 UTC (rev 3535)
@@ -0,0 +1,5 @@
+<beans>
+ <decorators>
+ <class>org.jboss.jsr299.tck.tests.decorators.invocation.producer.method.ProducerDecorator</class>
+ </decorators>
+</beans>
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-16 18:06:59 UTC (rev 3534)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-16 19:54:01 UTC (rev 3535)
@@ -3515,10 +3515,17 @@
<text>If the invocation is not a business method invocation, it is treated as a normal Java method call and is not intercepted by the container.</text>
</assertion>
- <assertion id="h">
+ <group>
<text>Invocations of initializer methods by the container are not business method invocations.</text>
- </assertion>
+ <assertion id="ha">
+ <text>Check initializer methods aren't decorated</text>
+ </assertion>
+ <assertion id="hb">
+ <text>Check initializer methods aren't intercepted</text>
+ </assertion>
+ </group>
+
<group>
<text>Invocations of producer, disposer and observer methods by the container are business method invocations are are intercepted by method interceptors and decorators.</text>
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3534 - tck/trunk.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-16 14:06:59 -0400 (Sun, 16 Aug 2009)
New Revision: 3534
Modified:
tck/trunk/pom.xml
Log:
oops, forgot to commit
Modified: tck/trunk/pom.xml
===================================================================
--- tck/trunk/pom.xml 2009-08-16 17:53:48 UTC (rev 3533)
+++ tck/trunk/pom.xml 2009-08-16 18:06:59 UTC (rev 3534)
@@ -123,6 +123,11 @@
<version>1.2_10</version>
</dependency>
<dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ <version>1.0.CR3</version>
+ </dependency>
+ <dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.1</version>
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3533 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-16 13:53:48 -0400 (Sun, 16 Aug 2009)
New Revision: 3533
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Fox.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/HorseStable.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Tarantula.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Map a few tests, split out assertions to a group
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-08-16 17:17:58 UTC (rev 3532)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-08-16 17:53:48 UTC (rev 3533)
@@ -184,7 +184,7 @@
public void testContextIsActiveWhenInvokingProducerField()
{
// Reset test class
- Tarantula.setDependentContextActive(false);
+ Tarantula.reset();
getInstanceByType(Tarantula.class,TAME_LITERAL);
assert Tarantula.isDependentContextActive();
}
@@ -200,7 +200,7 @@
CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
Tarantula tarantula = tarantulaBean.create(creationalContext);
assert tarantula != null;
- SpiderProducer.setDependentContextActive(false);
+ SpiderProducer.reset();
tarantulaBean.destroy(tarantula, creationalContext);
assert SpiderProducer.isDependentContextActive();
}
@@ -263,14 +263,31 @@
@Test(groups = { "contexts", "beanDestruction"})
@SpecAssertions({
+ @SpecAssertion(section = "6.1.1", id = "e")
+ })
+ public void testCallingCreationalContextReleaseDestroysDependents()
+ {
+ assert getBeans(Farm.class).size() == 1;
+ Bean<Farm> farmBean = getBeans(Farm.class).iterator().next();
+ CreationalContext<Farm> creationalContext = getCurrentManager().createCreationalContext(farmBean);
+ Farm farm = farmBean.create(creationalContext);
+ farm.open();
+ Stable.destroyed = false;
+ Horse.destroyed = false;
+ creationalContext.release();
+ assert Stable.destroyed;
+ assert Horse.destroyed;
+ }
+
+ @Test(groups = { "contexts", "beanDestruction"})
+ @SpecAssertions({
@SpecAssertion(section = "6.4.2", id = "aaaa"),
@SpecAssertion(section = "6.4", id = "b")
})
public void testDestroyingManagedParentDestroysDependentsOfSameBean()
{
// Reset test class
- Fox.setDestroyed(false);
- Fox.setDestroyCount(0);
+ Fox.reset();
assert getCurrentManager().getBeans(FoxRun.class).size() == 1;
Bean<FoxRun> bean = getBeans(FoxRun.class).iterator().next();
@@ -287,7 +304,7 @@
public void testDependentsDestroyedWhenElEvaluationCompletes() throws Exception
{
// Reset test class
- Fox.setDestroyed(false);
+ Fox.reset();
FoxRun.setDestroyed(false);
getCurrentConfiguration().getEl().evaluateValueExpression("#{foxRun}", FoxRun.class);
@@ -296,18 +313,24 @@
}
@Test(groups = { "contexts", "producerMethod" })
- @SpecAssertion(section = "6.4.2", id = "ddd")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.4.2", id = "ddd"),
+ @SpecAssertion(section = "6.4.1", id="h")
+ })
+
public void testDependentsDestroyedWhenProducerMethodCompletes()
{
// Reset the test class
- SpiderProducer.setDestroyed(false);
+ SpiderProducer.reset();
+ Tarantula.reset();
Tarantula spiderInstance = getInstanceByType(Tarantula.class, PET_LITERAL);
spiderInstance.ping();
assert SpiderProducer.isDestroyed();
+ assert Tarantula.isDestroyed();
}
@Test(groups = { "contexts", "producerField" })
- @SpecAssertion(section = "6.4.2", id = "ddd")
+ @SpecAssertion(section = "6.4.2", id = "dde")
public void testDependentsDestroyedWhenProducerFieldCompletes()
{
// Reset the test class
@@ -319,7 +342,10 @@
}
@Test(groups = { "contexts", "disposalMethod" })
- @SpecAssertion(section = "6.4.2", id = "ddd")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.4.2", id = "ddf"),
+ @SpecAssertion(section = "6.4.2", id ="ccc")
+ })
public void testDependentsDestroyedWhenDisposerMethodCompletes()
{
Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class, PET_LITERAL).iterator().next();
@@ -328,23 +354,28 @@
assert tarantula != null;
// Reset test class state
- SpiderProducer.setDestroyed(false);
+ SpiderProducer.reset();
+ Fox.reset();
tarantulaBean.destroy(tarantula, creationalContext);
assert SpiderProducer.isDestroyed();
+ assert Fox.isDestroyed();
}
@Test(groups = { "contexts", "observerMethod" })
- @SpecAssertion(section = "6.4.2", id = "ddd")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.4.2", id = "ddg"),
+ @SpecAssertion(section = "6.4.2", id = "ccd")
+ })
public void testDependentsDestroyedWhenObserverMethodEvaluationCompletes()
{
// Reset test class state...
- HorseStable.setInstanceThatObservedEvent(null);
- HorseStable.setDestroyed(false);
-
+ HorseStable.reset();
+ Fox.reset();
getCurrentManager().fireEvent(new HorseInStableEvent());
assert HorseStable.getInstanceThatObservedEvent() != null;
assert HorseStable.isDestroyed();
+ assert Fox.isDestroyed();
}
@Test(groups = { "contexts" })
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Fox.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Fox.java 2009-08-16 17:17:58 UTC (rev 3532)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Fox.java 2009-08-16 17:53:48 UTC (rev 3533)
@@ -17,16 +17,12 @@
return destroyed;
}
- public static void setDestroyed(boolean destroyed)
+ public static void reset()
{
- Fox.destroyed = destroyed;
+ destroyed = false;
+ destroyCount = 0;
}
- public static void setDestroyCount(int destroyCount)
- {
- Fox.destroyCount = destroyCount;
- }
-
public static int getDestroyCount()
{
return destroyCount;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/HorseStable.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/HorseStable.java 2009-08-16 17:17:58 UTC (rev 3532)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/HorseStable.java 2009-08-16 17:53:48 UTC (rev 3533)
@@ -20,7 +20,7 @@
dependentContextActive = beanManager.getContext(Dependent.class).isActive();
}
- public void horseEntered(@Observes HorseInStableEvent horseEvent)
+ public void horseEntered(@Observes HorseInStableEvent horseEvent, Fox fox)
{
instanceThatObservedEvent = this;
}
@@ -36,9 +36,11 @@
return dependentContextActive;
}
- public static void setDependentContextActive(boolean dependentContextActive)
+ public static void reset()
{
- HorseStable.dependentContextActive = dependentContextActive;
+ HorseStable.dependentContextActive = false;
+ instanceThatObservedEvent = null;
+ destroyed = false;
}
public static HorseStable getInstanceThatObservedEvent()
@@ -46,18 +48,8 @@
return instanceThatObservedEvent;
}
- public static void setInstanceThatObservedEvent(HorseStable instanceThatObservedEvent)
- {
- HorseStable.instanceThatObservedEvent = instanceThatObservedEvent;
- }
-
public static boolean isDestroyed()
{
return destroyed;
}
-
- public static void setDestroyed(boolean destroyed)
- {
- HorseStable.destroyed = destroyed;
- }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SpiderProducer.java 2009-08-16 17:17:58 UTC (rev 3532)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SpiderProducer.java 2009-08-16 17:53:48 UTC (rev 3533)
@@ -23,7 +23,7 @@
return spider;
}
- public void disposeTarantula(@Disposes @Pet Tarantula tarantula)
+ public void disposeTarantula(@Disposes @Pet Tarantula tarantula, Fox fox)
{
dependentContextActive = beanManager.getContext(Dependent.class).isActive();
instanceUsedForDisposal = this;
@@ -34,11 +34,6 @@
return dependentContextActive;
}
- public static void setDependentContextActive(boolean dependentContextActive)
- {
- SpiderProducer.dependentContextActive = dependentContextActive;
- }
-
public static SpiderProducer getInstanceUsedForDisposal()
{
return instanceUsedForDisposal;
@@ -48,10 +43,12 @@
{
return destroyed;
}
-
- public static void setDestroyed(boolean destroyed)
+
+ public static void reset()
{
- SpiderProducer.destroyed = destroyed;
+ destroyed = false;
+ dependentContextActive = false;
+ instanceUsedForDisposal = null;
}
@PreDestroy
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Tarantula.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Tarantula.java 2009-08-16 17:17:58 UTC (rev 3532)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Tarantula.java 2009-08-16 17:53:48 UTC (rev 3533)
@@ -1,10 +1,14 @@
package org.jboss.jsr299.tck.tests.context.dependent;
+import javax.annotation.PreDestroy;
+
import org.jboss.jsr299.tck.impl.JSR299ConfigurationImpl;
class Tarantula extends Spider implements DeadlySpider
{
+ private static boolean destroyed;
+
private static boolean dependentContextActive = false;
public Tarantula()
@@ -12,15 +16,27 @@
dependentContextActive = JSR299ConfigurationImpl.get().getContexts().getDependentContext().isActive();
}
+ @PreDestroy
+ public void preDestroy()
+ {
+ destroyed = true;
+ }
+
public static boolean isDependentContextActive()
{
return dependentContextActive;
}
- public static void setDependentContextActive(boolean dependentContextActive)
+ public static boolean isDestroyed()
{
- Tarantula.dependentContextActive = dependentContextActive;
+ return destroyed;
}
+ public static void reset()
+ {
+ destroyed = false;
+ dependentContextActive = false;
+ }
+
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-08-16 17:17:58 UTC (rev 3532)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-08-16 17:53:48 UTC (rev 3533)
@@ -44,7 +44,8 @@
@SpecAssertions( {
@SpecAssertion(section = "7.3.2", id = "aa"),
@SpecAssertion(section = "7.3.2", id = "bb"),
- @SpecAssertion(section = "7.3.3", id = "b")
+ @SpecAssertion(section = "7.3.3", id = "b"),
+ @SpecAssertion(section = "6.5.3", id = "b")
})
public void testCreateSFSB() throws Exception
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java 2009-08-16 17:17:58 UTC (rev 3532)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java 2009-08-16 17:53:48 UTC (rev 3533)
@@ -21,9 +21,10 @@
import javax.enterprise.context.ContextNotActiveException;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -62,7 +63,10 @@
// TODO expand this test
}
@Test
- @SpecAssertion(section="5.5.2", id="ab")
+ @SpecAssertions({
+ @SpecAssertion(section="5.5.2", id="ab"),
+ @SpecAssertion(section = "6.5.4", id="a")
+ })
public void testInactiveScope() throws Exception
{
assert getCurrentConfiguration().getContexts().getRequestContext().isActive();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-08-16 17:17:58 UTC (rev 3532)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-08-16 17:53:48 UTC (rev 3533)
@@ -51,7 +51,10 @@
{
@Test(groups = { "injectionPoint" })
- @SpecAssertion(section = "5.6.9", id = "aa")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.5.3", id="d"),
+ @SpecAssertion(section = "5.6.9", id = "aa")
+ })
public void testGetBean()
{
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-16 17:17:58 UTC (rev 3532)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-16 17:53:48 UTC (rev 3533)
@@ -2700,14 +2700,38 @@
<text>The container must ensure that all |@Dependent| scoped contextual instances injected into method parameters of an observer method of any container lifecycle event, as defined in Section 11.5, "Container lifecycle events", are destroyed after all observers of the |BeforeShutdown| event complete.</text>
</assertion>
- <assertion id="ccc">
+ <group>
<text>The container must ensure that all |@Dependent| scoped contextual instances injected into method parameters of a disposer method or observer method of any other event are destroyed when the invocation completes.</text>
- </assertion>
+ <assertion id="ccc">
+ <text>Check disposer method</text>
+ </assertion>
+
+ <assertion id="ccd">
+ <text>Check observer method</text>
+ </assertion>
+ </group>
- <assertion id="ddd">
+ <group>
<text>The container must ensure that any |@Dependent| scoped contextual instance created to receive a producer method, producer field, disposer method or observer method invocation is destroyed when the invocation completes.</text>
- </assertion>
+
+ <assertion id="ddd">
+ <text>Check producer method</text>
+ </assertion>
+
+ <assertion id="dde">
+ <text>Check producer field</text>
+ </assertion>
+
+ <assertion id="ddf">
+ <text>Check disposer method</text>
+ </assertion>
+
+ <assertion id="ddg">
+ <text>Check observer method</text>
+ </assertion>
+ </group>
+
<assertion id="eee">
<text>The container must ensure that all |@Dependent| scoped contextual instances created during an EL expression evaluation are destroyed when the evaluation completes.</text>
</assertion>
@@ -2741,8 +2765,9 @@
<text>From time to time, the container attempts to obtain a contextual instance of a bean that already exists, without creating a new contextual instance. The container must determine if the scope of the bean is active and if it is, obtain the active context object for the bean scope, then attempt to obtain an instance of the bean by calling |Context.get()|, passing the |Bean| instance representing the bean without passing any instance of |CreationalContext|.</text>
</assertion>
- <assertion id="c">
- <text>IF the scope is not active, or if |Context.get()| returns a null value, there is no contextual instance that already exists.</text>
+ <assertion id="c" testable="false">
+ <text>If the scope is not active, or if |Context.get()| returns a null value, there is no contextual instance that already exists.</text>
+ <note>Statement of intent</note>
</assertion>
<assertion id="e">
@@ -2777,9 +2802,11 @@
<text>Any reference to a bean with a normal scope is valid as long as the application maintains a hard reference to it. However, it may only be invoked when the context associated with the normal scope is active. If it is invoked when the context is inactive, a |ContextNotActiveException| is thrown by the container.</text>
</assertion>
- <assertion id="b">
- <text>Any reference to a bean with a pseudo-scope (such as |@Dependent|) is valid until the bean instance to which it refers is
-destroyed. It may be invoked even if the context associated with the pseudo-scope is not active. If the application invokes a method of a reference to an instance that has already been destroyed, the behavior is undefined.</text>
+ <assertion id="b" testable="false">
+ <text>
+ Any reference to a bean with a pseudo-scope (such as |@Dependent|) is valid until the bean instance to which it refers is destroyed. It may be invoked even if the context associated with the pseudo-scope is not active. If the application invokes a method of a reference to an instance that has already been destroyed, the behavior is undefined.
+ </text>
+ <note>Describes unspecified behavior</note>
</assertion>
</section>
@@ -2789,6 +2816,8 @@
</assertion>
</section>
+
+
<section id="6.6.1" title="Passivation capable beans">
<assertion id="a" testable="false">
<text>As defined by the EJB specification, all stateful session beans are passivation capable. Stateless and singleton session beans are not passivation capable.</text>
@@ -2852,9 +2881,7 @@
<text>The |getId()| ~method of the |PassivationCapable| implementation must return a value that uniquely identifies the instance of |Bean| or |Contextual|. It~ is recommended that the string contain the package name of the class that implements |Bean| or |Contextual|.</text>
<note>Recommendation only</note>
</assertion>
- </section>
-
- <section id="6.6.2" title="Passivation capable dependencies">
+ </section><section id="6.6.2" title="Passivation capable dependencies">
<assertion id="a">
<text>The container must guarantee that all session beans are passivation capable dependencies.</text>
</assertion>
@@ -2893,8 +2920,9 @@
</assertion>
</group>
- <assertion id="b">
+ <assertion id="b" testable="false">
<text>Passivating scopes must be explicitly declared |@ScopeType(passivating=true)|.</text>
+ <note>A statement of intent</note>
</assertion>
</section>
@@ -3067,9 +3095,58 @@
</section>
<section id="6.7" title="Context management for built-in scopes">
- <assertion id="a">
+ <group>
<text>The built-in context object is active during servlet, web service and EJB invocations, or in the case of the conversation context object, for JSF requests.</text>
- </assertion>
+
+ <assertion id="a">
+ <text>Test request, session and application for servlet service method()</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Test request, session and application for servlet filter</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Test request, session and application for servlet listener</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Test request, session and application for web service</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Test request, session and application for synchronous EJB invocation</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Test request, session and application for asynchronous EJB invocation</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Test request, session, application and conversation context for a JSF action method</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>Test request, session, application and conversation context for a JSF validator</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>Test request, session, application and conversation context for a JSF converter</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>Test request, session, application and conversation context for a JSF action method</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>Test request, session, application and conversation context for a JSF value change listener</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>Test request, session, application and conversation context for a JSF render</text>
+ </assertion>
+ </group>
+
</section>
<section id="6.7.1" title="Request context lifecycle">
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3532 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-16 13:17:58 -0400 (Sun, 16 Aug 2009)
New Revision: 3532
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java
Log:
minor
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java 2009-08-16 17:12:15 UTC (rev 3531)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java 2009-08-16 17:17:58 UTC (rev 3532)
@@ -16,6 +16,7 @@
{
@Test(groups = { "manager", "ejb3", "integration", "jboss-as-broken" })
@SpecAssertion(section = "11.3", id = "da")
+ // Requires new injection framework carlo is working on I think PLM
public void testManagerLookupInJndi() throws Exception
{
BeanManager beanManager = getInstanceByType(JndiBeanManagerInjected.class).getManagerFromJndi();
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3531 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-16 13:12:15 -0400 (Sun, 16 Aug 2009)
New Revision: 3531
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java
Log:
wrong id
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java 2009-08-16 17:08:30 UTC (rev 3530)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java 2009-08-16 17:12:15 UTC (rev 3531)
@@ -68,7 +68,7 @@
@Test(groups="jboss-as-broken")
@SpecAssertions({
- @SpecAssertion(section="3.6", id="c")
+ @SpecAssertion(section="3.6", id="b")
})
public void testPrincipalBean() throws SystemException
{
16 years, 8 months