updates Activationconfig to Junit4
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/d747b890 Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/d747b890 Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/d747b890 Branch: refs/heads/master Commit: d747b890973916a7bd1cb60e68462606b9d13362 Parents: 0194b93 Author: Otavio Santana <[email protected]> Authored: Fri Jul 14 09:58:57 2017 -0300 Committer: Otavio Santana <[email protected]> Committed: Fri Jul 14 09:58:57 2017 -0300 ---------------------------------------------------------------------- .../ActivationConfigPropertyOverrideTest.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/d747b890/container/openejb-core/src/test/java/org/apache/openejb/config/ActivationConfigPropertyOverrideTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/ActivationConfigPropertyOverrideTest.java b/container/openejb-core/src/test/java/org/apache/openejb/config/ActivationConfigPropertyOverrideTest.java index 402af7f..d005b8f 100755 --- a/container/openejb-core/src/test/java/org/apache/openejb/config/ActivationConfigPropertyOverrideTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/config/ActivationConfigPropertyOverrideTest.java @@ -30,12 +30,17 @@ import org.apache.openejb.jee.EjbJar; import org.apache.openejb.jee.MessageDrivenBean; import org.apache.openejb.jee.oejb3.OpenejbJar; import org.apache.openejb.loader.SystemInstance; +import org.junit.Test; import javax.ejb.MessageDriven; import javax.jms.Message; import javax.jms.MessageListener; import java.util.Properties; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /* 1 -D<deploymentId>.activation.<property>=<value> 2. -D<ejbName>.activation.<property>=<value> @@ -43,12 +48,13 @@ import java.util.Properties; 4. -Dmdb.activation.<property>=<value> Order: 4 is overriden by 3 (and so on) */ -public class ActivationConfigPropertyOverrideTest extends TestCase { +public class ActivationConfigPropertyOverrideTest{ /** * Test internal method used in ActivationConfigPropertyOverride */ + @Test public void testGetOverridesShouldTrimAwayPrefixesCorrectly() { final Properties properties = new Properties(); properties.put("ENTERPRISEBEAN.mdb.activation.destinationType", "something"); @@ -61,6 +67,7 @@ public class ActivationConfigPropertyOverrideTest extends TestCase { * * @throws OpenEJBException */ + @Test public void testOverrideActivationConfigProperty() throws OpenEJBException { // set overrides for destinationType and check @@ -81,6 +88,7 @@ public class ActivationConfigPropertyOverrideTest extends TestCase { * * @throws OpenEJBException */ + @Test public void testAddActivationConfigPropertyIfNotAlreadyPresent() throws OpenEJBException { // set overrides @@ -110,6 +118,7 @@ public class ActivationConfigPropertyOverrideTest extends TestCase { return false; } + @Test public void testNoOverrideSetShouldNotOverride() throws OpenEJBException { if (SystemInstance.get().getProperties().containsKey("ENTERPRISEBEAN.mdb.activation.destinationType")) { SystemInstance.get().getProperties().remove("ENTERPRISEBEAN.mdb.activation.destinationType"); @@ -124,6 +133,7 @@ public class ActivationConfigPropertyOverrideTest extends TestCase { assertTrue(containsActivationKeyValuePair(mdb, "destinationType", "shouldNotBeOverriddenString")); } + @Test public void testNotOverridden() throws Exception { SystemInstance.reset(); final Assembler assembler = new Assembler(); @@ -151,6 +161,7 @@ public class ActivationConfigPropertyOverrideTest extends TestCase { assertEquals("YELLOW.TOPIC", yellow.activationProperties.get("destination")); } + @Test public void testMdbOverrideSystem() throws Exception { SystemInstance.reset(); final Properties systProps = SystemInstance.get().getProperties(); @@ -190,6 +201,7 @@ public class ActivationConfigPropertyOverrideTest extends TestCase { } } + @Test public void testMdbOverrideOpenejbJar() throws Exception { SystemInstance.reset(); @@ -253,6 +265,7 @@ public class ActivationConfigPropertyOverrideTest extends TestCase { } + @Test public void testEjbNameOverrideSystem() throws Exception { SystemInstance.reset(); final Properties properties = SystemInstance.get().getProperties(); @@ -286,6 +299,7 @@ public class ActivationConfigPropertyOverrideTest extends TestCase { assertEquals("OVERRIDDEN.QUEUE", yellow.activationProperties.get("destination")); } + @Test public void testEjbNameOverrideOpenejbJar() throws Exception { SystemInstance.reset();
