Author: pete.muir(a)jboss.org
Date: 2009-04-06 10:37:20 -0400 (Mon, 06 Apr 2009)
New Revision: 2319
Removed:
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/AbstractLogTest.java
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/StandaloneContainersImpl.java
Modified:
extensions/trunk/logger/pom.xml
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/log/LoggerInjectionTest.java
extensions/trunk/logger/src/test/resources/META-INF/web-beans-tck.properties
Log:
WBRI-216
Modified: extensions/trunk/logger/pom.xml
===================================================================
--- extensions/trunk/logger/pom.xml 2009-04-06 14:36:06 UTC (rev 2318)
+++ extensions/trunk/logger/pom.xml 2009-04-06 14:37:20 UTC (rev 2319)
@@ -53,6 +53,12 @@
</dependency>
<dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-core-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-api</artifactId>
<scope>test</scope>
Deleted:
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/AbstractLogTest.java
===================================================================
---
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/AbstractLogTest.java 2009-04-06
14:36:06 UTC (rev 2318)
+++
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/AbstractLogTest.java 2009-04-06
14:37:20 UTC (rev 2319)
@@ -1,67 +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.test;
-
-import javax.inject.manager.Manager;
-
-import org.jboss.testharness.AbstractTest;
-import org.jboss.webbeans.CurrentManager;
-import org.testng.ITestContext;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.BeforeSuite;
-
-/**
- * Some basic abstractions useful for tests in this project.
- *
- * @author David Allen
- *
- */
-public abstract class AbstractLogTest extends AbstractTest
-{
- private Manager manager;
-
- @Override
- @BeforeSuite
- public void beforeSuite(ITestContext context) throws Exception
- {
- if (!isInContainer())
- {
- getCurrentConfiguration().setStandaloneContainers(new
StandaloneContainersImpl());
-
getCurrentConfiguration().getExtraPackages().add(AbstractLogTest.class.getPackage().getName());
- }
- super.beforeSuite(context);
- }
-
- @BeforeMethod
- public void before() throws Exception
- {
- this.manager = CurrentManager.rootManager();
- }
-
- @AfterMethod
- public void after() throws Exception
- {
- manager = null;
- }
-
- public Manager getCurrentManager()
- {
- return manager;
- }
-}
Deleted:
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/StandaloneContainersImpl.java
===================================================================
---
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/StandaloneContainersImpl.java 2009-04-06
14:36:06 UTC (rev 2318)
+++
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/StandaloneContainersImpl.java 2009-04-06
14:37:20 UTC (rev 2319)
@@ -1,78 +0,0 @@
-package org.jboss.webbeans.test;
-
-import java.net.URL;
-
-import org.jboss.testharness.api.DeploymentException;
-import org.jboss.testharness.spi.StandaloneContainers;
-import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.mock.MockEELifecycle;
-import org.jboss.webbeans.mock.MockServletLifecycle;
-import org.jboss.webbeans.mock.MockWebBeanDiscovery;
-
-public class StandaloneContainersImpl implements StandaloneContainers
-{
-
- // 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
- {
- 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)
- {
- discovery.setWebBeansXmlFiles(beansXml);
- }
- lifecycle.beginApplication();
- }
- catch (Exception e)
- {
- throw new DeploymentException("Error deploying beans", e);
- }
- lifecycle.beginSession();
- lifecycle.beginRequest();
- }
-
- public void deploy(Iterable<Class<?>> classes) throws DeploymentException
- {
- deploy(classes, null);
- }
-
- public void cleanup()
- {
- // Np-op
-
- }
-
- public void setup()
- {
- // No-op
- }
-
- public void undeploy()
- {
- lifecycle.endRequest();
- lifecycle.endSession();
- lifecycle.endApplication();
- CurrentManager.setRootManager(null);
- lifecycle = null;
- }
-
-}
Modified:
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/log/LoggerInjectionTest.java
===================================================================
---
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/log/LoggerInjectionTest.java 2009-04-06
14:36:06 UTC (rev 2318)
+++
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/log/LoggerInjectionTest.java 2009-04-06
14:37:20 UTC (rev 2319)
@@ -19,7 +19,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Classes;
-import org.jboss.webbeans.test.AbstractLogTest;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
/**
@@ -29,7 +29,7 @@
*/
@Artifact
@Classes(packages = { "org.jboss.webbeans.log",
"org.jboss.webbeans.test.log" })
-public class LoggerInjectionTest extends AbstractLogTest
+public class LoggerInjectionTest extends AbstractWebBeansTest
{
@Test
public void testBasicLogInjection()
Modified: extensions/trunk/logger/src/test/resources/META-INF/web-beans-tck.properties
===================================================================
---
extensions/trunk/logger/src/test/resources/META-INF/web-beans-tck.properties 2009-04-06
14:36:06 UTC (rev 2318)
+++
extensions/trunk/logger/src/test/resources/META-INF/web-beans-tck.properties 2009-04-06
14:37:20 UTC (rev 2319)
@@ -1,3 +1 @@
-org.jboss.testharness.spi.StandaloneContainers=org.jboss.webbeans.test.StandaloneContainersImpl
-org.jboss.testharness.api.TestLauncher=org.jboss.testharness.impl.runner.servlet.ServletTestLauncher
org.jboss.testharness.testPackage=org.jboss.webbeans.test
\ No newline at end of file