Author: manik.surtani(a)jboss.com
Date: 2008-01-02 14:37:27 -0500 (Wed, 02 Jan 2008)
New Revision: 4947
Modified:
core/trunk/src/test/java/org/jboss/cache/eviction/RegionManagerTest.java
Log:
Updated test
Modified: core/trunk/src/test/java/org/jboss/cache/eviction/RegionManagerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/eviction/RegionManagerTest.java 2008-01-02
19:32:44 UTC (rev 4946)
+++ core/trunk/src/test/java/org/jboss/cache/eviction/RegionManagerTest.java 2008-01-02
19:37:27 UTC (rev 4947)
@@ -1,13 +1,5 @@
package org.jboss.cache.eviction;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertNotSame;
-import static org.testng.AssertJUnit.assertTrue;
-import static org.testng.AssertJUnit.fail;
-
-import java.util.List;
-
import org.jboss.cache.Fqn;
import org.jboss.cache.Region;
import org.jboss.cache.RegionManager;
@@ -16,9 +8,13 @@
import org.jboss.cache.config.EvictionRegionConfig;
import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.xml.XmlHelper;
+import static org.testng.AssertJUnit.*;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import org.w3c.dom.Element;
+
+import java.util.List;
+
/**
* Region Manager unit tests.
*
@@ -26,7 +22,7 @@
* @author Daniel Huang (dhuang(a)jboss.org)
* @version $Revision$
*/
-@Test(groups = {"functional"})
+@Test(groups = "functional")
public class RegionManagerTest
{
private final Fqn DEFAULT_REGION = Fqn.ROOT;
@@ -97,12 +93,10 @@
regionManager.getRegion(Fqn.fromString("/a"), Region.Type.EVICTION,
false);
fail("If we don't setCache the default region, we should throw a
RTE!");
}
- catch (Exception e)
+ catch (Exception expected)
{
// This is ok. Should throw an runtime exception
}
-
- assert regionManager.getRegion(Fqn.fromString("/a"), false) == null :
"Should not throw an exception if we dont specify a region type!";
}
public void testGetRegion()
@@ -121,9 +115,9 @@
{
// test the new style configuration
String xml = "<region name=\"/test/\"
policyClass=\"org.jboss.cache.eviction.LFUPolicy\">" +
- "<attribute
name=\"minNodes\">10</attribute>" +
- "<attribute
name=\"maxNodes\">20</attribute>" +
- "</region>";
+ "<attribute name=\"minNodes\">10</attribute>"
+
+ "<attribute name=\"maxNodes\">20</attribute>"
+
+ "</region>";
Element element = XmlHelper.stringToElement(xml);
RegionManager regionManager = new RegionManager();
regionManager.setUsingEvictions(true);
@@ -140,9 +134,9 @@
// test the 1.2.x style configuration
xml = "<region name=\"abc\">" +
- "<attribute
name=\"minNodes\">10</attribute>" +
- "<attribute
name=\"maxNodes\">20</attribute>" +
- "</region>";
+ "<attribute name=\"minNodes\">10</attribute>"
+
+ "<attribute name=\"maxNodes\">20</attribute>"
+
+ "</region>";
element = XmlHelper.stringToElement(xml);
erc = XmlConfigurationParser.parseEvictionRegionConfig(element,
"org.jboss.cache.eviction.LFUPolicy", EvictionConfig.EVENT_QUEUE_SIZE_DEFAULT);
regionManager = new RegionManager();