[webbeans-commits] Webbeans SVN: r3259 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-26 15:50:22 -0400 (Sun, 26 Jul 2009)
New Revision: 3259
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/PrimitiveInjectionPointTest.java
Log:
Fix test
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/PrimitiveInjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/PrimitiveInjectionPointTest.java 2009-07-26 19:48:22 UTC (rev 3258)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/PrimitiveInjectionPointTest.java 2009-07-26 19:50:22 UTC (rev 3259)
@@ -17,6 +17,7 @@
package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.broken.primitive;
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;
@@ -29,9 +30,9 @@
*/
@Artifact
@ExpectedDeploymentException(DeploymentError.class)
-public class PrimitiveInjectionPointTest
+public class PrimitiveInjectionPointTest extends AbstractJSR299Test
{
- @Test(groups={"resolution", "producerMethod", "ri-broken"})
+ @Test(groups={"resolution", "producerMethod"})
@SpecAssertion(section="5.3.4", id="aa")
public void testPrimitiveInjectionPointResolvedToNonPrimitiveProducerMethod() {
assert false;
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3258 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/failsDuringValidation.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-26 15:48:22 -0400 (Sun, 26 Jul 2009)
New Revision: 3258
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/failsDuringValidation/AfterBeanDiscoveryFailureTest.java
Log:
Mark test broken and fix the exception it expects
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/failsDuringValidation/AfterBeanDiscoveryFailureTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/failsDuringValidation/AfterBeanDiscoveryFailureTest.java 2009-07-26 19:47:31 UTC (rev 3257)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/failsDuringValidation/AfterBeanDiscoveryFailureTest.java 2009-07-26 19:48:22 UTC (rev 3258)
@@ -17,11 +17,10 @@
package org.jboss.jsr299.tck.tests.deployment.lifecycle.broken.failsDuringValidation;
-import javax.enterprise.inject.UnsatisfiedResolutionException;
-
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
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.testng.annotations.Test;
@@ -37,13 +36,13 @@
* @author Dan Allen
*/
@Artifact
-(a)ExpectedDeploymentException(UnsatisfiedResolutionException.class)
+(a)ExpectedDeploymentException(DeploymentError.class)
public class AfterBeanDiscoveryFailureTest extends AbstractJSR299Test
{
// TODO make this an integration test using Extension
- @Test
+ @Test(groups="incontainer-broken")
@SpecAssertions({
@SpecAssertion(section = "11.5.2", id = "a"),
@SpecAssertion(section = "12.2", id = "e"),
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3257 - ri/trunk/impl/src/main/java/org/jboss/webbeans/bean.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-26 15:47:31 -0400 (Sun, 26 Jul 2009)
New Revision: 3257
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
Log:
Fix NPE
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-07-26 19:23:33 UTC (rev 3256)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-07-26 19:47:31 UTC (rev 3257)
@@ -301,7 +301,7 @@
// TODO Merge serializable check in here
for (WBInjectionPoint<?, ?> injectionPoint : getAnnotatedInjectionPoints())
{
- if (!getScopeType().equals(Dependent.class) && injectionPoint.getType().equals(InjectionPoint.class))
+ if (!Dependent.class.equals(getScopeType()) && injectionPoint.getType().equals(InjectionPoint.class))
{
throw new DefinitionException("Cannot inject an InjectionPoint into a non @Dependent scoped bean " + injectionPoint);
}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3256 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-26 15:23:33 -0400 (Sun, 26 Jul 2009)
New Revision: 3256
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
Log:
Link in WBRIs
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-07-26 19:19:45 UTC (rev 3255)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-07-26 19:23:33 UTC (rev 3256)
@@ -206,6 +206,7 @@
@Test(groups = { "injectionPoint", "ri-broken" })
@SpecAssertion(section = "5.6.9", id="dba")
+ // WBRI-310
public void testIsDelegate()
{
assert !getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral()).getInjectedBean().getInjectedMetadata().isDelegate();
@@ -219,6 +220,7 @@
@Test(groups = { "ri-broken", "resolution" })
@SpecAssertion(section = "5.3", id = "hb")
+ // WBRI-296
public void testDecoratorNotResolved()
{
Cat cat = getInstanceByType(Cat.class);
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3255 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-26 15:19:45 -0400 (Sun, 26 Jul 2009)
New Revision: 3255
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
Log:
link in WBRI
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-07-26 19:16:13 UTC (rev 3254)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-07-26 19:19:45 UTC (rev 3255)
@@ -134,6 +134,7 @@
@Test(groups = { "injectionPoint", "ri-broken" })
@SpecAssertion(section = "5.6.9", id = "daa")
+ // WBRI-309
public void testGetAnnotatedField()
{
// Get an instance of the bean which has another bean injected into it
@@ -146,6 +147,7 @@
@Test(groups = { "injectionPoint", "ri-broken" })
@SpecAssertion(section = "5.6.9", id = "daa")
+ // WBRI-309
public void testGetAnnotatedParameter()
{
// Get an instance of the bean which has another bean injected into it
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3254 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-26 15:16:13 -0400 (Sun, 26 Jul 2009)
New Revision: 3254
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectableReferenceTest.java
Log:
link in WBRI
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectableReferenceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectableReferenceTest.java 2009-07-26 19:11:54 UTC (rev 3253)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectableReferenceTest.java 2009-07-26 19:16:13 UTC (rev 3254)
@@ -64,6 +64,7 @@
@SpecAssertions({
@SpecAssertion(section = "11.3.2", id = "b")
})
+ // WBRI-296
public void testGetInjectableReferenceReturnsDelegateForDelegateInjectionPoint()
{
// Get the consumer of the logger and work back from there to get the injection point
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3253 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-26 15:11:54 -0400 (Sun, 26 Jul 2009)
New Revision: 3253
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointOnNonBeanTest.java
Log:
Link in WBRI
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointOnNonBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointOnNonBeanTest.java 2009-07-26 18:58:45 UTC (rev 3252)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointOnNonBeanTest.java 2009-07-26 19:11:54 UTC (rev 3253)
@@ -32,6 +32,7 @@
{
@Test(groups = { "injectionPoint", "ri-broken" })
@SpecAssertion(section = "5.6.9", id = "g")
+ // WBRI-308
public void test()
{
assert false;
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3252 - ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-26 14:58:45 -0400 (Sun, 26 Jul 2009)
New Revision: 3252
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ManualCidPropagationTest.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/AbstractConversationManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ConversationAwareViewHandler.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/WebBeansPhaseListener.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ConversationPropagationFilter.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ClientConversationContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/InvalidatingSessionDestroysConversationTest.java
Log:
add getUnderlyingId method to ConversationImpl for internal use, and mark some tests broken with TODOs
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/AbstractConversationManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/AbstractConversationManager.java 2009-07-26 18:57:47 UTC (rev 3251)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/AbstractConversationManager.java 2009-07-26 18:58:45 UTC (rev 3252)
@@ -127,7 +127,7 @@
public void cleanupConversation()
{
log.trace("Cleaning up conversation for " + currentConversation);
- String cid = currentConversation.getId();
+ String cid = currentConversation.getUnderlyingId();
if (currentConversation.isLongRunning())
{
Future<?> terminationHandle = scheduleForTermination(cid, currentConversation.getTimeout());
@@ -170,7 +170,7 @@
// Conversation.begin(String), we need to unlock the original conversation
// and re-schedule
// it for termination
- String originalCid = currentConversation.getOriginalCid();
+ String originalCid = currentConversation.getOriginalId();
ConversationEntry longRunningConversation = originalCid == null ? null : longRunningConversations.get(originalCid);
if (longRunningConversation != null)
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java 2009-07-26 18:57:47 UTC (rev 3251)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java 2009-07-26 18:58:45 UTC (rev 3252)
@@ -20,8 +20,6 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;
-import javax.enterprise.context.Conversation;
-
import org.jboss.webbeans.context.ConversationContext;
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.log.LogProvider;
@@ -37,7 +35,7 @@
private static LogProvider log = Logging.getLogProvider(ConversationEntry.class);
// The conversation
- private Conversation conversation;
+ private ConversationImpl conversation;
// The handle to the asynchronous timeout task
private Future<?> terminationHandle;
// The lock for concurrent access prevention
@@ -51,7 +49,7 @@
* @param cid The conversation ID
* @param terminationHandle The timeout termination handle
*/
- protected ConversationEntry(BeanStore beanStore, Conversation conversation, Future<?> terminationHandle)
+ protected ConversationEntry(BeanStore beanStore, ConversationImpl conversation, Future<?> terminationHandle)
{
this.beanStore = beanStore;
// conversation is a proxy so we need to make a "real" instance
@@ -68,7 +66,7 @@
* @param terminationHandle The timeout termination handle
* @return A new conversation entry
*/
- public static ConversationEntry of(BeanStore beanStore, Conversation conversation, Future<?> terminationHandle)
+ public static ConversationEntry of(BeanStore beanStore, ConversationImpl conversation, Future<?> terminationHandle)
{
return new ConversationEntry(beanStore, conversation, terminationHandle);
}
@@ -167,7 +165,7 @@
log.trace("Conversation " + conversation + " re-scheduled for termination");
}
- public Conversation getConversation()
+ public ConversationImpl getConversation()
{
return conversation;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java 2009-07-26 18:57:47 UTC (rev 3251)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java 2009-07-26 18:58:45 UTC (rev 3252)
@@ -45,9 +45,9 @@
private static LogProvider log = Logging.getLogProvider(ConversationImpl.class);
// The conversation ID
- private String cid;
+ private String id;
// The original conversation ID (if any)
- private String originalCid;
+ private String originalId;
// Is the conversation long-running?
private boolean longRunning;
// The timeout in milliseconds
@@ -65,9 +65,9 @@
*
* @param conversation The old conversation
*/
- public ConversationImpl(Conversation conversation)
+ public ConversationImpl(ConversationImpl conversation)
{
- this.cid = conversation.getId();
+ this.id = conversation.getUnderlyingId();
this.longRunning = conversation.isLongRunning();
this.timeout = conversation.getTimeout();
}
@@ -81,7 +81,7 @@
@Initializer
public void init(ConversationIdGenerator conversationIdGenerator, @ConversationInactivityTimeout long timeout)
{
- this.cid = conversationIdGenerator.nextId();
+ this.id = conversationIdGenerator.nextId();
this.timeout = timeout;
this.longRunning = false;
log.debug("Created a new conversation " + this);
@@ -93,19 +93,21 @@
{
throw new IllegalStateException("Attempt to call begin() on a long-running conversation");
}
- log.debug("Promoted conversation " + cid + " to long-running");
+ log.debug("Promoted conversation " + id + " to long-running");
longRunning = true;
}
public void begin(String id)
{
- // Store away the (first) change to the conversation ID. If the original conversation was long-running,
- // we might have to place it back for termination once the request is over.
- if (originalCid == null)
+ // Store away the (first) change to the conversation ID. If the original
+ // conversation was long-running,
+ // we might have to place it back for termination once the request is
+ // over.
+ if (originalId == null)
{
- originalCid = cid;
+ originalId = id;
}
- cid = id;
+ this.id = id;
begin();
}
@@ -115,7 +117,7 @@
{
throw new IllegalStateException("Attempt to call end() on a transient conversation");
}
- log.debug("Demoted conversation " + cid + " to transient");
+ log.debug("Demoted conversation " + id + " to transient");
this.longRunning = false;
}
@@ -123,7 +125,7 @@
{
if (isLongRunning())
{
- return cid;
+ return id;
}
else
{
@@ -131,6 +133,17 @@
}
}
+ /**
+ * Get the Conversation Id, regardless of whether the conversation is long
+ * running or transient, needed for internal operations
+ *
+ * @return the id
+ */
+ public String getUnderlyingId()
+ {
+ return id;
+ }
+
public long getTimeout()
{
return timeout;
@@ -152,10 +165,10 @@
* @param conversation The new conversation
*
*/
- public void switchTo(Conversation conversation)
+ public void switchTo(ConversationImpl conversation)
{
log.debug("Switched conversation from " + this);
- cid = conversation.getId();
+ id = conversation.getUnderlyingId();
longRunning = conversation.isLongRunning();
timeout = conversation.getTimeout();
log.debug(" to " + this);
@@ -164,12 +177,12 @@
@Override
public String toString()
{
- return "ID: " + cid + ", long-running: " + longRunning + ", timeout: " + timeout + "ms";
+ return "ID: " + id + ", long-running: " + longRunning + ", timeout: " + timeout + "ms";
}
public void setLongRunning(boolean longRunning)
{
- log.debug("Set conversation " + cid + " to long-running: " + longRunning);
+ log.debug("Set conversation " + id + " to long-running: " + longRunning);
this.longRunning = longRunning;
}
@@ -178,28 +191,31 @@
*
* @return The id
*/
- public String getOriginalCid()
+ public String getOriginalId()
{
- return originalCid;
+ return originalId;
}
-
+
@Override
public boolean equals(Object obj)
{
-
- if (obj == null || !(obj instanceof Conversation))
+ if (obj instanceof ConversationImpl)
+ {
+ ConversationImpl that = (ConversationImpl) obj;
+ return (id == null || that.getUnderlyingId() == null) ? false : id.equals(that.getUnderlyingId());
+ }
+ else
+ {
return false;
- String otherCid = ((Conversation)obj).getId();
- return (cid == null || otherCid == null) ? false : cid.equals(otherCid);
+ }
}
-
+
@Override
public int hashCode()
{
- return cid == null ? super.hashCode() : cid.hashCode();
+ return id == null ? super.hashCode() : id.hashCode();
}
-
public boolean isTransient()
{
return !isLongRunning();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ConversationAwareViewHandler.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ConversationAwareViewHandler.java 2009-07-26 18:57:47 UTC (rev 3251)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ConversationAwareViewHandler.java 2009-07-26 18:58:45 UTC (rev 3252)
@@ -16,12 +16,12 @@
*/
package org.jboss.webbeans.jsf;
-import javax.enterprise.context.Conversation;
import javax.faces.application.ViewHandler;
import javax.faces.application.ViewHandlerWrapper;
import javax.faces.context.FacesContext;
import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.conversation.ConversationImpl;
/**
* <p>
@@ -66,10 +66,10 @@
public String getActionURL(FacesContext context, String viewId)
{
String actionUrl = super.getActionURL(context, viewId);
- Conversation conversation = CurrentManager.rootManager().getInstanceByType(Conversation.class);
+ ConversationImpl conversation = CurrentManager.rootManager().getInstanceByType(ConversationImpl.class);
if (conversation.isLongRunning())
{
- return new FacesUrlTransformer(actionUrl).appendConversationIdIfNecessary(conversation.getId()).getUrl();
+ return new FacesUrlTransformer(actionUrl).appendConversationIdIfNecessary(conversation.getUnderlyingId()).getUrl();
}
else
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/WebBeansPhaseListener.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/WebBeansPhaseListener.java 2009-07-26 18:57:47 UTC (rev 3251)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/WebBeansPhaseListener.java 2009-07-26 18:58:45 UTC (rev 3252)
@@ -22,7 +22,6 @@
*/
package org.jboss.webbeans.jsf;
-import javax.enterprise.context.Conversation;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
@@ -31,6 +30,7 @@
import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.context.ConversationContext;
import org.jboss.webbeans.context.SessionContext;
+import org.jboss.webbeans.conversation.ConversationImpl;
import org.jboss.webbeans.conversation.ConversationManager;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -154,7 +154,7 @@
HttpSession session = PhaseHelper.getHttpSession();
CurrentManager.rootManager().getInstanceByType(HttpSessionManager.class).setSession(session);
CurrentManager.rootManager().getInstanceByType(ConversationManager.class).beginOrRestoreConversation(PhaseHelper.getConversationId());
- String cid = CurrentManager.rootManager().getInstanceByType(Conversation.class).getId();
+ String cid = CurrentManager.rootManager().getInstanceByType(ConversationImpl.class).getUnderlyingId();
ConversationContext conversationContext = CurrentManager.rootManager().getServices().get(ConversationContext.class);
conversationContext.setBeanStore(new ConversationBeanStore(session, cid));
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ConversationPropagationFilter.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ConversationPropagationFilter.java 2009-07-26 18:57:47 UTC (rev 3251)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ConversationPropagationFilter.java 2009-07-26 18:58:45 UTC (rev 3252)
@@ -18,7 +18,6 @@
import java.io.IOException;
-import javax.enterprise.context.Conversation;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
@@ -29,6 +28,7 @@
import javax.servlet.http.HttpServletResponseWrapper;
import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.conversation.ConversationImpl;
import org.jboss.webbeans.conversation.ConversationManager;
import org.jboss.webbeans.jsf.FacesUrlTransformer;
@@ -66,10 +66,10 @@
@Override
public void sendRedirect(String path) throws IOException
{
- Conversation conversation = CurrentManager.rootManager().getInstanceByType(Conversation.class);
+ ConversationImpl conversation = CurrentManager.rootManager().getInstanceByType(ConversationImpl.class);
if (conversation.isLongRunning())
{
- path = new FacesUrlTransformer(path).toRedirectViewId().toActionUrl().appendConversationIdIfNecessary(conversation.getId()).encode();
+ path = new FacesUrlTransformer(path).toRedirectViewId().toActionUrl().appendConversationIdIfNecessary(conversation.getUnderlyingId()).encode();
CurrentManager.rootManager().getInstanceByType(ConversationManager.class).cleanupConversation();
}
super.sendRedirect(path);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ClientConversationContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ClientConversationContextTest.java 2009-07-26 18:57:47 UTC (rev 3251)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ClientConversationContextTest.java 2009-07-26 18:58:45 UTC (rev 3252)
@@ -31,13 +31,14 @@
public class ClientConversationContextTest extends AbstractConversationTest
{
- @Test(groups = { "contexts" })
+ @Test(groups = { "contexts", "broken" })
@SpecAssertions({
@SpecAssertion(section = "6.7.4", id = "hb"),
@SpecAssertion(section = "6.7.4", id = "o")
})
public void testConversationIdSetByContainerIsUnique() throws Exception
{
+ // TODO Test assumes conversation.getId() is available when not in a lrc
HttpClient client = new HttpClient();
ConversationState c1 = request(client, "/home.jsf");
ConversationState c2 = request(client, "/home.jsf");
@@ -58,10 +59,11 @@
assert isCloudDestroyed(client);
}
- @Test(groups = { "contexts" })
+ @Test(groups = { "contexts", "broken"})
@SpecAssertion(section = "6.7.4", id = "k")
public void testLongRunningConversationInstancesNotDestroyedAtRequestEnd() throws Exception
{
+ // TODO Test assumes conversation.getId() is available when not in a lrc
HttpClient client = new HttpClient();
resetCloud(client);
ConversationState c = request(client, "/clouds.jsf");
@@ -70,21 +72,11 @@
assert c.isLongRunning();
}
- @Test(groups = { "contexts" })
- @SpecAssertion(section = "6.7.4", id = "n")
- public void testManualCidPropagation() throws Exception
- {
- HttpClient client = new HttpClient();
- ConversationState c1 = request(client, "/clouds.jsf");
- ConversationState c2 = request(client, "/cloud.jsf", c1);
- assert c2.isLongRunning();
- assert c1.getId().equals(c2.getId());
- }
-
- @Test(groups = { "contexts" })
+ @Test(groups = { "contexts", "broken" })
@SpecAssertion(section = "6.7.4", id = "o")
public void testConversationNotPropagated() throws Exception
{
+ // TODO Test assumes conversation.getId() is available when not in a lrc
HttpClient client = new HttpClient();
ConversationState c1 = request(client, "/clouds.jsf");
ConversationState c2 = request(client, "/clouds.jsf");
@@ -93,10 +85,11 @@
assert !c1.getId().equals(c2.getId());
}
- @Test(groups = { "contexts" })
+ @Test(groups = { "contexts" , "broken"})
@SpecAssertion(section = "6.7.4", id = "p")
public void testConversationsDontCrossSessionBoundary1() throws Exception
{
+ // TODO Test assumes conversation.getId() is available when not in a lrc
HttpClient client = new HttpClient();
ConversationState c1 = request(client, "/rain.jsf");
assert hasRained(client, "/cloud.jsf", c1);
@@ -104,10 +97,11 @@
assert !hasRained(client, "/cloud.jsf", c1);
}
- @Test(groups = { "contexts" })
+ @Test(groups = { "contexts" , "broken"})
@SpecAssertion(section = "6.7.4", id = "p")
public void testConversationsDontCrossSessionBoundary2() throws Exception
{
+ // TODO Test assumes conversation.getId() is available when not in a lrc
HttpClient client1 = new HttpClient();
HttpClient client2 = new HttpClient();
ConversationState c1 = request(client1, "/rain.jsf");
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/InvalidatingSessionDestroysConversationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/InvalidatingSessionDestroysConversationTest.java 2009-07-26 18:57:47 UTC (rev 3251)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/InvalidatingSessionDestroysConversationTest.java 2009-07-26 18:58:45 UTC (rev 3252)
@@ -27,11 +27,12 @@
public class InvalidatingSessionDestroysConversationTest extends AbstractConversationTest
{
- @Test(groups = { "contexts" })
+ @Test(groups = { "contexts", "broken" })
@SpecAssertion(section = "6.7.4", id = "qa")
// TODO this test doesn't precisely probe the boundaries of the service() method
public void testInvalidatingSessionDestroysConversation() throws Exception
{
+ // TODO Test assumes conversation.getId() is available when not in a lrc
HttpClient client = new HttpClient();
resetCloud(client);
request(client, "/clouds.jsf");
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ManualCidPropagationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ManualCidPropagationTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ManualCidPropagationTest.java 2009-07-26 18:58:45 UTC (rev 3252)
@@ -0,0 +1,43 @@
+package org.jboss.jsr299.tck.tests.context.conversation.client;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import org.jboss.testharness.impl.packaging.war.WarArtifactDescriptor;
+import org.testng.annotations.Test;
+
+/**
+ * @author Nicklas Karlsson
+ * @author Dan Allen
+ *
+ * Spec version: 20090625
+ */
+@Artifact(addCurrentPackage=false)
+(a)Classes({Storm.class, ConversationTestPhaseListener.class, ConversationStatusServlet.class, Cloud.class, CloudController.class})
+@IntegrationTest(runLocally=true)
+@Resources({
+ @Resource(destination=WarArtifactDescriptor.WEB_XML_DESTINATION, source="web.xml"),
+ @Resource(destination="cloud.jspx", source="cloud.jsf"),
+ @Resource(destination="clouds.jspx", source="clouds.jsf"),
+ @Resource(destination="/WEB-INF/faces-config.xml", source="faces-config.xml")
+})
+public class ManualCidPropagationTest extends AbstractConversationTest
+{
+
+ @Test(groups = { "contexts", "broken" })
+ @SpecAssertion(section = "6.7.4", id = "n")
+ public void testManualCidPropagation() throws Exception
+ {
+ // TODO Test assumes conversation.getId() is available when not in a lrc
+ HttpClient client = new HttpClient();
+ ConversationState c1 = request(client, "/clouds.jsf");
+ ConversationState c2 = request(client, "/cloud.jsf", c1);
+ assert c2.isLongRunning();
+ assert c1.getId().equals(c2.getId());
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ManualCidPropagationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3251 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-26 14:57:47 -0400 (Sun, 26 Jul 2009)
New Revision: 3251
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/NormalScopedBeanWithInjectionPoint.java
Log:
Fix test
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-07-26 18:52:49 UTC (rev 3250)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-07-26 18:57:47 UTC (rev 3251)
@@ -32,6 +32,7 @@
import javax.enterprise.inject.Specializes;
import javax.enterprise.inject.deployment.Standard;
import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.stereotype.Stereotype;
import org.jboss.webbeans.BeanManagerImpl;
@@ -157,6 +158,7 @@
initSerializable();
initProxyable();
initInjectionPoints();
+ checkInjectionPoints();
initDecorates();
checkDecorates();
}
@@ -293,6 +295,19 @@
}
return true;
}
+
+ protected boolean checkInjectionPoints()
+ {
+ // TODO Merge serializable check in here
+ for (WBInjectionPoint<?, ?> injectionPoint : getAnnotatedInjectionPoints())
+ {
+ if (!getScopeType().equals(Dependent.class) && injectionPoint.getType().equals(InjectionPoint.class))
+ {
+ throw new DefinitionException("Cannot inject an InjectionPoint into a non @Dependent scoped bean " + injectionPoint);
+ }
+ }
+ return true;
+ }
/**
* Initializes the scope type
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/NormalScopedBeanWithInjectionPoint.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/NormalScopedBeanWithInjectionPoint.java 2009-07-26 18:52:49 UTC (rev 3250)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/NormalScopedBeanWithInjectionPoint.java 2009-07-26 18:57:47 UTC (rev 3251)
@@ -17,6 +17,7 @@
package org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.normal.scope;
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;
@@ -28,12 +29,14 @@
*/
@Artifact
@ExpectedDeploymentException(DefinitionError.class)
-public class NormalScopedBeanWithInjectionPoint {
-
- @Test(groups = { "injectionPoint", "ri-broken" })
- @SpecAssertion(section="5.6.9", id="f")
- public void testSessionScopedBeanWithInjectionPoint() {
- assert false;
- }
+public class NormalScopedBeanWithInjectionPoint extends AbstractJSR299Test
+{
+ @Test(groups = { "injectionPoint"})
+ @SpecAssertion(section = "5.6.9", id = "f")
+ public void testSessionScopedBeanWithInjectionPoint()
+ {
+ assert false;
+ }
+
}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3250 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-26 14:52:49 -0400 (Sun, 26 Jul 2009)
New Revision: 3250
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java
Log:
Add WBRIs
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java 2009-07-26 18:46:04 UTC (rev 3249)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java 2009-07-26 18:52:49 UTC (rev 3250)
@@ -48,12 +48,13 @@
assert injectionPoint.getPaymentProcessor() instanceof Instance;
}
- @Test(groups = {"ri-broken", "review"})
+ @Test(groups = {"ri-broken"})
@SpecAssertions({
@SpecAssertion(section = "5.7", id ="ba"),
@SpecAssertion(section = "5.7", id ="ca"),
@SpecAssertion(section = "5.7.1", id ="ab")
})
+ // WBRI-307
public void testDynamicLookup()
{
ObtainsInjectionPointBean injectionPoint = getInstanceByType(ObtainsInjectionPointBean.class);
@@ -61,7 +62,8 @@
}
@Test(groups = "ri-broken", expectedExceptions = IllegalArgumentException.class)
- @SpecAssertion(section = "5.7.1", id ="da")
+ @SpecAssertion(section = "5.7.1", id ="da")
+ // WBRI-307
public void testDuplicateBindingsThrowsException()
{
ObtainsInjectionPointBean injectionPoint = getInstanceByType(ObtainsInjectionPointBean.class);
@@ -70,6 +72,7 @@
@Test(groups = "ri-broken", expectedExceptions = IllegalArgumentException.class)
@SpecAssertion(section = "5.7.1", id = "e")
+ // WBRI-307
public void testNonBindingThrowsException()
{
ObtainsInjectionPointBean injectionPoint = getInstanceByType(ObtainsInjectionPointBean.class);
@@ -80,6 +83,7 @@
@SpecAssertions({
@SpecAssertion(section = "5.7.1", id = "fb"),
@SpecAssertion(section = "5.7.1", id = "l")})
+ // WBRI-307
public void testUnsatisfiedDependencyThrowsException()
{
ObtainsInjectionPointBean injectionPoint = getInstanceByType(ObtainsInjectionPointBean.class);
@@ -101,6 +105,7 @@
@Test(groups= "ri-broken")
@SpecAssertion(section = "5.7.1", id = "m")
+ // WBRI-307
public void testIsAmbiguous()
{
ObtainsInjectionPointBean injectionPoint = getInstanceByType(ObtainsInjectionPointBean.class);
15 years, 4 months