View Javadoc
1   package org.codehaus.plexus.compiler.ajc;
2   
3   import java.io.File;
4   import java.util.Arrays;
5   import java.util.Collection;
6   import java.util.Collections;
7   import java.util.List;
8   
9   import org.codehaus.plexus.compiler.AbstractCompilerTest;
10  
11  /**
12   * @author <a href="mailto:jason@plexus.org">Jason van Zyl</a>
13   */
14  public class AspectJCompilerTest
15      extends AbstractCompilerTest
16  {
17      public AspectJCompilerTest()
18      {
19          super();
20      }
21  
22      protected String getRoleHint()
23      {
24          return "aspectj";
25      }
26  
27      protected int expectedErrors()
28      {
29          // olamy well I agree it's hackhish but I don't want to waste too much time with aspectj which is probably
30          // not used a lot anymore...
31          if (getJavaVersion().startsWith( "9" ) || getJavaVersion().startsWith( "10" ))
32          {
33              return 11;
34          }
35          return 1;
36      }
37  
38      protected Collection<String> expectedOutputFiles()
39      {
40          String javaVersion = System.getProperty( "java.version" );
41          // olamy well I agree it's hackhish but I don't want to waste too much time with aspectj which is probably
42          // not used a lot anymore...
43          if (javaVersion.startsWith( "9" ) || javaVersion.startsWith( "10" ))
44          {
45              return Collections.emptyList();
46          }
47          return Arrays.asList( new String[]{ "org/codehaus/foo/ExternalDeps.class", "org/codehaus/foo/Person.class" } );
48      }
49  
50      protected List<String> getClasspath()
51          throws Exception
52      {
53          List<String> cp = super.getClasspath();
54  
55          File localArtifactPath =
56              getLocalArtifactPath( "org.aspectj", "aspectjrt", System.getProperty( "aspectj.version" ), "jar" );
57          cp.add( localArtifactPath.getAbsolutePath() );
58  
59          return cp;
60      }
61  
62  }