[jboss-svn-commits] JBL Code SVN: r24223 - in labs/jbossesb/workspace/skeagh/container/microcontainer/src: main/resources/META-INF and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Dec 3 03:18:51 EST 2008
Author: beve
Date: 2008-12-03 03:18:51 -0500 (Wed, 03 Dec 2008)
New Revision: 24223
Added:
labs/jbossesb/workspace/skeagh/container/microcontainer/src/main/java/org/jboss/esb/microcontainer/deployers/EsbConfigParser.java
labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbConfigParserTest.java
labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbConfigParserTest.xml
Removed:
labs/jbossesb/workspace/skeagh/container/microcontainer/src/main/java/org/jboss/esb/microcontainer/deployers/EsbParserDeployer.java
labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbParserDeployerTest.java
labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbParserDeployerTest.xml
Modified:
labs/jbossesb/workspace/skeagh/container/microcontainer/src/main/resources/META-INF/esb-deployers-jboss-beans.xml
labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbDeployerTest.java
labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbDeployerTest.xml
Log:
Renamed EsbParserDeployer to EsbConfigParser.
Copied: labs/jbossesb/workspace/skeagh/container/microcontainer/src/main/java/org/jboss/esb/microcontainer/deployers/EsbConfigParser.java (from rev 24222, labs/jbossesb/workspace/skeagh/container/microcontainer/src/main/java/org/jboss/esb/microcontainer/deployers/EsbParserDeployer.java)
===================================================================
--- labs/jbossesb/workspace/skeagh/container/microcontainer/src/main/java/org/jboss/esb/microcontainer/deployers/EsbConfigParser.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/container/microcontainer/src/main/java/org/jboss/esb/microcontainer/deployers/EsbConfigParser.java 2008-12-03 08:18:51 UTC (rev 24223)
@@ -0,0 +1,179 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
+ * LLC, and individual contributors 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.esb.microcontainer.deployers;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.esb.api.context.ResourceLocator;
+import org.jboss.esb.api.exception.DeploymentException;
+import org.jboss.esb.deploy.config.DeploymentUnit;
+import org.jboss.esb.deploy.config.digest.DefaultConfigurationDigester;
+import org.jboss.esb.microcontainer.config.DeploymentUnitResourceLocator;
+import org.jboss.esb.microcontainer.metadata.EsbMetaData;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
+
+/**
+ * EsbParserDeployer picks up jboss-esb.xml files, parses the content
+ * and produces an {@link EsbMetaData} instance.
+ * <p/>
+ *
+ * Sample configuration:
+ * <pre>{@code
+ * <bean name="EsbParserDeployer" class="org.jboss.esb.microcontainer.deployers.EsbParserDeployer"/>
+ * }</pre>
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ * @since 5.0
+ *
+ */
+public class EsbConfigParser extends AbstractVFSParsingDeployer<EsbMetaData>
+{
+ /**
+ * Logger.
+ */
+ private Logger log = Logger.getLogger(EsbConfigParser.class);
+
+ /**
+ * The default suffix of JBossESB configuration files that should be picked up.
+ */
+ private static final String ESB_FILE_SUFFIX = "-esb.xml";
+
+ /**
+ * The default suffix of JBossESB archives that should be accepted.
+ */
+ private static final String ESB_JAR_SUFFIX = ".esb";
+
+ /**
+ * Sole constructor.
+ */
+ public EsbConfigParser()
+ {
+ super(EsbMetaData.class);
+ setSuffix(ESB_FILE_SUFFIX);
+ setJarExtension(ESB_JAR_SUFFIX);
+ setStage(DeploymentStages.CLASSLOADER);
+ }
+
+ /**
+ * Parses a ESB deployment and produces a {@link EsbMetaData} instance.
+ *
+ * @param deploymentUnit The deployment unit to parse
+ * @param file The virtual file of the deployment
+ * @param metaData A possible pre-existing EsbMetaData
+ * @return EsbMetaData {@link EsbMetaData} created with the virtual file of the deployment and the archive name.
+ * @throws DeploymentException If an exception occurs while trying parsing the deployment.
+ */
+ @Override
+ protected final EsbMetaData parse(final VFSDeploymentUnit deploymentUnit, final VirtualFile file, final EsbMetaData metaData) throws DeploymentException
+ {
+ final DeploymentUnit esbDeploymentUnit = createEsbDeploymentUnit(deploymentUnit, file);
+ return new EsbMetaData(esbDeploymentUnit, file.getPathName());
+ }
+
+ /**
+ * Creates an ESB {@link DeploymentUnit}.
+ *
+ * @param deploymentUnit The MC deployment unit.
+ * @param file The file representing the deployment.
+ * @return DeploymentUnit The ESB Deployment unit.
+ * @throws DeploymentException If an excption occurs while creating the deployment unit.
+ */
+ private DeploymentUnit createEsbDeploymentUnit(final VFSDeploymentUnit deploymentUnit, final VirtualFile file) throws DeploymentException
+ {
+ log.info("Parsing ESB configuration'" + file + "'");
+
+ final ResourceLocator resourceLocator = new DeploymentUnitResourceLocator(deploymentUnit.getClassLoader());
+ final VirtualFile esbConfigFile = findEsbConfigFile(file);
+ try
+ {
+ return new DefaultConfigurationDigester(resourceLocator).digest(esbConfigFile.openStream());
+ }
+ catch (final IOException e)
+ {
+ throw new DeploymentException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Tries to rescursively find a file that ends with "-esb.xml".
+ *
+ * @param file The virtual file. Can point to a file or a directory which will be searched.
+ * @return VirtualFile VirtualFile representing a found configuration file.
+ * @throws DeploymentException If not configuration file could be found, or more than one was found.
+ */
+ private VirtualFile findEsbConfigFile(final VirtualFile file) throws DeploymentException
+ {
+ if (file.getName().endsWith(ESB_FILE_SUFFIX))
+ {
+ return file;
+ }
+
+ List<VirtualFile> esbConfigFiles;
+ try
+ {
+ esbConfigFiles = file.getChildrenRecursively(new EsbConfigFileFilter());
+ }
+ catch (final IOException e)
+ {
+ throw new DeploymentException(e.getMessage(), e);
+ }
+
+ final int esbConfigFilesFound = esbConfigFiles.size();
+
+ if (esbConfigFilesFound == 0)
+ {
+ throw new DeploymentException("No JBossESB configuration could be located the archive '" + file + "'");
+ }
+ else if (esbConfigFilesFound > 1)
+ {
+ throw new DeploymentException("Only one JBossESB configuration can exist in an archive. Please check '" + file + "'");
+ }
+ else
+ {
+ return esbConfigFiles.get(0);
+ }
+ }
+
+ /**
+ * Filter for filtering out ESB configuration files.
+ *
+ */
+ private static class EsbConfigFileFilter implements VirtualFileFilter
+ {
+ /**
+ * Accepts only files ending with the ESB_FILE_SUFFIX.
+ * @param file The file to filter.
+ * @return true If the file name ends with "-esb.xml".
+ *
+ */
+ public boolean accepts(final VirtualFile file)
+ {
+ return file.getName().endsWith(ESB_FILE_SUFFIX);
+ }
+ }
+
+}
Property changes on: labs/jbossesb/workspace/skeagh/container/microcontainer/src/main/java/org/jboss/esb/microcontainer/deployers/EsbConfigParser.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: labs/jbossesb/workspace/skeagh/container/microcontainer/src/main/java/org/jboss/esb/microcontainer/deployers/EsbParserDeployer.java
===================================================================
--- labs/jbossesb/workspace/skeagh/container/microcontainer/src/main/java/org/jboss/esb/microcontainer/deployers/EsbParserDeployer.java 2008-12-03 00:44:03 UTC (rev 24222)
+++ labs/jbossesb/workspace/skeagh/container/microcontainer/src/main/java/org/jboss/esb/microcontainer/deployers/EsbParserDeployer.java 2008-12-03 08:18:51 UTC (rev 24223)
@@ -1,180 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
- * LLC, and individual contributors 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.esb.microcontainer.deployers;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.esb.api.context.ResourceLocator;
-import org.jboss.esb.api.exception.DeploymentException;
-import org.jboss.esb.deploy.config.DeploymentUnit;
-import org.jboss.esb.deploy.config.digest.DefaultConfigurationDigester;
-import org.jboss.esb.microcontainer.config.DeploymentUnitResourceLocator;
-import org.jboss.esb.microcontainer.metadata.EsbMetaData;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileFilter;
-
-/**
- * EsbParserDeployer picks up jboss-esb.xml files, parses the content
- * and produces an {@link EsbMetaData} instance.
- * <p/>
- *
- * Sample configuration:
- * <pre>{@code
- * <bean name="EsbParserDeployer" class="org.jboss.esb.microcontainer.deployers.EsbParserDeployer"/>
- * }</pre>
- *
- * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
- * @since 5.0
- *
- */
-public class EsbParserDeployer extends AbstractVFSParsingDeployer<EsbMetaData>
-{
- /**
- * Logger.
- */
- private Logger log = Logger.getLogger(EsbParserDeployer.class);
-
- /**
- * The default suffix of JBossESB configuration files that should be picked up.
- */
- private static final String ESB_FILE_SUFFIX = "-esb.xml";
-
- /**
- * The default suffix of JBossESB archives that should be accepted.
- */
- private static final String ESB_JAR_SUFFIX = ".esb";
-
- /**
- * Sole constructor.
- */
- public EsbParserDeployer()
- {
- super(EsbMetaData.class);
- setSuffix(ESB_FILE_SUFFIX);
- setJarExtension(ESB_JAR_SUFFIX);
- setStage(DeploymentStages.CLASSLOADER);
- }
-
- /**
- * Parses a ESB deployment, creates a EsbMetaData instance that is attached to the
- * deploymentUnit.
- *
- * @param deploymentUnit The deployment unit to parse
- * @param file The virtual file of the deployment
- * @param metaData A possible pre-existing EsbMetaData
- * @return EsbMetaData {@link EsbMetaData} created with the virtual file of the deployment and the archive name.
- * @throws DeploymentException If an exception occurs while trying parsing the deployment.
- */
- @Override
- protected final EsbMetaData parse(final VFSDeploymentUnit deploymentUnit, final VirtualFile file, final EsbMetaData metaData) throws DeploymentException
- {
- final DeploymentUnit esbDeploymentUnit = createEsbDeploymentUnit(deploymentUnit, file);
- return new EsbMetaData(esbDeploymentUnit, file.getPathName());
- }
-
- /**
- * Creates an ESB {@link DeploymentUnit}.
- *
- * @param deploymentUnit The MC deployment unit.
- * @param file The file representing the deployment.
- * @return DeploymentUnit The ESB Deployment unit.
- * @throws DeploymentException If an excption occurs while creating the deployment unit.
- */
- private DeploymentUnit createEsbDeploymentUnit(final VFSDeploymentUnit deploymentUnit, final VirtualFile file) throws DeploymentException
- {
- log.info("Parsing ESB configuration'" + file + "'");
-
- final ResourceLocator resourceLocator = new DeploymentUnitResourceLocator(deploymentUnit.getClassLoader());
- final VirtualFile esbConfigFile = findEsbConfigFile(file);
- try
- {
- return new DefaultConfigurationDigester(resourceLocator).digest(esbConfigFile.openStream());
- }
- catch (final IOException e)
- {
- throw new DeploymentException(e.getMessage(), e);
- }
- }
-
- /**
- * Tries to rescursively find a file that ends with "-esb.xml".
- *
- * @param file The virtual file. Can point to a file or a directory which will be searched.
- * @return VirtualFile VirtualFile representing a found configuration file.
- * @throws DeploymentException If not configuration file could be found, or more than one was found.
- */
- private VirtualFile findEsbConfigFile(final VirtualFile file) throws DeploymentException
- {
- if (file.getName().endsWith(ESB_FILE_SUFFIX))
- {
- return file;
- }
-
- List<VirtualFile> esbConfigFiles;
- try
- {
- esbConfigFiles = file.getChildrenRecursively(new EsbConfigFileFilter());
- }
- catch (final IOException e)
- {
- throw new DeploymentException(e.getMessage(), e);
- }
-
- final int esbConfigFilesFound = esbConfigFiles.size();
-
- if (esbConfigFilesFound == 0)
- {
- throw new DeploymentException("No JBossESB configuration could be located the archive '" + file + "'");
- }
- else if (esbConfigFilesFound > 1)
- {
- throw new DeploymentException("Only one JBossESB configuration can exist in an archive. Please check '" + file + "'");
- }
- else
- {
- return esbConfigFiles.get(0);
- }
- }
-
- /**
- * Filter for filtering out ESB configuration files.
- *
- */
- private static class EsbConfigFileFilter implements VirtualFileFilter
- {
- /**
- * Accepts only files ending with the ESB_FILE_SUFFIX.
- * @param file The file to filter.
- * @return true If the file name ends with "-esb.xml".
- *
- */
- public boolean accepts(final VirtualFile file)
- {
- return file.getName().endsWith(ESB_FILE_SUFFIX);
- }
- }
-
-}
Modified: labs/jbossesb/workspace/skeagh/container/microcontainer/src/main/resources/META-INF/esb-deployers-jboss-beans.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/container/microcontainer/src/main/resources/META-INF/esb-deployers-jboss-beans.xml 2008-12-03 00:44:03 UTC (rev 24222)
+++ labs/jbossesb/workspace/skeagh/container/microcontainer/src/main/resources/META-INF/esb-deployers-jboss-beans.xml 2008-12-03 08:18:51 UTC (rev 24223)
@@ -4,7 +4,7 @@
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <bean name="EsbParserDeployer" class="org.jboss.esb.microcontainer.deployers.EsbParserDeployer"/>
+ <bean name="EsbConfigParser" class="org.jboss.esb.microcontainer.deployers.EsbConfigParser"/>
<bean name="EsbDeployer" class="org.jboss.esb.microcontainer.deployers.EsbDeployer"/>
Copied: labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbConfigParserTest.java (from rev 24222, labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbParserDeployerTest.java)
===================================================================
--- labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbConfigParserTest.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbConfigParserTest.java 2008-12-03 08:18:51 UTC (rev 24223)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
+ * LLC, and individual contributors 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.esb.microcontainer.deployers;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.esb.api.exception.DeploymentException;
+import org.jboss.esb.microcontainer.metadata.EsbMetaData;
+import org.jboss.test.kernel.junit.MicrocontainerTest;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Test for {@link EsbDeployer}.
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public class EsbConfigParserTest extends MicrocontainerTest
+{
+ private EsbConfigParser parserDeployer;
+ private String testArchivesDir = "/test_esb_archives";
+
+ public EsbConfigParserTest(final String name)
+ {
+ super(name);
+ }
+
+ public void testExplodedEsbArchive() throws Throwable
+ {
+ assertDeployed("exploded-esb-archive.jar");
+ }
+
+ public void testExplodedEsbArchiveConfigInRoot() throws Throwable
+ {
+ assertDeployed("exploded-esb-archive-xml-in-root.jar");
+ }
+
+ public void testEsbArchive() throws Throwable
+ {
+ assertDeployed("esb-archive.jar");
+ }
+
+ public void testEsbArchiveConfigInRoot() throws Throwable
+ {
+ assertDeployed("esb-archive-xml-in-root.jar");
+ }
+
+ private void assertDeployed(final String archiveName) throws Exception, DeploymentException
+ {
+ VirtualFile virtualFile = TestUtil.getVirtualFile(testArchivesDir, archiveName, this.getClass());
+ VFSDeploymentUnit deploymentUnit = TestUtil.getDeploymentUnit(virtualFile);
+ EsbMetaData esbMetaData = parserDeployer.parse(deploymentUnit, virtualFile, (EsbMetaData)null);
+
+ assertEquals(virtualFile.getName(), esbMetaData.getAchiveName());
+ }
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ parserDeployer = (EsbConfigParser) getBean("EsbConfigParser");
+ }
+
+}
Copied: labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbConfigParserTest.xml (from rev 24222, labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbParserDeployerTest.xml)
===================================================================
--- labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbConfigParserTest.xml (rev 0)
+++ labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbConfigParserTest.xml 2008-12-03 08:18:51 UTC (rev 24223)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="EsbConfigParser" class="org.jboss.esb.microcontainer.deployers.EsbConfigParser">
+ </bean>
+
+ <bean name="EsbDeployer" class="org.jboss.esb.microcontainer.deployers.EsbDeployer"/>
+
+ <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+ <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+ <property name="deployers"><inject bean="Deployers"/></property>
+ </bean>
+
+ <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+ <property name="structureBuilder">
+ <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder"/>
+ </property>
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+ <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+ <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+</deployment>
Modified: labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbDeployerTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbDeployerTest.java 2008-12-03 00:44:03 UTC (rev 24222)
+++ labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbDeployerTest.java 2008-12-03 08:18:51 UTC (rev 24223)
@@ -60,7 +60,7 @@
final String archiveName = "exploded-esb-archive.jar";
final VirtualFile virtualFile = TestUtil.getVirtualFile(testArchivesDir, archiveName, this.getClass());
deploymentUnit = TestUtil.getDeploymentUnit(virtualFile);
- EsbParserDeployer parserDeployer = (EsbParserDeployer) getBean("EsbParserDeployer");
+ EsbConfigParser parserDeployer = (EsbConfigParser) getBean("EsbConfigParser");
esbMetaData = parserDeployer.parse(deploymentUnit, virtualFile, (EsbMetaData)null);
runtimeDeployer = (EsbDeployer) getBean("EsbDeployer");
}
Modified: labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbDeployerTest.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbDeployerTest.xml 2008-12-03 00:44:03 UTC (rev 24222)
+++ labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbDeployerTest.xml 2008-12-03 08:18:51 UTC (rev 24223)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <bean name="EsbParserDeployer" class="org.jboss.esb.microcontainer.deployers.EsbParserDeployer"/>
+ <bean name="EsbConfigParser" class="org.jboss.esb.microcontainer.deployers.EsbConfigParser"/>
<bean name="EsbDeployer" class="org.jboss.esb.microcontainer.deployers.EsbDeployer"/>
<bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
Deleted: labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbParserDeployerTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbParserDeployerTest.java 2008-12-03 00:44:03 UTC (rev 24222)
+++ labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbParserDeployerTest.java 2008-12-03 08:18:51 UTC (rev 24223)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
- * LLC, and individual contributors 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.esb.microcontainer.deployers;
-
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.esb.api.exception.DeploymentException;
-import org.jboss.esb.microcontainer.metadata.EsbMetaData;
-import org.jboss.test.kernel.junit.MicrocontainerTest;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * Test for {@link EsbDeployer}.
- *
- * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
- *
- */
-public class EsbParserDeployerTest extends MicrocontainerTest
-{
- private EsbParserDeployer parserDeployer;
- private String testArchivesDir = "/test_esb_archives";
-
- public EsbParserDeployerTest(final String name)
- {
- super(name);
- }
-
- public void testExplodedEsbArchive() throws Throwable
- {
- assertDeployed("exploded-esb-archive.jar");
- }
-
- public void testExplodedEsbArchiveConfigInRoot() throws Throwable
- {
- assertDeployed("exploded-esb-archive-xml-in-root.jar");
- }
-
- public void testEsbArchive() throws Throwable
- {
- assertDeployed("esb-archive.jar");
- }
-
- public void testEsbArchiveConfigInRoot() throws Throwable
- {
- assertDeployed("esb-archive-xml-in-root.jar");
- }
-
- private void assertDeployed(final String archiveName) throws Exception, DeploymentException
- {
- VirtualFile virtualFile = TestUtil.getVirtualFile(testArchivesDir, archiveName, this.getClass());
- VFSDeploymentUnit deploymentUnit = TestUtil.getDeploymentUnit(virtualFile);
- EsbMetaData esbMetaData = parserDeployer.parse(deploymentUnit, virtualFile, (EsbMetaData)null);
-
- assertEquals(virtualFile.getName(), esbMetaData.getAchiveName());
- }
-
- @Override
- public void setUp() throws Exception
- {
- super.setUp();
- parserDeployer = (EsbParserDeployer) getBean("EsbParserDeployer");
- }
-
-}
Deleted: labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbParserDeployerTest.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbParserDeployerTest.xml 2008-12-03 00:44:03 UTC (rev 24222)
+++ labs/jbossesb/workspace/skeagh/container/microcontainer/src/test/java/org/jboss/esb/microcontainer/deployers/EsbParserDeployerTest.xml 2008-12-03 08:18:51 UTC (rev 24223)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
- <bean name="EsbParserDeployer" class="org.jboss.esb.microcontainer.deployers.EsbParserDeployer">
- </bean>
-
- <bean name="EsbDeployer" class="org.jboss.esb.microcontainer.deployers.EsbDeployer"/>
-
- <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
- <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
- <property name="deployers"><inject bean="Deployers"/></property>
- </bean>
-
- <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
- <property name="structureBuilder">
- <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder"/>
- </property>
- <incallback method="addDeployer"/>
- <uncallback method="removeDeployer"/>
- </bean>
-
- <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
- <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
- <incallback method="addDeployer"/>
- <uncallback method="removeDeployer"/>
- </bean>
-
-</deployment>
More information about the jboss-svn-commits
mailing list