Author: pete.muir(a)jboss.org
Date: 2009-09-29 15:57:01 -0400 (Tue, 29 Sep 2009)
New Revision: 3814
Modified:
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/cluster/AbstractClusterTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java
Log:
simplify
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java 2009-09-29
19:35:36 UTC (rev 3813)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/TestContainer.java 2009-09-29
19:57:01 UTC (rev 3814)
@@ -10,7 +10,7 @@
* @author pmuir
*
*/
-public class TestContainer<L extends MockServletLifecycle>
+public class TestContainer
{
public static class Status
@@ -35,7 +35,7 @@
}
- private final L lifecycle;
+ private final MockServletLifecycle lifecycle;
private final Iterable<Class<?>> classes;
private final Iterable<URL> beansXml;
@@ -46,7 +46,7 @@
* @param classes
* @param beansXml
*/
- public TestContainer(L lifecycle, Iterable<Class<?>> classes,
Iterable<URL> beansXml)
+ public TestContainer(MockServletLifecycle lifecycle, Iterable<Class<?>>
classes, Iterable<URL> beansXml)
{
this.lifecycle = lifecycle;
this.classes = classes;
@@ -88,7 +88,7 @@
*
* @return
*/
- public L getLifecycle()
+ public MockServletLifecycle getLifecycle()
{
return lifecycle;
}
Modified:
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/cluster/AbstractClusterTest.java
===================================================================
---
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/cluster/AbstractClusterTest.java 2009-09-29
19:35:36 UTC (rev 3813)
+++
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/cluster/AbstractClusterTest.java 2009-09-29
19:57:01 UTC (rev 3814)
@@ -31,12 +31,12 @@
SingletonProvider.reset();
}
- protected TestContainer<MockEELifecycle> bootstrapContainer(int id,
Iterable<Class<?>> classes)
+ protected TestContainer bootstrapContainer(int id, Iterable<Class<?>>
classes)
{
// Bootstrap container
SwitchableSingletonProvider.use(id);
- TestContainer<MockEELifecycle> container = new
TestContainer<MockEELifecycle>(new MockEELifecycle(), classes, null);
+ TestContainer container = new TestContainer(new MockEELifecycle(), classes, null);
container.startContainer();
container.ensureRequestActive();
Modified:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java 2009-09-29
19:35:36 UTC (rev 3813)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/cluster/NaiveClusterTest.java 2009-09-29
19:57:01 UTC (rev 3814)
@@ -5,7 +5,6 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.mock.MockEELifecycle;
import org.jboss.webbeans.mock.TestContainer;
import org.jboss.webbeans.mock.cluster.AbstractClusterTest;
import org.testng.annotations.Test;
@@ -17,11 +16,11 @@
public void testSimpleSessionReplication() throws Exception
{
- TestContainer<MockEELifecycle> container1 = bootstrapContainer(1,
Arrays.<Class<?>>asList(Foo.class));
+ TestContainer container1 = bootstrapContainer(1,
Arrays.<Class<?>>asList(Foo.class));
BeanManagerImpl beanManager1 = container1.getBeanManager();
Bean<?> fooBean1 = beanManager1.resolve(beanManager1.getBeans(Foo.class));
- TestContainer<MockEELifecycle> container2 = bootstrapContainer(2,
Arrays.<Class<?>>asList(Foo.class));
+ TestContainer container2 = bootstrapContainer(2,
Arrays.<Class<?>>asList(Foo.class));
BeanManagerImpl beanManager2 = container2.getBeanManager();
Bean<?> fooBean2 = beanManager2.resolve(beanManager2.getBeans(Foo.class));
@@ -41,11 +40,11 @@
public void testMultipleDependentObjectsSessionReplication() throws Exception
{
Iterable<Class<?>> classes =
Arrays.<Class<?>>asList(Stable.class, Horse.class, Fodder.class);
- TestContainer<MockEELifecycle> container1 = bootstrapContainer(1, classes);
+ TestContainer container1 = bootstrapContainer(1, classes);
BeanManagerImpl beanManager1 = container1.getBeanManager();
Bean<?> stableBean1 =
beanManager1.resolve(beanManager1.getBeans(Stable.class));
- TestContainer<MockEELifecycle> container2 = bootstrapContainer(2, classes);
+ TestContainer container2 = bootstrapContainer(2, classes);
BeanManagerImpl beanManager2 = container2.getBeanManager();
Bean<?> stableBean2 =
beanManager2.resolve(beanManager2.getBeans(Stable.class));
@@ -84,11 +83,11 @@
// NB This is not a valid deployment scenario for a cluster, but it does allow us
to test bean ids neatly!
Iterable<Class<?>> classes1 =
Arrays.<Class<?>>asList(Stable.class, Horse.class, Fodder.class);
Iterable<Class<?>> classes2 =
Arrays.<Class<?>>asList(Stable.class, Horse.class, Fodder.class, Foo.class);
- TestContainer<MockEELifecycle> container1 = bootstrapContainer(1, classes1);
+ TestContainer container1 = bootstrapContainer(1, classes1);
BeanManagerImpl beanManager1 = container1.getBeanManager();
Bean<?> stableBean1 =
beanManager1.resolve(beanManager1.getBeans(Stable.class));
- TestContainer<MockEELifecycle> container2 = bootstrapContainer(2, classes2);
+ TestContainer container2 = bootstrapContainer(2, classes2);
BeanManagerImpl beanManager2 = container2.getBeanManager();
Bean<?> stableBean2 =
beanManager2.resolve(beanManager2.getBeans(Stable.class));