diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/plugins/HierarchicalStorageUpdaterTest.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/plugins/HierarchicalStorageUpdaterTest.java index 4b983848ea2dcadf5a9cc7db1a8527a345be1275..1d7b15b4f0dd9af18f75ea98eb96597bcc3c1d25 100644 --- a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/plugins/HierarchicalStorageUpdaterTest.java +++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/plugins/HierarchicalStorageUpdaterTest.java @@ -17,6 +17,7 @@ package ch.systemsx.cisd.etlserver.plugins; import java.io.File; +import java.io.FileFilter; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -47,6 +48,14 @@ public class HierarchicalStorageUpdaterTest extends AbstractFileSystemTestCase private final static String DATASET_TYPE = "dataset-type"; + private final static FileFilter ignoreSVNFiles = new FileFilter() + { + public boolean accept(File pathname) + { + return pathname.getName().equals(".svn") == false; + } + }; + private IEncapsulatedOpenBISService openBISService; private Mockery context; @@ -80,7 +89,7 @@ public class HierarchicalStorageUpdaterTest extends AbstractFileSystemTestCase } @Test - public void testDataIsNotDeletedAfterReconfig() + public void testDataIsNotDeletedAfterReconfig() throws Exception { updater().execute(); @@ -94,7 +103,7 @@ public class HierarchicalStorageUpdaterTest extends AbstractFileSystemTestCase private void prepareDirectoryStructures() throws IOException { - FileUtils.copyDirectory(STORE_ROOT_TEMPLATE, getStoreRoot()); + FileUtils.copyDirectory(STORE_ROOT_TEMPLATE, getStoreRoot(), ignoreSVNFiles); getHierarchyRoot().mkdirs(); } @@ -108,9 +117,12 @@ public class HierarchicalStorageUpdaterTest extends AbstractFileSystemTestCase return new File(workingDirectory, "hierarchy-root"); } - private void assertDataStoreNotDamaged() + private void assertDataStoreNotDamaged() throws Exception { - long templateSize = FileUtils.sizeOfDirectory(STORE_ROOT_TEMPLATE); + File cleanStorage = new File(workingDirectory, "clean-storage-nosvn"); + FileUtils.copyDirectory(STORE_ROOT_TEMPLATE, cleanStorage, ignoreSVNFiles); + + long templateSize = FileUtils.sizeOfDirectory(cleanStorage); long rootSize = FileUtils.sizeOfDirectory(getStoreRoot()); String errMessage = @@ -122,12 +134,12 @@ public class HierarchicalStorageUpdaterTest extends AbstractFileSystemTestCase private HierarchicalStorageUpdater updater() { - return createUpdater(true); + return createUpdater(false); } private HierarchicalStorageUpdater reconfiguredUpdater() { - return createUpdater(false); + return createUpdater(true); }