Examples of Rights


Examples of buri.ddmsence.ddms.resource.Rights

      }

      // Invalid object in component list
      try {
        List<IDDMSComponent> components = getChildComponents(true);
        components.add(new Rights(true, true, true));
        new MetacardInfo(components, null);
      }
      catch (InvalidDDMSException e) {
        expectMessage(e, "rights is not a valid");
      }
View Full Code Here

Examples of buri.ddmsence.ddms.resource.Rights

      GeographicIdentifier builderComponent = new GeographicIdentifier.Builder(elementComponent).commit();
      assertEquals(elementComponent, builderComponent);
      assertEquals(elementComponent.hashCode(), builderComponent.hashCode());
     
      // Wrong class
      Rights wrongComponent = new Rights(true, true, true);
      assertFalse(elementComponent.equals(wrongComponent));
     
      // Different values in each field 
      GeographicIdentifier.Builder builder = getBaseBuilder();
      builder.getNames().clear();
View Full Code Here

Examples of buri.ddmsence.ddms.resource.Rights

    super(null);
  }

  @Test
  public void testBuildIndexInvalidInputBounds() throws InvalidDDMSException {
    Rights rights = new Rights(true, true, true);

    // Bad total
    try {
      rights.buildIndex(0, 0);
    }
    catch (IllegalArgumentException e) {
      expectMessage(e, "The total must be at least 1");
    }

    // Low index
    try {
      rights.buildIndex(-1, 1);
    }
    catch (IllegalArgumentException e) {
      expectMessage(e, "The index is not properly bounded");
    }

    // High index
    try {
      rights.buildIndex(2, 2);
    }
    catch (IllegalArgumentException e) {
      expectMessage(e, "The index is not properly bounded");
    }
  }
View Full Code Here

Examples of buri.ddmsence.ddms.resource.Rights

    }
  }

  @Test
  public void testBuildIndexValidInputBounds() throws InvalidDDMSException {
    Rights rights = new Rights(true, true, true);

    // Good total
    rights.buildIndex(0, 1);

    // Good index
    rights.buildIndex(1, 2);
  }
View Full Code Here

Examples of buri.ddmsence.ddms.resource.Rights

    rights.buildIndex(1, 2);
  }

  @Test
  public void testBuildIndexLevel0() throws InvalidDDMSException {
    Rights rights = new Rights(true, true, true);

    PropertyReader.setProperty("output.indexLevel", "0");
    String index = rights.buildIndex(0, 1);
    assertEquals("", index);
    index = rights.buildIndex(2, 4);
    assertEquals("", index);

    PropertyReader.setProperty("output.indexLevel", "unknown");
    index = rights.buildIndex(0, 1);
    assertEquals("", index);
    index = rights.buildIndex(2, 4);
    assertEquals("", index);
  }
View Full Code Here

Examples of buri.ddmsence.ddms.resource.Rights

    assertEquals("", index);
  }

  @Test
  public void testBuildIndexLevel1() throws InvalidDDMSException {
    Rights rights = new Rights(true, true, true);

    PropertyReader.setProperty("output.indexLevel", "1");
    String index = rights.buildIndex(0, 1);
    assertEquals("", index);
    index = rights.buildIndex(2, 4);
    assertEquals("[3]", index);
  }
View Full Code Here

Examples of buri.ddmsence.ddms.resource.Rights

    assertEquals("[3]", index);
  }

  @Test
  public void testBuildIndexLevel2() throws InvalidDDMSException {
    Rights rights = new Rights(true, true, true);

    PropertyReader.setProperty("output.indexLevel", "2");
    String index = rights.buildIndex(0, 1);
    assertEquals("[1]", index);
    index = rights.buildIndex(2, 4);
    assertEquals("[3]", index);
  }
View Full Code Here

Examples of buri.ddmsence.ddms.resource.Rights

    assertEquals("[3]", index);
  }

  @Test
  public void testBuildOutput() throws InvalidDDMSException {
    Rights rights = new Rights(true, true, true);
    List<IDDMSComponent> objectList = new ArrayList<IDDMSComponent>();
    objectList.add(rights);
    assertEquals("rights.privacyAct: true\nrights.intellectualProperty: true\nrights.copyright: true\n",
      rights.buildHTMLTextOutput(OutputFormat.TEXT, "", objectList));

    List<String> stringList = new ArrayList<String>();
    stringList.add("Text");
    assertEquals("name: Text\n", rights.buildHTMLTextOutput(OutputFormat.TEXT, "name", stringList));

    List<Double> otherList = new ArrayList<Double>();
    otherList.add(Double.valueOf(2.0));
    assertEquals("name: 2.0\n", rights.buildHTMLTextOutput(OutputFormat.TEXT, "name", otherList));
  }
View Full Code Here

Examples of buri.ddmsence.ddms.resource.Rights

    assertEquals("{\"excludeFromRollup\":true,\"classification\":\"U\",\"ownerProducer\":[\"USA\"]}", security.toJSON());
  }
 
  @Test
  public void testSelfEquality() throws InvalidDDMSException {
    Rights rights = new Rights(true, true, true);
    assertEquals(rights, rights);
  }
View Full Code Here

Examples of buri.ddmsence.ddms.resource.Rights

    assertEquals(rights, rights);
  }

  @Test
  public void testToString() throws InvalidDDMSException {
    Rights rights = new Rights(true, true, true);
    assertEquals(rights.toString(), rights.toXML());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.