@Test
  public void testCreateRepositoryFromNonexistentRepositoryId() throws Exception {

    long repositoryId = RandomTestUtil.randomLong();

    RepositoryFactoryUtil.create(repositoryId);
  }
  @Test(expected = NoSuchRepositoryEntryException.class)
  public void testCreateRepositoryFromNonexistentFileVersionId() throws Exception {

    long fileVersionId = RandomTestUtil.randomLong();

    RepositoryFactoryUtil.create(0, 0, fileVersionId);
  }
  @Test(expected = NoSuchRepositoryEntryException.class)
  public void testCreateLocalRepositoryFromNonexistentFileVersionId() throws Exception {

    long fileVersionId = RandomTestUtil.randomLong();

    RepositoryLocalServiceUtil.getLocalRepositoryImpl(0, 0, fileVersionId);
  }
  @Test(expected = NoSuchRepositoryEntryException.class)
  public void testCreateLocalRepositoryFromInvalidFolderId() throws Exception {

    long folderId = RandomTestUtil.randomLong();

    RepositoryLocalServiceUtil.getLocalRepositoryImpl(folderId, 0, 0);
  }
  @Test(expected = RepositoryException.class)
  public void testCreateRepositoryFromNonexistentRepositoryId() throws Exception {

    long repositoryId = RandomTestUtil.randomLong();

    RepositoryLocalServiceUtil.getRepositoryImpl(repositoryId);
  }
  protected DDMStructure createStructure(String name, String definition) {
    DDMStructure structure = new DDMStructureImpl();

    structure.setStructureId(RandomTestUtil.randomLong());
    structure.setName(name);
    structure.setDefinition(definition);

    _structures.put(structure.getStructureId(), structure);

    return structure;
  }