Ejemplo n.º 1
0
  @Test(expected = InstallationException.class)
  public void testNonExistentMetadataFile() throws InstallationException {
    InstallRequest request = new InstallRequest();
    request.addMetadata(metadata.setFile(new File("missing.xml")));

    installer.install(session, request);
  }
Ejemplo n.º 2
0
  @Test(expected = InstallationException.class)
  public void testNullMetadataFile() throws InstallationException {
    InstallRequest request = new InstallRequest();
    request.addMetadata(metadata.setFile(null));

    installer.install(session, request);
  }
Ejemplo n.º 3
0
  @Test(expected = InstallationException.class)
  public void testMetadataDestinationEqualsSource() throws Exception {
    String path = session.getLocalRepositoryManager().getPathForLocalMetadata(metadata);
    File file = new File(session.getLocalRepository().getBasedir(), path);
    metadata = metadata.setFile(file);
    TestFileUtils.writeString(file, "test");

    request.addMetadata(metadata);
    installer.install(session, request);
  }