Search in sources :

Example 6 with AssemblyArchiverPhase

use of org.apache.maven.plugins.assembly.archive.phase.AssemblyArchiverPhase in project maven-plugins by apache.

the class DefaultAssemblyArchiverTest method testCreateArchiver_ShouldCreateZipArchiver.

@Test
public void testCreateArchiver_ShouldCreateZipArchiver() throws NoSuchArchiverException, ArchiverException {
    final EasyMockSupport mm = new EasyMockSupport();
    final ZipArchiver archiver = new ZipArchiver();
    final MockAndControlForAssemblyArchiver macArchiverManager = new MockAndControlForAssemblyArchiver(mm);
    macArchiverManager.expectGetArchiver("zip", archiver);
    final AssemblerConfigurationSource configSource = mm.createMock(AssemblerConfigurationSource.class);
    expect(configSource.isDryRun()).andReturn(false).anyTimes();
    expect(configSource.getArchiverConfig()).andReturn(null).anyTimes();
    expect(configSource.getWorkingDirectory()).andReturn(new File(".")).anyTimes();
    expect(configSource.isUpdateOnly()).andReturn(false).anyTimes();
    expect(configSource.getJarArchiveConfiguration()).andReturn(null).anyTimes();
    expect(configSource.isIgnorePermissions()).andReturn(true).anyTimes();
    mm.replayAll();
    final DefaultAssemblyArchiver subject = createSubject(macArchiverManager, new ArrayList<AssemblyArchiverPhase>(), null);
    subject.createArchiver("zip", false, null, configSource, null, false, null);
}
Also used : EasyMockSupport(org.easymock.classextension.EasyMockSupport) ZipArchiver(org.codehaus.plexus.archiver.zip.ZipArchiver) AssemblerConfigurationSource(org.apache.maven.plugins.assembly.AssemblerConfigurationSource) File(java.io.File) AssemblyArchiverPhase(org.apache.maven.plugins.assembly.archive.phase.AssemblyArchiverPhase) Test(org.junit.Test)

Example 7 with AssemblyArchiverPhase

use of org.apache.maven.plugins.assembly.archive.phase.AssemblyArchiverPhase in project maven-plugins by apache.

the class DefaultAssemblyArchiverTest method setupStdExpectations.

private DefaultAssemblyArchiver setupStdExpectations(EasyMockSupport mm, MockAndControlForAssemblyArchiver macArchiverManager, AssemblerConfigurationSource configSource) {
    expect(configSource.getProject()).andReturn(new MavenProject(new Model())).anyTimes();
    expect(configSource.getJarArchiveConfiguration()).andReturn(null).anyTimes();
    expect(configSource.getWorkingDirectory()).andReturn(new File(".")).anyTimes();
    expect(configSource.isUpdateOnly()).andReturn(false).anyTimes();
    expect(configSource.isIgnorePermissions()).andReturn(true).anyTimes();
    mm.replayAll();
    return createSubject(macArchiverManager, new ArrayList<AssemblyArchiverPhase>(), null);
}
Also used : MavenProject(org.apache.maven.project.MavenProject) Model(org.apache.maven.model.Model) File(java.io.File) AssemblyArchiverPhase(org.apache.maven.plugins.assembly.archive.phase.AssemblyArchiverPhase)

Aggregations

AssemblyArchiverPhase (org.apache.maven.plugins.assembly.archive.phase.AssemblyArchiverPhase)7 File (java.io.File)5 EasyMockSupport (org.easymock.classextension.EasyMockSupport)4 Test (org.junit.Test)4 AssemblerConfigurationSource (org.apache.maven.plugins.assembly.AssemblerConfigurationSource)3 IOException (java.io.IOException)2 Model (org.apache.maven.model.Model)2 MavenProject (org.apache.maven.project.MavenProject)2 ArchiverException (org.codehaus.plexus.archiver.ArchiverException)2 NoSuchArchiverException (org.codehaus.plexus.archiver.manager.NoSuchArchiverException)2 ArrayList (java.util.ArrayList)1 ArtifactRepository (org.apache.maven.artifact.repository.ArtifactRepository)1 AssemblyProxyArchiver (org.apache.maven.plugins.assembly.archive.archiver.AssemblyProxyArchiver)1 AssemblyArchiverPhaseComparator (org.apache.maven.plugins.assembly.archive.phase.AssemblyArchiverPhaseComparator)1 DependencyResolutionException (org.apache.maven.plugins.assembly.artifact.DependencyResolutionException)1 ContainerDescriptorHandler (org.apache.maven.plugins.assembly.filter.ContainerDescriptorHandler)1 Assembly (org.apache.maven.plugins.assembly.model.Assembly)1 Archiver (org.codehaus.plexus.archiver.Archiver)1 DryRunArchiver (org.codehaus.plexus.archiver.diags.DryRunArchiver)1 JarArchiver (org.codehaus.plexus.archiver.jar.JarArchiver)1