コード例 #1
0
  @Test
  public void shouldRemoveProjectionViaFederationManager() throws Exception {
    testRoot.addNode("child1");
    session.save();

    federationManager.createProjection(
        "/testRoot", SOURCE_NAME, MockConnector.DOC1_LOCATION, "federated1");
    federationManager.createProjection(
        "/testRoot", SOURCE_NAME, MockConnector.DOC2_LOCATION, "federated2");

    federationManager.removeProjection("/testRoot/federated2");
    assertNodeFound("/testRoot/federated1");
    assertNodeFound("/testRoot/child1");
    assertNodeNotFound("/testRoot/federated2");

    federationManager.removeProjection("/testRoot/federated1");
    assertNodeNotFound("/testRoot/federation1");
    assertNodeFound("/testRoot/child1");
  }
コード例 #2
0
  @Test
  public void removeProjectionViaFederationManagerShouldNotDeleteExternalNode() throws Exception {
    federationManager.createProjection(
        "/testRoot", SOURCE_NAME, MockConnector.DOC2_LOCATION, "projection1");
    federationManager.createProjection(
        "/testRoot", SOURCE_NAME, MockConnector.DOC2_LOCATION, "projection2");

    federationManager.removeProjection("/testRoot/projection1");
    assertNodeFound("/testRoot/projection2/federated3");
  }
コード例 #3
0
 @Test(expected = PathNotFoundException.class)
 public void shouldNotRemoveProjectionIfPathInvalid() throws Exception {
   federationManager.createProjection(
       "/testRoot", SOURCE_NAME, MockConnector.DOC1_LOCATION, "federated1");
   federationManager.removeProjection("/testRoot/federated");
 }
コード例 #4
0
 @Test(expected = IllegalArgumentException.class)
 public void shouldNotRemoveProjectionUsingRootPath() throws Exception {
   federationManager.createProjection(
       "/testRoot", SOURCE_NAME, MockConnector.DOC1_LOCATION, "federated1");
   federationManager.removeProjection("/");
 }