[jboss-cvs] JBossAS SVN: r70772 - in projects/jboss-deployers/trunk: deployers-structure-spi/src/tests/org/jboss/test/deployers/structure/structurebuilder and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Mar 12 10:25:57 EDT 2008
Author: alesj
Date: 2008-03-12 10:25:57 -0400 (Wed, 12 Mar 2008)
New Revision: 70772
Added:
projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testClasspathEntries/
projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testClasspathEntries/cp1.txt
projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testClasspathEntries/cp2.txt
Modified:
projects/jboss-deployers/trunk/deployers-client-spi/src/main/org/jboss/deployers/client/spi/DeploymentFactory.java
projects/jboss-deployers/trunk/deployers-structure-spi/src/tests/org/jboss/test/deployers/structure/structurebuilder/AbstractStructureBuilderTest.java
projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java
Log:
JBDEPLOY-11; initial classpath check
Modified: projects/jboss-deployers/trunk/deployers-client-spi/src/main/org/jboss/deployers/client/spi/DeploymentFactory.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-client-spi/src/main/org/jboss/deployers/client/spi/DeploymentFactory.java 2008-03-12 14:21:18 UTC (rev 70771)
+++ projects/jboss-deployers/trunk/deployers-client-spi/src/main/org/jboss/deployers/client/spi/DeploymentFactory.java 2008-03-12 14:25:57 UTC (rev 70772)
@@ -179,7 +179,7 @@
// Nothing predetermined yet
if (attachments == null)
{
- mutable = AttachmentsFactory.createMutableAttachments();;
+ mutable = AttachmentsFactory.createMutableAttachments();
context.setPredeterminedManagedObjects(mutable);
}
// Some predetermined but needs to be made mutable
Modified: projects/jboss-deployers/trunk/deployers-structure-spi/src/tests/org/jboss/test/deployers/structure/structurebuilder/AbstractStructureBuilderTest.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-structure-spi/src/tests/org/jboss/test/deployers/structure/structurebuilder/AbstractStructureBuilderTest.java 2008-03-12 14:21:18 UTC (rev 70771)
+++ projects/jboss-deployers/trunk/deployers-structure-spi/src/tests/org/jboss/test/deployers/structure/structurebuilder/AbstractStructureBuilderTest.java 2008-03-12 14:25:57 UTC (rev 70772)
@@ -55,7 +55,7 @@
protected abstract DeploymentFactory getDeploymentFactory();
protected abstract String getDeploymentName();
-
+
public void testSimple() throws Exception
{
Deployment deployment = createDeployment();
@@ -105,12 +105,24 @@
{
DeploymentFactory factory = getDeploymentFactory();
Deployment deployment = createDeployment();
- factory.addContext(deployment, "", ContextInfo.DEFAULT_METADATA_PATH, factory.createClassPath(""));
+ factory.addContext(deployment, "", ContextInfo.DEFAULT_METADATA_PATH, DeploymentFactory.createClassPath(""));
DeploymentContext context = build(deployment);
checkDeployment(context, deployment);
}
+ public void testClasspathEntries() throws Exception
+ {
+ DeploymentFactory factory = getDeploymentFactory();
+ Deployment deployment = createDeployment();
+ ContextInfo contextInfo = factory.addContext(deployment, "");
+ contextInfo.addClassPathEntry(DeploymentFactory.createClassPathEntry("cp1.txt"));
+ contextInfo.addClassPathEntry(DeploymentFactory.createClassPathEntry("cp2.txt"));
+
+ DeploymentContext context = build(deployment);
+ checkDeployment(context, deployment);
+ }
+
protected void checkDeployment(DeploymentContext context, Deployment deployment) throws Exception
{
assertNotNull(context);
Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testClasspathEntries/cp1.txt
===================================================================
Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testClasspathEntries/cp2.txt
===================================================================
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java 2008-03-12 14:21:18 UTC (rev 70771)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java 2008-03-12 14:25:57 UTC (rev 70772)
@@ -132,7 +132,22 @@
assertNull(classPath);
else
{
- // TODO JBMICROCONT-185 test it got the correct classpath
+ int cpeSize = classPathEntries.size();
+ int cpSize = classPath != null ? classPath.size() : 0;
+ assertTrue(cpeSize >= cpSize);
+ for(int i = 0; i < cpeSize; i++)
+ {
+ ClassPathEntry entry = classPathEntries.get(i);
+ VirtualFile file = (i < cpSize) ? classPath.get(i) : null;
+ String path = entry.getPath();
+ if ("".equals(path))
+ assertTrue(file == null || "".equals(file.getPathName()));
+ else
+ {
+ assertNotNull(file);
+ assertEquals(path, file.getPathName());
+ }
+ }
}
}
}
More information about the jboss-cvs-commits
mailing list