@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);
  }
  @Test(expected = InstallationException.class)
  public void testNullMetadataFile() throws InstallationException {
    InstallRequest request = new InstallRequest();
    request.addMetadata(metadata.setFile(null));

    installer.install(session, request);
  }
  @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);
  }