openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1561898 - in /openwebbeans/trunk: distribution/src/assembly/ webbeans-impl/src/test/java/org/apache/webbeans/newtests/ webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/ webbeans-impl/src/test/java/org/apache/we...
Date Mon, 27 Jan 2014 22:48:17 GMT
Author: struberg
Date: Mon Jan 27 22:48:16 2014
New Revision: 1561898

URL: http://svn.apache.org/r1561898
Log:
OWB-763 migrate old unit tests

Added:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/AnnotatedTypeImplTest.java
      - copied, changed from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/portable/AnnotatedTypeImplTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/ClassUtilTest.java
      - copied, changed from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ClassUtilTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/CustomBaseType.java
      - copied, changed from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomBaseType.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/CustomType.java
      - copied, changed from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomType.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/ExtendedCustomType.java
      - copied, changed from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedCustomType.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/ExtendedSpecificClass.java
      - copied, changed from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedSpecificClass.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/GenericInterface.java
      - copied, changed from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/GenericInterface.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/GenericsUtilTest.java
      - copied, changed from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/GenericsUtilTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/MySubClass.java
      - copied, changed from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/MySubClass.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/MySuperClass.java
      - copied, changed from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/MySuperClass.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/SpecificClass.java
      - copied, changed from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/SpecificClass.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/WebBeansUtilTest.java
      - copied, changed from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/WebBeansUtilTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/differentPackage/
      - copied from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/differentPackage/
Removed:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/portable/
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/
Modified:
    openwebbeans/trunk/distribution/src/assembly/dist-binary.xml
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/AbstractUnitTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/InterceptorDecoratorProxyFactoryTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/differentPackage/MyOtherPackageSubClass.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/containertests/ComponentResolutionByTypeTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/binding/AnyBindingTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/binding/BrokenBindingComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/definition/BeanTypesTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/component/BrokenComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/initializer/BrokenInitializerTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/alternative/AlternativeTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/parametrized/BoundedTypeVariableTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/producer/broken/BrokenProducerTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/strict/AlternativesTest.java
    openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/xml/alternative/alternatives.xml
    openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/ScannerService.java

Modified: openwebbeans/trunk/distribution/src/assembly/dist-binary.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/distribution/src/assembly/dist-binary.xml?rev=1561898&r1=1561897&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/distribution/src/assembly/dist-binary.xml (original)
+++ openwebbeans/trunk/distribution/src/assembly/dist-binary.xml Mon Jan 27 22:48:16 2014
@@ -191,7 +191,7 @@ under the License.
             <outputDirectory>api</outputDirectory>
             <includes>
                 <include>org.apache.geronimo.specs:geronimo-atinject_1.0_spec:jar</include>
-                <include>org.apache.geronimo.specs:geronimo-jcdi_1.0_spec:jar</include>
+                <include>org.apache.geronimo.specs:geronimo-jcdi_1.1_spec:jar</include>
             </includes>
         </dependencySet>
 
@@ -206,11 +206,10 @@ under the License.
                 <include>org.apache.openwebbeans:openwebbeans-ee</include>
                 <include>org.apache.openwebbeans:openwebbeans-ee-common</include>
                 <include>org.apache.openwebbeans:openwebbeans-el10</include>
-		<include>org.apache.openwebbeans:openwebbeans-el22</include>
+                <include>org.apache.openwebbeans:openwebbeans-el22</include>
                 <include>org.apache.openwebbeans:openwebbeans-resource</include>
                 <include>org.apache.openwebbeans:openwebbeans-osgi</include>
                 <include>org.apache.openwebbeans:openwebbeans-web</include>
-                <include>org.apache.openwebbeans:openwebbeans-tomcat6</include>
                 <include>org.apache.openwebbeans:openwebbeans-tomcat7</include>
             </includes>
 

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/AbstractUnitTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/AbstractUnitTest.java?rev=1561898&r1=1561897&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/AbstractUnitTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/AbstractUnitTest.java Mon Jan 27 22:48:16 2014
@@ -76,6 +76,13 @@ public abstract class AbstractUnitTest
         startContainer(new ArrayList<Class<?>>(Arrays.asList(beanClasses)), null);
     }
 
+    protected void startContainer(String beansXml, Class<?>... beanClasses)
+    {
+        List<String> beansXmls = new ArrayList<String>(1);
+        beansXmls.add(getXmlUrl(beansXml));
+        startContainer(new ArrayList<Class<?>>(Arrays.asList(beanClasses)), beansXmls);
+    }
+
     protected void startContainer(Collection<Class<?>> beanClasses)
     {
         startContainer(beanClasses, null);
@@ -207,18 +214,31 @@ public abstract class AbstractUnitTest
     }
 
 
-
+    /**
+     * @param packageName package of the beans.xml file
+     * @param fileName name of the beans xml file, without '.xml'
+     * @return the absolute beans.xml URL
+     */
     protected String getXmlPath(String packageName, String fileName)
     {
         StringBuilder prefix = new StringBuilder(packageName.replace('.', '/'));
         prefix.append("/");
         prefix.append(fileName);
         prefix.append(".xml");
-        
+
+        return getXmlUrl(prefix.toString());
+    }
+
+    /**
+     * @param fileName the resource path of the beans.xml to parse
+     * @return the URL of the beans.xml.
+     */
+    protected String getXmlUrl(String fileName)
+    {
         ClassLoader loader = Thread.currentThread().getContextClassLoader();
-        return loader.getResource(prefix.toString()).toExternalForm();
+        return loader.getResource(fileName).toExternalForm();
     }
