[jboss-cvs] JBossAS SVN: r99162 - in projects/jboss-deployers/trunk/deployers-vfs/src/test: java/org/jboss/test/deployers/vfs/matchers/test and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jan 8 09:55:15 EST 2010
Author: alesj
Date: 2010-01-08 09:55:14 -0500 (Fri, 08 Jan 2010)
New Revision: 99162
Added:
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/matchers/test/MetaDataTypeFilterTestCase.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/META-INF/
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/META-INF/empty.txt
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/META-INF/fst.txt
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/META-INF/jboss-structure.xml
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/alt/
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/alt/qwert.tmp
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/alt/snd.txt
Modified:
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/matchers/VFSMatchersTestSuite.java
Log:
[JBDEPLOY-232]; add parser deployer tests.
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/matchers/VFSMatchersTestSuite.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/matchers/VFSMatchersTestSuite.java 2010-01-08 14:33:26 UTC (rev 99161)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/matchers/VFSMatchersTestSuite.java 2010-01-08 14:55:14 UTC (rev 99162)
@@ -26,6 +26,7 @@
import junit.textui.TestRunner;
import org.jboss.test.deployers.vfs.matchers.test.FileMatchersTestCase;
import org.jboss.test.deployers.vfs.matchers.test.JarExtensionsTestCase;
+import org.jboss.test.deployers.vfs.matchers.test.MetaDataTypeFilterTestCase;
import org.jboss.test.deployers.vfs.matchers.test.NameIgnoreMechanismTestCase;
/**
@@ -47,6 +48,7 @@
suite.addTest(FileMatchersTestCase.suite());
suite.addTest(JarExtensionsTestCase.suite());
suite.addTest(NameIgnoreMechanismTestCase.suite());
+ suite.addTest(MetaDataTypeFilterTestCase.suite());
return suite;
}
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/matchers/test/MetaDataTypeFilterTestCase.java (from rev 99156, 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/MetaDataTypeFilterTestCase.java (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/matchers/test/MetaDataTypeFilterTestCase.java 2010-01-08 14:55:14 UTC (rev 99162)
@@ -0,0 +1,93 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.vfs.matchers.test;
+
+import junit.framework.Test;
+
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.deployers.spi.structure.MetaDataTypeFilter;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.plugins.structure.explicit.DeclaredStructure;
+import org.jboss.test.deployers.BaseDeployersVFSTest;
+import org.jboss.test.deployers.vfs.matchers.support.FeedbackDeployer;
+
+/**
+ * MetaDataType filter tests.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class MetaDataTypeFilterTestCase extends BaseDeployersVFSTest
+{
+ public MetaDataTypeFilterTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(MetaDataTypeFilterTestCase.class);
+ }
+
+ public void testAlternative() throws Exception
+ {
+ FeedbackDeployer fbd = new FeedbackDeployer();
+ fbd.setAllowMultipleFiles(true);
+ fbd.setSuffix(".txt");
+ fbd.setFilter(MetaDataTypeFilter.ALL);
+
+ DeployerClient main = createMainDeployer(fbd);
+ addStructureDeployer(main, new DeclaredStructure());
+
+ Deployment deployment = createDeployment("/matchers", "mdtf");
+ main.deploy(deployment);
+
+ assertEquals(3, fbd.getFiles().size());
+ }
+
+ public void testFilterFromUnit() throws Exception
+ {
+ AbstractDeployer pre = new AbstractDeployer()
+ {
+ public void deploy(DeploymentUnit unit) throws DeploymentException
+ {
+ unit.addAttachment(MetaDataTypeFilter.class, MetaDataTypeFilter.ALL);
+ }
+ };
+ pre.setStage(DeploymentStages.PRE_PARSE);
+ FeedbackDeployer fbd = new FeedbackDeployer();
+ fbd.setAllowMultipleFiles(true);
+ fbd.setSuffix(".txt");
+ fbd.setFilter(null); // disable default
+
+ DeployerClient main = createMainDeployer(fbd, pre);
+ addStructureDeployer(main, new DeclaredStructure());
+
+ Deployment deployment = createDeployment("/matchers", "mdtf");
+ main.deploy(deployment);
+
+ assertEquals(3, fbd.getFiles().size());
+ }
+}
\ No newline at end of file
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/META-INF/empty.txt (from rev 99156, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/ignore/META-INF/empty.txt)
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/META-INF/empty.txt (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/META-INF/empty.txt 2010-01-08 14:55:14 UTC (rev 99162)
@@ -0,0 +1 @@
+Empty.
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/META-INF/fst.txt (from rev 99156, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/ignore/META-INF/fst.txt)
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/META-INF/fst.txt (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/META-INF/fst.txt 2010-01-08 14:55:14 UTC (rev 99162)
@@ -0,0 +1 @@
+First.
Added: projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/META-INF/jboss-structure.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/META-INF/jboss-structure.xml (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/META-INF/jboss-structure.xml 2010-01-08 14:55:14 UTC (rev 99162)
@@ -0,0 +1,9 @@
+<structure>
+ <context>
+ <path name=""/>
+ <metaDataPath>
+ <path name="META-INF" type="Default"/>
+ <path name="alt" type="Alt"/>
+ </metaDataPath>
+ </context>
+</structure>
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/alt/qwert.tmp (from rev 99156, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/ignore/META-INF/qwert.tmp)
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/alt/qwert.tmp (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/alt/qwert.tmp 2010-01-08 14:55:14 UTC (rev 99162)
@@ -0,0 +1 @@
+Tmp file.
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/alt/snd.txt (from rev 99156, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/ignore/META-INF/snd.txt)
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/alt/snd.txt (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/matchers/mdtf/alt/snd.txt 2010-01-08 14:55:14 UTC (rev 99162)
@@ -0,0 +1,2 @@
+Second.
+
More information about the jboss-cvs-commits
mailing list