Author: pete.muir(a)jboss.org
Date: 2010-03-09 17:43:32 -0500 (Tue, 09 Mar 2010)
New Revision: 6025
Removed:
extensions/trunk/src/test/java/org/jboss/weld/extensions/genericbeans/test/AbstractTest.java
Modified:
extensions/trunk/src/test/java/org/jboss/weld/extensions/genericbeans/test/GenericBeanTest.java
Log:
use weld-core-test to run the tests
Deleted:
extensions/trunk/src/test/java/org/jboss/weld/extensions/genericbeans/test/AbstractTest.java
===================================================================
---
extensions/trunk/src/test/java/org/jboss/weld/extensions/genericbeans/test/AbstractTest.java 2010-03-09
22:31:27 UTC (rev 6024)
+++
extensions/trunk/src/test/java/org/jboss/weld/extensions/genericbeans/test/AbstractTest.java 2010-03-09
22:43:32 UTC (rev 6025)
@@ -1,59 +0,0 @@
-package org.jboss.weld.extensions.genericbeans.test;
-
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.jboss.weld.environment.se.Weld;
-import org.jboss.weld.environment.se.WeldContainer;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-
-public class AbstractTest
-{
-
- protected BeanManager manager;
-
- Weld weld;
-
- protected void preBootstrap()
- {
- }
-
- @BeforeClass
- public void setup()
- {
- weld = new Weld();
- WeldContainer container = weld.initialize();
- manager = container.getBeanManager();
- }
-
- @AfterClass
- public void teardown()
- {
- weld.shutdown();
- }
-
- public <T> T getReference(Class<T> clazz, Annotation... bindings)
- {
- Set<Bean<?>> beans = manager.getBeans(clazz, bindings);
- if (beans.isEmpty())
- {
- throw new RuntimeException("No bean found with class: " + clazz +
" and bindings " + bindings.toString());
- }
- else if (beans.size() != 1)
- {
- StringBuilder bs = new StringBuilder("[");
- for (Annotation a : bindings)
- {
- bs.append(a.toString() + ",");
- }
- bs.append("]");
- throw new RuntimeException("More than one bean found with class: " +
clazz + " and bindings " + bs);
- }
- Bean bean = beans.iterator().next();
- return (T) bean.create(manager.createCreationalContext(bean));
- }
-}
Modified:
extensions/trunk/src/test/java/org/jboss/weld/extensions/genericbeans/test/GenericBeanTest.java
===================================================================
---
extensions/trunk/src/test/java/org/jboss/weld/extensions/genericbeans/test/GenericBeanTest.java 2010-03-09
22:31:27 UTC (rev 6024)
+++
extensions/trunk/src/test/java/org/jboss/weld/extensions/genericbeans/test/GenericBeanTest.java 2010-03-09
22:43:32 UTC (rev 6025)
@@ -1,8 +1,11 @@
package org.jboss.weld.extensions.genericbeans.test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
-public class GenericBeanTest extends AbstractTest
+@Artifact
+public class GenericBeanTest extends AbstractWeldTest
{
@Test
public void testGeneric()
Show replies by date