-    
+
     /**
      * Add a CDI Extension which should get used in the test case.
      * Use this function instead of defining test Extensions via the usual

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/InterceptorDecoratorProxyFactoryTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/InterceptorDecoratorProxyFactoryTest.java?rev=1561898&r1=1561897&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/InterceptorDecoratorProxyFactoryTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/factory/InterceptorDecoratorProxyFactoryTest.java Mon Jan 27 22:48:16 2014
@@ -41,11 +41,11 @@ import org.apache.webbeans.proxy.Interce
 import org.apache.webbeans.proxy.InterceptorHandler;
 import org.apache.webbeans.proxy.OwbInterceptorProxy;
 import org.apache.webbeans.util.ClassUtil;
-import org.apache.webbeans.util.CustomBaseType;
-import org.apache.webbeans.util.CustomType;
-import org.apache.webbeans.util.ExtendedSpecificClass;
-import org.apache.webbeans.util.GenericInterface;
-import org.apache.webbeans.util.SpecificClass;
+import org.apache.webbeans.newtests.util.CustomBaseType;
+import org.apache.webbeans.newtests.util.CustomType;
+import org.apache.webbeans.newtests.util.ExtendedSpecificClass;
+import org.apache.webbeans.newtests.util.GenericInterface;
+import org.apache.webbeans.newtests.util.SpecificClass;
 import org.junit.Assert;
 import org.junit.Test;
 

Copied: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/AnnotatedTypeImplTest.java (from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/portable/AnnotatedTypeImplTest.java)
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/AnnotatedTypeImplTest.java?p2=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/AnnotatedTypeImplTest.java&p1=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/portable/AnnotatedTypeImplTest.java&r1=1561772&r2=1561898&rev=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/portable/AnnotatedTypeImplTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/AnnotatedTypeImplTest.java Mon Jan 27 22:48:16 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.webbeans.portable;
+package org.apache.webbeans.newtests.portable;
 
 import java.util.ArrayList;
 import java.util.concurrent.CountDownLatch;

Copied: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/ClassUtilTest.java (from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ClassUtilTest.java)
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/ClassUtilTest.java?p2=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/ClassUtilTest.java&p1=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ClassUtilTest.java&r1=1561772&r2=1561898&rev=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ClassUtilTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/ClassUtilTest.java Mon Jan 27 22:48:16 2014
@@ -16,13 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.webbeans.util;
+package org.apache.webbeans.newtests.util;
 
 import java.lang.reflect.Method;
 import java.util.Arrays;
 import java.util.List;
 
-import org.apache.webbeans.util.differentPackage.MyOtherPackageSubClass;
+import org.apache.webbeans.util.ClassUtil;
+import org.apache.webbeans.newtests.util.differentPackage.MyOtherPackageSubClass;
 import org.junit.Test;
 
 import junit.framework.Assert;

Copied: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/CustomBaseType.java (from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomBaseType.java)
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/CustomBaseType.java?p2=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/CustomBaseType.java&p1=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomBaseType.java&r1=1561772&r2=1561898&rev=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomBaseType.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/CustomBaseType.java Mon Jan 27 22:48:16 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.webbeans.util;
+package org.apache.webbeans.newtests.util;
 
 public abstract class CustomBaseType
 {

Copied: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/CustomType.java (from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomType.java)
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/CustomType.java?p2=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/CustomType.java&p1=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomType.java&r1=1561772&r2=1561898&rev=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/CustomType.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/CustomType.java Mon Jan 27 22:48:16 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.webbeans.util;
+package org.apache.webbeans.newtests.util;
 
 public class CustomType extends CustomBaseType
 {

Copied: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/ExtendedCustomType.java (from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedCustomType.java)
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/ExtendedCustomType.java?p2=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/ExtendedCustomType.java&p1=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedCustomType.java&r1=1561772&r2=1561898&rev=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedCustomType.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/ExtendedCustomType.java Mon Jan 27 22:48:16 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.webbeans.util;
+package org.apache.webbeans.newtests.util;
 
 public class ExtendedCustomType extends CustomType
 {

Copied: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/ExtendedSpecificClass.java (from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedSpecificClass.java)
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/ExtendedSpecificClass.java?p2=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/ExtendedSpecificClass.java&p1=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedSpecificClass.java&r1=1561772&r2=1561898&rev=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/ExtendedSpecificClass.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/ExtendedSpecificClass.java Mon Jan 27 22:48:16 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.webbeans.util;
+package org.apache.webbeans.newtests.util;
 
 public class ExtendedSpecificClass extends SpecificClass {
 

Copied: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/GenericInterface.java (from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/GenericInterface.java)
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/GenericInterface.java?p2=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/GenericInterface.java&p1=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/GenericInterface.java&r1=1561772&r2=1561898&rev=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/GenericInterface.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/GenericInterface.java Mon Jan 27 22:48:16 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.webbeans.util;
+package org.apache.webbeans.newtests.util;
 
 public interface GenericInterface<T extends CustomBaseType> {
 

Copied: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/GenericsUtilTest.java (from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/GenericsUtilTest.java)
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/GenericsUtilTest.java?p2=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/GenericsUtilTest.java&p1=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/GenericsUtilTest.java&r1=1561772&r2=1561898&rev=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/GenericsUtilTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/GenericsUtilTest.java Mon Jan 27 22:48:16 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.webbeans.util;
+package org.apache.webbeans.newtests.util;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
@@ -25,6 +25,8 @@ import java.lang.reflect.Field;
 import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
 
+import org.apache.webbeans.util.GenericsUtil;
+import org.junit.Assert;
 import org.junit.Test;
 
 public class GenericsUtilTest {
@@ -32,7 +34,7 @@ public class GenericsUtilTest {
     @Test
     public void resolveType() throws NoSuchFieldException {
         Field field = AbstractObject.class.getDeclaredField("field");
-        assertEquals(Object.class, GenericsUtil.resolveType(SimpleObject.class, field));
+        Assert.assertEquals(Object.class, GenericsUtil.resolveType(SimpleObject.class, field));
         assertEquals(String.class, GenericsUtil.resolveType(StringObject.class, field));
 
         Type t = GenericsUtil.resolveType(GenericObject.class, field);

Copied: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/MySubClass.java (from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/MySubClass.java)
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/MySubClass.java?p2=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/MySubClass.java&p1=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/MySubClass.java&r1=1561772&r2=1561898&rev=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/MySubClass.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/MySubClass.java Mon Jan 27 22:48:16 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.webbeans.util;
+package org.apache.webbeans.newtests.util;
 
 /**
 *

Copied: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/MySuperClass.java (from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/MySuperClass.java)
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/MySuperClass.java?p2=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/MySuperClass.java&p1=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/MySuperClass.java&r1=1561772&r2=1561898&rev=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/MySuperClass.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/MySuperClass.java Mon Jan 27 22:48:16 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.webbeans.util;
+package org.apache.webbeans.newtests.util;
 
 /**
 *

Copied: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/SpecificClass.java (from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/SpecificClass.java)
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/SpecificClass.java?p2=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/SpecificClass.java&p1=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/SpecificClass.java&r1=1561772&r2=1561898&rev=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/SpecificClass.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/SpecificClass.java Mon Jan 27 22:48:16 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.webbeans.util;
+package org.apache.webbeans.newtests.util;
 
 public class SpecificClass<T extends CustomType> implements GenericInterface<T> {
 

Copied: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/WebBeansUtilTest.java (from r1561772, openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/WebBeansUtilTest.java)
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/WebBeansUtilTest.java?p2=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/WebBeansUtilTest.java&p1=openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/WebBeansUtilTest.java&r1=1561772&r2=1561898&rev=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/util/WebBeansUtilTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/WebBeansUtilTest.java Mon Jan 27 22:48:16 2014
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.webbeans.util;
+package org.apache.webbeans.newtests.util;
 
 import static org.junit.Assert.assertEquals;
 
@@ -25,6 +25,7 @@ import javax.enterprise.inject.IllegalPr
 
 import junit.framework.Assert;
 
+import org.apache.webbeans.util.WebBeansUtil;
 import org.junit.Test;
 
 

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/differentPackage/MyOtherPackageSubClass.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/differentPackage/MyOtherPackageSubClass.java?rev=1561898&r1=1561772&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/differentPackage/MyOtherPackageSubClass.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/util/differentPackage/MyOtherPackageSubClass.java Mon Jan 27 22:48:16 2014
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.webbeans.util.differentPackage;
+package org.apache.webbeans.newtests.util.differentPackage;
 
-import org.apache.webbeans.util.MySuperClass;
+import org.apache.webbeans.newtests.util.MySuperClass;
 
 /**
 *

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/containertests/ComponentResolutionByTypeTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/containertests/ComponentResolutionByTypeTest.java?rev=1561898&r1=1561897&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/containertests/ComponentResolutionByTypeTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/containertests/ComponentResolutionByTypeTest.java Mon Jan 27 22:48:16 2014
@@ -24,17 +24,14 @@ import javax.enterprise.inject.spi.Bean;
 
 import junit.framework.Assert;
 
-import org.apache.webbeans.config.WebBeansContext;
-import org.apache.webbeans.container.BeanManagerImpl;
-import org.apache.webbeans.test.TestContext;
+import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.test.annotation.binding.AnnotationWithBindingMember;
 import org.apache.webbeans.test.annotation.binding.AnnotationWithNonBindingMember;
 import org.apache.webbeans.test.component.BindingComponent;
 import org.apache.webbeans.test.component.NonBindingComponent;
-import org.junit.Before;
 import org.junit.Test;
 
-public class ComponentResolutionByTypeTest extends TestContext
+public class ComponentResolutionByTypeTest extends AbstractUnitTest
 {
     public @AnnotationWithBindingMember(value = "B", number = 3)
     BindingComponent s1 = null;
@@ -48,53 +45,45 @@ public class ComponentResolutionByTypeTe
     public @AnnotationWithNonBindingMember(value = "C", arg1 = "arg11", arg2 = "arg21")
     NonBindingComponent s5 = null;
 
-    private BeanManagerImpl cont;
-
     private static final String CLAZZ_NAME = ComponentResolutionByTypeTest.class.getName();
 
-    public ComponentResolutionByTypeTest()
-    {
-        super(CLAZZ_NAME);
-    }
     
-    @Override
-    @Before
-    public void init()
-    {
-        cont = WebBeansContext.getInstance().getBeanManagerImpl();
-    }
-
 
     @Test
-    public void testBindingTypeOk() throws Throwable
+    public void testBindingTypeOk() throws Exception
     {
-        cont.getBeans(BindingComponent.class, ComponentResolutionByTypeTest.class.getDeclaredField("s1").getAnnotations());
+        startContainer(this.getClass());
+        getBeanManager().getBeans(BindingComponent.class, ComponentResolutionByTypeTest.class.getDeclaredField("s1").getAnnotations());
     }
 
     @Test
-    public void testBindingTypeNonOk() throws Throwable
+    public void testBindingTypeNonOk() throws Exception
     {
-        cont.getBeans(BindingComponent.class, ComponentResolutionByTypeTest.class.getDeclaredField("s2").getAnnotations());
+        startContainer(this.getClass());
+        getBeanManager().getBeans(BindingComponent.class, ComponentResolutionByTypeTest.class.getDeclaredField("s2").getAnnotations());
     }
 
     @Test
-    public void testNonBindingTypeOk1() throws Throwable
+    public void testNonBindingTypeOk1() throws Exception
     {
-        cont.getBeans(NonBindingComponent.class, ComponentResolutionByTypeTest.class.getDeclaredField("s3").getAnnotations());
+        startContainer(this.getClass());
+        getBeanManager().getBeans(NonBindingComponent.class, ComponentResolutionByTypeTest.class.getDeclaredField("s3").getAnnotations());
     }
 
     @Test
-    public void testNonBindingTypeOk2() throws Throwable
+    public void testNonBindingTypeOk2() throws Exception
     {
-        Set<Bean<?>> beans = cont.getBeans(NonBindingComponent.class, ComponentResolutionByTypeTest.class.getDeclaredField("s4").getAnnotations());
+        startContainer(this.getClass());
+        Set<Bean<?>> beans = getBeanManager().getBeans(NonBindingComponent.class, ComponentResolutionByTypeTest.class.getDeclaredField("s4").getAnnotations());
         Assert.assertNotNull(beans);
         Assert.assertTrue(beans.isEmpty());
     }
 
     @Test
-    public void testNonBindingTypeNonOk() throws Throwable
+    public void testNonBindingTypeNonOk() throws Exception
     {
-        cont.getBeans(NonBindingComponent.class, ComponentResolutionByTypeTest.class.getDeclaredField("s5").getAnnotations());
+        startContainer(this.getClass());
+        getBeanManager().getBeans(NonBindingComponent.class, ComponentResolutionByTypeTest.class.getDeclaredField("s5").getAnnotations());
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/binding/AnyBindingTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/binding/AnyBindingTest.java?rev=1561898&r1=1561897&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/binding/AnyBindingTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/binding/AnyBindingTest.java Mon Jan 27 22:48:16 2014
@@ -22,47 +22,37 @@ package org.apache.webbeans.test.unittes
 import java.lang.annotation.Annotation;
 import java.util.Set;
 
-import org.apache.webbeans.component.AbstractOwbBean;
-import org.apache.webbeans.test.TestContext;
+import org.apache.webbeans.annotation.AnyLiteral;
+import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.test.component.binding.AnyBindingComponent;
 import org.apache.webbeans.test.component.binding.DefaultAnyBinding;
 import org.apache.webbeans.test.component.binding.NonAnyBindingComponent;
 import org.junit.Assert;
-import org.junit.Before;
 import org.junit.Test;
 
-public class AnyBindingTest extends TestContext{
+import javax.enterprise.inject.spi.Bean;
 
-   public AnyBindingTest()
-   {
-      super(AnyBindingTest.class.getName());
-   }
+public class AnyBindingTest extends AbstractUnitTest {
 
-   @Override
-   @Before
-   public void init()
-   {
-   }
+    @Test
+    public void testAny()
+    {
+        startContainer(AnyBindingComponent.class, NonAnyBindingComponent.class, DefaultAnyBinding.class);
 
-   @Test
-   public void testAny()
-   {
-      AbstractOwbBean<AnyBindingComponent> comp1 = defineManagedBean(AnyBindingComponent.class);
-      Set<Annotation> qualifiers = comp1.getQualifiers();
+        Bean<AnyBindingComponent> comp1 = getBean(AnyBindingComponent.class, AnyLiteral.INSTANCE);
+        Set<Annotation> qualifiers = comp1.getQualifiers();
 
-      Assert.assertEquals(2, qualifiers.size());
+        Assert.assertEquals(2, qualifiers.size());
 
-      AbstractOwbBean<NonAnyBindingComponent> comp2 = defineManagedBean(NonAnyBindingComponent.class);
-      qualifiers = comp2.getQualifiers();
+        Bean<NonAnyBindingComponent> comp2 = getBean(NonAnyBindingComponent.class, AnyLiteral.INSTANCE);
+        qualifiers = comp2.getQualifiers();
 
-      Assert.assertEquals(4, qualifiers.size());
+        Assert.assertEquals(4, qualifiers.size());
 
 
-      AbstractOwbBean<DefaultAnyBinding> comp3 = defineManagedBean(DefaultAnyBinding.class);
-      qualifiers = comp3.getQualifiers();
+        Bean<DefaultAnyBinding> comp3 = getBean(DefaultAnyBinding.class, AnyLiteral.INSTANCE);
+        qualifiers = comp3.getQualifiers();
 
-      Assert.assertEquals(2, qualifiers.size());
-
-
-   }
+        Assert.assertEquals(2, qualifiers.size());
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/binding/BrokenBindingComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/binding/BrokenBindingComponentTest.java?rev=1561898&r1=1561897&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/binding/BrokenBindingComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/binding/BrokenBindingComponentTest.java Mon Jan 27 22:48:16 2014
@@ -20,37 +20,24 @@ package org.apache.webbeans.test.unittes
 
 import junit.framework.Assert;
 
-import org.apache.webbeans.test.TestContext;
+import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.test.component.binding.BindingWithNonBindingAnnotationTypeComponent;
 import org.apache.webbeans.test.component.binding.BindingWithNonBindingArrayTypeComponent;
-import org.junit.Before;
 import org.junit.Test;
 
-public class BrokenBindingComponentTest extends TestContext
-{
-
-    public BrokenBindingComponentTest()
-    {
-        super(BrokenBindingComponentTest.class.getName());
-    }
-
-    @Override
-    @Before
-    public void init()
-    {
-        super.init();
-    }
+import javax.enterprise.inject.spi.DefinitionException;
 
+public class BrokenBindingComponentTest extends AbstractUnitTest
+{
     @Test
     public void testNonBindingArrayType()
     {
         try
         {
-            defineManagedBean(BindingWithNonBindingArrayTypeComponent.class);
+            startContainer(BindingWithNonBindingArrayTypeComponent.class);
         }
-        catch (Exception e)
+        catch (DefinitionException e)
         {
-            System.out.println("got expected exception: " + e.getMessage());
             return; // all ok!
         }
         Assert.fail("expecting an exception!");
@@ -61,11 +48,10 @@ public class BrokenBindingComponentTest 
     {
         try
         {
-            defineManagedBean(BindingWithNonBindingAnnotationTypeComponent.class);
+            startContainer(BindingWithNonBindingAnnotationTypeComponent.class);
         }
-        catch (Exception e)
+        catch (DefinitionException e)
         {
-            System.out.println("got expected exception: " + e.getMessage());
             return; // all ok!
         }
         Assert.fail("expecting an exception!");

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/definition/BeanTypesTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/definition/BeanTypesTest.java?rev=1561898&r1=1561897&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/definition/BeanTypesTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/definition/BeanTypesTest.java Mon Jan 27 22:48:16 2014
@@ -25,38 +25,25 @@ import javax.enterprise.inject.spi.Bean;
 
 import junit.framework.Assert;
 
-import org.apache.webbeans.test.TestContext;
+import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.test.component.CheckWithCheckPayment;
 import org.apache.webbeans.test.component.definition.BeanTypesDefinedBean;
-import org.junit.Before;
 import org.junit.Test;
 
-public class BeanTypesTest extends TestContext
+public class BeanTypesTest extends AbstractUnitTest
 {
-    public BeanTypesTest()
-    {
-        super(BeanTypesTest.class.getName());
-    }
-    
-    @Override
-    @Before
-    public void init()
-    {
-        super.init();
-    }
-
     @Test
     public void testBeanTypes()
     {
-        clear();
-        
-        Bean<BeanTypesDefinedBean> bean = defineManagedBean(BeanTypesDefinedBean.class);
+        startContainer(BeanTypesDefinedBean.class);
+
+        Bean<BeanTypesDefinedBean> bean = getBean(BeanTypesDefinedBean.class);
         Set<Type> apiTypes = bean.getTypes();
         
         Assert.assertEquals(2, apiTypes.size());        
         Assert.assertTrue(apiTypes.contains(BeanTypesDefinedBean.class));
         
-        Set<Bean<?>> beans = getManager().getBeans("paymentField");
+        Set<Bean<?>> beans = getBeanManager().getBeans("paymentField");
         Assert.assertEquals(1, beans.size());
         
         Bean<?> pbean = beans.iterator().next();
@@ -65,7 +52,7 @@ public class BeanTypesTest extends TestC
         Assert.assertEquals(2, apiTypes.size());        
         Assert.assertTrue(apiTypes.contains(CheckWithCheckPayment.class));
         
-        beans = getManager().getBeans("paymentMethod");
+        beans = getBeanManager().getBeans("paymentMethod");
         Assert.assertEquals(1, beans.size());
         
         pbean = beans.iterator().next();
@@ -73,8 +60,5 @@ public class BeanTypesTest extends TestC
         
         Assert.assertEquals(2, apiTypes.size());        
         Assert.assertTrue(apiTypes.contains(CheckWithCheckPayment.class));
-        
-        
-        
     }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/component/BrokenComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/component/BrokenComponentTest.java?rev=1561898&r1=1561897&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/component/BrokenComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/component/BrokenComponentTest.java Mon Jan 27 22:48:16 2014
@@ -20,30 +20,19 @@ package org.apache.webbeans.test.unittes
 
 import junit.framework.Assert;
 
-import org.apache.webbeans.test.TestContext;
+import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.test.component.event.broken.BrokenObserverComponent1;
 import org.apache.webbeans.test.component.event.broken.BrokenObserverComponent2;
 import org.apache.webbeans.test.component.event.broken.BrokenObserverComponent3;
 import org.apache.webbeans.test.component.event.broken.BrokenObserverComponent4;
 import org.apache.webbeans.test.component.event.broken.BrokenObserverComponent5;
 import org.apache.webbeans.test.component.event.broken.BrokenObserverComponent6;
-import org.junit.Before;
 import org.junit.Test;
 
-public class BrokenComponentTest extends TestContext
-{
-    public BrokenComponentTest()
-    {
-        super(BrokenComponentTest.class.getName());
-    }
-
-    @Override
-    @Before
-    public void init()
-    {
-        super.init();
-    }
+import javax.enterprise.inject.spi.DefinitionException;
 
+public class BrokenComponentTest extends AbstractUnitTest
+{
     @Test
     public void test1()
     {
@@ -51,7 +40,7 @@ public class BrokenComponentTest extends
 
         try
         {
-            defineManagedBean(BrokenObserverComponent1.class);
+            startContainer(BrokenObserverComponent1.class);
 
         }
         catch (Exception e)
@@ -59,103 +48,78 @@ public class BrokenComponentTest extends
             System.out.println(e.getMessage());
             exc = e;
         }
-
-        Assert.assertNull(exc);
     }
 
     @Test
     public void test2()
     {
-        Exception exc = null;
-
         try
         {
-            defineManagedBean(BrokenObserverComponent2.class);
-
+            startContainer(BrokenObserverComponent2.class);
+            Assert.fail("DefinitionException expected");
         }
-        catch (Exception e)
+        catch (DefinitionException e)
         {
-            System.out.println(e.getMessage());
-            exc = e;
+            return; // all ok
         }
-
-        Assert.assertNotNull(exc);
     }
 
     @Test
     public void test3()
     {
-        Exception exc = null;
-
         try
         {
-            defineManagedBean(BrokenObserverComponent3.class);
+            startContainer(BrokenObserverComponent3.class);
+            Assert.fail("DefinitionException expected");
 
         }
-        catch (Exception e)
+        catch (DefinitionException e)
         {
-            System.out.println(e.getMessage());
-            exc = e;
+            return; // all ok
         }
-
-        Assert.assertNotNull(exc);
     }
 
     @Test
     public void test4()
     {
-        Exception exc = null;
-
         try
         {
-            defineManagedBean(BrokenObserverComponent4.class);
+            startContainer(BrokenObserverComponent4.class);
+            Assert.fail("DefinitionException expected");
 
         }
-        catch (Exception e)
+        catch (DefinitionException e)
         {
-            System.out.println(e.getMessage());
-            exc = e;
+            return; // all ok
         }
-
-        Assert.assertNotNull(exc);
     }
 
     @Test
     public void test5()
     {
-        Exception exc = null;
-
         try
         {
-            defineManagedBean(BrokenObserverComponent5.class);
-
+            startContainer(BrokenObserverComponent5.class);
+            Assert.fail("DefinitionException expected");
         }
-        catch (Exception e)
+        catch (DefinitionException e)
         {
-            System.out.println(e.getMessage());
-            exc = e;
+            return; // all ok
         }
-
-        Assert.assertNotNull(exc);
     }
 
     @Test
     public void test6()
     {
-        Exception exc = null;
-
         try
         {
-            defineManagedBean(BrokenObserverComponent6.class);
-
+            startContainer(BrokenObserverComponent6.class);
+            Assert.fail("DefinitionException expected");
         }
-        catch (Exception e)
+        catch (DefinitionException e)
         {
-            System.out.println(e.getMessage());
-            exc = e;
+            return; // all ok
         }
-
-        Assert.assertNotNull(exc);
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/initializer/BrokenInitializerTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/initializer/BrokenInitializerTest.java?rev=1561898&r1=1561897&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/initializer/BrokenInitializerTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/initializer/BrokenInitializerTest.java Mon Jan 27 22:48:16 2014
@@ -18,98 +18,72 @@
  */
 package org.apache.webbeans.test.unittests.exception.initializer;
 
