This is an automated email from the ASF dual-hosted git repository. gk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-pool.git
commit 7c8b75d4fdc56aec908ac9f46ad9519949cc5103 Author: Jeffery Painter <[email protected]> AuthorDate: Fri Jan 11 12:28:28 2019 +0000 Update junit 5, fix changes doc location for report generation git-svn-id: https://svn.apache.org/repos/asf/turbine/fulcrum/trunk/pool@1851029 13f79535-47bb-0310-9956-ffa450edef68 --- {xdocs => src/changes}/changes.xml | 3 ++ .../org/apache/fulcrum/pool/PoolServiceTest.java | 46 +++++++++++++--------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/xdocs/changes.xml b/src/changes/changes.xml similarity index 95% rename from xdocs/changes.xml rename to src/changes/changes.xml index 6131005..b6d4c63 100644 --- a/xdocs/changes.xml +++ b/src/changes/changes.xml @@ -26,6 +26,9 @@ <body> <release version="1.0.5" date="in SVN"> <action dev="painter" type="update"> + Update test to use junit 5 + </action> + <action dev="painter" type="update"> Derive from Turbine parent POM 5 </action> <action dev="painter" type="update"> diff --git a/src/test/org/apache/fulcrum/pool/PoolServiceTest.java b/src/test/org/apache/fulcrum/pool/PoolServiceTest.java index be471e9..bd080de 100644 --- a/src/test/org/apache/fulcrum/pool/PoolServiceTest.java +++ b/src/test/org/apache/fulcrum/pool/PoolServiceTest.java @@ -1,5 +1,8 @@ package org.apache.fulcrum.pool; + +import static org.junit.jupiter.api.Assertions.assertEquals; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -19,41 +22,37 @@ package org.apache.fulcrum.pool; * under the License. */ -import org.apache.fulcrum.testcontainer.BaseUnitTest; -import org.junit.Before; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.apache.fulcrum.testcontainer.BaseUnit5Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + /** + * Basic testing of the PoolService Component + * + * @author <a href="mailto:[email protected]">Jeffery Painter</a> * @author Eric Pugh * @author <a href="mailto:[email protected]">Stephen McConnell</a> * */ -public class PoolServiceTest extends BaseUnitTest +public class PoolServiceTest extends BaseUnit5Test { /** Default pool service **/ private PoolService poolService = null; /** - * Defines the testcase name for JUnit. - * - * @param name the testcase's name. - */ - public PoolServiceTest(String name) - { - super(name); - } - - /** * Perform pool service setup * * @throws Exception generic exception */ - @Before + @BeforeEach public void setUp() throws Exception { - super.setUp(); - - poolService = (PoolService) this.resolve(PoolService.class.getName()); + setConfigurationFileName("src/test/TestComponentConfig.xml"); + setRoleFileName("src/test/TestRoleConfig.xml"); + poolService = (PoolService) this.lookup(PoolService.class.getName()); } /** @@ -69,6 +68,9 @@ public class PoolServiceTest extends BaseUnitTest } + /** + * Test adding an instance to the pool + */ @Test public void testPutInstance() { @@ -79,6 +81,9 @@ public class PoolServiceTest extends BaseUnitTest } + /** + * Test altering pool capacity + */ @Test public void testGetSetCapacity() { @@ -88,6 +93,9 @@ public class PoolServiceTest extends BaseUnitTest } + /** + * Test to determine current size of the pool + */ @Test public void testGetSize() { @@ -114,7 +122,7 @@ public class PoolServiceTest extends BaseUnitTest assertEquals(0, poolService.getSize("java.lang.String")); } - /* + /** * Class to test for void clearPool() */ @Test
