[jboss-cvs] JBossAS SVN: r95573 - projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/matchers/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Oct 26 12:28:45 EDT 2009
Author: alesj
Date: 2009-10-26 12:28:45 -0400 (Mon, 26 Oct 2009)
New Revision: 95573
Modified:
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/matchers/test/NameIgnoreMechanismTestCase.java
Log:
Make test OO.
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/matchers/test/NameIgnoreMechanismTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/matchers/test/NameIgnoreMechanismTestCase.java 2009-10-26 16:23:33 UTC (rev 95572)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/matchers/test/NameIgnoreMechanismTestCase.java 2009-10-26 16:28:45 UTC (rev 95573)
@@ -52,6 +52,20 @@
return suite(NameIgnoreMechanismTestCase.class);
}
+ protected void testNameIgnoreMechanism(FeedbackDeployer fbd, int size) throws Throwable
+ {
+ NIMDeployer nimd = new NIMDeployer(new CollectionNameIgnoreMechanism(Collections.singleton("fst.txt")));
+
+ DeployerClient main = createMainDeployer(fbd, nimd);
+ addStructureDeployer(main, new JARStructure());
+
+ Deployment deployment = createDeployment("/matchers", "ignore");
+ main.deploy(deployment);
+
+ assertEquals(size, fbd.getFiles().size());
+ assertFalse(fbd.getFiles().contains("fst.txt"));
+ }
+
public void testSingleNameNoSuffix() throws Throwable
{
FeedbackDeployer fbd1 = new FeedbackDeployer();
@@ -75,16 +89,8 @@
FeedbackDeployer fbd = new FeedbackDeployer();
Set<String> names = new HashSet<String>(Arrays.asList("empty.txt", "fst.txt", "snd.txt"));
fbd.setNames(names);
- NIMDeployer nimd = new NIMDeployer(new CollectionNameIgnoreMechanism(Collections.singleton("fst.txt")));
- DeployerClient main = createMainDeployer(fbd, nimd);
- addStructureDeployer(main, new JARStructure());
-
- Deployment deployment = createDeployment("/matchers", "ignore");
- main.deploy(deployment);
-
- assertEquals(2, fbd.getFiles().size());
- assertFalse(fbd.getFiles().contains("fst.txt"));
+ testNameIgnoreMechanism(fbd, 2);
}
public void testNoNameJustSuffix() throws Throwable
@@ -92,16 +98,8 @@
FeedbackDeployer fbd = new FeedbackDeployer();
fbd.setSuffix(".txt");
fbd.setAllowMultipleFiles(true);
- NIMDeployer nimd = new NIMDeployer(new CollectionNameIgnoreMechanism(Collections.singleton("fst.txt")));
- DeployerClient main = createMainDeployer(fbd, nimd);
- addStructureDeployer(main, new JARStructure());
-
- Deployment deployment = createDeployment("/matchers", "ignore");
- main.deploy(deployment);
-
- assertEquals(2, fbd.getFiles().size());
- assertFalse(fbd.getFiles().contains("fst.txt"));
+ testNameIgnoreMechanism(fbd, 2);
}
public void testNamesWithSuffix() throws Throwable
@@ -110,15 +108,7 @@
Set<String> names = new HashSet<String>(Arrays.asList("empty.txt", "fst.txt", "snd.txt"));
fbd.setNames(names);
fbd.setSuffix(".tmp");
- NIMDeployer nimd = new NIMDeployer(new CollectionNameIgnoreMechanism(Collections.singleton("fst.txt")));
- DeployerClient main = createMainDeployer(fbd, nimd);
- addStructureDeployer(main, new JARStructure());
-
- Deployment deployment = createDeployment("/matchers", "ignore");
- main.deploy(deployment);
-
- assertEquals(3, fbd.getFiles().size());
- assertFalse(fbd.getFiles().contains("fst.txt"));
+ testNameIgnoreMechanism(fbd, 3);
}
}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list