-import org.apache.webbeans.test.TestContext;
+import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.test.component.exception.initializer.BrokenInitializer1;
 import org.apache.webbeans.test.component.exception.initializer.BrokenInitializer2;
 import org.apache.webbeans.test.component.exception.initializer.BrokenInitializer3;
 import org.apache.webbeans.test.component.exception.initializer.BrokenInitializer4;
 import org.junit.Assert;
-import org.junit.Before;
 import org.junit.Test;
 
-public class BrokenInitializerTest extends TestContext
+import javax.enterprise.inject.spi.DefinitionException;
+
+public class BrokenInitializerTest extends AbstractUnitTest
 {
-    public BrokenInitializerTest()
-    {
-        super(BrokenInitializerTest.class.getName());
-    }
-    
-    @Override
-    @Before
-    public void init()
-    {
-    }
-    
     @Test
     public void broken1()
     {
-        Exception e = null;
-        
         try
         {
-            defineManagedBean(BrokenInitializer1.class);
-            
-        }catch(Exception e1)
+            startContainer(BrokenInitializer1.class);
+            Assert.fail("DefinitionException expected");
+        }
+        catch (DefinitionException e)
         {
-            System.out.println(e1.getMessage());
-            e = e1;
+            return; // all ok
         }
-        
-        Assert.assertNotNull(e);
     }
     
     @Test
     public void broken2()
     {
-        Exception e = null;
-        
         try
         {
-            defineManagedBean(BrokenInitializer2.class);
-            
-        }catch(Exception e1)
+            startContainer(BrokenInitializer2.class);
+            Assert.fail("DefinitionException expected");
+        }
+        catch (DefinitionException e)
         {
-            System.out.println(e1.getMessage());
-            e = e1;
+            return; // all ok
         }
