org.fcrepo.test.integration.cma
Class ConflictingDeploymentTests

java.lang.Object
  extended by org.fcrepo.test.integration.cma.ConflictingDeploymentTests

public class ConflictingDeploymentTests
extends Object

Tests for reasonable/predictable behaviour when sDeps conflict.

Two Service Deployment objects (SDeps) deployed simultaneously for the same service on the same content model creates a conflict. In general, this is a problem - don't do it. However, there are a few legitimate reasons for wanting to do so, primarily when replacing one SDep with another. Faced with a choice of first removing the old SDep, then replacing it vs. first ingesting/activating a new one, then subsequently removing the old one, we notice that the former situation guarantees a period of time in which there is no SDep for a given service - which may be problematic in situations where downtime is unacceptable.

In order to support replacing sDeps without downtime, Fedora adopts the following policy: If two or more SDep objects deploy the same service for the same content model, then the object with the earliest modification date will be used. Thus, a newly ingested or modified SDep will have a more recent last modified date, and will be ignored until the existing SDep is purged or modified.

These tests verify the above behavior.

Author:
birkland

Constructor Summary
ConflictingDeploymentTests()
           
 
Method Summary
 void setUp()
           
static junit.framework.Test suite()
           
 void tearDown()
           
 void testDeployFirstIngested12()
          If two sDeps are ingested, the first one ingested should be the one to drive the dissemination.
 void testDeployFirstIngested21()
          If two sDeps are ingested, the first one ingested should be the one to drive the dissemination.
 void testModifyNewestSdep()
          Modifying the newest SDep should have no effect
 void testModifyOldestSdep()
          Modifying the oldest SDep will make it the newest, thus switching the SDep used.
 void testPurgeReplace()
          Represents the most likely case.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConflictingDeploymentTests

public ConflictingDeploymentTests()
Method Detail

suite

public static junit.framework.Test suite()

setUp

public void setUp()
           throws Exception
Throws:
Exception

tearDown

public void tearDown()
              throws Exception
Throws:
Exception

testDeployFirstIngested12

public void testDeployFirstIngested12()
                               throws Exception
If two sDeps are ingested, the first one ingested should be the one to drive the dissemination. Ingest in order 1,2

Throws:
Exception

testDeployFirstIngested21

public void testDeployFirstIngested21()
                               throws Exception
If two sDeps are ingested, the first one ingested should be the one to drive the dissemination. Ingest in order 2,1

Throws:
Exception

testModifyOldestSdep

public void testModifyOldestSdep()
                          throws Exception
Modifying the oldest SDep will make it the newest, thus switching the SDep used.

Throws:
Exception

testModifyNewestSdep

public void testModifyNewestSdep()
                          throws Exception
Modifying the newest SDep should have no effect

Throws:
Exception

testPurgeReplace

public void testPurgeReplace()
                      throws Exception
Represents the most likely case. Should pass with flying colours.

Throws:
Exception


Copyright © 2012 DuraSpace. All Rights Reserved.