[jboss-cvs] JBossAS SVN: r84097 - projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/modified/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Feb 11 11:21:25 EST 2009


Author: alesj
Date: 2009-02-11 11:21:25 -0500 (Wed, 11 Feb 2009)
New Revision: 84097

Modified:
   projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/modified/test/MetaDataStructureModificationTestCase.java
Log:
Test multiple changes.

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/modified/test/MetaDataStructureModificationTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/modified/test/MetaDataStructureModificationTestCase.java	2009-02-11 15:44:13 UTC (rev 84096)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/modified/test/MetaDataStructureModificationTestCase.java	2009-02-11 16:21:25 UTC (rev 84097)
@@ -131,4 +131,40 @@
          undeploy(vdu);
       }
    }
+
+   public void testMultipleChanges() throws Exception
+   {
+      AssembledDirectory top = createAssembledDirectory("top.jar", "top.jar");
+      AssembledDirectory metainf = top.mkdir("META-INF");
+      StructureModificationChecker checker = createStructureModificationChecker();
+
+      VFSDeploymentUnit vdu = assertDeploy(top);
+      try
+      {
+         VirtualFile root = vdu.getRoot();
+         assertFalse(checker.hasStructureBeenModified(root));
+
+         URL url1 = getResource("/scanning/smoke/META-INF/jboss-scanning.xml");
+         assertNotNull(url1);
+         metainf.addChild(VFS.createNewRoot(url1));
+         URL url2 = getResource("/dependency/module/META-INF/jboss-dependency.xml");
+         assertNotNull(url2);
+         metainf.addChild(VFS.createNewRoot(url2));
+
+         assertTrue(checker.hasStructureBeenModified(root));
+         assertFalse(checker.hasStructureBeenModified(root));
+
+         File f1 = new File(url1.toURI());
+         assertTrue(f1.setLastModified(System.currentTimeMillis()));
+         File f2 = new File(url1.toURI());
+         assertTrue(f2.setLastModified(System.currentTimeMillis()));
+
+         assertTrue(checker.hasStructureBeenModified(root));
+         assertFalse(checker.hasStructureBeenModified(root));         
+      }
+      finally
+      {
+         undeploy(vdu);
+      }
+   }
 }
\ No newline at end of file




More information about the jboss-cvs-commits mailing list