-        
-        Assert.assertNotNull(e);
     }
 
     @Test
     public void broken3()
     {
-        Exception e = null;
-        
         try
         {
-            defineManagedBean(BrokenInitializer3.class);
-            
-        }catch(Exception e1)
+            startContainer(BrokenInitializer3.class);
+            Assert.fail("DefinitionException expected");
+        }
+        catch (DefinitionException e)
         {
-            System.out.println(e1.getMessage());
-            e = e1;
+            return; // all ok
         }
-        
-        Assert.assertNotNull(e);
     }
 
     @Test
     public void broken4()
     {
-        Exception e = null;
-        
         try
         {
-            defineManagedBean(BrokenInitializer4.class);
-            
-        }catch(Exception e1)
+            startContainer(BrokenInitializer4.class);
+            Assert.fail("DefinitionException expected");
+        }
+        catch (DefinitionException e)
         {
-            System.out.println(e1.getMessage());
-            e = e1;
+            return; // all ok
         }
-        
-        Assert.assertNotNull(e);
     }
 
   }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/alternative/AlternativeTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/alternative/AlternativeTest.java?rev=1561898&r1=1561897&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/alternative/AlternativeTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/alternative/AlternativeTest.java Mon Jan 27 22:48:16 2014
@@ -18,49 +18,29 @@
  */
 package org.apache.webbeans.test.unittests.inject.alternative;
 
-import java.io.InputStream;
-
-import javax.enterprise.inject.spi.Bean;
 
 import junit.framework.Assert;
 
 import org.apache.webbeans.config.WebBeansContext;
-import org.apache.webbeans.test.TestContext;
+import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.test.component.inject.alternative.AlternativeComponent;
 import org.apache.webbeans.test.component.inject.alternative.AlternativeInjector;
 import org.apache.webbeans.test.component.inject.alternative.IAlternative;
 import org.apache.webbeans.test.component.inject.alternative.NotAlternativeComponent;
-import org.apache.webbeans.xml.WebBeansXMLConfigurator;
-import org.junit.Before;
 import org.junit.Test;
 
-public class AlternativeTest extends TestContext
+public class AlternativeTest extends AbstractUnitTest
 {
-    public AlternativeTest()
-    {
-        super(AlternativeTest.class.getName());
-    }
-    
-    @Before
-    public void setUp()
-    {
-        super.init();
-    }
-    
+
     @Test
     public void testInjectAlternative()
     {
-        InputStream stream = getClass().getClassLoader().getResourceAsStream("org/apache/webbeans/test/xml/alternative/alternatives.xml");
-        Assert.assertNotNull(stream);
+        startContainer("org/apache/webbeans/test/xml/alternative/alternatives.xml",
+                       AlternativeComponent.class,
+                       NotAlternativeComponent.class,
+                       AlternativeInjector.class);
 
-        WebBeansXMLConfigurator configurator = new WebBeansXMLConfigurator();
-        configurator.configureSpecSpecific(stream, "alternative.xml");
-        
-        defineManagedBean(AlternativeComponent.class);
-        defineManagedBean(NotAlternativeComponent.class);
-        
-        Bean<AlternativeInjector> injector = defineManagedBean(AlternativeInjector.class);
-        AlternativeInjector instance = (AlternativeInjector) getManager().getReference(injector, AlternativeInjector.class, getManager().createCreationalContext(injector));
+        AlternativeInjector instance = getInstance(AlternativeInjector.class);
         
         Assert.assertNotNull(instance);
         
@@ -75,13 +55,10 @@ public class AlternativeTest extends Tes
     @Test
     public void testInjectNotAlternative()
     {
-        WebBeansContext.getInstance().getAlternativesManager().clear();
-        
-        defineManagedBean(AlternativeComponent.class);
-        defineManagedBean(NotAlternativeComponent.class);
+
+        startContainer(AlternativeComponent.class, NotAlternativeComponent.class, AlternativeInjector.class);
         
-        Bean<AlternativeInjector> injector = defineManagedBean(AlternativeInjector.class);
-        AlternativeInjector instance = (AlternativeInjector) getManager().getReference(injector, AlternativeInjector.class, getManager().createCreationalContext(injector));
+        AlternativeInjector instance = getInstance(AlternativeInjector.class);
         
         Assert.assertNotNull(instance);
         

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/parametrized/BoundedTypeVariableTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/parametrized/BoundedTypeVariableTest.java?rev=1561898&r1=1561897&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/parametrized/BoundedTypeVariableTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/parametrized/BoundedTypeVariableTest.java Mon Jan 27 22:48:16 2014
@@ -22,19 +22,14 @@ import java.lang.reflect.Field;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 
-import org.apache.webbeans.test.TestContext;
+import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.test.component.inject.parametrized.BoundedTypeVariableComponent;
 import org.apache.webbeans.util.ClassUtil;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class BoundedTypeVariableTest extends TestContext
+public class BoundedTypeVariableTest extends AbstractUnitTest
 {
-    public BoundedTypeVariableTest()
-    {
-        super(BoundedTypeVariableTest.class.getName());
-    }
-
     @Test
     public void testBoundedTypeVariableTest()
     {
@@ -85,9 +80,10 @@ public class BoundedTypeVariableTest ext
             Assert.assertFalse(ClassUtil.isUnboundedTypeVariable(argument));
             
             
-        }catch(Exception e)
+        }
+        catch(Exception e)
         {
-            fail("BoundedWildCardTest");
+            Assert.fail("BoundedWildCardTest");
         }
         
     }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/producer/broken/BrokenProducerTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/producer/broken/BrokenProducerTest.java?rev=1561898&r1=1561897&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/producer/broken/BrokenProducerTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/producer/broken/BrokenProducerTest.java Mon Jan 27 22:48:16 2014
@@ -18,7 +18,7 @@
  */
 package org.apache.webbeans.test.unittests.producer.broken;
 
-import org.apache.webbeans.test.TestContext;
+import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.test.component.producer.broken.BrokenProducerComponent1;
 import org.apache.webbeans.test.component.producer.broken.BrokenProducerComponent2;
 import org.apache.webbeans.test.component.producer.broken.BrokenProducerComponent3;
@@ -26,37 +26,24 @@ import org.apache.webbeans.test.componen
 import org.apache.webbeans.test.component.producer.broken.BrokenProducerComponent5;
 import org.apache.webbeans.test.component.producer.broken.BrokenProducerComponent6;
 import org.junit.Assert;
-import org.junit.Before;
 import org.junit.Test;
 
-public class BrokenProducerTest extends TestContext
-{
-
-    public BrokenProducerTest()
-    {
-        super(BrokenProducerTest.class.getName());
-    }
-
-    @Override
-    @Before
-    public void init()
-    {
-    }
+import javax.enterprise.inject.spi.DefinitionException;
 
+public class BrokenProducerTest extends AbstractUnitTest
+{
     @Test
     public void testBroken1()
     {
         try
         {
-            clear();
-            defineManagedBean(BrokenProducerComponent1.class);
+            startContainer(BrokenProducerComponent1.class);
+            Assert.fail("DefinitionException expected");
         }
-        catch (Exception e)
+        catch (DefinitionException e)
         {
-            System.out.println("got expected exception: " + e.getMessage());
-            return; // all ok!
+            return; // all ok
         }
-        Assert.fail("expecting an exception!");
     }
 
     @Test
@@ -64,15 +51,13 @@ public class BrokenProducerTest extends 
     {
         try
         {
-            clear();
-            defineManagedBean(BrokenProducerComponent2.class);
+            startContainer(BrokenProducerComponent2.class);
+            Assert.fail("DefinitionException expected");
         }
-        catch (Exception e)
+        catch (DefinitionException e)
         {
-            System.out.println("got expected exception: " + e.getMessage());
-            return; // all ok!
+            return; // all ok
         }
-        Assert.fail("expecting an exception!");
     }
 
     @Test
@@ -80,15 +65,13 @@ public class BrokenProducerTest extends 
     {
         try
         {
-            clear();
-            defineManagedBean(BrokenProducerComponent3.class);
+            startContainer(BrokenProducerComponent3.class);
+            Assert.fail("DefinitionException expected");
         }
-        catch (Exception e)
+        catch (DefinitionException e)
         {
-            System.out.println("got expected exception: " + e.getMessage());
-            return; // all ok!
+            return; // all ok
         }
-        Assert.fail("expecting an exception!");
     }
 
     @Test
@@ -96,15 +79,13 @@ public class BrokenProducerTest extends 
     {
         try
         {
-            clear();
-            defineManagedBean(BrokenProducerComponent4.class);
+            startContainer(BrokenProducerComponent4.class);
+            Assert.fail("DefinitionException expected");
         }
-        catch (Exception e)
+        catch (DefinitionException e)
         {
-            System.out.println("got expected exception: " + e.getMessage());
-            return; // all ok!
+            return; // all ok
         }
-        Assert.fail("expecting an exception!");
     }
 
     @Test
@@ -112,15 +93,13 @@ public class BrokenProducerTest extends 
     {
         try
         {
-            clear();
-            defineManagedBean(BrokenProducerComponent5.class);
+            startContainer(BrokenProducerComponent5.class);
+            Assert.fail("DefinitionException expected");
         }
-        catch (Exception e)
+        catch (DefinitionException e)
         {
-            System.out.println("got expected exception: " + e.getMessage());
-            return; // all ok!
+            return; // all ok
         }
-        Assert.fail("expecting an exception!");
     }
 
     @Test
@@ -128,15 +107,13 @@ public class BrokenProducerTest extends 
     {
         try
         {
-            clear();
-            defineManagedBean(BrokenProducerComponent6.class);
+            startContainer(BrokenProducerComponent6.class);
+            Assert.fail("DefinitionException expected");
         }
-        catch (Exception e)
+        catch (DefinitionException e)
         {
-            System.out.println("got expected exception: " + e.getMessage());
-            return; // all ok!
+            return; // all ok
         }
-        Assert.fail("expecting an exception!");
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/strict/AlternativesTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/strict/AlternativesTest.java?rev=1561898&r1=1561897&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/strict/AlternativesTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/strict/AlternativesTest.java Mon Jan 27 22:48:16 2014
@@ -27,30 +27,22 @@ import junit.framework.Assert;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.inject.AlternativesManager;
-import org.apache.webbeans.test.TestContext;
+import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.test.xml.strict.Alternative1;
 import org.apache.webbeans.test.xml.strict.Alternative2;
 import org.apache.webbeans.xml.WebBeansXMLConfigurator;
 import org.junit.Test;
 
-public class AlternativesTest extends TestContext
+public class AlternativesTest extends AbstractUnitTest
 {
-    public AlternativesTest()
-    {
-        super(AlternativesTest.class.getName());
-    }
 
     @Test
     public void testAlternativeCorrect()
     {
-        Bean<Alternative1> alternative1 = defineManagedBean(Alternative1.class);
-        Bean<Alternative2> alternative2 = defineManagedBean(Alternative2.class);        
-        
-        InputStream stream = getClass().getClassLoader().getResourceAsStream("org/apache/webbeans/test/xml/strict/alternatives_correct.xml");
-        Assert.assertNotNull(stream);
+        startContainer("org/apache/webbeans/test/xml/strict/alternatives_correct.xml", Alternative1.class, Alternative2.class);
 
-        WebBeansXMLConfigurator configurator = new WebBeansXMLConfigurator();
-        configurator.configureSpecSpecific(stream, "alternatives_correct.xml");
+        Bean<Alternative1> alternative1 = getBean(Alternative1.class);
+        Bean<Alternative2> alternative2 = getBean(Alternative2.class);
 
         AlternativesManager manager = WebBeansContext.getInstance().getAlternativesManager();
         

Modified: openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/xml/alternative/alternatives.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/xml/alternative/alternatives.xml?rev=1561898&r1=1561897&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/xml/alternative/alternatives.xml (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/xml/alternative/alternatives.xml Mon Jan 27 22:48:16 2014
@@ -18,7 +18,7 @@ specific language governing permissions 
 under the License.
 -->
 <beans>
-	<alternatives>
-		<class>org.apache.webbeans.test.component.inject.alternative.AlternativeComponent</class>
-	</alternatives>
+    <alternatives>
+        <class>org.apache.webbeans.test.component.inject.alternative.AlternativeComponent</class>
+    </alternatives>
 </beans>

Modified: openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/ScannerService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/ScannerService.java?rev=1561898&r1=1561897&r2=1561898&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/ScannerService.java (original)
+++ openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/ScannerService.java Mon Jan 27 22:48:16 2014
@@ -37,8 +37,8 @@ import java.util.Set;
 public interface ScannerService
 {
     /**
-     * Any initializtion action that is
-     * required by the implementors. 
+     * Any initialisation action that is
+     * required by the implementation.
      * @param object initialization object
      */
     public void init(Object object);



Mime
View raw message