From 954f9b6dd6de2f31bb1f60e3a48ce2f7b86e6ae7 Mon Sep 17 00:00:00 2001
From: cramakri <cramakri>
Date: Tue, 13 Sep 2011 20:15:20 +0000
Subject: [PATCH] MINOR: Fixed tests to run outside of svn. They were expecting
 that .svn folders were in the test data

SVN: 22925
---
 .../ds1/{.gitignore => emptyfile.txt}         |  0
 .../ds2/{.gitignore => emptyfile.txt}         |  0
 .../ds3/{.gitignore => emptyfile.txt}         |  0
 .../ds1/{.gitignore => emptyfile.txt}         |  0
 .../ds2/{.gitignore => emptyfile.txt}         |  0
 .../ds3/{.gitignore => emptyfile.txt}         |  0
 .../ds1/{.gitignore => emptyfile.txt}         |  0
 .../ds2/{.gitignore => emptyfile.txt}         |  0
 .../ds3/{.gitignore => emptyfile.txt}         |  0
 .../shared/api/v1/FileInfoDssBuilderTest.java | 22 +++++++++++++++----
 10 files changed, 18 insertions(+), 4 deletions(-)
 rename datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/empty-lines/ds1/{.gitignore => emptyfile.txt} (100%)
 rename datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/empty-lines/ds2/{.gitignore => emptyfile.txt} (100%)
 rename datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/empty-lines/ds3/{.gitignore => emptyfile.txt} (100%)
 rename datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/missing-sample-identifier/ds1/{.gitignore => emptyfile.txt} (100%)
 rename datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/missing-sample-identifier/ds2/{.gitignore => emptyfile.txt} (100%)
 rename datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/missing-sample-identifier/ds3/{.gitignore => emptyfile.txt} (100%)
 rename datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/not-all-subfolders-mentioned/ds1/{.gitignore => emptyfile.txt} (100%)
 rename datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/not-all-subfolders-mentioned/ds2/{.gitignore => emptyfile.txt} (100%)
 rename datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/not-all-subfolders-mentioned/ds3/{.gitignore => emptyfile.txt} (100%)

diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/empty-lines/ds1/.gitignore b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/empty-lines/ds1/emptyfile.txt
similarity index 100%
rename from datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/empty-lines/ds1/.gitignore
rename to datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/empty-lines/ds1/emptyfile.txt
diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/empty-lines/ds2/.gitignore b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/empty-lines/ds2/emptyfile.txt
similarity index 100%
rename from datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/empty-lines/ds2/.gitignore
rename to datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/empty-lines/ds2/emptyfile.txt
diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/empty-lines/ds3/.gitignore b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/empty-lines/ds3/emptyfile.txt
similarity index 100%
rename from datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/empty-lines/ds3/.gitignore
rename to datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/empty-lines/ds3/emptyfile.txt
diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/missing-sample-identifier/ds1/.gitignore b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/missing-sample-identifier/ds1/emptyfile.txt
similarity index 100%
rename from datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/missing-sample-identifier/ds1/.gitignore
rename to datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/missing-sample-identifier/ds1/emptyfile.txt
diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/missing-sample-identifier/ds2/.gitignore b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/missing-sample-identifier/ds2/emptyfile.txt
similarity index 100%
rename from datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/missing-sample-identifier/ds2/.gitignore
rename to datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/missing-sample-identifier/ds2/emptyfile.txt
diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/missing-sample-identifier/ds3/.gitignore b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/missing-sample-identifier/ds3/emptyfile.txt
similarity index 100%
rename from datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/missing-sample-identifier/ds3/.gitignore
rename to datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/missing-sample-identifier/ds3/emptyfile.txt
diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/not-all-subfolders-mentioned/ds1/.gitignore b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/not-all-subfolders-mentioned/ds1/emptyfile.txt
similarity index 100%
rename from datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/not-all-subfolders-mentioned/ds1/.gitignore
rename to datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/not-all-subfolders-mentioned/ds1/emptyfile.txt
diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/not-all-subfolders-mentioned/ds2/.gitignore b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/not-all-subfolders-mentioned/ds2/emptyfile.txt
similarity index 100%
rename from datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/not-all-subfolders-mentioned/ds2/.gitignore
rename to datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/not-all-subfolders-mentioned/ds2/emptyfile.txt
diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/not-all-subfolders-mentioned/ds3/.gitignore b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/not-all-subfolders-mentioned/ds3/emptyfile.txt
similarity index 100%
rename from datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/not-all-subfolders-mentioned/ds3/.gitignore
rename to datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/entityregistration/test-data/not-all-subfolders-mentioned/ds3/emptyfile.txt
diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/dss/generic/shared/api/v1/FileInfoDssBuilderTest.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/dss/generic/shared/api/v1/FileInfoDssBuilderTest.java
index d30d238679a..b62cf8ef005 100644
--- a/datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/dss/generic/shared/api/v1/FileInfoDssBuilderTest.java
+++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/dss/generic/shared/api/v1/FileInfoDssBuilderTest.java
@@ -37,8 +37,21 @@ public class FileInfoDssBuilderTest extends AssertJUnit
         ArrayList<FileInfoDssDTO> list = new ArrayList<FileInfoDssDTO>();
         File requestedFile = new File(root);
         builder.appendFileInfosForFile(requestedFile, list, false);
-        // The 3 test files + 1 sub dir + .svn
-        assertEquals(5, list.size());
+        removeSvnFoldersFromList(list);
+        // The 3 test files + 1 sub dir
+        assertEquals(4, list.size());
+    }
+
+    private void removeSvnFoldersFromList(ArrayList<FileInfoDssDTO> list)
+    {
+        // Copy the list since we will modify it
+        for (FileInfoDssDTO info : new ArrayList<FileInfoDssDTO>(list))
+        {
+            if (info.getPathInDataSet().endsWith(".svn"))
+            {
+                list.remove(info);
+            }
+        }
     }
 
     @Test
@@ -50,8 +63,9 @@ public class FileInfoDssBuilderTest extends AssertJUnit
         ArrayList<FileInfoDssDTO> list = new ArrayList<FileInfoDssDTO>();
         File requestedFile = new File(root);
         builder.appendFileInfosForFile(requestedFile, list, false);
-        // The 3 test files + 1 sub dir + .svn
-        assertEquals(5, list.size());
+        removeSvnFoldersFromList(list);
+        // The 3 test files + 1 sub dir
+        assertEquals(4, list.size());
     }
 
     @Test
-- 
GitLab