Author: dan.j.allen
Date: 2009-07-21 00:22:46 -0400 (Tue, 21 Jul 2009)
New Revision: 3100
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/NonBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCity.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCityConsumer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Sleeping.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/FooConsumer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableFoo.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer2.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Generator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/NonSerializableTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation2.java
Log:
fix broken integration tests
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer.java 2009-07-21
04:22:07 UTC (rev 3099)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer.java 2009-07-21
04:22:46 UTC (rev 3100)
@@ -1,12 +1,11 @@
package org.jboss.jsr299.tck.tests.context.passivating;
-import javax.enterprise.context.Dependent;
import javax.enterprise.context.SessionScoped;
import javax.enterprise.inject.Produces;
class CityProducer
{
- @Produces @Dependent public Violation reference = new Violation();
+ @Produces public Violation reference = new Violation();
- @Produces @SessionScoped public HelsinkiNonSerializable helsinki = new
HelsinkiNonSerializable();
+ @Produces @SessionScoped public HelsinkiNonSerializable helsinki = new
HelsinkiNonSerializable();
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer2.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer2.java 2009-07-21
04:22:07 UTC (rev 3099)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer2.java 2009-07-21
04:22:46 UTC (rev 3100)
@@ -1,11 +1,10 @@
package org.jboss.jsr299.tck.tests.context.passivating;
-import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Produces;
class CityProducer2
{
- @Produces @Dependent @Big
+ @Produces @Big
public Violation create()
{
return new Violation();
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/FooConsumer.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/FooConsumer.java 2009-07-21
04:22:07 UTC (rev 3099)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/FooConsumer.java 2009-07-21
04:22:46 UTC (rev 3100)
@@ -1,14 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.passivating;
-
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.Current;
-
-@RequestScoped
-class FooConsumer
-{
-
- @Current SerializableFoo foo;
-
- public void ping(){};
-
-}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Generator.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Generator.java 2009-07-21
04:22:07 UTC (rev 3099)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Generator.java 2009-07-21
04:22:46 UTC (rev 3100)
@@ -1,13 +1,12 @@
package org.jboss.jsr299.tck.tests.context.passivating;
-
import java.io.Serializable;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
@ApplicationScoped
-class Generator implements Serializable
+class Generator implements Serializable
{
private static final long serialVersionUID = -7213673465118041882L;
@@ -19,9 +18,9 @@
return number;
}
- @Produces SerializableFoo getFoo()
+ @Produces @Sleeping SerializableCity getCity()
{
- return new SerializableFoo();
+ return new SerializableCity();
}
-}
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java 2009-07-21
04:22:07 UTC (rev 3099)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java 2009-07-21
04:22:46 UTC (rev 3100)
@@ -1,6 +1,6 @@
package org.jboss.jsr299.tck.tests.context.passivating;
-class HelsinkiNonSerializable
+@NonBean class HelsinkiNonSerializable
{
public void ping()
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/NonBean.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/NonBean.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/NonBean.java 2009-07-21
04:22:46 UTC (rev 3100)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.deployment.DeploymentType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface NonBean
+{
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-07-21
04:22:07 UTC (rev 3099)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-07-21
04:22:46 UTC (rev 3100)
@@ -2,12 +2,10 @@
import java.io.IOException;
import java.io.Serializable;
-import java.lang.annotation.Annotation;
import java.util.Set;
import javax.enterprise.context.SessionScoped;
import javax.enterprise.context.spi.Context;
-import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.IllegalProductException;
import javax.enterprise.inject.spi.Bean;
@@ -18,7 +16,6 @@
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
-import org.jboss.testharness.impl.util.Reflections;
import org.testng.annotations.Test;
/**
@@ -43,15 +40,15 @@
}
@Test @SpecAssertion(section="unknown", id = "unknown")
- public void testInjectionOfDependentSerializableProductIntoNormalBean()
+ public void testInjectionOfDependentPrimitiveProductIntoNormalBean()
{
getInstanceByType(NumberConsumer.class).ping();
}
@Test @SpecAssertion(section="unknown", id = "unknown")
- public void testInjectionOfDependentPrimitiveProductIntoNormalBean()
+ public void testInjectionOfDependentSerializableProductIntoNormalBean()
{
- getInstanceByType(FooConsumer.class).ping();
+ getInstanceByType(SerializableCityConsumer.class).ping();
}
@Test(groups = { "contexts", "passivation" })
@@ -77,6 +74,7 @@
T instance = getCurrentManager().getContext(bean.getScopeType()).get(bean);
byte[] data = serialize(instance);
T resurrected = (T) deserialize(data);
+ assert resurrected != null;
return resurrected.toString().equals(instance.toString());
}
@@ -125,7 +123,7 @@
}
@Test(expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "6.6.4", id = "d")
+ @SpecAssertion(section = "6.6.4", id = "d")
public void
testNonSerializableProducerFieldDeclaredPassivatingThrowsIllegalProductException()
{
getInstanceByType(HelsinkiNonSerializable.class).ping();
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCity.java
(from rev 3098,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableFoo.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCity.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCity.java 2009-07-21
04:22:46 UTC (rev 3100)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+public class SerializableCity extends City implements Serializable
+{
+}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCityConsumer.java
(from rev 3098,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/FooConsumer.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCityConsumer.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableCityConsumer.java 2009-07-21
04:22:46 UTC (rev 3100)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import javax.enterprise.context.RequestScoped;
+
+@RequestScoped
+class SerializableCityConsumer
+{
+
+ @Sleeping SerializableCity city;
+
+ public void ping()
+ {
+ };
+
+}
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableFoo.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableFoo.java 2009-07-21
04:22:07 UTC (rev 3099)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/SerializableFoo.java 2009-07-21
04:22:46 UTC (rev 3100)
@@ -1,8 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.passivating;
-
-import java.io.Serializable;
-
-public class SerializableFoo implements Serializable
-{
-
-}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Sleeping.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Sleeping.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Sleeping.java 2009-07-21
04:22:46 UTC (rev 3100)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Sleeping
+{
+
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation.java 2009-07-21
04:22:07 UTC (rev 3099)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation.java 2009-07-21
04:22:46 UTC (rev 3100)
@@ -1,14 +1,8 @@
package org.jboss.jsr299.tck.tests.context.passivating;
-import javax.enterprise.context.Dependent;
-
-@Dependent
-class Violation
+@NonBean class Violation
{
-
public void ping()
{
-
}
-
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/NonSerializableTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/NonSerializableTest.java 2009-07-21
04:22:07 UTC (rev 3099)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/NonSerializableTest.java 2009-07-21
04:22:46 UTC (rev 3100)
@@ -7,12 +7,15 @@
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
+/**
+ * Spec version: 20090625
+ */
@Artifact
@ExpectedDeploymentException(DeploymentError.class)
public class NonSerializableTest extends AbstractJSR299Test
{
@Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "8.4", id = "o")
+ @SpecAssertion(section = "6.6.4", id = "cb")
public void
testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoProducerMethodParameterWithPassivatingScopeFails()
{
assert false;
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation.java 2009-07-21
04:22:07 UTC (rev 3099)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation.java 2009-07-21
04:22:46 UTC (rev 3100)
@@ -1,9 +1,5 @@
package org.jboss.jsr299.tck.tests.context.passivating.broken9;
-import javax.enterprise.context.Dependent;
-
-@Dependent
class Violation
{
-
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation2.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation2.java 2009-07-21
04:22:07 UTC (rev 3099)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken9/Violation2.java 2009-07-21
04:22:46 UTC (rev 3100)
@@ -1,9 +1,5 @@
package org.jboss.jsr299.tck.tests.context.passivating.broken9;
-import javax.enterprise.context.Dependent;
-
-@Dependent
class Violation2
{
-
}