Patch application on startup reports progress

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2190 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-01-24 23:49:16 +00:00
parent ff7e10f80c
commit 744535fa73
10 changed files with 245 additions and 22 deletions

View File

@@ -16,6 +16,7 @@
*/
package org.alfresco.repo.admin.patch;
import java.util.Date;
import java.util.List;
import junit.framework.TestCase;
@@ -138,4 +139,28 @@ public class PatchTest extends TestCase
assertTrue("Sample 01 not in list of applied patches", found01);
assertTrue("Sample 02 not in list of applied patches", found02);
}
public void testGetPatchesByDate() throws Exception
{
// ensure that there are some applied patches
testApplyOutstandingPatches();
// get the number of applied patches
List<AppliedPatch> appliedPatches = patchDaoComponent.getAppliedPatches();
assertTrue("Expected at least 2 applied patches", appliedPatches.size() >= 2);
// now requery using null dates
List<PatchInfo> appliedPatchesAllDates = patchService.getPatches(null, null);
assertEquals("Applied patches by all dates doesn't match all applied patches",
appliedPatches.size(), appliedPatchesAllDates.size());
// make sure that the objects are not connected to the persistence layer
PatchInfo disconnectedObject = appliedPatchesAllDates.get(0);
AppliedPatch persistedObject = patchDaoComponent.getAppliedPatch(disconnectedObject.getId());
assertNotSame("Instances should not be shared between evicted and cached objects",
disconnectedObject, persistedObject);
// perform another query with dates that should return no results
List<PatchInfo> appliedPatchesFutureDates = patchService.getPatches(new Date(), new Date());
assertEquals("Query returned results for dates when no patches should exist", 0, appliedPatchesFutureDates.size());
}
}