[webbeans-commits] Webbeans SVN: r2367 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities and 10 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-09 14:41:41 -0400 (Thu, 09 Apr 2009)
New Revision: 2367
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Order.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/interceptorAndDecorator/
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
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/passivating/Helsinki.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextIntegrationTest.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/event/EventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/ImplicitEventBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/ArrayTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/PrivateConstructorTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Remove, enable and fix a few ri-broken tests
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-04-09 16:48:39 UTC (rev 2366)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-04-09 18:41:41 UTC (rev 2367)
@@ -20,6 +20,7 @@
import java.io.InputStream;
import java.io.Serializable;
import java.lang.annotation.Annotation;
+import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
@@ -379,7 +380,6 @@
* @see javax.inject.manager.Manager#resolveObservers(java.lang.Object,
* java.lang.annotation.Annotation[])
*/
- @SuppressWarnings("unchecked")
public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings)
{
Class<?> clazz = event.getClass();
@@ -395,19 +395,36 @@
{
throw new DuplicateBindingTypeException("Duplicate binding types: " + bindings);
}
- Type t = new Reflections.HierarchyDiscovery(clazz).getResolvedType();
- for (Type type : Reflections.getActualTypeArguments(clazz))
+ checkEventType(clazz);
+ return eventManager.getObservers(event, bindings);
+ }
+
+ private void checkEventType(Type eventType)
+ {
+ Type[] types;
+ if (eventType instanceof Class)
{
+ types = Reflections.getActualTypeArguments((Class<?>) eventType);
+ }
+ else if (eventType instanceof ParameterizedType)
+ {
+ types = ((ParameterizedType) eventType).getActualTypeArguments();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Event type " + eventType + " isn't a concrete type");
+ }
+ for (Type type : types)
+ {
if (type instanceof WildcardType)
{
- throw new IllegalArgumentException("Cannot resolve an event type parameterized with a wildcard " + clazz);
+ throw new IllegalArgumentException("Cannot provide an event type parameterized with a wildcard " + eventType);
}
if (type instanceof TypeVariable)
{
- throw new IllegalArgumentException("Cannot resolve an event type parameterized with a type parameter " + clazz);
+ throw new IllegalArgumentException("Cannot provide an event type parameterized with a type parameter " + eventType);
}
}
- return eventManager.getObservers(event, bindings);
}
/**
@@ -657,6 +674,7 @@
*/
public <T> Manager addObserverByType(Observer<T> observer, Type eventType, Annotation... bindings)
{
+ checkEventType(eventType);
this.eventManager.addObserver(observer, eventType, bindings);
for (ManagerImpl childActivity : childActivities)
{
@@ -772,7 +790,7 @@
{
if (creationalContext != null || (creationalContext == null && getContext(bean.getScopeType()).get(bean) != null))
{
- return (T) clientProxyProvider.getClientProxy(this, bean);
+ return clientProxyProvider.getClientProxy(this, bean);
}
else
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-04-09 16:48:39 UTC (rev 2366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-04-09 18:41:41 UTC (rev 2367)
@@ -214,7 +214,7 @@
assert childActivity.resolveObservers(new NightTime()).iterator().next().equals(observer);
}
- @Test(groups="ri-broken")
+ @Test
@SpecAssertion(section="11.6", id="k")
public void testObserverBelongingToParentFiresForChildActivity()
{
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-04-09 16:48:39 UTC (rev 2366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-04-09 18:41:41 UTC (rev 2367)
@@ -82,7 +82,7 @@
assert tarantula != tarantula2;
}
- @Test(groups = { "contexts", "disposalMethod", "ri-broken" })
+ @Test(groups = { "contexts", "disposalMethod" })
@SpecAssertion(section = "8.3", id = "d")
public void testInstanceUsedForDisposalMethodNotShared() throws Exception
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Helsinki.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Helsinki.java 2009-04-09 16:48:39 UTC (rev 2366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Helsinki.java 2009-04-09 18:41:41 UTC (rev 2367)
@@ -5,7 +5,7 @@
@Dependent
@Stateful
-class Helsinki implements HelsinkiLocal
+public class Helsinki implements HelsinkiLocal
{
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextIntegrationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextIntegrationTest.java 2009-04-09 16:48:39 UTC (rev 2366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextIntegrationTest.java 2009-04-09 18:41:41 UTC (rev 2367)
@@ -25,7 +25,7 @@
assert false;
}
- @Test(groups = { "contexts", "passivation", "integration", "broken" }, expectedExceptions = IllegalProductException.class)
+ @Test(groups = { "contexts", "passivation", "integration", "ri-broken" }, expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "8.4", id = "p")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoStatefulSessionBeanFails() throws SecurityException, NoSuchMethodException
{
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-04-09 16:48:39 UTC (rev 2366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-04-09 18:41:41 UTC (rev 2367)
@@ -84,7 +84,7 @@
* @throws ClassNotFoundException
* @throws IOException
*/
- @Test(groups = { "contexts", "passivation", "incontainer-ri-broken" })
+ @Test(groups = { "contexts", "passivation" })
@SpecAssertion(section = "8.4", id = "j")
public void testDependentEJBsAreSerializable() throws IOException, ClassNotFoundException
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-04-09 16:48:39 UTC (rev 2366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-04-09 18:41:41 UTC (rev 2367)
@@ -196,47 +196,39 @@
assert observer != null;
}
- //TODO The exception is never thrown with parameterized types
- @Test(groups = { "ri-broken", "events" }, expectedExceptions = { IllegalArgumentException.class })
+ @Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
@SpecAssertions( { @SpecAssertion(section = "7.3", id = "f") })
public void testManagerAddObserverWithEventTypeParametersFails()
{
- ArrayList<String> anEvent = new ArrayList<String>();
- Observer<ArrayList<String>> observer = new Observer<ArrayList<String>>() {
+ observerWithEventObjectContainsTypeVariables();
+ }
- public void notify(ArrayList<String> event)
+ private <E> void observerWithEventObjectContainsTypeVariables()
+ {
+ Observer<ArrayList<E>> observer = new Observer<ArrayList<E>>() {
+
+ public void notify(ArrayList<E> event)
{
}
};
- observerWithEventObjectContainsTypeVariables(anEvent, observer);
- }
-
- private <E> void observerWithEventObjectContainsTypeVariables(ArrayList<E> eventToFire, Observer<ArrayList<E>> observer)
- {
getCurrentManager().addObserver(observer, new TypeLiteral<ArrayList<E>>() {});
}
- @Test(groups = { "events", "broken" }, expectedExceptions = { IllegalArgumentException.class })
+ @Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
@SpecAssertions( { @SpecAssertion(section = "7.3", id = "g") })
public void testManagerAddObserverWithEventTypeWildcardsFails()
{
-// ArrayList<?> anEvent = new ArrayList<String>();
-// Observer<ArrayList<String>> observer = new Observer<ArrayList<String>>() {
-//
-// public void notify(ArrayList<String> event)
-// {
-// }
-//
-// };
-// observerWithEventObjectContainsTypeWildcard(anEvent, observer);
+ Observer<ArrayList<?>> observer = new Observer<ArrayList<?>>() {
+
+ public void notify(ArrayList<?> event)
+ {
+ }
+
+ };
+ getCurrentManager().addObserver(observer, new TypeLiteral<ArrayList<?>>() {});
}
-// private void observerWithEventObjectContainsTypeWildcard(ArrayList<?> eventToFire, Observer<ArrayList<?>> observer)
-// {
-// getCurrentManager().addObserver(observer, new TypeLiteral<ArrayList<?>>() {});
-// }
-
@Test(groups = { "events", "underInvestigation" }, expectedExceptions = { IllegalArgumentException.class })
@SpecAssertions( { @SpecAssertion(section = "7.3", id = "h") })
public void testManagerRemoveObserverWithEventTypeParametersFails()
@@ -324,15 +316,6 @@
assert resolvedObservers.size() == 2;
}
-// @Test(groups = { "events", "broken" })
-// @SpecAssertions( { @SpecAssertion(section = "7.7.1", id = "b") } )
-// public void testEqualsUsedToCompareBindingTypes()
-// {
-// RoleBinding roleBinding = new RoleBinding("Admin");
-// getCurrentManager().resolveObservers(new MultiBindingType(), roleBinding, new TameAnnotationLiteral());
-// assert false;
-// }
-
@Test(groups = { "stub", "events", "webbeansxml" })
@SpecAssertions( {
@SpecAssertion(section = "7.5.3", id = "a"),
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/ImplicitEventBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/ImplicitEventBeanTest.java 2009-04-09 16:48:39 UTC (rev 2366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/ImplicitEventBeanTest.java 2009-04-09 18:41:41 UTC (rev 2367)
@@ -38,7 +38,7 @@
@BeansXml("beans.xml")
public class ImplicitEventBeanTest extends AbstractJSR299Test
{
- @Test(groups = { "events", "broken" })
+ @Test(groups = { "events", "ri-broken" })
@SpecAssertions( {
@SpecAssertion(section = "7.6", id = "b"),
@SpecAssertion(section = "7.6", id = "c"),
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java 2009-04-09 16:48:39 UTC (rev 2366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java 2009-04-09 18:41:41 UTC (rev 2367)
@@ -51,6 +51,7 @@
};
private PomeranianInterface dog = null;
+ @Override
public void beforeMethod()
{
super.beforeMethod();
@@ -173,14 +174,6 @@
assert false;
}
- @Test(groups = { "broken", "events", "integration" })
- @SpecAssertion(section = "7.5.8", id = "p")
- public void testTransactionalObserverThrownExceptionIsCaughtAndLogged()
- {
- // TODO There really is no way to verify that something is logged
- assert false;
- }
-
/**
* Otherwise, the observer method is called in the same transaction context,
* client security context and lifecycle contexts as the invocation of
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-04-09 16:48:39 UTC (rev 2366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-04-09 18:41:41 UTC (rev 2367)
@@ -96,7 +96,7 @@
* parameterized type, the set of bean types contains the bean class and all
* superclasses.
*/
- @Test(groups = { "enterpriseBeans", "broken" })
+ @Test(groups = { "enterpriseBeans", "ri-broken" })
@SpecAssertion(section = "3.3.3", id = "b")
public void testEnterpriseBeanWithLocalViewAndNotParameterizedTypeHasClassAndSuperclassesAsBeanTypes()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java 2009-04-09 16:48:39 UTC (rev 2366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java 2009-04-09 18:41:41 UTC (rev 2367)
@@ -40,6 +40,7 @@
@Resource(source="ejb-jar.xml", destination="META-INF/ejb-jar.xml")
public class EnterpriseBeanViaXmlTest extends AbstractJSR299Test
{
+
//TODO Once EJBs can be deployed in a WAR (3.1), this test should work
@Test(groups = { "enterpriseBeans", "broken" })
@SpecAssertions( { @SpecAssertion(section = "3.2.1", id = "n") })
@@ -50,4 +51,5 @@
assert elephantBean.getTypes().contains(ElephantLocal.class);
assert !elephantBean.getTypes().contains(Elephant.class);
}
+
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Order.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Order.java 2009-04-09 16:48:39 UTC (rev 2366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Order.java 2009-04-09 18:41:41 UTC (rev 2367)
@@ -1,11 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.simple.definition;
-
-import javax.inject.Production;
-
-@Production
-class Order
-{
-
- public static boolean constructed = true;
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java 2009-04-09 16:48:39 UTC (rev 2366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java 2009-04-09 18:41:41 UTC (rev 2367)
@@ -28,16 +28,6 @@
{
assert getCurrentManager().resolveByType(Cow_NotBean.class).size() == 0;
}
-
- @Test(groups = "ri-broken")
- @SpecAssertions({
- @SpecAssertion(section = "3.2", id = "cb"),
- @SpecAssertion(section = "3.2.1", id = "da")
- })
- public void testAbstractDecoratorClassDeclaredInJavaIsDiscovered()
- {
- assert getCurrentManager().resolveByType(AnimalDecorator.class).size() > 0;
- }
@Test(groups = "innerClass")
@SpecAssertions({
@@ -196,15 +186,6 @@
}
- @Test(groups="broken")
- @SpecAssertion(section = "3.2.6.1", id = "b")
- public void testImplicitConstructorUsed()
- {
- Order.constructed = false;
- getCurrentManager().getInstanceByType(Order.class);
- assert Order.constructed;
- }
-
@Test
@SpecAssertions({
@SpecAssertion(section = "3.2.5", id = "a"),
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/ArrayTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/ArrayTest.java 2009-04-09 16:48:39 UTC (rev 2366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/array/ArrayTest.java 2009-04-09 18:41:41 UTC (rev 2367)
@@ -3,15 +3,16 @@
import javax.inject.UnproxyableDependencyException;
import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
@Artifact
@ExpectedDeploymentException(UnproxyableDependencyException.class)
-public class ArrayTest
+public class ArrayTest extends AbstractJSR299Test
{
- @Test(groups = "broken")
+ @Test(groups = "ri-broken")
@SpecAssertion(section = "5.4.1", id = "d")
public void testInjectionPointWithArrayType()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/PrivateConstructorTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/PrivateConstructorTest.java 2009-04-09 16:48:39 UTC (rev 2366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/privateconstructor/PrivateConstructorTest.java 2009-04-09 18:41:41 UTC (rev 2367)
@@ -13,7 +13,7 @@
@ExpectedDeploymentException(UnproxyableDependencyException.class)
public class PrivateConstructorTest extends AbstractJSR299Test
{
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertion(section = "5.4.1", id = "a")
public void testClassWithPrivateConstructor()
{
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-04-09 16:48:39 UTC (rev 2366)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-04-09 18:41:41 UTC (rev 2367)
@@ -954,6 +954,7 @@
<assertion id="b">
<text>If a simple bean defined using annotations does not explicitly declare a constructor using |@Initializer|, the constructor that accepts no parameters is the bean constructor</text>
+ <note>Can't check implicit constructor</note>
</assertion>
<assertion id="c">
@@ -4276,8 +4277,9 @@
<text>Placeholder for path 4 etc</text>
</assertion>
- <assertion id="p">
+ <assertion id="p" testable="false">
<text>If the observer is a transactional or asynchronous observer method, any exception is caught and logged by the container</text>
+ <note>Cannot be tested as they are not under our control</note>
</assertion>
<assertion id="q">
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2366 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml: annotationtypes/notvalidxml/bindingtype/notannotationtype and 4 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-09 12:48:39 -0400 (Thu, 09 Apr 2009)
New Revision: 2366
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notannotationtype/NotAnnotationTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notjavatype/NotJavaTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/NotAnnotationType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java
Log:
Fix tests to run incontainer
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java 2009-04-09 15:52:54 UTC (rev 2365)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java 2009-04-09 16:48:39 UTC (rev 2366)
@@ -3,8 +3,12 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.foo.AnotherTestInterceptorBindingType;
import org.jboss.jsr299.tck.tests.xml.annotationtypes.foo.TestBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.foo.TestDeploymentType;
import org.jboss.jsr299.tck.tests.xml.annotationtypes.foo.TestInterceptorBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.foo.TestNamed;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.foo.TestScopeType;
import org.jboss.jsr299.tck.tests.xml.annotationtypes.foo.TestStereotype;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Classes;
@@ -12,7 +16,14 @@
import org.testng.annotations.Test;
@Artifact
-(a)Classes({TestBindingType.class, TestInterceptorBindingType.class, TestStereotype.class})
+@Classes({
+ TestBindingType.class,
+ TestInterceptorBindingType.class,
+ TestStereotype.class,
+ AnotherTestInterceptorBindingType.class,
+ TestScopeType.class,
+ TestDeploymentType.class,
+ TestNamed.class})
@BeansXml("beans.xml")
public class AnnotationTypesTest extends AbstractJSR299Test
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notannotationtype/NotAnnotationTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notannotationtype/NotAnnotationTypeTest.java 2009-04-09 15:52:54 UTC (rev 2365)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notannotationtype/NotAnnotationTypeTest.java 2009-04-09 16:48:39 UTC (rev 2366)
@@ -21,7 +21,7 @@
@ExpectedDeploymentException(DefinitionException.class)
public class NotAnnotationTypeTest extends AbstractJSR299Test
{
- @Test
+ @Test(groups="ri-broken")
@SpecAssertions({
@SpecAssertion(section="9.4", id="d")
})
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notjavatype/NotJavaTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notjavatype/NotJavaTypeTest.java 2009-04-09 15:52:54 UTC (rev 2365)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notjavatype/NotJavaTypeTest.java 2009-04-09 16:48:39 UTC (rev 2366)
@@ -20,7 +20,7 @@
@ExpectedDeploymentException(DefinitionException.class)
public class NotJavaTypeTest extends AbstractJSR299Test
{
- @Test
+ @Test(groups="ri-broken")
@SpecAssertions({
@SpecAssertion(section="9.4", id="d")
})
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/NotAnnotationType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/NotAnnotationType.java 2009-04-09 15:52:54 UTC (rev 2365)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/NotAnnotationType.java 2009-04-09 16:48:39 UTC (rev 2366)
@@ -1,5 +1,6 @@
package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo;
-public class NotAnnotationType {
+public class NotAnnotationType
+{
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java 2009-04-09 15:52:54 UTC (rev 2365)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java 2009-04-09 16:48:39 UTC (rev 2366)
@@ -3,6 +3,7 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.metadata.foo.AnotherDeploymentType;
import org.jboss.jsr299.tck.tests.xml.metadata.foo.Order;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Classes;
@@ -16,7 +17,10 @@
@Resource(source="namespace", destination="WEB-INF/classes/org/jboss/jsr299/tck/tests/xml/metadata/namespace"),
@Resource(source="schema.xsd", destination="WEB-INF/classes/org/jboss/jsr299/tck/tests/xml/metadata/schema.xsd")
})
-(a)Classes({Order.class})
+@Classes({
+ Order.class,
+ AnotherDeploymentType.class
+})
@BeansXml("beans.xml")
public class XmlBasedMetadataTest extends AbstractJSR299Test
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java 2009-04-09 15:52:54 UTC (rev 2365)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java 2009-04-09 16:48:39 UTC (rev 2366)
@@ -20,7 +20,7 @@
@Resources({
@Resource(source="namespace", destination="WEB-INF/classes/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/namespace")
})
-(a)Classes({AnotherDeploymentType.class, TestDeploymentType.class})
+(a)Classes({AnotherDeploymentType.class, TestDeploymentType.class, org.jboss.jsr299.tck.tests.xml.namespace.aggregation.foo.copy.AnotherDeploymentType.class})
@BeansXml("beans.xml")
@ExpectedDeploymentException(DefinitionException.class)
public class MultipleTypesInAggregatedNamespacesTest extends AbstractJSR299Test
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2365 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/bean and 9 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-09 11:52:54 -0400 (Thu, 09 Apr 2009)
New Revision: 2365
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ApplicationContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/RequestContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/SessionContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/RunInDependentContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/AsynchronousTransactionalEventNotification.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ContextsImpl.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
Log:
encapsulate static access in contexts
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -1130,9 +1130,9 @@
log.trace("Ending application");
shutdownExecutors();
CurrentManager.cleanup();
- ApplicationContext.INSTANCE.destroy();
- ApplicationContext.INSTANCE.setActive(false);
- ApplicationContext.INSTANCE.setBeanStore(null);
+ ApplicationContext.instance().destroy();
+ ApplicationContext.instance().setActive(false);
+ ApplicationContext.instance().setBeanStore(null);
getServices().get(NamingContext.class).unbind(ManagerImpl.JNDI_KEY);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -331,9 +331,9 @@
{
if (getDeclaringBean().isDependent())
{
- DependentContext.INSTANCE.startCollectingDependents(dependentStorageRequest);
+ DependentContext.instance().startCollectingDependents(dependentStorageRequest);
}
- DependentContext.INSTANCE.setActive(true);
+ DependentContext.instance().setActive(true);
T instance = produceInstance(creationalContext);
checkReturnValue(instance);
return instance;
@@ -342,10 +342,10 @@
{
if (getDeclaringBean().isDependent())
{
- DependentContext.INSTANCE.stopCollectingDependents(dependentStorageRequest);
+ DependentContext.instance().stopCollectingDependents(dependentStorageRequest);
dependentInstancesStore.destroyDependentInstances(dependentStorageRequest.getKey());
}
- DependentContext.INSTANCE.setActive(false);
+ DependentContext.instance().setActive(false);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -228,7 +228,7 @@
{
try
{
- DependentContext.INSTANCE.setActive(true);
+ DependentContext.instance().setActive(true);
T instance = proxyClass.newInstance();
creationalContext.push(instance);
((ProxyObject) instance).setHandler(new EnterpriseBeanProxyMethodHandler(this));
@@ -250,7 +250,7 @@
}
finally
{
- DependentContext.INSTANCE.setActive(false);
+ DependentContext.instance().setActive(false);
}
}
@@ -321,15 +321,15 @@
public void push(T incompleteInstance) {};
};
- DependentContext.INSTANCE.startCollectingDependents(dependentStorageRequest);
- DependentContext.INSTANCE.setActive(true);
+ DependentContext.instance().startCollectingDependents(dependentStorageRequest);
+ DependentContext.instance().setActive(true);
injectBoundFields(instance, creationalContext);
callInitializers(instance, creationalContext);
}
finally
{
- DependentContext.INSTANCE.stopCollectingDependents(dependentStorageRequest);
- DependentContext.INSTANCE.setActive(false);
+ DependentContext.instance().stopCollectingDependents(dependentStorageRequest);
+ DependentContext.instance().setActive(false);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -113,7 +113,7 @@
{
try
{
- DependentContext.INSTANCE.setActive(true);
+ DependentContext.instance().setActive(true);
T instance = null;
DependentStorageRequest dependentStorageRequest = null;
try
@@ -121,7 +121,7 @@
instance = constructor.newInstance(manager, creationalContext);
creationalContext.push(instance);
dependentStorageRequest = DependentStorageRequest.of(dependentInstancesStore, instance);
- DependentContext.INSTANCE.startCollectingDependents(dependentStorageRequest);
+ DependentContext.instance().startCollectingDependents(dependentStorageRequest);
injectEjbAndCommonFields(instance);
injectBoundFields(instance, creationalContext);
callInitializers(instance, creationalContext);
@@ -129,13 +129,13 @@
}
finally
{
- DependentContext.INSTANCE.stopCollectingDependents(dependentStorageRequest);
+ DependentContext.instance().stopCollectingDependents(dependentStorageRequest);
}
return instance;
}
finally
{
- DependentContext.INSTANCE.setActive(false);
+ DependentContext.instance().setActive(false);
}
}
@@ -148,7 +148,7 @@
{
try
{
- DependentContext.INSTANCE.setActive(true);
+ DependentContext.instance().setActive(true);
callPreDestroy(instance);
dependentInstancesStore.destroyDependentInstances(instance);
}
@@ -158,7 +158,7 @@
}
finally
{
- DependentContext.INSTANCE.setActive(false);
+ DependentContext.instance().setActive(false);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -28,7 +28,7 @@
{
try
{
- DependentContext.INSTANCE.setActive(true);
+ DependentContext.instance().setActive(true);
InjectionPoint injectionPoint = this.getManager().getInjectionPoint();
if (injectionPoint != null)
{
@@ -51,7 +51,7 @@
}
finally
{
- DependentContext.INSTANCE.setActive(false);
+ DependentContext.instance().setActive(false);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -248,21 +248,21 @@
protected void beginApplication(BeanStore applicationBeanStore)
{
log.trace("Starting application");
- ApplicationContext.INSTANCE.setBeanStore(applicationBeanStore);
- ApplicationContext.INSTANCE.setActive(true);
+ ApplicationContext.instance().setBeanStore(applicationBeanStore);
+ ApplicationContext.instance().setActive(true);
}
protected void beginDeploy(BeanStore requestBeanStore)
{
- RequestContext.INSTANCE.setBeanStore(requestBeanStore);
- RequestContext.INSTANCE.setActive(true);
+ RequestContext.instance().setBeanStore(requestBeanStore);
+ RequestContext.instance().setActive(true);
}
protected void endDeploy(BeanStore requestBeanStore)
{
- RequestContext.INSTANCE.setBeanStore(null);
- RequestContext.INSTANCE.setActive(false);
+ RequestContext.instance().setBeanStore(null);
+ RequestContext.instance().setActive(false);
}
public void shutdown()
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ApplicationContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ApplicationContext.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ApplicationContext.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -33,18 +33,23 @@
public class ApplicationContext extends AbstractMapContext
{
- public static ApplicationContext INSTANCE;
-
+ private static ApplicationContext INSTANCE;
+
+ public static ApplicationContext instance()
+ {
+ return INSTANCE;
+ }
+
public static ApplicationContext create()
{
INSTANCE = new ApplicationContext();
- return INSTANCE;
+ return instance();
}
// The beans
private BeanStore beanStore;
// Is the context active?
- private AtomicBoolean active;
+ private final AtomicBoolean active;
/**
* Constructor
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -34,36 +34,36 @@
protected void restoreSession(String id, BeanStore sessionBeanStore)
{
log.trace("Restoring session " + id);
- SessionContext.INSTANCE.setBeanStore(sessionBeanStore);
- SessionContext.INSTANCE.setActive(true);
+ SessionContext.instance().setBeanStore(sessionBeanStore);
+ SessionContext.instance().setActive(true);
}
protected void endSession(String id, BeanStore sessionBeanStore)
{
log.trace("Ending session " + id);
- SessionContext.INSTANCE.setActive(true);
+ SessionContext.instance().setActive(true);
ConversationManager conversationManager = CurrentManager.rootManager().getInstanceByType(ConversationManager.class);
conversationManager.destroyAllConversations();
- SessionContext.INSTANCE.destroy();
- SessionContext.INSTANCE.setBeanStore(null);
- SessionContext.INSTANCE.setActive(false);
+ SessionContext.instance().destroy();
+ SessionContext.instance().setBeanStore(null);
+ SessionContext.instance().setActive(false);
}
public void beginRequest(String id, BeanStore requestBeanStore)
{
log.trace("Starting request " + id);
- RequestContext.INSTANCE.setBeanStore(requestBeanStore);
- RequestContext.INSTANCE.setActive(true);
- DependentContext.INSTANCE.setActive(true);
+ RequestContext.instance().setBeanStore(requestBeanStore);
+ RequestContext.instance().setActive(true);
+ DependentContext.instance().setActive(true);
}
public void endRequest(String id, BeanStore requestBeanStore)
{
log.trace("Ending request " + id);
- RequestContext.INSTANCE.setBeanStore(requestBeanStore);
- DependentContext.INSTANCE.setActive(false);
- RequestContext.INSTANCE.destroy();
- RequestContext.INSTANCE.setActive(false);
+ RequestContext.instance().setBeanStore(requestBeanStore);
+ DependentContext.instance().setActive(false);
+ RequestContext.instance().destroy();
+ RequestContext.instance().setActive(false);
}
protected void restoreConversation(String id, BeanStore conversationBeanStore)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -31,17 +31,22 @@
*/
public class DependentContext extends AbstractContext
{
- public static DependentContext INSTANCE;
+ private static DependentContext INSTANCE;
+ public static DependentContext instance()
+ {
+ return INSTANCE;
+ }
+
public static DependentContext create()
{
INSTANCE = new DependentContext();
- return INSTANCE;
+ return instance();
}
- private ThreadLocal<AtomicInteger> reentrantActiveCount;
+ private final ThreadLocal<AtomicInteger> reentrantActiveCount;
// A (possible null) request to store dependents created
- private ThreadLocal<DependentStorageRequest> dependentStorageRequest;
+ private final ThreadLocal<DependentStorageRequest> dependentStorageRequest;
/**
* Constructor
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/RequestContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/RequestContext.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/RequestContext.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -27,12 +27,17 @@
public class RequestContext extends AbstractThreadLocalMapContext
{
- public static RequestContext INSTANCE;
-
+ private static RequestContext INSTANCE;
+
+ public static RequestContext instance()
+ {
+ return INSTANCE;
+ }
+
public static RequestContext create()
{
INSTANCE = new RequestContext();
- return INSTANCE;
+ return instance();
}
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/SessionContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/SessionContext.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/SessionContext.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -31,12 +31,17 @@
{
private static LogProvider log = Logging.getLogProvider(SessionContext.class);
- public static SessionContext INSTANCE;
-
+ private static SessionContext INSTANCE;
+
+ public static SessionContext instance()
+ {
+ return INSTANCE;
+ }
+
public static SessionContext create()
{
INSTANCE = new SessionContext();
- return INSTANCE;
+ return instance();
}
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/RunInDependentContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/RunInDependentContext.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/RunInDependentContext.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -19,16 +19,16 @@
private void setup()
{
- DependentContext.INSTANCE.setActive(true);
- DependentContext.INSTANCE.startCollectingDependents(dependentStorageRequest);
+ DependentContext.instance().setActive(true);
+ DependentContext.instance().startCollectingDependents(dependentStorageRequest);
}
private void cleanup()
{
- DependentContext.INSTANCE.stopCollectingDependents(dependentStorageRequest);
+ DependentContext.instance().stopCollectingDependents(dependentStorageRequest);
// TODO kinky
dependentStorageRequest.getDependentInstancesStore().destroyDependentInstances(dependentStorageRequest.getKey());
- DependentContext.INSTANCE.setActive(false);
+ DependentContext.instance().setActive(false);
}
protected abstract void execute() throws Exception;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/AsynchronousTransactionalEventNotification.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/AsynchronousTransactionalEventNotification.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/AsynchronousTransactionalEventNotification.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -38,7 +38,7 @@
public void run()
{
// Let the event be deferred again as just an asynchronous event
- DependentContext.INSTANCE.setActive(true);
+ DependentContext.instance().setActive(true);
try
{
log.trace("Sending event [" + event + "] asynchronously to transaction observer " + observer);
@@ -50,7 +50,7 @@
}
finally
{
- DependentContext.INSTANCE.setActive(false);
+ DependentContext.instance().setActive(false);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -108,7 +108,7 @@
{
try
{
- DependentContext.INSTANCE.setActive(true);
+ DependentContext.instance().setActive(true);
for (Observer<T> observer : observers)
{
observer.notify(event);
@@ -116,7 +116,7 @@
}
finally
{
- DependentContext.INSTANCE.setActive(false);
+ DependentContext.instance().setActive(false);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -176,7 +176,7 @@
{
if (Dependent.class.equals(observerBean.getScopeType()) && observerBean instanceof RIBean)
{
- DependentContext.INSTANCE.startCollectingDependents(dependentStorageRequest);
+ DependentContext.instance().startCollectingDependents(dependentStorageRequest);
}
// Get the most specialized instance of the component
instance = getInstance(observerBean);
@@ -191,7 +191,7 @@
{
if (Dependent.class.equals(observerBean.getScopeType()))
{
- DependentContext.INSTANCE.stopCollectingDependents(dependentStorageRequest);
+ DependentContext.instance().stopCollectingDependents(dependentStorageRequest);
dependentStorageRequest.getDependentInstancesStore().destroyDependentInstances(dependentStorageRequest.getKey());
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -95,10 +95,10 @@
public void inject(final Object instance)
{
- if (DependentContext.INSTANCE != null && ApplicationContext.INSTANCE != null)
+ if (DependentContext.instance() != null && ApplicationContext.instance() != null)
{
- DependentContext.INSTANCE.setActive(true);
- ApplicationContext.INSTANCE.setActive(true);
+ DependentContext.instance().setActive(true);
+ ApplicationContext.instance().setActive(true);
Set<FieldInjectionPoint<?>> injectionPoints = instances.putIfAbsent(instance.getClass(), new Callable<Set<FieldInjectionPoint<?>>>()
{
@@ -113,8 +113,8 @@
{
injectionPoint.inject(instance, manager, null);
}
- DependentContext.INSTANCE.setActive(false);
- ApplicationContext.INSTANCE.setActive(false);
+ DependentContext.instance().setActive(false);
+ ApplicationContext.instance().setActive(false);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -124,7 +124,7 @@
}
super.endRequest(request.getRequestURI(), beanStore);
request.removeAttribute(REQUEST_ATTRIBUTE_NAME);
- SessionContext.INSTANCE.setBeanStore(null);
+ SessionContext.instance().setBeanStore(null);
}
}
Modified: ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ContextsImpl.java
===================================================================
--- ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ContextsImpl.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ContextsImpl.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -11,7 +11,7 @@
public RequestContext getRequestContext()
{
- return RequestContext.INSTANCE;
+ return RequestContext.instance();
}
public void setActive(AbstractContext context)
@@ -26,7 +26,7 @@
public AbstractContext getDependentContext()
{
- return DependentContext.INSTANCE;
+ return DependentContext.instance();
}
public void destroyContext(AbstractContext context)
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-04-09 15:45:47 UTC (rev 2364)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-04-09 15:52:54 UTC (rev 2365)
@@ -31,12 +31,12 @@
protected void setup()
{
- DependentContext.INSTANCE.setActive(true);
+ DependentContext.instance().setActive(true);
}
protected void cleanup()
{
- DependentContext.INSTANCE.setActive(false);
+ DependentContext.instance().setActive(false);
}
public final void run() throws Exception
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2364 - ri/trunk/impl/src/main/java/org/jboss/webbeans/bean and 15 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-09 11:45:47 -0400 (Thu, 09 Apr 2009)
New Revision: 2364
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/
ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/DefaultEntityDiscovery.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/PersistenceApiAbstraction.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardinEntityDiscovery.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/
ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/
ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/EntityDiscovery.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/JpaServices.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEntityDiscovery.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedPackageTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Vet.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/mock-orm.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/package-mock-orm.xml
Removed:
ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/JpaServices.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardingJpaServices.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockJpaServices.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java
Log:
Support for not making entities beans
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -84,7 +84,8 @@
{
throw new DuplicateBindingTypeException(newAnnotation + " is already present in the bindings list for " + this);
}
- }
+ result.add(newAnnotation)
+; }
return result.toArray(EMPTY_BINDINGS);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -43,10 +43,11 @@
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.AnnotatedParameter;
-import org.jboss.webbeans.jpa.spi.JpaServices;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.metadata.MetaDataCache;
+import org.jboss.webbeans.persistence.PersistenceApiAbstraction;
+import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.spi.ResourceServices;
import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
@@ -222,8 +223,8 @@
protected void initPersistenceUnitInjectionPoints()
{
this.persistenceUnitInjectionPoints = new HashSet<AnnotatedInjectionPoint<?, ?>>();
- Class<? extends Annotation> persistenceContextAnnotationType = manager.getServices().get(EJBApiAbstraction.class).PERSISTENCE_CONTEXT_ANNOTATION_CLASS;
- Object extendedPersistenceContextEnum = manager.getServices().get(EJBApiAbstraction.class).EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE;
+ Class<? extends Annotation> persistenceContextAnnotationType = manager.getServices().get(PersistenceApiAbstraction.class).PERSISTENCE_CONTEXT_ANNOTATION_CLASS;
+ Object extendedPersistenceContextEnum = manager.getServices().get(PersistenceApiAbstraction.class).EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE;
for (AnnotatedField<?> field : annotatedItem.getAnnotatedFields(persistenceContextAnnotationType))
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -33,13 +33,11 @@
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.WrappedAnnotatedField;
import org.jboss.webbeans.introspector.WrappedAnnotatedMethod;
-import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
-import org.jboss.webbeans.jpa.spi.JpaServices;
import org.jboss.webbeans.jsf.JSFApiAbstraction;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.persistence.spi.EntityDiscovery;
import org.jboss.webbeans.resources.ClassTransformer;
-import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.servlet.ServletApiAbstraction;
import org.jboss.webbeans.util.Reflections;
@@ -294,10 +292,26 @@
!servletApiAbstraction.SERVLET_REQUEST_LISTENER_CLASS.isAssignableFrom(rawType) &&
!ejbApiAbstraction.ENTERPRISE_BEAN_CLASS.isAssignableFrom(rawType) &&
!jsfApiAbstraction.UICOMPONENT_CLASS.isAssignableFrom(rawType) &&
- hasSimpleWebBeanConstructor(clazz)
- && (manager.getServices().contains(JpaServices.class) ? !manager.getServices().get(JpaServices.class).discoverEntities().contains(clazz.getRawType()) : true);
+ hasSimpleWebBeanConstructor(clazz) &&
+ !isEntity(clazz);
}
+ private boolean isEntity(AnnotatedClass<?> clazz)
+ {
+ if (manager.getServices().contains(EntityDiscovery.class))
+ {
+ EntityDiscovery entityDiscovery = manager.getServices().get(EntityDiscovery.class);
+ return
+ entityDiscovery.discoverEntitiesFromAnnotations().contains(clazz.getRawType()) ||
+ entityDiscovery.discoverEntitiesFromPersistenceUnits().contains(clazz.getRawType()) ||
+ entityDiscovery.discoverEntitiesFromXml().contains(clazz.getRawType());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
private static boolean hasSimpleWebBeanConstructor(AnnotatedClass<?> type)
{
return type.getNoArgsConstructor() != null || type.getAnnotatedConstructors(Initializer.class).size() > 0;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -52,13 +52,16 @@
import org.jboss.webbeans.ejb.EjbDescriptorCache;
import org.jboss.webbeans.ejb.spi.EjbServices;
import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.jpa.spi.JpaServices;
import org.jboss.webbeans.jsf.JSFApiAbstraction;
import org.jboss.webbeans.literal.DeployedLiteral;
import org.jboss.webbeans.literal.InitializedLiteral;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.metadata.MetaDataCache;
+import org.jboss.webbeans.persistence.DefaultEntityDiscovery;
+import org.jboss.webbeans.persistence.PersistenceApiAbstraction;
+import org.jboss.webbeans.persistence.spi.EntityDiscovery;
+import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.ClassTransformer;
import org.jboss.webbeans.resources.DefaultNamingContext;
import org.jboss.webbeans.resources.DefaultResourceLoader;
@@ -91,6 +94,7 @@
// initialize default services
getServices().add(ResourceLoader.class, new DefaultResourceLoader());
getServices().add(NamingContext.class, new DefaultNamingContext());
+ getServices().add(EntityDiscovery.class, new DefaultEntityDiscovery(getServices()));
}
public void initialize()
@@ -124,6 +128,7 @@
ResourceLoader resourceLoader = getServices().get(ResourceLoader.class);
getServices().add(EJBApiAbstraction.class, new EJBApiAbstraction(resourceLoader));
getServices().add(JSFApiAbstraction.class, new JSFApiAbstraction(resourceLoader));
+ getServices().add(PersistenceApiAbstraction.class, new PersistenceApiAbstraction(resourceLoader));
getServices().add(ServletApiAbstraction.class, new ServletApiAbstraction(resourceLoader));
// Temporary workaround to provide context for building annotated class
// TODO expose AnnotatedClass on SPI and allow container to provide impl of this via ResourceLoader
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -35,22 +35,13 @@
{
super(resourceLoader);
ENTERPRISE_BEAN_CLASS = classForName("javax.ejb.EnterpriseBean");
- PERSISTENCE_CONTEXT_ANNOTATION_CLASS = annotationTypeForName("javax.persistence.PersistenceContext");
EJB_ANNOTATION_CLASS = annotationTypeForName("javax.ejb.EJB");
RESOURCE_ANNOTATION_CLASS = annotationTypeForName("javax.annotation.Resource");
- PERSISTENCE_CONTEXT_TYPE_CLASS = classForName("javax.persistence.PersistenceContextType");
- if (PERSISTENCE_CONTEXT_TYPE_CLASS.getClass().equals( Dummy.class)) {
- EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE = enumValue(PERSISTENCE_CONTEXT_TYPE_CLASS, "EXTENDED");
- } else {
- EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE = DummyEnum.DUMMY_VALUE;
- }
+
}
- public final Class<?> PERSISTENCE_CONTEXT_TYPE_CLASS;
public final Class<?> ENTERPRISE_BEAN_CLASS;
- public final Class<? extends Annotation> PERSISTENCE_CONTEXT_ANNOTATION_CLASS;
public final Class<? extends Annotation> EJB_ANNOTATION_CLASS;
public final Class<? extends Annotation> RESOURCE_ANNOTATION_CLASS;
- public final Object EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -18,7 +18,7 @@
import org.jboss.webbeans.bootstrap.api.Environments;
import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.jpa.spi.JpaServices;
+import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.spi.ResourceServices;
import org.jboss.webbeans.transaction.spi.TransactionServices;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -11,7 +11,7 @@
import javax.persistence.Entity;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-import org.jboss.webbeans.jpa.spi.JpaServices;
+import org.jboss.webbeans.persistence.spi.JpaServices;
public class MockJpaServices implements JpaServices
{
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/DefaultEntityDiscovery.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/DefaultEntityDiscovery.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/DefaultEntityDiscovery.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,164 @@
+/*
+ * 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.webbeans.persistence;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.log.Log;
+import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.persistence.spi.EntityDiscovery;
+import org.jboss.webbeans.resources.spi.ResourceLoader;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * @author Pete Muir
+ *
+ */
+public class DefaultEntityDiscovery implements EntityDiscovery
+{
+
+ private static final Log log = Logging.getLog(DefaultEntityDiscovery.class);
+
+ private final ServiceRegistry serviceRegistry;
+ private Set<Class<?>> entitiesFromAnnotations;
+ private Set<Class<?>> entitiesFromOrmXml;
+ private Set<Class<?>> entitiesFromPersistenceXml;
+
+ public DefaultEntityDiscovery(ServiceRegistry serviceRegistry)
+ {
+ this.serviceRegistry = serviceRegistry;
+
+ }
+
+ public void initialize()
+ {
+ this.entitiesFromAnnotations = new HashSet<Class<?>>();
+ this.entitiesFromOrmXml = new HashSet<Class<?>>();
+ this.entitiesFromPersistenceXml = new HashSet<Class<?>>();
+ PersistenceApiAbstraction jpaApiAbstraction = serviceRegistry.get(PersistenceApiAbstraction.class);
+ // TODO process persistence.xml
+ for (Class<?> clazz : serviceRegistry.get(WebBeanDiscovery.class).discoverWebBeanClasses())
+ {
+ if (clazz.isAnnotationPresent(jpaApiAbstraction.ENTITY_CLASS) || clazz.isAnnotationPresent(jpaApiAbstraction.EMBEDDABLE_CLASS) || clazz.isAnnotationPresent(jpaApiAbstraction.MAPPED_SUPERCLASS_CLASS))
+ {
+ entitiesFromAnnotations.add(clazz);
+ }
+ }
+ for (URL url : serviceRegistry.get(ResourceLoader.class).getResources("META-INF/orm.xml"))
+ {
+ try
+ {
+ parseOrmXml(getRootElementSafely(url));
+ }
+ catch (Exception e)
+ {
+ log.warn("Error parsing {0}, entities defined there will be detected as simple beans", e, url.toString());
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void parseOrmXml(Element root)
+ {
+ String packagePrefix = "";
+
+ Element pkg = root.element("package");
+ if (pkg!=null)
+ {
+ packagePrefix = pkg.getTextTrim() + ".";
+ }
+ ResourceLoader resourceLoader = serviceRegistry.get(ResourceLoader.class);
+ for (Element entity: (List<Element>) root.elements("entity"))
+ {
+ String className = packagePrefix + entity.attribute("class").getText();
+ entitiesFromOrmXml.add(resourceLoader.classForName(className));
+ }
+ for (Element entity: (List<Element>) root.elements("mapped-superclass"))
+ {
+ String className = packagePrefix + entity.attribute("class").getText();
+ entitiesFromOrmXml.add(resourceLoader.classForName(className));
+ }
+ }
+
+ public Collection<Class<?>> discoverEntitiesFromAnnotations()
+ {
+ if (entitiesFromAnnotations == null)
+ {
+ initialize();
+ }
+ return Collections.unmodifiableCollection(entitiesFromAnnotations);
+ }
+
+ public Collection<Class<?>> discoverEntitiesFromPersistenceUnits()
+ {
+ if (entitiesFromPersistenceXml == null)
+ {
+ initialize();
+ }
+ return Collections.unmodifiableCollection(entitiesFromPersistenceXml);
+ }
+
+ public Collection<Class<?>> discoverEntitiesFromXml()
+ {
+ if (entitiesFromOrmXml == null)
+ {
+ initialize();
+ }
+ return Collections.unmodifiableCollection(entitiesFromOrmXml);
+ }
+
+ /**
+ * Parses an XML document safely, as to not resolve any external DTDs
+ * @throws IOException
+ */
+ public static Element getRootElementSafely(URL url) throws DocumentException, IOException
+ {
+ InputStream stream = url.openStream();
+ SAXReader saxReader = new SAXReader();
+ saxReader.setEntityResolver(new NullEntityResolver());
+ saxReader.setMergeAdjacentText(true);
+ return saxReader.read(stream).getRootElement();
+ }
+
+ private static class NullEntityResolver implements EntityResolver
+ {
+ private static final byte[] empty = new byte[0];
+
+ public InputSource resolveEntity(String systemId, String publicId) throws SAXException, IOException
+ {
+ return new InputSource(new ByteArrayInputStream(empty));
+ }
+
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/DefaultEntityDiscovery.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/PersistenceApiAbstraction.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/PersistenceApiAbstraction.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/PersistenceApiAbstraction.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,42 @@
+package org.jboss.webbeans.persistence;
+
+import java.lang.annotation.Annotation;
+
+import org.jboss.webbeans.bootstrap.api.Service;
+import org.jboss.webbeans.resources.spi.ResourceLoader;
+import org.jboss.webbeans.util.ApiAbstraction;
+import org.jboss.webbeans.util.ApiAbstraction.Dummy;
+import org.jboss.webbeans.util.ApiAbstraction.DummyEnum;
+
+public class PersistenceApiAbstraction extends ApiAbstraction implements Service
+{
+
+ public final Class<? extends Annotation> PERSISTENCE_CONTEXT_ANNOTATION_CLASS;
+ public final Object EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE;
+ public final Class<?> PERSISTENCE_CONTEXT_TYPE_CLASS;
+ public final Class<? extends Annotation> ENTITY_CLASS;
+ public final Class<? extends Annotation> MAPPED_SUPERCLASS_CLASS;
+ public final Class<? extends Annotation> EMBEDDABLE_CLASS;
+
+ /**
+ * @param resourceLoader
+ */
+ public PersistenceApiAbstraction(ResourceLoader resourceLoader)
+ {
+ super(resourceLoader);
+ PERSISTENCE_CONTEXT_ANNOTATION_CLASS = annotationTypeForName("javax.persistence.PersistenceContext");
+ PERSISTENCE_CONTEXT_TYPE_CLASS = classForName("javax.persistence.PersistenceContextType");
+ if (PERSISTENCE_CONTEXT_TYPE_CLASS.getClass().equals( Dummy.class))
+ {
+ EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE = enumValue(PERSISTENCE_CONTEXT_TYPE_CLASS, "EXTENDED");
+ }
+ else
+ {
+ EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE = DummyEnum.DUMMY_VALUE;
+ }
+ ENTITY_CLASS = annotationTypeForName("javax.persistence.Entity");
+ MAPPED_SUPERCLASS_CLASS = annotationTypeForName("javax.persistence.MappedSuperclass");
+ EMBEDDABLE_CLASS = annotationTypeForName("javax.persistence.Embeddable");
+ }
+
+}
\ No newline at end of file
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/PersistenceApiAbstraction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -22,7 +22,8 @@
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.jpa.spi.JpaServices;
+import org.jboss.webbeans.persistence.spi.EntityDiscovery;
+import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.resources.spi.ResourceServices;
@@ -40,12 +41,12 @@
/**
* Java EE5 or Java EE6
*/
- EE(WebBeanDiscovery.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, NamingContext.class, ResourceLoader.class),
+ EE(WebBeanDiscovery.class, EjbServices.class, JpaServices.class, EntityDiscovery.class, ResourceServices.class, TransactionServices.class, NamingContext.class, ResourceLoader.class),
/**
* Java EE6 Web Profile
*/
- EE_WEB_PROFILE(WebBeanDiscovery.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, NamingContext.class, ResourceLoader.class),
+ EE_WEB_PROFILE(WebBeanDiscovery.class, EjbServices.class, EntityDiscovery.class, JpaServices.class, ResourceServices.class, TransactionServices.class, NamingContext.class, ResourceLoader.class),
/**
* Servlet container such as Tomcat
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -6,8 +6,8 @@
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.jpa.spi.JpaServices;
import org.jboss.webbeans.manager.api.WebBeansManager;
+import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.resources.spi.ResourceServices;
Deleted: ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/JpaServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/JpaServices.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/JpaServices.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -1,57 +0,0 @@
-/*
- * 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.webbeans.jpa.spi;
-
-import java.util.Collection;
-
-import javax.inject.manager.InjectionPoint;
-
-import org.jboss.webbeans.bootstrap.api.Service;
-
-/**
- * A container should implement this interface to allow the Web Beans RI to
- * resolve JPA persistence units and discover entities
- *
- * @author Pete Muir
- *
- */
-public interface JpaServices extends Service
-{
-
- /**
- * Gets the class for each entity in the application
- *
- * @return the entity classes
- */
- public Collection<Class<?>> discoverEntities();
-
- /**
- * Resolve the value for the given @PersistenceContext injection point
- *
- * @param injectionPoint
- * the injection point metadata
- * @return an instance of the persistence unit
- * @throws IllegalArgumentException
- * if the injection point is not annotated with
- * @PersistenceContext, or, if the injection point is a method that doesn't
- * follow JavaBean conventions
- * @throws IllegalStateException
- * if no suitable persistence units can be resolved for injection
- */
- public Object resolvePersistenceContext(InjectionPoint injectionPoint);
-
-}
Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardinEntityDiscovery.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardinEntityDiscovery.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardinEntityDiscovery.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,27 @@
+package org.jboss.webbeans.jpa.spi.helpers;
+
+import java.util.Collection;
+
+import org.jboss.webbeans.persistence.spi.EntityDiscovery;
+
+public abstract class ForwardinEntityDiscovery implements EntityDiscovery
+{
+
+ protected abstract EntityDiscovery delegate();
+
+ public Collection<Class<?>> discoverEntitiesFromAnnotations()
+ {
+ return delegate().discoverEntitiesFromAnnotations();
+ }
+
+ public Collection<Class<?>> discoverEntitiesFromPersistenceUnits()
+ {
+ return delegate().discoverEntitiesFromPersistenceUnits();
+ }
+
+ public Collection<Class<?>> discoverEntitiesFromXml()
+ {
+ return delegate().discoverEntitiesFromXml();
+ }
+
+}
Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardinEntityDiscovery.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardingJpaServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardingJpaServices.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardingJpaServices.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -20,7 +20,7 @@
import javax.inject.manager.InjectionPoint;
-import org.jboss.webbeans.jpa.spi.JpaServices;
+import org.jboss.webbeans.persistence.spi.JpaServices;
/**
* An implementation of {@link JpaServices} which forwards all its method calls
@@ -37,11 +37,6 @@
protected abstract JpaServices delegate();
- public Collection<Class<?>> discoverEntities()
- {
- return delegate().discoverEntities();
- }
-
public Object resolvePersistenceContext(InjectionPoint injectionPoint)
{
return delegate().resolvePersistenceContext(injectionPoint);
Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/EntityDiscovery.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/EntityDiscovery.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/EntityDiscovery.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,56 @@
+/*
+ * 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.webbeans.persistence.spi;
+
+import java.util.Collection;
+
+import org.jboss.webbeans.bootstrap.api.Service;
+
+/**
+ * A container should implement this interface to replace portions or all
+ * of the built in entity discovery in Web Beans.
+ *
+ * The built in discovery considers @Entity, parses any META-INF/orm.xml
+ * and META-INF/persistence.xml.
+ *
+ * @author Pete Muir
+ *
+ */
+public interface EntityDiscovery extends Service
+{
+ /**
+ * Discover any entities defined using annotations
+ *
+ * @return an iteration of the entity classes found
+ */
+ public Collection<Class<?>> discoverEntitiesFromAnnotations();
+
+ /**
+ * Discover any entities defined using XML
+ *
+ * @return an iteration of the entity classes found
+ */
+ public Collection<Class<?>> discoverEntitiesFromXml();
+
+ /**
+ * Discover any extra entities defined using persistence unit configuration
+ *
+ * @return an iteration of the entity classes found
+ */
+ public Collection<Class<?>> discoverEntitiesFromPersistenceUnits();
+
+}
Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/EntityDiscovery.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/JpaServices.java (from rev 2360, ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/JpaServices.java)
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/JpaServices.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/JpaServices.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -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.webbeans.persistence.spi;
+
+import javax.inject.manager.InjectionPoint;
+
+import org.jboss.webbeans.bootstrap.api.Service;
+
+/**
+ * A container should implement this interface to allow the Web Beans RI to
+ * resolve JPA persistence units and discover entities
+ *
+ * @author Pete Muir
+ *
+ */
+public interface JpaServices extends Service
+{
+
+ /**
+ * Resolve the value for the given @PersistenceContext injection point
+ *
+ * @param injectionPoint
+ * the injection point metadata
+ * @return an instance of the persistence unit
+ * @throws IllegalArgumentException
+ * if the injection point is not annotated with
+ * @PersistenceContext, or, if the injection point is a method that doesn't
+ * follow JavaBean conventions
+ * @throws IllegalStateException
+ * if no suitable persistence units can be resolved for injection
+ */
+ public Object resolvePersistenceContext(InjectionPoint injectionPoint);
+
+}
Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/JpaServices.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -5,7 +5,8 @@
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.jpa.spi.JpaServices;
+import org.jboss.webbeans.persistence.spi.EntityDiscovery;
+import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.resources.spi.ResourceServices;
@@ -37,6 +38,7 @@
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(EntityDiscovery.class, new MockEntityDiscovery());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
}
@@ -52,10 +54,28 @@
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
+ bootstrap.getServices().add(EntityDiscovery.class, new MockEntityDiscovery());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
}
+ @Test(expectedExceptions=IllegalStateException.class)
+ public void testMissingEntityDiscovery()
+ {
+ AbstractBootstrap bootstrap = new MockBootstrap();
+ bootstrap.setEnvironment(Environments.EE);
+ bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
+ bootstrap.getServices().add(NamingContext.class, new MockNamingContext());
+ bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
+ bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
+ bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
+ bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+ bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.initialize();
+ }
+
+
@Test
public void testEEEnv()
{
@@ -68,6 +88,7 @@
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(EntityDiscovery.class, new MockEntityDiscovery());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
}
@@ -84,6 +105,7 @@
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(EntityDiscovery.class, new MockEntityDiscovery());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
}
@@ -99,6 +121,7 @@
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(EntityDiscovery.class, new MockEntityDiscovery());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
}
@@ -114,6 +137,7 @@
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(EntityDiscovery.class, new MockEntityDiscovery());
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
bootstrap.initialize();
}
Added: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEntityDiscovery.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEntityDiscovery.java (rev 0)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEntityDiscovery.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,25 @@
+package org.jboss.webbeans.bootstrap.api.test;
+
+import java.util.Collection;
+
+import org.jboss.webbeans.persistence.spi.EntityDiscovery;
+
+public class MockEntityDiscovery implements EntityDiscovery
+{
+
+ public Collection<Class<?>> discoverEntitiesFromAnnotations()
+ {
+ return null;
+ }
+
+ public Collection<Class<?>> discoverEntitiesFromPersistenceUnits()
+ {
+ return null;
+ }
+
+ public Collection<Class<?>> discoverEntitiesFromXml()
+ {
+ return null;
+ }
+
+}
Property changes on: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEntityDiscovery.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockJpaServices.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockJpaServices.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockJpaServices.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -4,7 +4,7 @@
import javax.inject.manager.InjectionPoint;
-import org.jboss.webbeans.jpa.spi.JpaServices;
+import org.jboss.webbeans.persistence.spi.JpaServices;
public class MockJpaServices implements JpaServices
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -76,7 +76,7 @@
assert getCurrentManager().resolveByType(Animal.class).size() == 0;
}
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertion(section = "3.2.1", id = "e")
public void testEntityClassesNotDiscoveredAsSimpleBean()
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedPackageTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedPackageTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedPackageTest.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.definition;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest
+@Resources({
+ @Resource(source="package-mock-orm.xml", destination="WEB-INF/classes/META-INF/orm.xml")
+})
+public class SimpleBeanOrmMappedPackageTest extends AbstractJSR299Test
+{
+
+
+ @Test
+ @SpecAssertion(section = "3.2.1", id = "o")
+ public void testOrmMappedEntityClassesNotDiscoveredAsSimpleBean()
+ {
+ assert getCurrentManager().resolveByType(Vet.class).size() == 0;
+ }
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedPackageTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedTest.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.definition;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest
+@Resources({
+ @Resource(source="mock-orm.xml", destination="WEB-INF/classes/META-INF/orm.xml")
+})
+public class SimpleBeanOrmMappedTest extends AbstractJSR299Test
+{
+
+
+ @Test
+ @SpecAssertion(section = "3.2.1", id = "o")
+ public void testOrmMappedEntityClassesNotDiscoveredAsSimpleBean()
+ {
+ assert getCurrentManager().resolveByType(Vet.class).size() == 0;
+ }
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Vet.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Vet.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Vet.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.definition;
+
+public class Vet
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Vet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/mock-orm.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/mock-orm.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/mock-orm.xml 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" version="1.0">
+
+ <entity class="org.jboss.jsr299.tck.tests.implementation.simple.definition.Vet" />
+
+</entity-mappings>
\ No newline at end of file
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/mock-orm.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/package-mock-orm.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/package-mock-orm.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/package-mock-orm.xml 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" version="1.0">
+
+ <package>org.jboss.jsr299.tck.tests.implementation.simple.definition</package>
+
+ <entity class="Vet" />
+
+</entity-mappings>
\ No newline at end of file
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/package-mock-orm.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2363 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/xml/namespace/javaee and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: vitold
Date: 2009-04-09 10:45:30 -0400 (Thu, 09 Apr 2009)
New Revision: 2363
Removed:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/namespace
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/JavaEeNamespaceTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/NotDeclaredNamespaceTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/beans.xml
Log:
some changes with tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java 2009-04-09 12:34:25 UTC (rev 2362)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java 2009-04-09 14:45:30 UTC (rev 2363)
@@ -27,8 +27,7 @@
{
@Test
@SpecAssertions({
- @SpecAssertion(section="9.2", id="e"),
- @SpecAssertion(section="9.2", id="f")
+ @SpecAssertion(section="9.2", id="e")
})
public void testNamespaceAggregation()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/JavaEeNamespaceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/JavaEeNamespaceTest.java 2009-04-09 12:34:25 UTC (rev 2362)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/JavaEeNamespaceTest.java 2009-04-09 14:45:30 UTC (rev 2363)
@@ -3,7 +3,8 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.tests.xml.metadata.foo.Order;
+import org.jboss.jsr299.tck.tests.xml.namespace.javaee.foo.AnotherDeploymentType;
+import org.jboss.jsr299.tck.tests.xml.namespace.javaee.foo.Order;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Classes;
import org.jboss.testharness.impl.packaging.Resource;
@@ -15,19 +16,20 @@
@Resources({
@Resource(source="namespace", destination="WEB-INF/classes/org/jboss/jsr299/tck/tests/xml/namespace/javaee/namespace")
})
-(a)Classes({Order.class})
+(a)Classes({Order.class, AnotherDeploymentType.class})
@BeansXml("beans.xml")
public class JavaEeNamespaceTest extends AbstractJSR299Test
{
@Test
@SpecAssertions({
+ @SpecAssertion(section="9.1", id="e"),
+ @SpecAssertion(section="9.1", id="f"),
+ @SpecAssertion(section="9.2", id="f"),
@SpecAssertion(section="9.2.1", id="a"),
@SpecAssertion(section="9.2.1", id="b"),
@SpecAssertion(section="9.2.1", id="c"),
@SpecAssertion(section="9.2.1", id="d"),
- @SpecAssertion(section="9.2.1", id="e"),
- @SpecAssertion(section="9.1", id="e"),
- @SpecAssertion(section="9.1", id="f")
+ @SpecAssertion(section="9.2.1", id="e")
})
public void testJavaEeNamespace()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/NotDeclaredNamespaceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/NotDeclaredNamespaceTest.java 2009-04-09 12:34:25 UTC (rev 2362)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/NotDeclaredNamespaceTest.java 2009-04-09 14:45:30 UTC (rev 2363)
@@ -4,20 +4,12 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
-import org.jboss.jsr299.tck.tests.xml.metadata.foo.Order;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.Classes;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
-import org.jboss.testharness.impl.packaging.Resource;
-import org.jboss.testharness.impl.packaging.Resources;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@Artifact
-@Resources({
- @Resource(source="namespace", destination="WEB-INF/classes/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/namespace")
-})
-(a)Classes({Order.class})
@ExpectedDeploymentException(DefinitionException.class)
@BeansXml("beans.xml")
public class NotDeclaredNamespaceTest
Modified: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/beans.xml 2009-04-09 12:34:25 UTC (rev 2362)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/beans.xml 2009-04-09 14:45:30 UTC (rev 2363)
@@ -1,22 +1,8 @@
-<Beans xmlns="urn:java:ee"
- xmlns:test="urn:java:org.jboss.jsr299.tck.tests.xml.namespace.javaee">
+<Beans xmlns="urn:java:ee">
<Deploy>
<Standard />
<Production />
<test:AnotherDeploymentType />
</Deploy>
- <test:Order>
- <RequestScoped />
- <Integer />
- <Array>
- <String />
- </Array>
- </test:Order>
- <Decorators>
- <test:TestDecorator />
- </Decorators>
- <Interceptors>
- <test:TestInterceptor />
- </Interceptors>
- <me:TestElement />
+ <me:NotDeclared />
</Beans>
\ No newline at end of file
Deleted: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/namespace
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/namespace 2009-04-09 12:34:25 UTC (rev 2362)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/namespace/notdeclared/namespace 2009-04-09 14:45:30 UTC (rev 2363)
@@ -1,2 +0,0 @@
-org.jboss.jsr299.tck.tests.xml.namespace.javaee
-org.jboss.jsr299.tck.tests.xml.namespace.javaee.foo
\ No newline at end of file
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2362 - doc/trunk/reference/en-US.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-09 08:34:25 -0400 (Thu, 09 Apr 2009)
New Revision: 2362
Modified:
doc/trunk/reference/en-US/ri.xml
Log:
WBRI-226
Modified: doc/trunk/reference/en-US/ri.xml
===================================================================
--- doc/trunk/reference/en-US/ri.xml 2009-04-09 11:24:57 UTC (rev 2361)
+++ doc/trunk/reference/en-US/ri.xml 2009-04-09 12:34:25 UTC (rev 2362)
@@ -358,7 +358,7 @@
<callout arearefs="faces.default.suffix">
<para>
Tell JSF that we will be giving our source files (facelets) an
- extension of <literal>.jsf</literal>
+ extension of <literal>.xhtml</literal>
</para>
</callout>
<callout arearefs="session.timeout">
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2361 - ri/trunk/tests.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-09 07:24:57 -0400 (Thu, 09 Apr 2009)
New Revision: 2361
Modified:
ri/trunk/tests/pom.xml
Log:
oops
Modified: ri/trunk/tests/pom.xml
===================================================================
--- ri/trunk/tests/pom.xml 2009-04-09 10:44:50 UTC (rev 2360)
+++ ri/trunk/tests/pom.xml 2009-04-09 11:24:57 UTC (rev 2361)
@@ -24,11 +24,6 @@
</dependency>
<dependency>
- <groupId>org.jboss.webbeans.tomcat</groupId>
- <artifactId>webbeans-tomcat</artifactId>
- </dependency>
-
- <dependency>
<groupId>org.jboss.test-harness</groupId>
<artifactId>jboss-test-harness</artifactId>
</dependency>
@@ -52,6 +47,17 @@
</dependency>
<dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-spi</artifactId>
+ </dependency>
+
+
+ <dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-api</artifactId>
<scope>test</scope>
@@ -146,12 +152,6 @@
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
</artifactItem>
- <artifactItem>
- <groupId>org.jboss.webbeans.tomcat</groupId>
- <artifactId>webbeans-tomcat</artifactId>
- <overWrite>true</overWrite>
- <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
- </artifactItem>
</artifactItems>
</configuration>
</execution>
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2360 - ri/trunk/tests/src/main/java/org/jboss/webbeans/test.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-09 06:44:50 -0400 (Thu, 09 Apr 2009)
New Revision: 2360
Added:
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractStandaloneContainersImpl.java
Log:
oops
Added: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractStandaloneContainersImpl.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractStandaloneContainersImpl.java (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractStandaloneContainersImpl.java 2009-04-09 10:44:50 UTC (rev 2360)
@@ -0,0 +1,63 @@
+package org.jboss.webbeans.test;
+
+import java.net.URL;
+
+import org.jboss.testharness.api.DeploymentException;
+import org.jboss.testharness.spi.StandaloneContainers;
+import org.jboss.webbeans.mock.MockServletLifecycle;
+import org.jboss.webbeans.mock.MockWebBeanDiscovery;
+
+public abstract class AbstractStandaloneContainersImpl implements StandaloneContainers
+{
+
+ private MockServletLifecycle lifecycle;
+
+ public void deploy(Iterable<Class<?>> classes, Iterable<URL> beansXml) throws DeploymentException
+ {
+ this.lifecycle = newLifecycle();
+ lifecycle.initialize();
+ try
+ {
+ MockWebBeanDiscovery discovery = lifecycle.getWebBeanDiscovery();
+ discovery.setWebBeanClasses(classes);
+ if (beansXml != null)
+ {
+ discovery.setWebBeansXmlFiles(beansXml);
+ }
+ lifecycle.beginApplication();
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Error deploying beans", e);
+ }
+ lifecycle.beginSession();
+ lifecycle.beginRequest();
+ }
+
+ protected abstract MockServletLifecycle newLifecycle();
+
+ public void deploy(Iterable<Class<?>> classes) throws DeploymentException
+ {
+ deploy(classes, null);
+ }
+
+ public void cleanup()
+ {
+ // Np-op
+
+ }
+
+ public void setup()
+ {
+ // No-op
+ }
+
+ public void undeploy()
+ {
+ lifecycle.endRequest();
+ lifecycle.endSession();
+ lifecycle.endApplication();
+ lifecycle = null;
+ }
+
+}
\ No newline at end of file
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2359 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml and 31 other directories.
by webbeans-commits@lists.jboss.org
Author: vitold
Date: 2009-04-09 03:30:54 -0400 (Thu, 09 Apr 2009)
New Revision: 2359
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/multipledeclaration/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/multipledeclaration/MultipleDeclarationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notannotationtype/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notannotationtype/NotAnnotationTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notjavatype/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notjavatype/NotJavaTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/AnnotationType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/NotAnnotationType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/TestBindingType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/TestInterceptorBindingType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/TestStereotype.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/multipledeclaration/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/multipledeclaration/MultipleDeclarationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notannotationtype/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notannotationtype/NotAnnotationTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notjavatype/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notjavatype/NotJavaTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notvalidtype/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notvalidtype/NotValidTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/multipledeclaration/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/multipledeclaration/MultipleDeclarationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notannotationtype/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notannotationtype/NotAnnotationTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notjavatype/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notjavatype/NotJavaTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notvalidtype/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notvalidtype/NotValidTypeTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/multipledeclaration/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/multipledeclaration/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notannotationtype/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notannotationtype/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notjavatype/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notjavatype/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/multipledeclaration/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/multipledeclaration/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notannotationtype/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notannotationtype/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notjavatype/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notjavatype/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notvalidtype/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notvalidtype/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/multipledeclaration/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/multipledeclaration/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notannotationtype/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notannotationtype/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notjavatype/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notjavatype/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notvalidtype/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notvalidtype/beans.xml
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java
Log:
add some tests for 9.4
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java 2009-04-08 19:28:30 UTC (rev 2358)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -32,7 +32,7 @@
@SpecAssertion(section="9.4.2", id="a"),
@SpecAssertion(section="9.4.2", id="d")
})
- public void testNamespaceAggregation()
+ public void testAnnotationTypes()
{
assert true;
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/multipledeclaration/MultipleDeclarationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/multipledeclaration/MultipleDeclarationTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/multipledeclaration/MultipleDeclarationTest.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,31 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.bindingtype.multipledeclaration;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestInterceptorBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestStereotype;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Classes({TestBindingType.class, TestInterceptorBindingType.class, TestStereotype.class})
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class MultipleDeclarationTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="9.4", id="h")
+ })
+ public void testMultipleDeclaration()
+ {
+ assert true;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notannotationtype/NotAnnotationTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notannotationtype/NotAnnotationTypeTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notannotationtype/NotAnnotationTypeTest.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,32 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.bindingtype.notannotationtype;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.NotAnnotationType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestInterceptorBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestStereotype;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Classes({TestBindingType.class, TestInterceptorBindingType.class, TestStereotype.class, NotAnnotationType.class})
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class NotAnnotationTypeTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="9.4", id="d")
+ })
+ public void testNotAnnotationType()
+ {
+ assert true;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notjavatype/NotJavaTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notjavatype/NotJavaTypeTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notjavatype/NotJavaTypeTest.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,31 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.bindingtype.notjavatype;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestInterceptorBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestStereotype;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Classes({TestBindingType.class, TestInterceptorBindingType.class, TestStereotype.class})
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class NotJavaTypeTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="9.4", id="d")
+ })
+ public void testNotJavaType()
+ {
+ assert true;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/AnnotationType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/AnnotationType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/AnnotationType.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo;
+
+public @interface AnnotationType {
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/NotAnnotationType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/NotAnnotationType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/NotAnnotationType.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo;
+
+public class NotAnnotationType {
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/TestBindingType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/TestBindingType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/TestBindingType.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo;
+
+public @interface TestBindingType
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/TestInterceptorBindingType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/TestInterceptorBindingType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/TestInterceptorBindingType.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo;
+
+public @interface TestInterceptorBindingType
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/TestStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/TestStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/foo/TestStereotype.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo;
+
+public @interface TestStereotype
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/multipledeclaration/MultipleDeclarationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/multipledeclaration/MultipleDeclarationTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/multipledeclaration/MultipleDeclarationTest.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,31 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.interceptorbindingtype.multipledeclaration;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestInterceptorBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestStereotype;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Classes({TestBindingType.class, TestInterceptorBindingType.class, TestStereotype.class})
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class MultipleDeclarationTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="9.4", id="h")
+ })
+ public void testMultipleDeclaration()
+ {
+ assert true;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notannotationtype/NotAnnotationTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notannotationtype/NotAnnotationTypeTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notannotationtype/NotAnnotationTypeTest.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,33 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.interceptorbindingtype.notannotationtype;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.NotAnnotationType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestInterceptorBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestStereotype;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Classes({TestBindingType.class, TestInterceptorBindingType.class, TestStereotype.class, NotAnnotationType.class})
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class NotAnnotationTypeTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="9.4", id="d"),
+ @SpecAssertion(section="9.4.2", id="c")
+ })
+ public void testNotAnnotationType()
+ {
+ assert true;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notjavatype/NotJavaTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notjavatype/NotJavaTypeTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notjavatype/NotJavaTypeTest.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,32 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.interceptorbindingtype.notjavatype;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestInterceptorBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestStereotype;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Classes({TestBindingType.class, TestInterceptorBindingType.class, TestStereotype.class})
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class NotJavaTypeTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="9.4", id="d"),
+ @SpecAssertion(section="9.4.2", id="b")
+ })
+ public void testNotJavaType()
+ {
+ assert true;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notvalidtype/NotValidTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notvalidtype/NotValidTypeTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notvalidtype/NotValidTypeTest.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,32 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.interceptorbindingtype.notvalidtype;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.AnnotationType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestInterceptorBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestStereotype;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Classes({TestBindingType.class, TestInterceptorBindingType.class, TestStereotype.class, AnnotationType.class})
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class NotValidTypeTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="9.4.2", id="e")
+ })
+ public void testNotValidType()
+ {
+ assert true;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/multipledeclaration/MultipleDeclarationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/multipledeclaration/MultipleDeclarationTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/multipledeclaration/MultipleDeclarationTest.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,31 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.stereotype.multipledeclaration;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestInterceptorBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestStereotype;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Classes({TestBindingType.class, TestInterceptorBindingType.class, TestStereotype.class})
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class MultipleDeclarationTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="9.4", id="h")
+ })
+ public void testMultipleDeclaration()
+ {
+ assert true;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notannotationtype/NotAnnotationTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notannotationtype/NotAnnotationTypeTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notannotationtype/NotAnnotationTypeTest.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,33 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.stereotype.notannotationtype;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.NotAnnotationType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestInterceptorBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestStereotype;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Classes({TestBindingType.class, TestInterceptorBindingType.class, TestStereotype.class, NotAnnotationType.class})
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class NotAnnotationTypeTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="9.4", id="d"),
+ @SpecAssertion(section="9.4.1", id="c")
+ })
+ public void testNotAnnotationType()
+ {
+ assert true;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notjavatype/NotJavaTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notjavatype/NotJavaTypeTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notjavatype/NotJavaTypeTest.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,32 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.stereotype.notjavatype;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestInterceptorBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestStereotype;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Classes({TestBindingType.class, TestInterceptorBindingType.class, TestStereotype.class})
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class NotJavaTypeTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="9.4", id="d"),
+ @SpecAssertion(section="9.4.1", id="b")
+ })
+ public void testNotJavaType()
+ {
+ assert true;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notvalidtype/NotValidTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notvalidtype/NotValidTypeTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notvalidtype/NotValidTypeTest.java 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,32 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.stereotype.notvalidtype;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.AnnotationType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestInterceptorBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo.TestStereotype;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Classes({TestBindingType.class, TestInterceptorBindingType.class, TestStereotype.class, AnnotationType.class})
+@BeansXml("beans.xml")
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class NotValidTypeTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="9.4.1", id="h")
+ })
+ public void testNotValidType()
+ {
+ assert true;
+ }
+}
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/multipledeclaration/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/multipledeclaration/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/multipledeclaration/beans.xml 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,15 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:dd="urn:java:org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo">
+ <dd:TestBindingType>
+ <BindingType />
+ </dd:TestBindingType>
+ <dd:TestInterceptorBindingType>
+ <InterceptorBindingType />
+ </dd:TestInterceptorBindingType>
+ <dd:TestStereotype>
+ <Stereotype />
+ </dd:TestStereotype>
+ <dd:TestBindingType>
+ <BindingType />
+ </dd:TestBindingType>
+</Beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notannotationtype/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notannotationtype/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notannotationtype/beans.xml 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,13 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:dd="urn:java:org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo">
+ <dd:TestBindingType>
+ <BindingType />
+ <dd:NotAnnotationType />
+ </dd:TestBindingType>
+ <dd:TestInterceptorBindingType>
+ <InterceptorBindingType />
+ </dd:TestInterceptorBindingType>
+ <dd:TestStereotype>
+ <Stereotype />
+ </dd:TestStereotype>
+</Beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notjavatype/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notjavatype/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/bindingtype/notjavatype/beans.xml 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,13 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:dd="urn:java:org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo">
+ <dd:TestBindingType>
+ <BindingType />
+ <dd:NotJavaType />
+ </dd:TestBindingType>
+ <dd:TestInterceptorBindingType>
+ <InterceptorBindingType />
+ </dd:TestInterceptorBindingType>
+ <dd:TestStereotype>
+ <Stereotype />
+ </dd:TestStereotype>
+</Beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/multipledeclaration/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/multipledeclaration/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/multipledeclaration/beans.xml 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,15 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:dd="urn:java:org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo">
+ <dd:TestBindingType>
+ <BindingType />
+ </dd:TestBindingType>
+ <dd:TestInterceptorBindingType>
+ <InterceptorBindingType />
+ </dd:TestInterceptorBindingType>
+ <dd:TestStereotype>
+ <Stereotype />
+ </dd:TestStereotype>
+ <dd:TestInterceptorBindingType>
+ <InterceptorBindingType />
+ </dd:TestInterceptorBindingType>
+</Beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notannotationtype/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notannotationtype/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notannotationtype/beans.xml 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,13 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:dd="urn:java:org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo">
+ <dd:TestBindingType>
+ <BindingType />
+ </dd:TestBindingType>
+ <dd:TestInterceptorBindingType>
+ <InterceptorBindingType />
+ <dd:NotAnnotationType />
+ </dd:TestInterceptorBindingType>
+ <dd:TestStereotype>
+ <Stereotype />
+ </dd:TestStereotype>
+</Beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notjavatype/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notjavatype/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notjavatype/beans.xml 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,13 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:dd="urn:java:org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo">
+ <dd:TestBindingType>
+ <BindingType />
+ </dd:TestBindingType>
+ <dd:TestInterceptorBindingType>
+ <InterceptorBindingType />
+ <dd:NotJavaType />
+ </dd:TestInterceptorBindingType>
+ <dd:TestStereotype>
+ <Stereotype />
+ </dd:TestStereotype>
+</Beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notvalidtype/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notvalidtype/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/interceptorbindingtype/notvalidtype/beans.xml 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,13 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:dd="urn:java:org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo">
+ <dd:TestBindingType>
+ <BindingType />
+ </dd:TestBindingType>
+ <dd:TestInterceptorBindingType>
+ <InterceptorBindingType />
+ <dd:AnnotationType />
+ </dd:TestInterceptorBindingType>
+ <dd:TestStereotype>
+ <Stereotype />
+ </dd:TestStereotype>
+</Beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/multipledeclaration/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/multipledeclaration/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/multipledeclaration/beans.xml 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,15 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:dd="urn:java:org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo">
+ <dd:TestBindingType>
+ <BindingType />
+ </dd:TestBindingType>
+ <dd:TestInterceptorBindingType>
+ <InterceptorBindingType />
+ </dd:TestInterceptorBindingType>
+ <dd:TestStereotype>
+ <Stereotype />
+ </dd:TestStereotype>
+ <dd:TestStereotype>
+ <Stereotype />
+ </dd:TestStereotype>
+</Beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notannotationtype/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notannotationtype/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notannotationtype/beans.xml 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,13 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:dd="urn:java:org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo">
+ <dd:TestBindingType>
+ <BindingType />
+ </dd:TestBindingType>
+ <dd:TestInterceptorBindingType>
+ <InterceptorBindingType />
+ </dd:TestInterceptorBindingType>
+ <dd:TestStereotype>
+ <Stereotype />
+ <dd:NotAnnotationType />
+ </dd:TestStereotype>
+</Beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notjavatype/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notjavatype/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notjavatype/beans.xml 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,13 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:dd="urn:java:org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo">
+ <dd:TestBindingType>
+ <BindingType />
+ </dd:TestBindingType>
+ <dd:TestInterceptorBindingType>
+ <InterceptorBindingType />
+ </dd:TestInterceptorBindingType>
+ <dd:TestStereotype>
+ <Stereotype />
+ <dd:NotJavaType />
+ </dd:TestStereotype>
+</Beans>
\ No newline at end of file
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notvalidtype/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notvalidtype/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/notvalidxml/stereotype/notvalidtype/beans.xml 2009-04-09 07:30:54 UTC (rev 2359)
@@ -0,0 +1,13 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:dd="urn:java:org.jboss.jsr299.tck.tests.xml.annotationtypes.notvalidxml.foo">
+ <dd:TestBindingType>
+ <BindingType />
+ </dd:TestBindingType>
+ <dd:TestInterceptorBindingType>
+ <InterceptorBindingType />
+ </dd:TestInterceptorBindingType>
+ <dd:TestStereotype>
+ <Stereotype />
+ <dd:AnnotationType />
+ </dd:TestStereotype>
+</Beans>
\ No newline at end of file
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2358 - in ri/trunk: tests/src/main/java/org/jboss/webbeans/test and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-08 15:28:30 -0400 (Wed, 08 Apr 2009)
New Revision: 2358
Added:
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/ServletLifecycleContainersImpl.java
Modified:
ri/trunk/tests/pom.xml
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/StandaloneContainersImpl.java
ri/trunk/version-matrix/pom.xml
Log:
better test classes
Modified: ri/trunk/tests/pom.xml
===================================================================
--- ri/trunk/tests/pom.xml 2009-04-08 19:09:28 UTC (rev 2357)
+++ ri/trunk/tests/pom.xml 2009-04-08 19:28:30 UTC (rev 2358)
@@ -12,16 +12,6 @@
<dependencies>
<dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-spi</artifactId>
- </dependency>
-
- <dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<classifier>jdk15</classifier>
@@ -34,6 +24,11 @@
</dependency>
<dependency>
+ <groupId>org.jboss.webbeans.tomcat</groupId>
+ <artifactId>webbeans-tomcat</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.test-harness</groupId>
<artifactId>jboss-test-harness</artifactId>
</dependency>
@@ -151,6 +146,12 @@
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
</artifactItem>
+ <artifactItem>
+ <groupId>org.jboss.webbeans.tomcat</groupId>
+ <artifactId>webbeans-tomcat</artifactId>
+ <overWrite>true</overWrite>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
</artifactItems>
</configuration>
</execution>
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-04-08 19:09:28 UTC (rev 2357)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-04-08 19:28:30 UTC (rev 2358)
@@ -68,7 +68,6 @@
{
if (!isInContainer())
{
- getCurrentConfiguration().setStandaloneContainers(new StandaloneContainersImpl());
getCurrentConfiguration().getExtraPackages().add(AbstractWebBeansTest.class.getPackage().getName());
}
super.beforeSuite(context);
Added: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/ServletLifecycleContainersImpl.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/ServletLifecycleContainersImpl.java (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/ServletLifecycleContainersImpl.java 2009-04-08 19:28:30 UTC (rev 2358)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test;
+
+import org.jboss.webbeans.mock.MockServletLifecycle;
+
+public class ServletLifecycleContainersImpl extends AbstractStandaloneContainersImpl
+{
+
+ @Override
+ protected MockServletLifecycle newLifecycle()
+ {
+ return new MockServletLifecycle();
+ }
+
+}
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/StandaloneContainersImpl.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/StandaloneContainersImpl.java 2009-04-08 19:09:28 UTC (rev 2357)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/StandaloneContainersImpl.java 2009-04-08 19:28:30 UTC (rev 2358)
@@ -1,76 +1,16 @@
package org.jboss.webbeans.test;
-import java.net.URL;
-
-import org.jboss.testharness.api.DeploymentException;
import org.jboss.testharness.spi.StandaloneContainers;
import org.jboss.webbeans.mock.MockEELifecycle;
import org.jboss.webbeans.mock.MockServletLifecycle;
-import org.jboss.webbeans.mock.MockWebBeanDiscovery;
-public class StandaloneContainersImpl implements StandaloneContainers
+public class StandaloneContainersImpl extends AbstractStandaloneContainersImpl implements StandaloneContainers
{
- // TODO this is a hack ;-)
- public static Class<? extends MockServletLifecycle> lifecycleClass = MockEELifecycle.class;
-
- private MockServletLifecycle lifecycle;
-
- public void deploy(Iterable<Class<?>> classes, Iterable<URL> beansXml) throws DeploymentException
+ @Override
+ protected MockServletLifecycle newLifecycle()
{
- try
- {
- this.lifecycle = lifecycleClass.newInstance();
- }
- catch (InstantiationException e1)
- {
- throw new DeploymentException("Error instantiating lifeycle", e1);
- }
- catch (IllegalAccessException e1)
- {
- throw new DeploymentException("Error instantiating lifeycle", e1);
- }
- lifecycle.initialize();
- try
- {
- MockWebBeanDiscovery discovery = lifecycle.getWebBeanDiscovery();
- discovery.setWebBeanClasses(classes);
- if (beansXml != null)
- {
- discovery.setWebBeansXmlFiles(beansXml);
- }
- lifecycle.beginApplication();
- }
- catch (Exception e)
- {
- throw new DeploymentException("Error deploying beans", e);
- }
- lifecycle.beginSession();
- lifecycle.beginRequest();
+ return new MockEELifecycle();
}
- public void deploy(Iterable<Class<?>> classes) throws DeploymentException
- {
- deploy(classes, null);
- }
-
- public void cleanup()
- {
- // Np-op
-
- }
-
- public void setup()
- {
- // No-op
- }
-
- public void undeploy()
- {
- lifecycle.endRequest();
- lifecycle.endSession();
- lifecycle.endApplication();
- lifecycle = null;
- }
-
}
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-04-08 19:09:28 UTC (rev 2357)
+++ ri/trunk/version-matrix/pom.xml 2009-04-08 19:28:30 UTC (rev 2358)
@@ -300,6 +300,12 @@
<version>1.0.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness-tomcat</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+
<!-- <dependency>-->
<!-- <groupId>org.jboss.naming</groupId>-->
<!-- <artifactId>jnp-client</artifactId>-->
15 years, 8 months