Exemplo n.º 1
0
  /**
   * Test retrieving the resources of a Role without providing a role id.
   *
   * @throws Exception If anything fails.
   */
  @Test
  public void testAARrr3_rest() throws Exception {

    try {
      retrieveResources(null);
      EscidocRestSoapTestBase.failMissingException(MissingMethodParameterException.class);
    } catch (final Exception e) {
      EscidocRestSoapTestBase.assertExceptionType(MissingMethodParameterException.class, e);
    }
  }
Exemplo n.º 2
0
  /**
   * Test retrieving the resources of a Role with providing an id of an existing resource of another
   * resource type.
   *
   * @throws Exception If anything fails.
   */
  @Test
  public void testAARrr2_2_rest() throws Exception {

    try {
      retrieveResources(CONTEXT_ID);
      EscidocRestSoapTestBase.failMissingException(RoleNotFoundException.class);
    } catch (final Exception e) {
      EscidocRestSoapTestBase.assertExceptionType(RoleNotFoundException.class, e);
    }
  }
Exemplo n.º 3
0
  /**
   * Test declining creation of Role with providing objid.
   *
   * @throws Exception If anything fails.
   */
  @Test
  public void testAACro9_rest() throws Exception {

    Document toBeCreatedDocument =
        EscidocRestSoapTestBase.getTemplateAsDocument(TEMPLATE_ROLE_PATH, "role_for_create.xml");
    addAttribute(
        toBeCreatedDocument,
        XPATH_ROLE,
        createAttributeNode(
            toBeCreatedDocument, XLINK_NS_URI, null, EscidocTestBase.NAME_OBJID, "escidoc:42"));
    insertUniqueRoleName(toBeCreatedDocument);

    try {
      create(toString(toBeCreatedDocument, false));
      EscidocRestSoapTestBase.failMissingException(XmlSchemaValidationException.class);
    } catch (final Exception e) {
      EscidocRestSoapTestBase.assertExceptionType(XmlSchemaValidationException.class, e);
    }
  }