[webbeans-commits] Webbeans SVN: r2347 - in ri/trunk/impl/src/main/java/org/jboss/webbeans: mock and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-08 09:26:25 -0400 (Wed, 08 Apr 2009)
New Revision: 2347
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/AbstractLifecycle.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
Log:
Fix packaging
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java (from rev 2343, ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/AbstractLifecycle.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java 2009-04-08 13:26:25 UTC (rev 2347)
@@ -0,0 +1,84 @@
+package org.jboss.webbeans.context;
+
+import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.context.api.BeanStore;
+import org.jboss.webbeans.conversation.ConversationManager;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.servlet.ConversationBeanStore;
+
+/**
+ * An implementation of the Web Beans lifecycle that supports restoring
+ * and destroying all the built in contexts
+ *
+ * @author Pete Muir
+ *
+ */
+public class ContextLifecycle
+{
+
+ private static ContextLifecycle instance;
+
+ public static ContextLifecycle instance()
+ {
+ return instance;
+ }
+
+ protected static void setInstance(ContextLifecycle instance)
+ {
+ ContextLifecycle.instance = instance;
+ }
+
+ private static LogProvider log = Logging.getLogProvider(ContextLifecycle.class);
+
+ protected void restoreSession(String id, BeanStore sessionBeanStore)
+ {
+ log.trace("Restoring session " + id);
+ SessionContext.INSTANCE.setBeanStore(sessionBeanStore);
+ SessionContext.INSTANCE.setActive(true);
+ }
+
+ protected void endSession(String id, BeanStore sessionBeanStore)
+ {
+ log.trace("Ending session " + id);
+ SessionContext.INSTANCE.setActive(true);
+ ConversationManager conversationManager = CurrentManager.rootManager().getInstanceByType(ConversationManager.class);
+ conversationManager.destroyAllConversations();
+ 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);
+ }
+
+ 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);
+ }
+
+ protected void restoreConversation(String id, BeanStore conversationBeanStore)
+ {
+ log.trace("Starting conversation " + id);
+ ConversationContext.INSTANCE.setBeanStore(conversationBeanStore);
+ ConversationContext.INSTANCE.setActive(true);
+ }
+
+ protected void destroyConversation(String id, ConversationBeanStore conversationBeanStore)
+ {
+ log.trace("Ending conversation " + id);
+ ConversationContext destructionContext = new ConversationContext();
+ destructionContext.setBeanStore(conversationBeanStore);
+ destructionContext.destroy();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextLifecycle.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java 2009-04-08 13:23:42 UTC (rev 2346)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java 2009-04-08 13:26:25 UTC (rev 2347)
@@ -3,13 +3,13 @@
import org.jboss.webbeans.bootstrap.WebBeansBootstrap;
import org.jboss.webbeans.bootstrap.api.Environments;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.context.ContextLifecycle;
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
-import org.jboss.webbeans.servlet.AbstractLifecycle;
-public class MockServletLifecycle extends AbstractLifecycle
+public class MockServletLifecycle extends ContextLifecycle
{
private static final ResourceLoader MOCK_RESOURCE_LOADER = new MockResourceLoader();
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/AbstractLifecycle.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/AbstractLifecycle.java 2009-04-08 13:23:42 UTC (rev 2346)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/AbstractLifecycle.java 2009-04-08 13:26:25 UTC (rev 2347)
@@ -1,87 +0,0 @@
-package org.jboss.webbeans.servlet;
-
-import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.context.ConversationContext;
-import org.jboss.webbeans.context.DependentContext;
-import org.jboss.webbeans.context.RequestContext;
-import org.jboss.webbeans.context.SessionContext;
-import org.jboss.webbeans.context.api.BeanStore;
-import org.jboss.webbeans.conversation.ConversationManager;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
-
-/**
- * A generic implementation of the Web Beans lifecycle that supports restoring
- * and destroying all the built in contexts
- *
- * @author Pete Muir
- *
- */
-public abstract class AbstractLifecycle
-{
-
- private static AbstractLifecycle instance;
-
- public static AbstractLifecycle instance()
- {
- return instance;
- }
-
- protected static void setInstance(AbstractLifecycle instance)
- {
- AbstractLifecycle.instance = instance;
- }
-
- private static LogProvider log = Logging.getLogProvider(AbstractLifecycle.class);
-
- protected void restoreSession(String id, BeanStore sessionBeanStore)
- {
- log.trace("Restoring session " + id);
- SessionContext.INSTANCE.setBeanStore(sessionBeanStore);
- SessionContext.INSTANCE.setActive(true);
- }
-
- protected void endSession(String id, BeanStore sessionBeanStore)
- {
- log.trace("Ending session " + id);
- SessionContext.INSTANCE.setActive(true);
- ConversationManager conversationManager = CurrentManager.rootManager().getInstanceByType(ConversationManager.class);
- conversationManager.destroyAllConversations();
- 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);
- }
-
- 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);
- }
-
- protected void restoreConversation(String id, BeanStore conversationBeanStore)
- {
- log.trace("Starting conversation " + id);
- ConversationContext.INSTANCE.setBeanStore(conversationBeanStore);
- ConversationContext.INSTANCE.setActive(true);
- }
-
- protected void destroyConversation(String id, ConversationBeanStore conversationBeanStore)
- {
- log.trace("Ending conversation " + id);
- ConversationContext destructionContext = new ConversationContext();
- destructionContext.setBeanStore(conversationBeanStore);
- destructionContext.destroy();
- }
-
-}
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-08 13:23:42 UTC (rev 2346)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2009-04-08 13:26:25 UTC (rev 2347)
@@ -21,6 +21,7 @@
import javax.servlet.http.HttpSession;
import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.context.ContextLifecycle;
import org.jboss.webbeans.context.SessionContext;
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
@@ -35,19 +36,19 @@
* @author Pete Muir
* @author Nicklas Karlsson
*/
-public class ServletLifecycle extends AbstractLifecycle
+public class ServletLifecycle extends ContextLifecycle
{
public static final String REQUEST_ATTRIBUTE_NAME = ServletLifecycle.class.getName() + ".requestBeanStore";
static
{
- AbstractLifecycle.setInstance(new ServletLifecycle());
+ ContextLifecycle.setInstance(new ServletLifecycle());
}
public static ServletLifecycle instance()
{
- return (ServletLifecycle) AbstractLifecycle.instance();
+ return (ServletLifecycle) ContextLifecycle.instance();
}
private static LogProvider log = Logging.getLogProvider(ServletLifecycle.class);
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2346 - ri/trunk/impl/src/main/java/org/jboss/webbeans/context.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-08 09:23:42 -0400 (Wed, 08 Apr 2009)
New Revision: 2346
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
Log:
minor
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java 2009-04-08 13:22:02 UTC (rev 2345)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java 2009-04-08 13:23:42 UTC (rev 2346)
@@ -74,7 +74,7 @@
}
if (getBeanStore() == null)
{
- throw new IllegalStateException("No bean store available");
+ throw new IllegalStateException("No bean store available for " + toString());
}
T instance = getBeanStore().get(contextual);
if (instance != null)
@@ -132,7 +132,7 @@
log.trace("Destroying " + bean);
if (getBeanStore() == null)
{
- throw new IllegalStateException("No bean store available");
+ throw new IllegalStateException("No bean store available for " + toString());
}
bean.destroy(getBeanStore().get(bean));
}
@@ -145,7 +145,7 @@
log.trace("Destroying context");
if (getBeanStore() == null)
{
- throw new IllegalStateException("No bean store available");
+ throw new IllegalStateException("No bean store available for " + toString());
}
for (Contextual<? extends Object> bean : getBeanStore().getBeans())
{
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2345 - ri/trunk/impl/src/main/java/org/jboss/webbeans/context.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-08 09:22:02 -0400 (Wed, 08 Apr 2009)
New Revision: 2345
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
Log:
better exception
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java 2009-04-08 13:15:36 UTC (rev 2344)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java 2009-04-08 13:22:02 UTC (rev 2345)
@@ -72,6 +72,10 @@
{
throw new ContextNotActiveException();
}
+ if (getBeanStore() == null)
+ {
+ throw new IllegalStateException("No bean store available");
+ }
T instance = getBeanStore().get(contextual);
if (instance != null)
{
@@ -126,6 +130,10 @@
private <T> void destroy(Contextual<T> bean)
{
log.trace("Destroying " + bean);
+ if (getBeanStore() == null)
+ {
+ throw new IllegalStateException("No bean store available");
+ }
bean.destroy(getBeanStore().get(bean));
}
@@ -135,6 +143,10 @@
public void destroy()
{
log.trace("Destroying context");
+ if (getBeanStore() == null)
+ {
+ throw new IllegalStateException("No bean store available");
+ }
for (Contextual<? extends Object> bean : getBeanStore().getBeans())
{
destroy(bean);
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2344 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/mock and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-08 09:15:36 -0400 (Wed, 08 Apr 2009)
New Revision: 2344
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/CurrentManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/StandaloneContainersImpl.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
Log:
explicitly clean up statics on shutdown
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/CurrentManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/CurrentManager.java 2009-04-08 10:36:50 UTC (rev 2343)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/CurrentManager.java 2009-04-08 13:15:36 UTC (rev 2344)
@@ -30,10 +30,16 @@
{
// The root manager instance
- private static Integer rootManagerId;
+ private static ManagerImpl rootManager;
private final static Map<Integer, ManagerImpl> managers = new ConcurrentHashMap<Integer, ManagerImpl>();
+ public static void cleanup()
+ {
+ rootManager = null;
+ managers.clear();
+ }
+
/**
* Gets the root manager
*
@@ -41,14 +47,7 @@
*/
public static ManagerImpl rootManager()
{
- if (rootManagerId == null)
- {
- return null;
- }
- else
- {
- return managers.get(rootManagerId);
- }
+ return rootManager;
}
/**
@@ -58,14 +57,8 @@
*/
public static void setRootManager(ManagerImpl managerImpl)
{
- if (managerImpl == null)
- {
- rootManagerId = null;
- }
- else
- {
- rootManagerId = add(managerImpl);
- }
+ rootManager = managerImpl;
+ managers.put(managerImpl.getId(), managerImpl);
}
public static ManagerImpl get(Integer key)
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-08 10:36:50 UTC (rev 2343)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-04-08 13:15:36 UTC (rev 2344)
@@ -1129,6 +1129,7 @@
{
log.trace("Ending application");
shutdownExecutors();
+ CurrentManager.cleanup();
ApplicationContext.INSTANCE.destroy();
ApplicationContext.INSTANCE.setActive(false);
ApplicationContext.INSTANCE.setBeanStore(null);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java 2009-04-08 10:36:50 UTC (rev 2343)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java 2009-04-08 13:15:36 UTC (rev 2344)
@@ -56,7 +56,7 @@
public void endApplication()
{
-
+ bootstrap.shutdown();
}
public void resetContexts()
Modified: ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java
===================================================================
--- ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java 2009-04-08 10:36:50 UTC (rev 2343)
+++ ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java 2009-04-08 13:15:36 UTC (rev 2344)
@@ -6,7 +6,6 @@
import org.jboss.testharness.api.DeploymentException;
import org.jboss.testharness.spi.StandaloneContainers;
-import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.mock.MockEELifecycle;
import org.jboss.webbeans.mock.MockWebBeanDiscovery;
@@ -74,7 +73,6 @@
lifecycle.endRequest();
lifecycle.endSession();
lifecycle.endApplication();
- CurrentManager.setRootManager(null);
lifecycle = null;
}
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 10:36:50 UTC (rev 2343)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/StandaloneContainersImpl.java 2009-04-08 13:15:36 UTC (rev 2344)
@@ -4,7 +4,6 @@
import org.jboss.testharness.api.DeploymentException;
import org.jboss.testharness.spi.StandaloneContainers;
-import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.mock.MockEELifecycle;
import org.jboss.webbeans.mock.MockServletLifecycle;
import org.jboss.webbeans.mock.MockWebBeanDiscovery;
@@ -71,7 +70,6 @@
lifecycle.endRequest();
lifecycle.endSession();
lifecycle.endApplication();
- CurrentManager.setRootManager(null);
lifecycle = null;
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java 2009-04-08 10:36:50 UTC (rev 2343)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java 2009-04-08 13:15:36 UTC (rev 2344)
@@ -43,7 +43,6 @@
lifecycle.endRequest();
lifecycle.endSession();
lifecycle.endApplication();
- CurrentManager.setRootManager(null);
lifecycle = null;
}
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2343 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-04-08 06:36:50 -0400 (Wed, 08 Apr 2009)
New Revision: 2343
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/RequestContextTest.java
Log:
Fixed request context problem with deferred events and enabled the tests.
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.java 2009-04-08 08:55:15 UTC (rev 2342)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.java 2009-04-08 10:36:50 UTC (rev 2343)
@@ -18,6 +18,7 @@
package org.jboss.webbeans.event;
import org.jboss.webbeans.context.DependentContext;
+import org.jboss.webbeans.context.RequestContext;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
@@ -49,6 +50,7 @@
public void run()
{
+ RequestContext.INSTANCE.setActive(true);
DependentContext.INSTANCE.setActive(true);
try
{
@@ -62,6 +64,7 @@
finally
{
DependentContext.INSTANCE.setActive(false);
+ RequestContext.INSTANCE.setActive(false);
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/RequestContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/RequestContextTest.java 2009-04-08 08:55:15 UTC (rev 2342)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/RequestContextTest.java 2009-04-08 10:36:50 UTC (rev 2343)
@@ -34,7 +34,7 @@
/**
* The request scope is active during any asynchronous observer method notification
*/
- @Test(groups = { "ri-broken", "contexts", "integration" })
+ @Test(groups = { "contexts", "integration" })
@SpecAssertion(section = "8.5.1", id = "f")
public void testRequestScopeIsActiveDuringAsynchronousObserverMethodInvocation() throws Exception
{
@@ -47,7 +47,7 @@
* The request context is destroyed after the asynchronous observer method notification
* completes
*/
- @Test(groups = { "ri-broken", "contexts", "integration" })
+ @Test(groups = { "contexts", "integration" })
@SpecAssertion(section = "8.5.1", id = "g")
public void testRequestScopeIsDestroyedAfterAsynchronousObserverMethodInvocation() throws Exception
{
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2342 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: vitold
Date: 2009-04-08 04:55:15 -0400 (Wed, 08 Apr 2009)
New Revision: 2342
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/
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/foo/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/AnotherTestInterceptorBindingType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestBindingType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestInterceptorBindingType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestNamed.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestScopeType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestStereotype.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/beans.xml
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java
Log:
make some tests for 9.4
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java 2009-04-08 00:20:36 UTC (rev 2341)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java 2009-04-08 08:55:15 UTC (rev 2342)
@@ -200,7 +200,8 @@
{
Element child = (Element)elIterator.next();
Class<? extends Annotation> clazz = ParseXmlHelper.loadAnnotationClass(child, Annotation.class, environment, packagesMap);
- if(!clazz.isAnnotationPresent(InterceptorBindingType.class))
+ if(!child.getName().equalsIgnoreCase(XmlConstants.INTERCEPTOR_BINDING_TYPE) &&
+ !clazz.isAnnotationPresent(InterceptorBindingType.class))
throw new DefinitionException("Direct child <" + child.getName() + "> of interceptor binding type <" + element.getName() +
"> declaration must be interceptor binding type");
@@ -214,11 +215,12 @@
{
Element stereotypeChild = (Element)elIterator.next();
Class<? extends Annotation> stereotypeClass = ParseXmlHelper.loadAnnotationClass(stereotypeChild, Annotation.class, environment, packagesMap);
- if(stereotypeClass.isAnnotationPresent(ScopeType.class) ||
+ if(stereotypeChild.getName().equalsIgnoreCase(XmlConstants.STEREOTYPE) ||
+ stereotypeClass.isAnnotationPresent(ScopeType.class) ||
stereotypeClass.isAnnotationPresent(DeploymentType.class) ||
stereotypeClass.isAnnotationPresent(InterceptorBindingType.class) ||
stereotypeClass.isAnnotationPresent(Named.class))
- return;
+ continue;
throw new DefinitionException("Direct child <" + stereotypeChild.getName() + "> of stereotype <" + stereotypeElement.getName() +
"> declaration must be scope type, or deployment type, or interceptor binding type, or javax.annotation.Named");
Added: 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 (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java 2009-04-08 08:55:15 UTC (rev 2342)
@@ -0,0 +1,39 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes;
+
+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.TestBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.foo.TestInterceptorBindingType;
+import org.jboss.jsr299.tck.tests.xml.annotationtypes.foo.TestStereotype;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+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")
+public class AnnotationTypesTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="9.4", id="a"),
+ @SpecAssertion(section="9.4", id="b"),
+ @SpecAssertion(section="9.4", id="c"),
+ @SpecAssertion(section="9.4", id="e"),
+ @SpecAssertion(section="9.4", id="f"),
+ @SpecAssertion(section="9.4", id="g"),
+ @SpecAssertion(section="9.4.1", id="a"),
+ @SpecAssertion(section="9.4.1", id="d"),
+ @SpecAssertion(section="9.4.1", id="e"),
+ @SpecAssertion(section="9.4.1", id="f"),
+ @SpecAssertion(section="9.4.1", id="g"),
+ @SpecAssertion(section="9.4.2", id="a"),
+ @SpecAssertion(section="9.4.2", id="d")
+ })
+ public void testNamespaceAggregation()
+ {
+ assert true;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/AnotherTestInterceptorBindingType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/AnotherTestInterceptorBindingType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/AnotherTestInterceptorBindingType.java 2009-04-08 08:55:15 UTC (rev 2342)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.foo;
+
+import javax.interceptor.InterceptorBindingType;
+
+@InterceptorBindingType
+public @interface AnotherTestInterceptorBindingType
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestBindingType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestBindingType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestBindingType.java 2009-04-08 08:55:15 UTC (rev 2342)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.foo;
+
+public @interface TestBindingType
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestDeploymentType.java 2009-04-08 08:55:15 UTC (rev 2342)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.foo;
+
+import javax.inject.DeploymentType;
+
+@DeploymentType
+public @interface TestDeploymentType
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestInterceptorBindingType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestInterceptorBindingType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestInterceptorBindingType.java 2009-04-08 08:55:15 UTC (rev 2342)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.foo;
+
+public @interface TestInterceptorBindingType
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestNamed.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestNamed.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestNamed.java 2009-04-08 08:55:15 UTC (rev 2342)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.foo;
+
+import javax.annotation.Named;
+
+@Named
+public @interface TestNamed
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestScopeType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestScopeType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestScopeType.java 2009-04-08 08:55:15 UTC (rev 2342)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.foo;
+
+import javax.context.ScopeType;
+
+@ScopeType
+public @interface TestScopeType
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/foo/TestStereotype.java 2009-04-08 08:55:15 UTC (rev 2342)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.xml.annotationtypes.foo;
+
+public @interface TestStereotype
+{
+
+}
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-08 00:20:36 UTC (rev 2341)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java 2009-04-08 08:55:15 UTC (rev 2342)
@@ -28,10 +28,7 @@
@SpecAssertion(section="9", id="d"),
@SpecAssertion(section="9.1", id="b"),
@SpecAssertion(section="9.1", id="c"),
- @SpecAssertion(section="9.1", id="d"),
- @SpecAssertion(section="9.3", id="a"),
- @SpecAssertion(section="9.3", id="b"),
- @SpecAssertion(section="9.3", id="c")
+ @SpecAssertion(section="9.1", id="d")
})
public void testXmlBasedMetadata()
{
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/xml/annotationtypes/beans.xml 2009-04-08 08:55:15 UTC (rev 2342)
@@ -0,0 +1,17 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:dd="urn:java:ee urn:java:org.jboss.jsr299.tck.tests.xml.annotationtypes.foo">
+ <dd:TestBindingType>
+ <BindingType />
+ </dd:TestBindingType>
+ <dd:TestInterceptorBindingType>
+ <InterceptorBindingType />
+ <dd:AnotherTestInterceptorBindingType />
+ </dd:TestInterceptorBindingType>
+ <dd:TestStereotype>
+ <Stereotype />
+ <dd:TestScopeType />
+ <dd:TestDeploymentType />
+ <dd:AnotherTestInterceptorBindingType />
+ <dd:TestNamed />
+ </dd:TestStereotype>
+</Beans>
\ No newline at end of file
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2341 - test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-07 20:20:36 -0400 (Tue, 07 Apr 2009)
New Revision: 2341
Added:
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/EnumerationIterable.java
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/EnumerationIterator.java
Log:
minor
Added: test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/EnumerationIterable.java
===================================================================
--- test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/EnumerationIterable.java (rev 0)
+++ test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/EnumerationIterable.java 2009-04-08 00:20:36 UTC (rev 2341)
@@ -0,0 +1,37 @@
+package org.jboss.testharness.impl.util;
+
+import java.util.Enumeration;
+import java.util.Iterator;
+
+/**
+ * An Enumeration -> Iteratble adaptor
+ *
+ * @author Pete Muir
+ * @see org.jboss.webbeans.util.EnumerationIterator
+ */
+class EnumerationIterable<T> implements Iterable<T>
+{
+ // The enumeration-iteartor
+ private EnumerationIterator<T> iterator;
+
+ /**
+ * Constructor
+ *
+ * @param enumeration The enumeration
+ */
+ public EnumerationIterable(Enumeration<T> enumeration)
+ {
+ this.iterator = new EnumerationIterator<T>(enumeration);
+ }
+
+ /**
+ * Gets an iterator
+ *
+ * @return The iterator
+ */
+ public Iterator<T> iterator()
+ {
+ return iterator;
+ }
+
+}
\ No newline at end of file
Property changes on: test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/EnumerationIterable.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/EnumerationIterator.java
===================================================================
--- test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/EnumerationIterator.java (rev 0)
+++ test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/EnumerationIterator.java 2009-04-08 00:20:36 UTC (rev 2341)
@@ -0,0 +1,55 @@
+package org.jboss.testharness.impl.util;
+
+import java.util.Enumeration;
+import java.util.Iterator;
+
+/**
+ * An enumeration -> iterator adapter
+ *
+ * @author Pete Muir
+ */
+@SuppressWarnings("unchecked")
+class EnumerationIterator<T> implements Iterator<T>
+{
+ // The enumeration
+ private Enumeration e;
+
+ /**
+ * Constructor
+ *
+ * @param e The enumeration
+ */
+ public EnumerationIterator(Enumeration e)
+ {
+ this.e = e;
+ }
+
+ /**
+ * Indicates if there are more items to iterate
+ *
+ * @return True if more, false otherwise
+ */
+ public boolean hasNext()
+ {
+ return e.hasMoreElements();
+ }
+
+ /**
+ * Gets the next item
+ *
+ * @return The next items
+ */
+ public T next()
+ {
+ return (T) e.nextElement();
+ }
+
+ /**
+ * Removes an item. Not supported
+ */
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+}
\ No newline at end of file
Property changes on: test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/EnumerationIterator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2340 - test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-07 20:16:32 -0400 (Tue, 07 Apr 2009)
New Revision: 2340
Modified:
ri/trunk/jboss-tck-runner/pom.xml
test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/ProfileServiceConnector.java
Log:
minor
Modified: ri/trunk/jboss-tck-runner/pom.xml
===================================================================
--- ri/trunk/jboss-tck-runner/pom.xml 2009-04-07 23:40:11 UTC (rev 2339)
+++ ri/trunk/jboss-tck-runner/pom.xml 2009-04-08 00:16:32 UTC (rev 2340)
@@ -186,7 +186,7 @@
<value>../jboss-as</value>
</property>
<property>
- <name>jboss.force.restart</name>
+ <name>org.jboss.testharness.container.forceRestart</name>
<value>true</value>
</property>
<property>
Modified: test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/ProfileServiceConnector.java
===================================================================
--- test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/ProfileServiceConnector.java 2009-04-07 23:40:11 UTC (rev 2339)
+++ test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/ProfileServiceConnector.java 2009-04-08 00:16:32 UTC (rev 2340)
@@ -33,6 +33,8 @@
private final File tmpdir;
private int deploymentCounter = 0;
private Integer maxDeployments;
+
+ private Boolean forceRestart;
public ProfileServiceConnector() throws Exception
@@ -142,6 +144,8 @@
{
if (deploymentCounter >= getMaxDeployments())
{
+ // Force into force-restart mode
+ forceRestart = true;
deploymentCounter = 0;
// Let everything stablise
removeFailedUnDeployments();
@@ -232,5 +236,18 @@
}
return maxDeployments;
}
+
+ @Override
+ protected Boolean getForceRestart()
+ {
+ if (forceRestart == null)
+ {
+ return super.getForceRestart();
+ }
+ else
+ {
+ return forceRestart;
+ }
+ }
}
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2339 - in extensions/trunk: logger/src/test/resources/META-INF and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-07 19:40:11 -0400 (Tue, 07 Apr 2009)
New Revision: 2339
Added:
extensions/trunk/logger/src/test/resources/META-INF/jboss-test-harness.properties
Removed:
extensions/trunk/logger/src/test/resources/META-INF/web-beans-tck.properties
Modified:
extensions/trunk/logger/pom.xml
extensions/trunk/tomcat/build/
extensions/trunk/xsd/
Log:
updates for harness changes
Modified: extensions/trunk/logger/pom.xml
===================================================================
--- extensions/trunk/logger/pom.xml 2009-04-07 23:37:11 UTC (rev 2338)
+++ extensions/trunk/logger/pom.xml 2009-04-07 23:40:11 UTC (rev 2339)
@@ -42,7 +42,7 @@
<dependency>
<groupId>org.jboss.test-harness</groupId>
- <artifactId>jboss-test-harness-jboss-as-5</artifactId>
+ <artifactId>jboss-test-harness-jboss-as-50</artifactId>
<scope>test</scope>
</dependency>
Copied: extensions/trunk/logger/src/test/resources/META-INF/jboss-test-harness.properties (from rev 2333, extensions/trunk/logger/src/test/resources/META-INF/web-beans-tck.properties)
===================================================================
--- extensions/trunk/logger/src/test/resources/META-INF/jboss-test-harness.properties (rev 0)
+++ extensions/trunk/logger/src/test/resources/META-INF/jboss-test-harness.properties 2009-04-07 23:40:11 UTC (rev 2339)
@@ -0,0 +1 @@
+org.jboss.testharness.testPackage=org.jboss.webbeans.test
\ No newline at end of file
Property changes on: extensions/trunk/logger/src/test/resources/META-INF/jboss-test-harness.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: extensions/trunk/logger/src/test/resources/META-INF/web-beans-tck.properties
===================================================================
--- extensions/trunk/logger/src/test/resources/META-INF/web-beans-tck.properties 2009-04-07 23:37:11 UTC (rev 2338)
+++ extensions/trunk/logger/src/test/resources/META-INF/web-beans-tck.properties 2009-04-07 23:40:11 UTC (rev 2339)
@@ -1 +0,0 @@
-org.jboss.testharness.testPackage=org.jboss.webbeans.test
\ No newline at end of file
Property changes on: extensions/trunk/tomcat/build
___________________________________________________________________
Name: svn:ignore
-
target
.classpath
.settings
.project
+
target
.classpath
.settings
.project
bin
Property changes on: extensions/trunk/xsd
___________________________________________________________________
Name: svn:ignore
- target
.settings
.project
.classpath
+
target
.settings
.project
.classpath
bin
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2338 - in ri/trunk: jboss-as and 8 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-04-07 19:37:11 -0400 (Tue, 07 Apr 2009)
New Revision: 2338
Added:
ri/trunk/jboss-tck-runner/src/main/resources/META-INF/jboss-test-harness.properties
ri/trunk/jboss-tck-runner/src/test/debug-resources/META-INF/jboss-test-harness.properties
ri/trunk/porting-package/src/main/resources/META-INF/jboss-test-harness.properties
ri/trunk/tests/src/main/resources/META-INF/jboss-test-harness.properties
ri/trunk/tests/src/test/resources/META-INF/jboss-test-harness.properties
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/DeploymentProperties.java
ri/trunk/jboss-tck-runner/src/main/resources/META-INF/web-beans-tck.properties
ri/trunk/jboss-tck-runner/src/test/debug-resources/META-INF/web-beans-tck.properties
ri/trunk/porting-package/src/main/resources/META-INF/web-beans-tck.properties
ri/trunk/tests/src/main/resources/META-INF/web-beans-tck.properties
ri/trunk/tests/src/test/resources/META-INF/web-beans-tck.properties
Modified:
ri/trunk/jboss-as/build.properties
ri/trunk/jboss-tck-runner/pom.xml
ri/trunk/tests/pom.xml
ri/trunk/version-matrix/pom.xml
Log:
updates for harness changes
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/DeploymentProperties.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/DeploymentProperties.java 2009-04-07 23:36:17 UTC (rev 2337)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/DeploymentProperties.java 2009-04-07 23:37:11 UTC (rev 2338)
@@ -1,175 +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.util;
-
-import static org.jboss.webbeans.util.Strings.split;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.resources.spi.ResourceLoader;
-import org.jboss.webbeans.resources.spi.ResourceLoadingException;
-
-/**
- * Utility class to load deployment properties
- *
- * @author Pete Muir
- */
-public class DeploymentProperties
-{
- // The resource bundle used to control Web Beans RI deployment
- public static final String RESOURCE_BUNDLE = "META-INF/web-beans-ri.properties";
-
- private static LogProvider log = Logging.getLogProvider(DeploymentProperties.class);
-
- // The class to work from
- private ResourceLoader resourceLoader;
-
- /**
- * Constructor
- *
- * @param classLoader The classloader to work on
- */
- public DeploymentProperties(ResourceLoader classLoader)
- {
- this.resourceLoader = classLoader;
- }
-
- /**
- * Get a list of possible values for a given key.
- *
- * First, System properties are tried, followed by the specified resource
- * bundle (first in classpath only).
- *
- * Colon (:) deliminated lists are split out.
- *
- * @param key The key to search for
- * @return A list of possible values. An empty list is returned if there are
- * no matches.
- */
- public List<String> getPropertyValues(String key)
- {
- List<String> values = new ArrayList<String>();
- addPropertiesFromSystem(key, values);
- addPropertiesFromResourceBundle(key, values);
- return values;
- }
-
- /**
- * Adds matches from system properties
- *
- * @param key The key to match
- * @param values The currently found values
- */
- private void addPropertiesFromSystem(String key, List<String> values)
- {
- addProperty(key, System.getProperty(key), values);
- }
-
- /**
- * Adds matches from detected resource bundles
- *
- * @param key The key to match
- * @param values The currently found values
- */
- private void addPropertiesFromResourceBundle(String key, List<String> values)
- {
- try
- {
- for (URL url : resourceLoader.getResources(RESOURCE_BUNDLE))
- {
- Properties properties = new Properties();
- InputStream propertyStream = url.openStream();
- try
- {
- properties.load(propertyStream);
- addProperty(key, properties.getProperty(key), values);
- }
- finally
- {
- if (propertyStream != null)
- {
- propertyStream.close();
- }
- }
- }
- }
- catch (IOException e)
- {
- // No - op, file is optional
- }
- }
-
- /**
- * Add the property to the set of properties only if it hasn't already been
- * added
- *
- * @param key The key searched for
- * @param value The value of the property
- * @param values The currently found values
- */
- private void addProperty(String key, String value, List<String> values)
- {
- if (value != null)
- {
- String[] properties = split(value, ":");
- for (String property : properties)
- {
- values.add(property);
- }
-
- }
- }
-
- /**
- * Gets the possible implementation class for a given property for which the
- * values are classanames
- *
- * @param deploymentProperties The deployment properties object to use
- * @param resourceLoader The resource laoder to use to attempt
- * @param propertyName The name of the property to load
- * @return A set of classes specified
- */
- public static <T> Set<Class<? extends T>> getClasses(DeploymentProperties deploymentProperties, ResourceLoader resourceLoader, String propertyName, Class<T> expectedType)
- {
- Set<Class<? extends T>> classes = new HashSet<Class<? extends T>>();
- for (String className : deploymentProperties.getPropertyValues(propertyName))
- {
- try
- {
- @SuppressWarnings("unchecked")
- Class<? extends T> classForName = (Class<? extends T>) resourceLoader.classForName(className);
- classes.add(classForName);
- }
- catch (ResourceLoadingException e)
- {
- log.debug("Unable to load class " + className + " for property " + propertyName, e);
- }
- }
- return classes;
- }
-
-}
Modified: ri/trunk/jboss-as/build.properties
===================================================================
--- ri/trunk/jboss-as/build.properties 2009-04-07 23:36:17 UTC (rev 2337)
+++ ri/trunk/jboss-as/build.properties 2009-04-07 23:37:11 UTC (rev 2338)
@@ -1,9 +1,9 @@
# Container a number of properties associated with installing Web Beans into JBoss AS and running the TCK in JBoss AS
#jboss.home=/Applications/jboss-5.0.1.GA
-java.opts=-Xms128m -Xmx384m -XX:MaxPermSize=128m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
+org.jboss.testharness.container.javaOpts=-Xms128m -Xmx384m -XX:MaxPermSize=128m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
# time to allow before attempting to restart JBoss AS
-# jboss.shutdown.delay=15000
+# org.jboss.testharness.container.shutdownDelay=15000
# maximum number of TCK tests to deploy before restarting JBoss AS
# jboss.deployments.restart = 25
Modified: ri/trunk/jboss-tck-runner/pom.xml
===================================================================
--- ri/trunk/jboss-tck-runner/pom.xml 2009-04-07 23:36:17 UTC (rev 2337)
+++ ri/trunk/jboss-tck-runner/pom.xml 2009-04-07 23:37:11 UTC (rev 2338)
@@ -40,7 +40,7 @@
<dependency>
<groupId>org.jboss.test-harness</groupId>
- <artifactId>jboss-test-harness-jboss-as-5</artifactId>
+ <artifactId>jboss-test-harness-jboss-as-50</artifactId>
</dependency>
@@ -139,11 +139,11 @@
<value>false</value>
</property>
<property>
- <name>jboss-as.dir</name>
+ <name>org.jboss.testharness.container.extraConfigurationDir</name>
<value>../jboss-as</value>
</property>
<property>
- <name>jboss.force.restart</name>
+ <name>org.jboss.testharness.container.forceRestart</name>
<value>false</value>
</property>
<property>
@@ -182,7 +182,7 @@
<value>false</value>
</property>
<property>
- <name>jboss-as.dir</name>
+ <name>org.jboss.testharness.container.extraConfigurationDir</name>
<value>../jboss-as</value>
</property>
<property>
Copied: ri/trunk/jboss-tck-runner/src/main/resources/META-INF/jboss-test-harness.properties (from rev 2333, ri/trunk/jboss-tck-runner/src/main/resources/META-INF/web-beans-tck.properties)
===================================================================
--- ri/trunk/jboss-tck-runner/src/main/resources/META-INF/jboss-test-harness.properties (rev 0)
+++ ri/trunk/jboss-tck-runner/src/main/resources/META-INF/jboss-test-harness.properties 2009-04-07 23:37:11 UTC (rev 2338)
@@ -0,0 +1 @@
+org.jboss.testharness.api.TestLauncher=org.jboss.testharness.impl.runner.servlet.ServletTestLauncher
\ No newline at end of file
Property changes on: ri/trunk/jboss-tck-runner/src/main/resources/META-INF/jboss-test-harness.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/jboss-tck-runner/src/main/resources/META-INF/web-beans-tck.properties
===================================================================
--- ri/trunk/jboss-tck-runner/src/main/resources/META-INF/web-beans-tck.properties 2009-04-07 23:36:17 UTC (rev 2337)
+++ ri/trunk/jboss-tck-runner/src/main/resources/META-INF/web-beans-tck.properties 2009-04-07 23:37:11 UTC (rev 2338)
@@ -1 +0,0 @@
-org.jboss.testharness.api.TestLauncher=org.jboss.testharness.impl.runner.servlet.ServletTestLauncher
\ No newline at end of file
Copied: ri/trunk/jboss-tck-runner/src/test/debug-resources/META-INF/jboss-test-harness.properties (from rev 2333, ri/trunk/jboss-tck-runner/src/test/debug-resources/META-INF/web-beans-tck.properties)
===================================================================
--- ri/trunk/jboss-tck-runner/src/test/debug-resources/META-INF/jboss-test-harness.properties (rev 0)
+++ ri/trunk/jboss-tck-runner/src/test/debug-resources/META-INF/jboss-test-harness.properties 2009-04-07 23:37:11 UTC (rev 2338)
@@ -0,0 +1,7 @@
+# Configuration for running incontainer tests from your IDE
+# Alter the path webbeans accordingly (relative from the tck/impl dir)
+org.jboss.testharness.standalone=false
+org.jboss.testharness.container.extraConfigurationDir=../../webbeans/jboss-as
+org.jboss.testharness.container.forceRestart=false
+org.jboss.testharness.libraryDirectory=../../webbeans/jboss-tck-runner/target/dependency/lib
+org.jboss.testharness.runIntegrationTests=true
\ No newline at end of file
Deleted: ri/trunk/jboss-tck-runner/src/test/debug-resources/META-INF/web-beans-tck.properties
===================================================================
--- ri/trunk/jboss-tck-runner/src/test/debug-resources/META-INF/web-beans-tck.properties 2009-04-07 23:36:17 UTC (rev 2337)
+++ ri/trunk/jboss-tck-runner/src/test/debug-resources/META-INF/web-beans-tck.properties 2009-04-07 23:37:11 UTC (rev 2338)
@@ -1,7 +0,0 @@
-# Configuration for running incontainer tests from your IDE
-# Alter the path webbeans accordingly (relative from the tck/impl dir)
-org.jboss.testharness.standalone=false
-jboss-as.dir=../../webbeans/jboss-as
-jboss.force.restart=false
-org.jboss.testharness.libraryDirectory=../../webbeans/jboss-tck-runner/target/dependency/lib
-org.jboss.testharness.runIntegrationTests=true
\ No newline at end of file
Copied: ri/trunk/porting-package/src/main/resources/META-INF/jboss-test-harness.properties (from rev 2333, ri/trunk/porting-package/src/main/resources/META-INF/web-beans-tck.properties)
===================================================================
--- ri/trunk/porting-package/src/main/resources/META-INF/jboss-test-harness.properties (rev 0)
+++ ri/trunk/porting-package/src/main/resources/META-INF/jboss-test-harness.properties 2009-04-07 23:37:11 UTC (rev 2338)
@@ -0,0 +1,5 @@
+org.jboss.jsr299.tck.spi.Managers=org.jboss.webbeans.tck.ManagersImpl
+org.jboss.jsr299.tck.spi.Beans=org.jboss.webbeans.tck.BeansImpl
+org.jboss.jsr299.tck.spi.Contexts=org.jboss.webbeans.tck.ContextsImpl
+org.jboss.testharness.spi.StandaloneContainers=org.jboss.webbeans.tck.StandaloneContainersImpl
+org.jboss.jsr299.tck.spi.EL=org.jboss.webbeans.tck.ELImpl
\ No newline at end of file
Deleted: ri/trunk/porting-package/src/main/resources/META-INF/web-beans-tck.properties
===================================================================
--- ri/trunk/porting-package/src/main/resources/META-INF/web-beans-tck.properties 2009-04-07 23:36:17 UTC (rev 2337)
+++ ri/trunk/porting-package/src/main/resources/META-INF/web-beans-tck.properties 2009-04-07 23:37:11 UTC (rev 2338)
@@ -1,5 +0,0 @@
-org.jboss.jsr299.tck.spi.Managers=org.jboss.webbeans.tck.ManagersImpl
-org.jboss.jsr299.tck.spi.Beans=org.jboss.webbeans.tck.BeansImpl
-org.jboss.jsr299.tck.spi.Contexts=org.jboss.webbeans.tck.ContextsImpl
-org.jboss.testharness.spi.StandaloneContainers=org.jboss.webbeans.tck.StandaloneContainersImpl
-org.jboss.jsr299.tck.spi.EL=org.jboss.webbeans.tck.ELImpl
\ No newline at end of file
Modified: ri/trunk/tests/pom.xml
===================================================================
--- ri/trunk/tests/pom.xml 2009-04-07 23:36:17 UTC (rev 2337)
+++ ri/trunk/tests/pom.xml 2009-04-07 23:37:11 UTC (rev 2338)
@@ -40,7 +40,7 @@
<dependency>
<groupId>org.jboss.test-harness</groupId>
- <artifactId>jboss-test-harness-jboss-as-5</artifactId>
+ <artifactId>jboss-test-harness-jboss-as-50</artifactId>
<scope>test</scope>
</dependency>
@@ -169,11 +169,11 @@
<value>false</value>
</property>
<property>
- <name>jboss-as.dir</name>
+ <name>org.jboss.testharness.container.extraConfigurationDir</name>
<value>../jboss-as</value>
</property>
<property>
- <name>jboss.force.restart</name>
+ <name>org.jboss.testharness.container.forceRestart</name>
<value>true</value>
</property>
<property>
Copied: ri/trunk/tests/src/main/resources/META-INF/jboss-test-harness.properties (from rev 2334, ri/trunk/tests/src/main/resources/META-INF/web-beans-tck.properties)
===================================================================
--- ri/trunk/tests/src/main/resources/META-INF/jboss-test-harness.properties (rev 0)
+++ ri/trunk/tests/src/main/resources/META-INF/jboss-test-harness.properties 2009-04-07 23:37:11 UTC (rev 2338)
@@ -0,0 +1,2 @@
+org.jboss.testharness.spi.StandaloneContainers=org.jboss.webbeans.test.StandaloneContainersImpl
+org.jboss.testharness.api.TestLauncher=org.jboss.testharness.impl.runner.servlet.ServletTestLauncher
Deleted: ri/trunk/tests/src/main/resources/META-INF/web-beans-tck.properties
===================================================================
--- ri/trunk/tests/src/main/resources/META-INF/web-beans-tck.properties 2009-04-07 23:36:17 UTC (rev 2337)
+++ ri/trunk/tests/src/main/resources/META-INF/web-beans-tck.properties 2009-04-07 23:37:11 UTC (rev 2338)
@@ -1,2 +0,0 @@
-org.jboss.testharness.spi.StandaloneContainers=org.jboss.webbeans.test.StandaloneContainersImpl
-org.jboss.testharness.api.TestLauncher=org.jboss.testharness.impl.runner.servlet.ServletTestLauncher
Copied: ri/trunk/tests/src/test/resources/META-INF/jboss-test-harness.properties (from rev 2334, ri/trunk/tests/src/test/resources/META-INF/web-beans-tck.properties)
===================================================================
--- ri/trunk/tests/src/test/resources/META-INF/jboss-test-harness.properties (rev 0)
+++ ri/trunk/tests/src/test/resources/META-INF/jboss-test-harness.properties 2009-04-07 23:37:11 UTC (rev 2338)
@@ -0,0 +1 @@
+org.jboss.testharness.testPackage=org.jboss.webbeans.test
Deleted: ri/trunk/tests/src/test/resources/META-INF/web-beans-tck.properties
===================================================================
--- ri/trunk/tests/src/test/resources/META-INF/web-beans-tck.properties 2009-04-07 23:36:17 UTC (rev 2337)
+++ ri/trunk/tests/src/test/resources/META-INF/web-beans-tck.properties 2009-04-07 23:37:11 UTC (rev 2338)
@@ -1 +0,0 @@
-org.jboss.testharness.testPackage=org.jboss.webbeans.test
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-04-07 23:36:17 UTC (rev 2337)
+++ ri/trunk/version-matrix/pom.xml 2009-04-07 23:37:11 UTC (rev 2338)
@@ -296,7 +296,7 @@
<dependency>
<groupId>org.jboss.test-harness</groupId>
- <artifactId>jboss-test-harness-jboss-as-5</artifactId>
+ <artifactId>jboss-test-harness-jboss-as-50</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
15 years, 9 months