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 java.io.File;
23 import java.util.Properties;
24
25 import org.apache.maven.it.Verifier;
26 import org.apache.maven.it.util.ResourceExtractor;
27
28
29
30
31
32
33
34 public class MavenITmng3810BadProfileActivationTest
35 extends AbstractMavenIntegrationTestCase
36 {
37
38 public MavenITmng3810BadProfileActivationTest()
39 {
40 super( "(2.0.10,2.1.0-M1),(2.1.0-M1,3.0-alpha-1),[3.0-alpha-3,)" );
41 }
42
43 public void testitMNG3810Property()
44 throws Exception
45 {
46 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3810/property" );
47
48 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
49 verifier.setAutoclean( false );
50 verifier.deleteDirectory( "target" );
51 try
52 {
53 verifier.executeGoal( "validate" );
54 fail( "Build should not succeed" );
55 }
56 catch ( Exception e )
57 {
58 verifier.verifyTextInLog( "The property name is required to activate the profile" );
59 }
60 verifier.resetStreams();
61
62 Properties props = verifier.loadProperties( "target/profile.properties" );
63 assertNull( props.getProperty( "project.properties.pomProperty" ) );
64 }
65
66 }