Author: pete.muir(a)jboss.org
Date: 2009-03-14 21:47:28 -0400 (Sat, 14 Mar 2009)
New Revision: 2000
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Animal.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlyAnimal.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlySpider.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DefangedTarantula.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Hound.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/HoundLocal.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Salmon.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ScottishFish.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/SeaBass.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Sole.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Spider.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tame.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tarantula.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/TarantulaProducer.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tuna.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Whitefish.java
ri/trunk/spi/src/test/java/org/
ri/trunk/spi/src/test/java/org/jboss/
ri/trunk/spi/src/test/java/org/jboss/webbeans/
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/
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/MockBootstrap.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEjbServices.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockNamingContext.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceLoader.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockWebBeanDiscovery.java
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockLifecycle.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/EjbDiscovery.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/helpers/ForwardingEjbDiscovery.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java
ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Bootstrap.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/ServiceRegistry.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/AbstractBootstrap.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingBootstrap.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbServices.java
Log:
WBRI-175, WBRI-178
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-03-15
00:12:08 UTC (rev 1999)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -268,26 +268,28 @@
*/
protected void injectEjbAndCommonFields(T beanInstance)
{
- NamingContext namingContext = manager.getServices().get(NamingContext.class);
- EjbServices ejbServices = manager.getServices().get(EjbServices.class);
- for (AnnotatedInjectionPoint<?, ?> injectionPoint : ejbInjectionPoints)
+ if (getManager().getServices().contains(EjbServices.class))
{
- Object ejbInstance = ejbServices.resolveEjb(injectionPoint, namingContext);
- injectionPoint.inject(beanInstance, ejbInstance);
+ EjbServices ejbServices = manager.getServices().get(EjbServices.class);
+ NamingContext namingContext = manager.getServices().get(NamingContext.class);
+ for (AnnotatedInjectionPoint<?, ?> injectionPoint : ejbInjectionPoints)
+ {
+ Object ejbInstance = ejbServices.resolveEjb(injectionPoint, namingContext);
+ injectionPoint.inject(beanInstance, ejbInstance);
+ }
+
+ for (AnnotatedInjectionPoint<?, ?> injectionPoint :
persistenceUnitInjectionPoints)
+ {
+ Object puInstance = ejbServices.resolvePersistenceContext(injectionPoint,
namingContext);
+ injectionPoint.inject(beanInstance, puInstance);
+ }
+
+ for (AnnotatedInjectionPoint<?, ?> injectionPoint :
resourceInjectionPoints)
+ {
+ Object resourceInstance = ejbServices.resolveResource(injectionPoint,
namingContext);
+ injectionPoint.inject(beanInstance, resourceInstance);
+ }
}
-
- for (AnnotatedInjectionPoint<?, ?> injectionPoint :
persistenceUnitInjectionPoints)
- {
- Object puInstance = ejbServices.resolvePersistenceContext(injectionPoint,
namingContext);
- injectionPoint.inject(beanInstance, puInstance);
- }
-
- for (AnnotatedInjectionPoint<?, ?> injectionPoint : resourceInjectionPoints)
- {
- Object resourceInstance = ejbServices.resolveResource(injectionPoint,
namingContext);
- injectionPoint.inject(beanInstance, resourceInstance);
- }
-
}
/**
@@ -302,9 +304,12 @@
initInjectionPoints();
initPostConstruct();
initPreDestroy();
- initEjbInjectionPoints();
- initPersistenceUnitInjectionPoints();
- initResourceInjectionPoints();
+ if (getManager().getServices().contains(EjbServices.class))
+ {
+ initEjbInjectionPoints();
+ initPersistenceUnitInjectionPoints();
+ initResourceInjectionPoints();
+ }
}
/**
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-03-15
00:12:08 UTC (rev 1999)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -27,6 +27,7 @@
import org.jboss.webbeans.bean.standard.ManagerBean;
import org.jboss.webbeans.bootstrap.api.Bootstrap;
import org.jboss.webbeans.bootstrap.api.helpers.AbstractBootstrap;
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.context.ApplicationContext;
import org.jboss.webbeans.context.ConversationContext;
import org.jboss.webbeans.context.DependentContext;
@@ -80,7 +81,7 @@
}
if (!getServices().contains(EjbServices.class))
{
- log.info("EJB services not available. Session beans, injection into
non-contextual EJBs, injection of @Resource, @PersistenceContext and @EJB in simple beans,
injection of Java EE resources and JMS resources will not be available.");
+ log.info("EJB services not available. Session beans will be simple beans,
injection into non-contextual EJBs, injection of @Resource, @PersistenceContext and @EJB
in simple beans, injection of Java EE resources and JMS resources will not be
available.");
}
this.manager = new ManagerImpl(getServices());
getServices().get(NamingContext.class).bind(ManagerImpl.JNDI_KEY, getManager());
@@ -122,18 +123,6 @@
{
throw new IllegalStateException("Manager has not been
initialized");
}
- if (getWebBeanDiscovery() == null)
- {
- throw new IllegalStateException("WebBeanDiscovery not set");
- }
- if (getEjbDiscovery() == null)
- {
- throw new IllegalStateException("EjbDiscovery is not set");
- }
- if (getResourceLoader() == null)
- {
- throw new IllegalStateException("ResourceLoader not set");
- }
if (getApplicationContext() == null)
{
throw new IllegalStateException("No application context BeanStore
set");
@@ -141,10 +130,13 @@
beginApplication(getApplicationContext());
BeanStore requestBeanStore = new ConcurrentHashMapBeanStore();
beginDeploy(requestBeanStore);
- // Must populate EJB cache first, as we need it to detect whether a
- // bean is an EJB!
- manager.getEjbDescriptorCache().addAll(getEjbDiscovery().discoverEjbs());
- BeansXmlParser parser = new BeansXmlParser(getResourceLoader(),
getWebBeanDiscovery().discoverWebBeansXml());
+ if (getServices().contains(EjbServices.class))
+ {
+ // Must populate EJB cache first, as we need it to detect whether a
+ // bean is an EJB!
+
manager.getEjbDescriptorCache().addAll(getServices().get(EjbServices.class).discoverEjbs());
+ }
+ BeansXmlParser parser = new
BeansXmlParser(getServices().get(ResourceLoader.class),
getServices().get(WebBeanDiscovery.class).discoverWebBeansXml());
parser.parse();
List<Class<? extends Annotation>> enabledDeploymentTypes =
parser.getEnabledDeploymentTypes();
if (enabledDeploymentTypes != null)
@@ -152,7 +144,7 @@
manager.setEnabledDeploymentTypes(enabledDeploymentTypes);
}
log.info("Deployment types: " + manager.getEnabledDeploymentTypes());
- registerBeans(getWebBeanDiscovery().discoverWebBeanClasses());
+
registerBeans(getServices().get(WebBeanDiscovery.class).discoverWebBeanClasses());
manager.fireEvent(manager, new InitializedLiteral());
log.info("Web Beans initialized. Validating beans.");
manager.getResolver().resolveInjectionPoints();
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java (from rev
1999, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockLifecycle.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,38 @@
+/*
+ * 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.mock;
+
+import org.jboss.webbeans.bootstrap.api.Environments;
+import org.jboss.webbeans.ejb.spi.EjbServices;
+import org.jboss.webbeans.transaction.spi.TransactionServices;
+
+public class MockEELifecycle extends MockServletLifecycle
+{
+
+ private static final TransactionServices MOCK_TRANSACTION_SERVICES = new
MockTransactionServices();
+
+ public MockEELifecycle()
+ {
+ super();
+ getBootstrap().getServices().add(TransactionServices.class,
MOCK_TRANSACTION_SERVICES);
+ getBootstrap().getServices().add(EjbServices.class, new
MockEjBServices(getWebBeanDiscovery()));
+ getBootstrap().setEnvironment(Environments.EE);
+ }
+
+
+
+}
Property changes on:
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java 2009-03-15
00:12:08 UTC (rev 1999)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -11,13 +11,22 @@
import javax.inject.manager.InjectionPoint;
import javax.persistence.PersistenceContext;
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.ejb.api.EjbReference;
import org.jboss.webbeans.ejb.spi.EjbDescriptor;
import org.jboss.webbeans.ejb.spi.EjbServices;
import org.jboss.webbeans.resources.spi.NamingContext;
-final class MockEjBServices implements EjbServices
+public class MockEjBServices implements EjbServices
{
+
+ private final MockEjbDiscovery ejbDiscovery;
+
+ public MockEjBServices(WebBeanDiscovery webBeanDiscovery)
+ {
+ this.ejbDiscovery = new MockEjbDiscovery(webBeanDiscovery);
+ }
+
public Class<? extends Annotation> getEJBAnnotation()
{
return EJB.class;
@@ -52,6 +61,11 @@
{
// No-op
}
+
+ public Iterable<EjbDescriptor<?>> discoverEjbs()
+ {
+ return ejbDiscovery.discoverEjbs();
+ }
public <T> EjbReference<T> resolveEJB(EjbDescriptor<T>
ejbDescriptor, NamingContext naming)
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java 2009-03-15
00:12:08 UTC (rev 1999)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -26,11 +26,10 @@
import javax.ejb.Stateful;
import javax.ejb.Stateless;
-import org.jboss.webbeans.bootstrap.spi.EjbDiscovery;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.ejb.spi.EjbDescriptor;
-public class MockEjbDiscovery implements EjbDiscovery
+public class MockEjbDiscovery
{
private final WebBeanDiscovery webBeanDiscovery;
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockLifecycle.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockLifecycle.java 2009-03-15
00:12:08 UTC (rev 1999)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockLifecycle.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -1,114 +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.mock;
-
-
-
-import org.jboss.webbeans.bootstrap.WebBeansBootstrap;
-import org.jboss.webbeans.bootstrap.spi.EjbDiscovery;
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-import org.jboss.webbeans.context.api.BeanStore;
-import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
-import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.resources.spi.NamingContext;
-import org.jboss.webbeans.resources.spi.ResourceLoader;
-import org.jboss.webbeans.servlet.AbstractLifecycle;
-import org.jboss.webbeans.transaction.spi.TransactionServices;
-
-public class MockLifecycle extends AbstractLifecycle
-{
-
- private static final EjbServices MOCK_EJB_RESOLVER = new MockEjBServices();
- private static final ResourceLoader MOCK_RESOURCE_LOADER = new MockResourceLoader();
- private static final TransactionServices MOCK_TRANSACTION_SERVICES = new
MockTransactionServices();
-
- private final WebBeansBootstrap bootstrap;
- private final MockWebBeanDiscovery webBeanDiscovery;
- private final BeanStore applicationBeanStore = new ConcurrentHashMapBeanStore();
- private final BeanStore sessionBeanStore = new ConcurrentHashMapBeanStore();
- private final BeanStore requestBeanStore = new ConcurrentHashMapBeanStore();
-
- public MockLifecycle()
- {
- this(new MockWebBeanDiscovery());
- }
-
- public MockLifecycle(MockWebBeanDiscovery mockWebBeanDiscovery)
- {
- this.webBeanDiscovery = mockWebBeanDiscovery;
- if (webBeanDiscovery == null)
- {
- throw new IllegalStateException("No WebBeanDiscovery is available");
- }
- bootstrap = new WebBeansBootstrap();
- bootstrap.getServices().add(NamingContext.class, new MockNamingContext(null));
- bootstrap.getServices().add(EjbServices.class, MOCK_EJB_RESOLVER);
- bootstrap.getServices().add(ResourceLoader.class, MOCK_RESOURCE_LOADER);
- bootstrap.getServices().add(WebBeanDiscovery.class, webBeanDiscovery);
- bootstrap.setApplicationContext(applicationBeanStore);
- bootstrap.getServices().add(TransactionServices.class, MOCK_TRANSACTION_SERVICES);
- bootstrap.getServices().add(EjbDiscovery.class, new
MockEjbDiscovery(webBeanDiscovery));
- bootstrap.initialize();
- }
-
- public MockWebBeanDiscovery getWebBeanDiscovery()
- {
- return webBeanDiscovery;
- }
-
- public WebBeansBootstrap getBootstrap()
- {
- return bootstrap;
- }
-
- public void beginApplication()
- {
- bootstrap.boot();
- }
-
- public void endApplication()
- {
-
- }
-
- public void resetContexts()
- {
-
- }
-
- public void beginRequest()
- {
- super.beginRequest("Mock", requestBeanStore);
- }
-
- public void endRequest()
- {
- super.endRequest("Mock", requestBeanStore);
- }
-
- public void beginSession()
- {
- super.restoreSession("Mock", sessionBeanStore);
- }
-
- public void endSession()
- {
- // TODO Conversation handling breaks this :-(
- //super.endSession("Mock", sessionBeanStore);
- }
-
-}
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
(from rev 1999, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockLifecycle.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,87 @@
+package org.jboss.webbeans.mock;
+
+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.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
+{
+ private static final ResourceLoader MOCK_RESOURCE_LOADER = new MockResourceLoader();
+
+ private final WebBeansBootstrap bootstrap;
+ private final MockWebBeanDiscovery webBeanDiscovery;
+ private final BeanStore applicationBeanStore = new ConcurrentHashMapBeanStore();
+ private final BeanStore sessionBeanStore = new ConcurrentHashMapBeanStore();
+ private final BeanStore requestBeanStore = new ConcurrentHashMapBeanStore();
+
+ public MockServletLifecycle()
+ {
+ this.webBeanDiscovery = new MockWebBeanDiscovery();
+ if (webBeanDiscovery == null)
+ {
+ throw new IllegalStateException("No WebBeanDiscovery is available");
+ }
+ bootstrap = new WebBeansBootstrap();
+ bootstrap.setEnvironment(Environments.SERVLET);
+ bootstrap.getServices().add(NamingContext.class, new MockNamingContext(null));
+ bootstrap.getServices().add(ResourceLoader.class, MOCK_RESOURCE_LOADER);
+ bootstrap.getServices().add(WebBeanDiscovery.class, webBeanDiscovery);
+ bootstrap.setApplicationContext(applicationBeanStore);
+ }
+
+ public void initialize()
+ {
+ bootstrap.initialize();
+ }
+
+ public MockWebBeanDiscovery getWebBeanDiscovery()
+ {
+ return webBeanDiscovery;
+ }
+
+ public WebBeansBootstrap getBootstrap()
+ {
+ return bootstrap;
+ }
+
+ public void beginApplication()
+ {
+ bootstrap.boot();
+ }
+
+ public void endApplication()
+ {
+
+ }
+
+ public void resetContexts()
+ {
+
+ }
+
+ public void beginRequest()
+ {
+ super.beginRequest("Mock", requestBeanStore);
+ }
+
+ public void endRequest()
+ {
+ super.endRequest("Mock", requestBeanStore);
+ }
+
+ public void beginSession()
+ {
+ super.restoreSession("Mock", sessionBeanStore);
+ }
+
+ public void endSession()
+ {
+ // TODO Conversation handling breaks this :-(
+ //super.endSession("Mock", sessionBeanStore);
+ }
+}
Property changes on:
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java 2009-03-15
00:12:08 UTC (rev 1999)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -5,19 +5,35 @@
import org.jboss.testharness.api.DeploymentException;
import org.jboss.testharness.spi.StandaloneContainers;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.mock.MockLifecycle;
+import org.jboss.webbeans.mock.MockEELifecycle;
+import org.jboss.webbeans.mock.MockServletLifecycle;
import org.jboss.webbeans.mock.MockWebBeanDiscovery;
public class StandaloneContainersImpl implements StandaloneContainers
{
- private MockLifecycle lifecycle;
+ // 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
{
- this.lifecycle = new MockLifecycle();
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)
Modified:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java 2009-03-15
00:12:08 UTC (rev 1999)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.test.unit.bootstrap;
-import org.jboss.webbeans.mock.MockLifecycle;
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.mock.MockEELifecycle;
import org.testng.annotations.Test;
public class DiscoverFailsBootstrapTest
@@ -9,7 +10,9 @@
@Test(groups="bootstrap", expectedExceptions=IllegalStateException.class)
public void testDiscoverFails()
{
- MockLifecycle lifecycle = new MockLifecycle(null);
+ MockEELifecycle lifecycle = new MockEELifecycle();
+ lifecycle.getBootstrap().getServices().add(WebBeanDiscovery.class, null);
+ lifecycle.initialize();
lifecycle.beginApplication();
}
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Animal.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Animal.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Animal.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+interface Animal
+{
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Animal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlyAnimal.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlyAnimal.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlyAnimal.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+interface DeadlyAnimal
+{
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlyAnimal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlySpider.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlySpider.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlySpider.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+interface DeadlySpider extends DeadlyAnimal
+{
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlySpider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DefangedTarantula.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DefangedTarantula.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DefangedTarantula.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+class DefangedTarantula extends Tarantula
+{
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DefangedTarantula.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Hound.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Hound.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Hound.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import javax.annotation.Named;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+@Stateful
+@Tame
+@Named("Pongo")
+class Hound implements HoundLocal
+{
+ @Remove
+ public void bye() {
+ }
+
+ public void ping()
+ {
+
+ }
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Hound.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/HoundLocal.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/HoundLocal.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/HoundLocal.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import javax.ejb.Local;
+
+@Local
+public interface HoundLocal
+{
+
+ public void ping();
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/HoundLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Salmon.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Salmon.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Salmon.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import javax.annotation.Named;
+import javax.inject.Production;
+
+@Production
+@Named
+class Salmon implements ScottishFish
+{
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Salmon.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ScottishFish.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ScottishFish.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ScottishFish.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+interface ScottishFish extends Animal
+{
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ScottishFish.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/SeaBass.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/SeaBass.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/SeaBass.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import javax.context.RequestScoped;
+import javax.inject.Production;
+
+@Production
+@RequestScoped
+class SeaBass implements Animal
+{
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/SeaBass.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,104 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.inject.AnnotationLiteral;
+import javax.inject.manager.Bean;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.bean.ProducerMethodBean;
+import org.jboss.webbeans.bean.RIBean;
+import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.mock.MockEELifecycle;
+import org.jboss.webbeans.mock.MockServletLifecycle;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.unit.StandaloneContainersImpl;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+@Artifact
+public class ServletEnvironmentTest extends AbstractWebBeansTest
+{
+
+ @BeforeClass
+ @Override
+ public void beforeClass() throws Throwable
+ {
+ StandaloneContainersImpl.lifecycleClass = MockServletLifecycle.class;
+ super.beforeClass();
+ }
+
+ @Override
+ @AfterClass(alwaysRun=true)
+ public void afterClass() throws Exception
+ {
+ StandaloneContainersImpl.lifecycleClass = MockEELifecycle.class;
+ super.afterClass();
+ }
+
+ @Test(groups="incontainer-broken")
+ public void testSimpleBeans()
+ {
+ List<Bean<?>> beans = manager.getBeans();
+ Map<Class<?>, Bean<?>> classes = new HashMap<Class<?>,
Bean<?>>();
+ for (Bean<?> bean : beans)
+ {
+ if (bean instanceof RIBean)
+ {
+ classes.put(((RIBean<?>) bean).getType(), bean);
+ }
+ }
+ assert classes.containsKey(Tuna.class);
+ assert classes.containsKey(Salmon.class);
+ assert classes.containsKey(SeaBass.class);
+ assert classes.containsKey(Sole.class);
+
+ assert classes.get(Tuna.class) instanceof SimpleBean;
+ assert classes.get(Salmon.class) instanceof SimpleBean;
+ assert classes.get(SeaBass.class) instanceof SimpleBean;
+ assert classes.get(Sole.class) instanceof SimpleBean;
+ manager.getInstanceByType(Sole.class, new AnnotationLiteral<Whitefish>()
{}).ping();
+ }
+
+ @Test(groups="incontainer-broken")
+ public void testProducerMethodBean()
+ {
+ //deployBeans(TarantulaProducer.class);
+ List<Bean<?>> beans = manager.getBeans();
+ Map<Class<?>, Bean<?>> classes = new HashMap<Class<?>,
Bean<?>>();
+ for (Bean<?> bean : beans)
+ {
+ if (bean instanceof RIBean)
+ {
+ classes.put(((RIBean<?>) bean).getType(), bean);
+ }
+ }
+ assert classes.containsKey(TarantulaProducer.class);
+ assert classes.containsKey(Tarantula.class);
+
+ assert classes.get(TarantulaProducer.class) instanceof SimpleBean;
+ assert classes.get(Tarantula.class) instanceof ProducerMethodBean;
+ manager.getInstanceByType(Tarantula.class, new AnnotationLiteral<Tame>()
{}).ping();
+ }
+
+ @Test(groups="incontainer-broken")
+ public void testSingleEnterpriseBean()
+ {
+ List<Bean<?>> beans = manager.getBeans();
+ Map<Class<?>, Bean<?>> classes = new HashMap<Class<?>,
Bean<?>>();
+ for (Bean<?> bean : beans)
+ {
+ if (bean instanceof RIBean)
+ {
+ classes.put(((RIBean<?>) bean).getType(), bean);
+ }
+ }
+ assert classes.containsKey(Hound.class);
+ assert classes.get(Hound.class) instanceof SimpleBean;
+ manager.getInstanceByType(HoundLocal.class, new AnnotationLiteral<Tame>()
{}).ping();
+ }
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Sole.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Sole.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Sole.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import javax.annotation.Named;
+import javax.ejb.EJB;
+import javax.inject.Production;
+
+@Production
+@Whitefish
+@Named("whitefish")
+class Sole implements ScottishFish
+{
+
+ @EJB HoundLocal hound;
+
+ public void ping()
+ {
+
+ }
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Sole.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Spider.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Spider.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Spider.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+class Spider implements Animal
+{
+
+ public final void layEggs()
+ {
+
+ }
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Spider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tame.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tame.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tame.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Tame
+{
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tame.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tarantula.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tarantula.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tarantula.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+class Tarantula extends Spider implements DeadlySpider
+{
+
+ public void ping()
+ {
+
+ }
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tarantula.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/TarantulaProducer.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/TarantulaProducer.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/TarantulaProducer.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import javax.inject.Produces;
+
+public class TarantulaProducer
+{
+
+ @Produces @Tame public Tarantula produceTameTarantula()
+ {
+ return new DefangedTarantula();
+ }
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/TarantulaProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tuna.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tuna.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tuna.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import javax.context.RequestScoped;
+
+@RequestScoped
+class Tuna
+{
+
+ public String getName()
+ {
+ return "Ophir";
+ }
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tuna.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Whitefish.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Whitefish.java
(rev 0)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Whitefish.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+public @interface Whitefish
+{
+
+}
Property changes on:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Whitefish.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-03-15
00:12:08 UTC (rev 1999)
+++
ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -8,13 +8,13 @@
import org.jboss.testharness.spi.StandaloneContainers;
import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.mock.MockLifecycle;
+import org.jboss.webbeans.mock.MockEELifecycle;
import org.jboss.webbeans.mock.MockWebBeanDiscovery;
public class StandaloneContainersImpl implements StandaloneContainers
{
- private MockLifecycle lifecycle;
+ private MockEELifecycle lifecycle;
public void deploy(List<Class<? extends Annotation>>
enabledDeploymentTypes, Iterable<Class<?>> classes) throws
DeploymentException
{
@@ -23,7 +23,8 @@
public void deploy(List<Class<? extends Annotation>>
enabledDeploymentTypes, Iterable<Class<?>> classes, Iterable<URL>
beansXml) throws DeploymentException
{
- this.lifecycle = new MockLifecycle();
+ this.lifecycle = new MockEELifecycle();
+ lifecycle.initialize();
try
{
ManagerImpl manager = lifecycle.getBootstrap().getManager();
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Bootstrap.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Bootstrap.java 2009-03-15
00:12:08 UTC (rev 1999)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Bootstrap.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -16,7 +16,6 @@
*/
package org.jboss.webbeans.bootstrap.api;
-import org.jboss.webbeans.bootstrap.spi.EjbDiscovery;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.ejb.spi.EjbServices;
@@ -43,14 +42,6 @@
public void setWebBeanDiscovery(WebBeanDiscovery webBeanDiscovery);
/**
- * Set the EjbDiscovery to use
- *
- * @param ejbDiscovery
- */
- @Deprecated
- public void setEjbDiscovery(EjbDiscovery ejbDiscovery);
-
- /**
* Set the EjbServices to use
*
* @param ejbServices
@@ -137,4 +128,11 @@
*/
public void shutdown();
+ /**
+ * Get the services available to this bootstrap
+ *
+ * @return the services availabel
+ */
+ public ServiceRegistry getServices();
+
}
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-03-15
00:12:08 UTC (rev 1999)
+++
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -20,7 +20,6 @@
import java.util.HashSet;
import java.util.Set;
-import org.jboss.webbeans.bootstrap.spi.EjbDiscovery;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.ejb.spi.EjbServices;
import org.jboss.webbeans.resources.spi.NamingContext;
@@ -39,12 +38,12 @@
/**
* Java EE5 or Java EE6
*/
- EE(WebBeanDiscovery.class, EjbDiscovery.class, EjbServices.class,
TransactionServices.class, NamingContext.class, ResourceLoader.class),
+ EE(WebBeanDiscovery.class, EjbServices.class, TransactionServices.class,
NamingContext.class, ResourceLoader.class),
/**
* Java EE6 Web Profile
*/
- EE_WEB_PROFILE(WebBeanDiscovery.class, EjbDiscovery.class, EjbServices.class,
TransactionServices.class, NamingContext.class, ResourceLoader.class),
+ EE_WEB_PROFILE(WebBeanDiscovery.class, EjbServices.class, TransactionServices.class,
NamingContext.class, ResourceLoader.class),
/**
* Servlet container such as Tomcat
Modified:
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/ServiceRegistry.java
===================================================================
---
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/ServiceRegistry.java 2009-03-15
00:12:08 UTC (rev 1999)
+++
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/ServiceRegistry.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -1,3 +1,19 @@
+/*
+ * 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.bootstrap.api;
import java.util.HashMap;
@@ -3,5 +19,10 @@
import java.util.Map;
-
+/**
+ * A registry for services
+ *
+ * @author Pete Muir
+ *
+ */
public class ServiceRegistry
{
@@ -25,7 +46,14 @@
*/
public <S extends Service> void add(java.lang.Class<S> type, S service)
{
- services.put(type, service);
+ if (service == null)
+ {
+ services.remove(type);
+ }
+ else
+ {
+ services.put(type, service);
+ }
}
/**
Modified:
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/AbstractBootstrap.java
===================================================================
---
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/AbstractBootstrap.java 2009-03-15
00:12:08 UTC (rev 1999)
+++
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/AbstractBootstrap.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -22,7 +22,6 @@
import org.jboss.webbeans.bootstrap.api.Environment;
import org.jboss.webbeans.bootstrap.api.Service;
import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
-import org.jboss.webbeans.bootstrap.spi.EjbDiscovery;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.ejb.spi.EjbServices;
@@ -51,12 +50,6 @@
}
@Deprecated
- public void setEjbDiscovery(EjbDiscovery ejbDiscovery)
- {
- getServices().add(EjbDiscovery.class, ejbDiscovery);
- }
-
- @Deprecated
public void setEjbServices(EjbServices ejbServices)
{
getServices().add(EjbServices.class, ejbServices);
@@ -86,6 +79,7 @@
getServices().add(TransactionServices.class, transactionServices);
}
+ @Deprecated
public WebBeanDiscovery getWebBeanDiscovery()
{
return getServices().get(WebBeanDiscovery.class);
@@ -108,12 +102,6 @@
{
return getServices().get(EjbServices.class);
}
-
- @Deprecated
- public EjbDiscovery getEjbDiscovery()
- {
- return getServices().get(EjbDiscovery.class);
- }
@Deprecated
public TransactionServices getTransactionServices()
Modified:
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingBootstrap.java
===================================================================
---
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingBootstrap.java 2009-03-15
00:12:08 UTC (rev 1999)
+++
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/ForwardingBootstrap.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -17,7 +17,6 @@
package org.jboss.webbeans.bootstrap.api.helpers;
import org.jboss.webbeans.bootstrap.api.Bootstrap;
-import org.jboss.webbeans.bootstrap.spi.EjbDiscovery;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.ejb.spi.EjbServices;
@@ -56,12 +55,6 @@
}
@Deprecated
- public void setEjbDiscovery(EjbDiscovery ejbDiscovery)
- {
- delegate().setEjbDiscovery(ejbDiscovery);
- }
-
- @Deprecated
public void setEjbServices(EjbServices ejbServices)
{
delegate().setEjbServices(ejbServices);
Deleted: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/EjbDiscovery.java
===================================================================
---
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/EjbDiscovery.java 2009-03-15
00:12:08 UTC (rev 1999)
+++
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/EjbDiscovery.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -1,43 +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.bootstrap.spi;
-
-import org.jboss.webbeans.bootstrap.api.Service;
-import org.jboss.webbeans.ejb.spi.EjbDescriptor;
-
-
-
-/**
- * A container should implement this interface to allow the Web Beans RI to
- * discover the EJBs the application contains
- *
- * @author Pete Muir
- *
- */
-public interface EjbDiscovery extends Service
-{
- public static final String PROPERTY_NAME = EjbDiscovery.class.getName();
-
- /**
- * Gets a descriptor for each EJB in the application
- *
- * @return The bean class to descriptor map
- */
- public Iterable<EjbDescriptor<?>> discoverEjbs();
-
-}
Deleted:
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/helpers/ForwardingEjbDiscovery.java
===================================================================
---
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/helpers/ForwardingEjbDiscovery.java 2009-03-15
00:12:08 UTC (rev 1999)
+++
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/helpers/ForwardingEjbDiscovery.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -1,44 +0,0 @@
-package org.jboss.webbeans.bootstrap.spi.helpers;
-
-import org.jboss.webbeans.bootstrap.spi.EjbDiscovery;
-import org.jboss.webbeans.ejb.spi.EjbDescriptor;
-
-/**
- * An implementation of {@link EjbDiscovery} which forwards all its method calls
- * to another {@link EjbDiscovery}}. Subclasses should override one or more
- * methods to modify the behavior of the backing {@link EjbDiscovery} as desired
- * per the <a
- *
href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator
pattern</a>.
- *
- * @author Pete Muir
- *
- */
-public abstract class ForwardingEjbDiscovery implements EjbDiscovery
-{
-
- protected abstract EjbDiscovery delegate();
-
- public Iterable<EjbDescriptor<?>> discoverEjbs()
- {
- return delegate().discoverEjbs();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- return delegate().equals(obj);
- }
-
- @Override
- public String toString()
- {
- return delegate().toString();
- }
-
- @Override
- public int hashCode()
- {
- return delegate().hashCode();
- }
-
-}
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java 2009-03-15
00:12:08 UTC (rev 1999)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -97,6 +97,13 @@
public <T> EjbReference<T> resolveEJB(EjbDescriptor<T>
ejbDescriptor, NamingContext namingContext);
/**
+ * Gets a descriptor for each EJB in the application
+ *
+ * @return The bean class to descriptor map
+ */
+ public Iterable<EjbDescriptor<?>> discoverEjbs();
+
+ /**
* Get the annotation which defines an @EJB injection point
*
* @return the annotation which defines an @EJB injection point
Modified:
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbServices.java
===================================================================
---
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbServices.java 2009-03-15
00:12:08 UTC (rev 1999)
+++
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbServices.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -58,11 +58,11 @@
{
return delegate().resolveResource(injectionPoint, namingContext);
}
-//
-// public void removeEjb(Collection<Object> instance)
-// {
-// delegate().removeEjb(instance);
-// }
+
+ public Iterable<EjbDescriptor<?>> discoverEjbs()
+ {
+ return delegate().discoverEjbs();
+ }
@Override
public boolean equals(Object obj)
Added:
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
(rev 0)
+++
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,105 @@
+package org.jboss.webbeans.bootstrap.api.test;
+
+import org.jboss.webbeans.bootstrap.api.Environments;
+import org.jboss.webbeans.bootstrap.api.helpers.AbstractBootstrap;
+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.resources.spi.NamingContext;
+import org.jboss.webbeans.resources.spi.ResourceLoader;
+import org.jboss.webbeans.transaction.spi.TransactionServices;
+import org.testng.annotations.Test;
+
+public class BootstrapTest
+{
+
+ @Test(expectedExceptions=IllegalStateException.class)
+ public void testMissingWBDiscovery()
+ {
+ AbstractBootstrap bootstrap = new MockBootstrap();
+ bootstrap.setEnvironment(Environments.SE);
+ bootstrap.getServices().add(NamingContext.class, new MockNamingContext());
+ bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
+ bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
+ bootstrap.initialize();
+ }
+
+ @Test(expectedExceptions=IllegalStateException.class)
+ public void testMissingEjbServices()
+ {
+ 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.initialize();
+ }
+
+ @Test
+ public void testEEEnv()
+ {
+ 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.initialize();
+ }
+
+ @Test
+ public void testEEWebProfileEnv()
+ {
+ AbstractBootstrap bootstrap = new MockBootstrap();
+ bootstrap.setEnvironment(Environments.EE_WEB_PROFILE);
+ 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.initialize();
+ }
+
+ @Test(expectedExceptions=IllegalStateException.class)
+ public void testMissingTxServices()
+ {
+ AbstractBootstrap bootstrap = new MockBootstrap();
+ bootstrap.setEnvironment(Environments.EE);
+ bootstrap.getServices().add(NamingContext.class, new MockNamingContext());
+ bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
+ bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
+ bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
+ bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.initialize();
+ }
+
+ @Test
+ public void testSEEnv()
+ {
+ AbstractBootstrap bootstrap = new MockBootstrap();
+ bootstrap.setEnvironment(Environments.SE);
+ bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
+ bootstrap.getServices().add(NamingContext.class, new MockNamingContext());
+ bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
+ bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.initialize();
+ }
+
+ @Test
+ public void testServletEnv()
+ {
+ AbstractBootstrap bootstrap = new MockBootstrap();
+ bootstrap.setEnvironment(Environments.SERVLET);
+ bootstrap.getServices().add(NamingContext.class, new MockNamingContext());
+ bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
+ bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
+ bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.initialize();
+ }
+
+}
Property changes on:
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockBootstrap.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockBootstrap.java
(rev 0)
+++
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockBootstrap.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,32 @@
+package org.jboss.webbeans.bootstrap.api.test;
+
+import org.jboss.webbeans.bootstrap.api.helpers.AbstractBootstrap;
+import org.jboss.webbeans.manager.api.WebBeansManager;
+
+public class MockBootstrap extends AbstractBootstrap
+{
+
+ public void boot()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public WebBeansManager getManager()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void initialize()
+ {
+ verify();
+ }
+
+ public void shutdown()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on:
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockBootstrap.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEjbServices.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEjbServices.java
(rev 0)
+++
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEjbServices.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,63 @@
+package org.jboss.webbeans.bootstrap.api.test;
+
+import java.lang.annotation.Annotation;
+
+import javax.inject.manager.InjectionPoint;
+
+import org.jboss.webbeans.ejb.api.EjbReference;
+import org.jboss.webbeans.ejb.spi.EjbDescriptor;
+import org.jboss.webbeans.ejb.spi.EjbServices;
+import org.jboss.webbeans.resources.spi.NamingContext;
+
+public class MockEjbServices implements EjbServices
+{
+
+ public Iterable<EjbDescriptor<?>> discoverEjbs()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Class<? extends Annotation> getEJBAnnotation()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Class<? extends Annotation> getPersistenceContextAnnotation()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Class<? extends Annotation> getResourceAnnotation()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public <T> EjbReference<T> resolveEJB(EjbDescriptor<T>
ejbDescriptor, NamingContext namingContext)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Object resolveEjb(InjectionPoint injectionPoint, NamingContext namingContext)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Object resolvePersistenceContext(InjectionPoint injectionPoint, NamingContext
namingContext)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Object resolveResource(InjectionPoint injectionPoint, NamingContext
namingContext)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on:
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEjbServices.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockNamingContext.java
===================================================================
---
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockNamingContext.java
(rev 0)
+++
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockNamingContext.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.bootstrap.api.test;
+
+import org.jboss.webbeans.resources.spi.NamingContext;
+
+public class MockNamingContext implements NamingContext
+{
+
+ public void bind(String name, Object value)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public <T> T lookup(String name, Class<? extends T> expectedType)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on:
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockNamingContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceLoader.java
===================================================================
---
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceLoader.java
(rev 0)
+++
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceLoader.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,28 @@
+package org.jboss.webbeans.bootstrap.api.test;
+
+import java.net.URL;
+
+import org.jboss.webbeans.resources.spi.ResourceLoader;
+
+public class MockResourceLoader implements ResourceLoader
+{
+
+ public Class<?> classForName(String name)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public URL getResource(String name)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Iterable<URL> getResources(String name)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on:
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceLoader.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java
===================================================================
---
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java
(rev 0)
+++
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.bootstrap.api.test;
+
+import javax.transaction.Synchronization;
+
+import org.jboss.webbeans.transaction.spi.TransactionServices;
+
+public class MockTransactionServices implements TransactionServices
+{
+
+ public boolean isTransactionActive()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void registerSynchronization(Synchronization synchronizedObserver)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on:
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockWebBeanDiscovery.java
===================================================================
---
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockWebBeanDiscovery.java
(rev 0)
+++
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockWebBeanDiscovery.java 2009-03-15
01:47:28 UTC (rev 2000)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.bootstrap.api.test;
+
+import java.net.URL;
+
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+
+public class MockWebBeanDiscovery implements WebBeanDiscovery
+{
+
+ public Iterable<Class<?>> discoverWebBeanClasses()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Iterable<URL> discoverWebBeansXml()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on:
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockWebBeanDiscovery.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain