openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1434507 - in /openwebbeans/trunk/webbeans-impl/src/test: java/org/apache/webbeans/test/unittests/intercept/webbeans/ resources/org/apache/webbeans/test/unittests/ resources/org/apache/webbeans/test/unittests/intercept/ resources/org/apache...
Date Thu, 17 Jan 2013 00:00:48 GMT
Author: struberg
Date: Thu Jan 17 00:00:48 2013
New Revision: 1434507

URL: http://svn.apache.org/viewvc?rev=1434507&view=rev
Log:
OWB-344 renovate another bloody old test. 

Added:
    openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/unittests/
    openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/unittests/intercept/
    openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/unittests/intercept/webbeans/
    openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.xml
Modified:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.java

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.java?rev=1434507&r1=1434506&r2=1434507&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.java
Thu Jan 17 00:00:48 2013
@@ -18,39 +18,32 @@
  */
 package org.apache.webbeans.test.unittests.intercept.webbeans;
 
+import java.util.ArrayList;
+import java.util.Collection;
+
 import junit.framework.Assert;
 
-import org.apache.webbeans.component.AbstractOwbBean;
-import org.apache.webbeans.config.WebBeansContext;
-import org.apache.webbeans.test.TestContext;
+import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.test.component.intercept.webbeans.SecureComponent;
 import org.apache.webbeans.test.component.intercept.webbeans.SecureInterceptor;
-import org.junit.Before;
 import org.junit.Test;
 
-public class SecureInterceptorComponentTest extends TestContext
+public class SecureInterceptorComponentTest extends AbstractUnitTest
 {
-    public SecureInterceptorComponentTest()
-    {
-        super(SecureInterceptorComponentTest.class.getName());
-    }
-
-    @Before
-    public void init()
-    {
-        initDefaultStereoTypes();
-        initializeInterceptorType(SecureInterceptor.class);
-    }
 
     @Test
     public void testSecureInterceptor()
     {
-        defineInterceptor(SecureInterceptor.class);
-        AbstractOwbBean<SecureComponent> component = defineManagedBean(SecureComponent.class);
+        Collection<String> beanXmls = new ArrayList<String>();
+        beanXmls.add(getXmlPath(this.getClass().getPackage().getName(), this.getClass().getSimpleName()));
+
+        Collection<Class<?>> beanClasses = new ArrayList<Class<?>>();
+        beanClasses.add(SecureComponent.class);
+        beanClasses.add(SecureInterceptor.class);
+        startContainer(beanClasses, beanXmls);
 
-        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
 
-        SecureComponent secureComponent = getManager().getInstance(component);
+        SecureComponent secureComponent = getInstance(SecureComponent.class);
 
         Assert.assertNotNull(secureComponent);
 
@@ -59,6 +52,7 @@ public class SecureInterceptorComponentT
         Assert.assertTrue(SecureInterceptor.CALL);
         Assert.assertTrue(value);
 
+        shutDownContainer();
     }
 
 }

Added: openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.xml?rev=1434507&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.xml
(added)
+++ openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.xml
Thu Jan 17 00:00:48 2013
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+-->
+<beans>
+    <interceptors>
+        <class>org.apache.webbeans.test.component.intercept.webbeans.SecureInterceptor</class>
+    </interceptors>
+</beans>



Mime
View raw message