1 package org.apache.maven.model.converter.plugins;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import junit.framework.Assert;
23 import org.apache.maven.model.converter.ProjectConverterException;
24 import org.codehaus.plexus.util.xml.Xpp3Dom;
25
26 import java.io.IOException;
27
28
29
30
31
32 public class PCCJalopyTest
33 extends AbstractPCCTest
34 {
35 protected void setUp()
36 throws Exception
37 {
38 super.setUp();
39
40 pluginConfigurationConverter = new PCCJalopy();
41 }
42
43 public void testBuildConfiguration()
44 {
45 try
46 {
47 projectProperties.load( getClassLoader().getResourceAsStream( "PCCJalopyTest.properties" ) );
48
49 pluginConfigurationConverter.buildConfiguration( configuration, v3Model, projectProperties );
50
51 String value = configuration.getChild( "convention" ).getValue();
52 Assert.assertEquals( "check convention value", "jalopy_conventions.xml", value );
53
54 value = configuration.getChild( "failOnError" ).getValue();
55 Assert.assertEquals( "check failOnError value", "false", value );
56
57 value = configuration.getChild( "fileFormat" ).getValue();
58 Assert.assertEquals( "check fileFormat value", "UNIX", value );
59
60 value = configuration.getChild( "history" ).getValue();
61 Assert.assertEquals( "check history value", "FILE", value );
62
63 value = configuration.getChild( "srcExcludesPattern" ).getValue();
64 Assert.assertEquals( "check srcExcludesPattern value", "**/*Exclude.java", value );
65
66 value = configuration.getChild( "srcIncludesPattern" ).getValue();
67 Assert.assertEquals( "check srcIncludesPattern value", "**/*.java", value );
68
69 value = configuration.getChild( "testExcludesPattern" ).getValue();
70 Assert.assertEquals( "check testExcludesPattern value", "**/*Test.java", value );
71
72 value = configuration.getChild( "testIncludesPattern" ).getValue();
73 Assert.assertEquals( "check testIncludesPattern value", "**/*TestCase.java", value );
74 }
75 catch ( ProjectConverterException e )
76 {
77 Assert.fail( e.getMessage() );
78 }
79 catch ( IOException e )
80 {
81 Assert.fail( "Unable to find the requested resource." );
82 }
83 }
84 }