From 9223881cfba54544d18d285a71f4005ae969ab51 Mon Sep 17 00:00:00 2001 From: erik Date: Sun, 15 Aug 2010 17:01:38 +0000 Subject: [PATCH] --- .../wamblee/cdi/BeanManagerLookupTest.java | 1 + .../org/wamblee/cdi/BeanManagerSetup.java | 49 ------------------- .../wamblee/cdi/CdiInjectorFactoryTest.java | 1 + .../java/org/wamblee/cdi/CdiInjectorTest.java | 1 + .../org/wamblee/cdi/InjectorBuilderTest.java | 1 + .../org/wamblee/cdi/SimpleInjectorTest.java | 1 + .../test/java/org/wamblee/cdi/WeldTest.java | 1 + 7 files changed, 6 insertions(+), 49 deletions(-) delete mode 100644 support/cdi/src/test/java/org/wamblee/cdi/BeanManagerSetup.java diff --git a/support/cdi/src/test/java/org/wamblee/cdi/BeanManagerLookupTest.java b/support/cdi/src/test/java/org/wamblee/cdi/BeanManagerLookupTest.java index 2889a2fa..58f1b05f 100644 --- a/support/cdi/src/test/java/org/wamblee/cdi/BeanManagerLookupTest.java +++ b/support/cdi/src/test/java/org/wamblee/cdi/BeanManagerLookupTest.java @@ -22,6 +22,7 @@ import javax.enterprise.inject.spi.BeanManager; import javax.naming.InitialContext; import org.junit.Test; +import org.wamblee.test.cdi.BeanManagerSetup; import org.wamblee.test.jndi.StubInitialContextFactory; public class BeanManagerLookupTest extends BaseTestFixture { diff --git a/support/cdi/src/test/java/org/wamblee/cdi/BeanManagerSetup.java b/support/cdi/src/test/java/org/wamblee/cdi/BeanManagerSetup.java deleted file mode 100644 index 80650311..00000000 --- a/support/cdi/src/test/java/org/wamblee/cdi/BeanManagerSetup.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2005-2010 the original author or authors. - * - * 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.wamblee.cdi; - -import javax.enterprise.inject.spi.BeanManager; - -import org.jboss.weld.environment.se.Weld; -import org.jboss.weld.environment.se.WeldContainer; - -public class BeanManagerSetup { - - private Weld weld; - private WeldContainer container; - private BeanManager beanManager; - - public BeanManagerSetup() { - // Empty - } - - public void initialize() { - weld = new Weld(); - container = weld.initialize(); - beanManager = container.getBeanManager(); - } - - public BeanManager getBeanManager() { - return beanManager; - } - - public void shutdown() { - weld.shutdown(); - weld = null; - container = null; - beanManager = null; - } -} diff --git a/support/cdi/src/test/java/org/wamblee/cdi/CdiInjectorFactoryTest.java b/support/cdi/src/test/java/org/wamblee/cdi/CdiInjectorFactoryTest.java index 861e8809..0c102a08 100644 --- a/support/cdi/src/test/java/org/wamblee/cdi/CdiInjectorFactoryTest.java +++ b/support/cdi/src/test/java/org/wamblee/cdi/CdiInjectorFactoryTest.java @@ -20,6 +20,7 @@ import org.junit.Before; import org.junit.Test; import org.wamblee.inject.Injector; import org.wamblee.inject.InjectorFactory; +import org.wamblee.test.cdi.BeanManagerSetup; import static junit.framework.TestCase.*; diff --git a/support/cdi/src/test/java/org/wamblee/cdi/CdiInjectorTest.java b/support/cdi/src/test/java/org/wamblee/cdi/CdiInjectorTest.java index 13946b3a..54514928 100644 --- a/support/cdi/src/test/java/org/wamblee/cdi/CdiInjectorTest.java +++ b/support/cdi/src/test/java/org/wamblee/cdi/CdiInjectorTest.java @@ -21,6 +21,7 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.wamblee.inject.InjectorBuilder; +import org.wamblee.test.cdi.BeanManagerSetup; public class CdiInjectorTest extends BaseTestFixture { diff --git a/support/cdi/src/test/java/org/wamblee/cdi/InjectorBuilderTest.java b/support/cdi/src/test/java/org/wamblee/cdi/InjectorBuilderTest.java index daffe9b1..50c436d3 100644 --- a/support/cdi/src/test/java/org/wamblee/cdi/InjectorBuilderTest.java +++ b/support/cdi/src/test/java/org/wamblee/cdi/InjectorBuilderTest.java @@ -26,6 +26,7 @@ import org.wamblee.cdi.SimpleInjectorTest.X; import org.wamblee.cdi.SimpleInjectorTest.Y; import org.wamblee.inject.InjectorFactory; import org.wamblee.inject.InjectorBuilder; +import org.wamblee.test.cdi.BeanManagerSetup; import org.wamblee.test.jndi.StubInitialContextFactory; public class InjectorBuilderTest extends BaseTestFixture { diff --git a/support/cdi/src/test/java/org/wamblee/cdi/SimpleInjectorTest.java b/support/cdi/src/test/java/org/wamblee/cdi/SimpleInjectorTest.java index 7c4bd112..7c61b2ff 100644 --- a/support/cdi/src/test/java/org/wamblee/cdi/SimpleInjectorTest.java +++ b/support/cdi/src/test/java/org/wamblee/cdi/SimpleInjectorTest.java @@ -29,6 +29,7 @@ import org.wamblee.inject.Injector; import org.wamblee.inject.InjectorFactory; import org.wamblee.inject.InjectorBuilder; import org.wamblee.inject.SimpleInjector; +import org.wamblee.test.cdi.BeanManagerSetup; import org.wamblee.test.jndi.StubInitialContextFactory; public class SimpleInjectorTest extends BaseTestFixture { diff --git a/support/cdi/src/test/java/org/wamblee/cdi/WeldTest.java b/support/cdi/src/test/java/org/wamblee/cdi/WeldTest.java index d2aa8a55..c6f378e8 100644 --- a/support/cdi/src/test/java/org/wamblee/cdi/WeldTest.java +++ b/support/cdi/src/test/java/org/wamblee/cdi/WeldTest.java @@ -9,6 +9,7 @@ import javax.enterprise.inject.spi.InjectionTarget; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.wamblee.test.cdi.BeanManagerSetup; public class WeldTest { -- 2.31.1