[webbeans-commits] Webbeans SVN: r3503 - in tck/trunk: impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client and 5 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Sat Aug 15 07:01:36 EDT 2009
Author: pete.muir at jboss.org
Date: 2009-08-15 07:01:36 -0400 (Sat, 15 Aug 2009)
New Revision: 3503
Modified:
tck/trunk/doc/reference/en-US/Author_Group.xml
tck/trunk/doc/reference/en-US/Book_Info.xml
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/AbstractConversationTest.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/Cloud.java
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/event/select/SelectEventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/BeanByTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/conversation/client/rain.jsf
Log:
fix a few tests
Modified: tck/trunk/doc/reference/en-US/Author_Group.xml
===================================================================
--- tck/trunk/doc/reference/en-US/Author_Group.xml 2009-08-15 09:40:56 UTC (rev 3502)
+++ tck/trunk/doc/reference/en-US/Author_Group.xml 2009-08-15 11:01:36 UTC (rev 3503)
@@ -7,7 +7,7 @@
<affiliation>
<jobtitle>JSR-299: Contexts and Dependency Injection (CDI) for Java EE
specification lead</jobtitle>
- <orgname>Red Hat Middleware LLC</orgname>
+ <orgname>Red Hat Inc.</orgname>
</affiliation>
</author>
<author>
@@ -15,7 +15,7 @@
<surname>Muir</surname>
<affiliation>
<jobtitle>CDI TCK lead</jobtitle>
- <orgname>Red Hat Middleware LLC</orgname>
+ <orgname>Red Hat Inc.</orgname>
</affiliation>
</author>
<author>
@@ -23,7 +23,7 @@
<surname>Allen</surname>
<affiliation>
<jobtitle>CDI TCK developer</jobtitle>
- <orgname>Red Hat Middleware LLC</orgname>
+ <orgname>Red Hat Inc.</orgname>
</affiliation>
</author>
<!--
Modified: tck/trunk/doc/reference/en-US/Book_Info.xml
===================================================================
--- tck/trunk/doc/reference/en-US/Book_Info.xml 2009-08-15 09:40:56 UTC (rev 3502)
+++ tck/trunk/doc/reference/en-US/Book_Info.xml 2009-08-15 11:01:36 UTC (rev 3503)
@@ -4,7 +4,7 @@
<copyright>
<year>2009</year>
<holder>
- Red Hat Middleware LLC, and individual contributors listed as authors.
+ Red Hat Inc., and individual contributors listed as authors.
</holder>
</copyright>
<releaseinfo><literallayout>Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,7 +19,7 @@
<title>Technology Compatibility Kit Reference Guide for JSR-299: Context and
Dependency Injection for Java EE</title>
- <subtitle>Specification Lead: Red Hat Middleware LLC</subtitle>
+ <subtitle>Specification Lead: Red Hat Inc.</subtitle>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Author_Group.xml" />
<!--
vim: ts=3:sw=3:tw=80:set expandtab
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/AbstractConversationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/AbstractConversationTest.java 2009-08-15 09:40:56 UTC (rev 3502)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/AbstractConversationTest.java 2009-08-15 11:01:36 UTC (rev 3503)
@@ -116,26 +116,6 @@
}
}
- protected boolean hasRained(HttpClient client, String viewId) throws Exception
- {
- HttpMethod method = new GetMethod(getPath(viewId));
- try
- {
- client.executeMethod(method);
- assert method.getStatusCode() == 200;
- return method.getResponseHeader(Cloud.RAINED_HEADER_NAME).getValue().equals("true") ? true : false;
- }
- finally
- {
- method.releaseConnection();
- }
- }
-
- protected boolean hasRained(HttpClient client, String viewId, ConversationState c) throws Exception
- {
- return hasRained(client, viewId + "?" + CID_REQUEST_PARAMETER_NAME + "=" + c.getId());
- }
-
protected String getPath(String viewId)
{
return getContextPath() + viewId;
@@ -192,5 +172,15 @@
return page.getWebResponse().getResponseHeaderValue(AbstractConversationTest.CID_HEADER_NAME);
}
+ protected Boolean hasRained(HtmlPage page)
+ {
+ return Boolean.valueOf(page.getWebResponse().getResponseHeaderValue(Cloud.RAINED_HEADER_NAME));
+ }
+ protected Boolean isLongRunning(HtmlPage page)
+ {
+ return Boolean.valueOf(page.getWebResponse().getResponseHeaderValue(LONG_RUNNING_HEADER_NAME));
+ }
+
+
}
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-08-15 09:40:56 UTC (rev 3502)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ClientConversationContextTest.java 2009-08-15 11:01:36 UTC (rev 3503)
@@ -12,6 +12,10 @@
import org.jboss.testharness.impl.packaging.war.WarArtifactDescriptor;
import org.testng.annotations.Test;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
+
/**
* @author Nicklas Karlsson
* @author Dan Allen
@@ -24,6 +28,7 @@
@Resource(destination="home.jspx", source="home.jsf"),
@Resource(destination="cloud.jspx", source="cloud.jsf"),
@Resource(destination="clouds.jspx", source="clouds.jsf"),
+ @Resource(destination="storm.jspx", source="storm.jsf"),
@Resource(destination="/WEB-INF/faces-config.xml", source="faces-config.xml"),
@Resource(destination="rain.jspx", source="rain.jsf")
})
@@ -31,23 +36,30 @@
public class ClientConversationContextTest extends AbstractConversationTest
{
- @Test(groups = { "contexts", "broken" })
+ @Test(groups = { "contexts"})
@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");
- assert c1.isTransient();
- assert c2.isTransient();
- assert !c1.getId().equals(c2.getId());
+ WebClient webClient = new WebClient();
+ HtmlPage storm = webClient.getPage(getPath("/storm.jsf"));
+ HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
+ storm = beginConversationButton.click();
+
+ String c1 = getCid(storm);
+
+ storm = webClient.getPage(getPath("/storm.jsf"));
+ beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
+ storm = beginConversationButton.click();
+
+ String c2 = getCid(storm);
+
+ assert !c1.equals(c2);
}
- @Test(groups = { "contexts" })
+ @Test(groups = { "contexts", "rewrite" })
@SpecAssertion(section = "6.7.4", id = "j")
// TODO this test doesn't verify that the conversation context itself is destroyed
public void testTransientConversationInstancesDestroyedAtRequestEnd() throws Exception
@@ -59,42 +71,34 @@
assert isCloudDestroyed(client);
}
- @Test(groups = { "contexts", "broken"})
+ @Test(groups = { "contexts"})
@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");
assert !isCloudDestroyed(client);
- c = request(client, "/home.jsf", c);
- assert c.isLongRunning();
}
- @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");
- assert c1.isTransient();
- assert c2.isTransient();
- assert !c1.getId().equals(c2.getId());
- }
-
@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);
- invalidateSession(client);
- assert !hasRained(client, "/cloud.jsf", c1);
+ WebClient webClient = new WebClient();
+ HtmlPage rain = webClient.getPage(getPath("/rain.jsf"));
+ HtmlSubmitInput beginConversationButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, "beginConversationButton");
+ rain = beginConversationButton.click();
+
+ HtmlSubmitInput rainButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, "rain");
+
+ rain = rainButton.click();
+
+ assert hasRained(rain);
+
+ webClient.getPage(getConversationStatusPath("invalidateSession"));
+
+ assert !hasRained(rain);
}
@Test(groups = { "contexts" , "broken"})
@@ -105,8 +109,8 @@
HttpClient client1 = new HttpClient();
HttpClient client2 = new HttpClient();
ConversationState c1 = request(client1, "/rain.jsf");
- assert hasRained(client1, "/cloud.jsf", c1);
- assert !hasRained(client2, "/cloud.jsf", c1);
+ //assert hasRained(client1, "/cloud.jsf", c1.getId());
+ //assert !hasRained(client2, "/cloud.jsf", c1.getId());
}
@Test(groups = { "contexts" })
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/Cloud.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/Cloud.java 2009-08-15 09:40:56 UTC (rev 3502)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/Cloud.java 2009-08-15 11:01:36 UTC (rev 3503)
@@ -42,10 +42,10 @@
return NAME;
}
- public String getRain()
+ public void rain()
{
rained = true;
- return "rain!";
+ System.out.println("rain!");
}
public boolean isRained()
Modified: 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 2009-08-15 09:40:56 UTC (rev 3502)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ManualCidPropagationTest.java 2009-08-15 11:01:36 UTC (rev 3503)
@@ -1,6 +1,7 @@
package org.jboss.jsr299.tck.tests.context.conversation.client;
-import org.apache.commons.httpclient.HttpClient;
+import java.net.URL;
+
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
@@ -11,6 +12,11 @@
import org.jboss.testharness.impl.packaging.war.WarArtifactDescriptor;
import org.testng.annotations.Test;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.WebRequestSettings;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
+
/**
* @author Nicklas Karlsson
* @author Dan Allen
@@ -22,6 +28,7 @@
@Resources({
@Resource(destination=WarArtifactDescriptor.WEB_XML_DESTINATION, source="web.xml"),
@Resource(destination="cloud.jspx", source="cloud.jsf"),
+ @Resource(destination="storm.jspx", source="storm.jsf"),
@Resource(destination="clouds.jspx", source="clouds.jsf"),
@Resource(destination="/WEB-INF/faces-config.xml", source="faces-config.xml")
})
@@ -33,12 +40,22 @@
@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());
+ WebClient webClient = new WebClient();
+ HtmlPage storm = webClient.getPage(getPath("/storm.jsf"));
+ HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
+ storm = beginConversationButton.click();
+
+ String c1 = getCid(storm);
+
+ WebRequestSettings settings = new WebRequestSettings(new URL(getPath("/cloud.jsf")));
+ settings.addAdditionalHeader(CID_REQUEST_PARAMETER_NAME, c1);
+
+ HtmlPage cloud = webClient.getPage(settings);
+
+ String c2 = getCid(cloud);
+
+ assert isLongRunning(cloud);
+ assert c1.equals(c2);
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SelectEventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SelectEventTest.java 2009-08-15 09:40:56 UTC (rev 3502)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SelectEventTest.java 2009-08-15 11:01:36 UTC (rev 3503)
@@ -1,10 +1,11 @@
package org.jboss.jsr299.tck.tests.event.select;
import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.TypeLiteral;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
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;
@@ -50,13 +51,13 @@
assert alarm.getNumViolentBreakIns() == 1;
}
- @Test(groups = {"events", "broken" }, expectedExceptions = IllegalArgumentException.class)
+ @Test(groups = {"events", "ri-broken" }, expectedExceptions = IllegalArgumentException.class)
@SpecAssertion(section = "10.3.1", id = "eab")
- public void testEventSelectThrowsExceptionIfEventTypeHasTypeVariable()
+ public <T> void testEventSelectThrowsExceptionIfEventTypeHasTypeVariable()
{
// TODO This test *doesn't* pass an event with a type variable in, it passes in a raw class PLM
SecuritySensor sensor = getInstanceByType(SecuritySensor.class);
- sensor.securityEvent.select(SecurityEvent_Illegal.class);
+ sensor.securityEvent.select(new TypeLiteral<SecurityEvent_Illegal<T>>() {});
}
@Test(groups = "events", expectedExceptions = IllegalArgumentException.class)
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/BeanByTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/BeanByTypeTest.java 2009-08-15 09:40:56 UTC (rev 3502)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/BeanByTypeTest.java 2009-08-15 11:01:36 UTC (rev 3503)
@@ -17,7 +17,9 @@
package org.jboss.jsr299.tck.tests.extensions.bean.bytype;
+import java.lang.reflect.GenericDeclaration;
import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
import java.util.Set;
import javax.enterprise.inject.spi.Bean;
@@ -63,19 +65,31 @@
assert beans.iterator().next().getBindings().contains(new CurrentLiteral());
}
- @Test(groups = "broken", expectedExceptions = IllegalArgumentException.class)
+ @Test(expectedExceptions = IllegalArgumentException.class)
@SpecAssertions({
@SpecAssertion(section = "11.3.4", id = "da")
})
public void testTypeVariable()
{
- //TODO Not sure how to get a type variable passed here
- getCurrentManager().getBeans(getType(new SimpleBean()));
- }
+ TypeVariable<?> t = new TypeVariable<GenericDeclaration>()
+ {
- private <T> Type getType(T object)
- {
- return object.getClass();
+ public Type[] getBounds()
+ {
+ return new Type[0];
+ }
+
+ public GenericDeclaration getGenericDeclaration()
+ {
+ return null;
+ }
+
+ public String getName()
+ {
+ return "";
+ }
+ };
+ getCurrentManager().getBeans(t);
}
@Test(expectedExceptions = IllegalArgumentException.class)
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.java 2009-08-15 09:40:56 UTC (rev 3502)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.java 2009-08-15 11:01:36 UTC (rev 3503)
@@ -4,10 +4,10 @@
import javax.enterprise.inject.AnnotationLiteral;
+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.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Packaging;
@@ -26,7 +26,6 @@
private static Annotation LANDOWNER_LITERAL = new AnnotationLiteral<Landowner>() {};
@Test(groups="broken")
- // Needs @Alternatives
@SpecAssertions({
@SpecAssertion(section = "4.3", id = "ca")
})
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-15 09:40:56 UTC (rev 3502)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java 2009-08-15 11:01:36 UTC (rev 3503)
@@ -3,9 +3,9 @@
import javax.enterprise.inject.spi.BeanManager;
import javax.naming.InitialContext;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.testng.annotations.Test;
@@ -15,7 +15,7 @@
@SpecVersion("20090625")
public class ManagerTest extends AbstractJSR299Test
{
- @Test(groups = { "manager", "ejb3", "integration", "rewrite" })
+ @Test(groups = { "manager", "ejb3", "integration", "rewrite", "jboss-as-broken" })
//TODO This test needs to use an EJB component that looks up the JNDI manager (java:comp)
@SpecAssertion(section = "11.3", id = "da")
public void testManagerLookupInJndi() throws Exception
Modified: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/conversation/client/rain.jsf
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/conversation/client/rain.jsf 2009-08-15 09:40:56 UTC (rev 3502)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/conversation/client/rain.jsf 2009-08-15 11:01:36 UTC (rev 3503)
@@ -14,8 +14,8 @@
</head>
<body>
<f:view>
- <h:outputText value="#{cloud.rain}" />
- <h:outputText value="#{cloudController.beginConversation}" />
+ <h:commandButton action="#{storm.beginConversation}" value="Thunder" id="beginConversationButton"/>
+ <h:commandButton action="#{cloud.rain}" value="Rain" id="rain"/>
</f:view>
</body>
</html>
More information about the weld-commits
mailing list