1 package org.apache.maven.it;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.it.util.ResourceExtractor;
23
24 import java.io.File;
25 import java.util.ArrayList;
26 import java.util.Arrays;
27 import java.util.List;
28
29
30
31
32
33 public class MavenIT0144LifecycleExecutionOrderTest
34 extends AbstractMavenIntegrationTestCase
35 {
36
37 public MavenIT0144LifecycleExecutionOrderTest()
38 {
39 super( ALL_MAVEN_VERSIONS );
40 }
41
42
43
44
45
46
47 public void testit0144()
48 throws Exception
49 {
50 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0144" );
51
52 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
53 verifier.deleteDirectory( "target" );
54 verifier.setAutoclean( false );
55 verifier.executeGoals( Arrays.asList( new String[]{ "post-clean", "deploy", "site-deploy" } ) );
56 verifier.verifyErrorFreeLog();
57 verifier.resetStreams();
58
59 List<String> expected = new ArrayList<>();
60
61 expected.add( "pre-clean" );
62 expected.add( "clean" );
63 expected.add( "post-clean" );
64
65 expected.add( "validate" );
66 expected.add( "initialize" );
67 expected.add( "generate-sources" );
68 expected.add( "process-sources" );
69 expected.add( "generate-resources" );
70 expected.add( "process-resources" );
71 expected.add( "compile" );
72 expected.add( "process-classes" );
73 expected.add( "generate-test-sources" );
74 expected.add( "process-test-sources" );
75 expected.add( "generate-test-resources" );
76 expected.add( "process-test-resources" );
77 expected.add( "test-compile" );
78 if ( matchesVersionRange( "(2.0.4,)" ) )
79 {
80
81 expected.add( "process-test-classes" );
82 }
83 expected.add( "test" );
84 if ( matchesVersionRange( "(2.1.0-M1,)" ) )
85 {
86
87 expected.add( "prepare-package" );
88 }
89 expected.add( "package" );
90 if ( matchesVersionRange( "(2.0.1,)" ) )
91 {
92 expected.add( "pre-integration-test" );
93 }
94 expected.add( "integration-test" );
95 if ( matchesVersionRange( "(2.0.1,)" ) )
96 {
97 expected.add( "post-integration-test" );
98 }
99 expected.add( "verify" );
100 expected.add( "install" );
101 expected.add( "deploy" );
102
103 expected.add( "pre-site" );
104 expected.add( "site" );
105 expected.add( "post-site" );
106 expected.add( "site-deploy" );
107
108 List<String> phases = verifier.loadLines( "target/phases.log", "UTF-8" );
109 assertEquals( expected, phases );
110 }
111
112 }