]> source.dussan.org Git - aspectj.git/commitdiff
328099
authoraclement <aclement>
Mon, 2 May 2011 18:41:04 +0000 (18:41 +0000)
committeraclement <aclement>
Mon, 2 May 2011 18:41:04 +0000 (18:41 +0000)
tests/bugs1612/pr328099/X.java [new file with mode: 0644]
tests/bugs1612/pr328099/aop.xml [new file with mode: 0755]
tests/bugs1612/pr328099/cert/key.store [new file with mode: 0755]
tests/bugs1612/pr328099/code.jar [new file with mode: 0644]
tests/bugs1612/pr328099/pom.xml [new file with mode: 0755]
tests/bugs1612/pr328099/readme [new file with mode: 0644]
tests/bugs1612/pr328099/src/META-INF/aop.xml [new file with mode: 0755]
tests/bugs1612/pr328099/src/foo/bar/BarAspect.java [new file with mode: 0755]
tests/bugs1612/pr328099/src/foo/bar/Foo.java [new file with mode: 0755]
tests/bugs1612/pr328099/src/foo/bar/FooLaunch.java [new file with mode: 0644]

diff --git a/tests/bugs1612/pr328099/X.java b/tests/bugs1612/pr328099/X.java
new file mode 100644 (file)
index 0000000..a4f7a14
--- /dev/null
@@ -0,0 +1 @@
+public class X{}
diff --git a/tests/bugs1612/pr328099/aop.xml b/tests/bugs1612/pr328099/aop.xml
new file mode 100755 (executable)
index 0000000..b65c5ef
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE aspectj PUBLIC\r
+        "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">\r
+<aspectj>\r
+  <weaver options="-debug">\r
+    <include within="foo.bar..*" />\r
+  </weaver>\r
+  <aspects>\r
+    <aspect name="foo.bar.BarAspect"/>\r
+  </aspects>\r
+</aspectj>\r
diff --git a/tests/bugs1612/pr328099/cert/key.store b/tests/bugs1612/pr328099/cert/key.store
new file mode 100755 (executable)
index 0000000..41288f6
Binary files /dev/null and b/tests/bugs1612/pr328099/cert/key.store differ
diff --git a/tests/bugs1612/pr328099/code.jar b/tests/bugs1612/pr328099/code.jar
new file mode 100644 (file)
index 0000000..2525896
Binary files /dev/null and b/tests/bugs1612/pr328099/code.jar differ
diff --git a/tests/bugs1612/pr328099/pom.xml b/tests/bugs1612/pr328099/pom.xml
new file mode 100755 (executable)
index 0000000..7cfbfaf
--- /dev/null
@@ -0,0 +1,95 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>foo.bar</groupId>
+  <artifactId>aspectj-certificate-problem</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <compilerVersion>1.6</compilerVersion>
+          <fork>true</fork>
+          <source>1.6</source>
+          <target>1.6</target>
+          <showWarnings>true</showWarnings>
+          <showDeprecation>true</showDeprecation>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <version>2.2</version>
+        <configuration>
+          <descriptorRefs>
+            <descriptorRef>jar-with-dependencies</descriptorRef>
+          </descriptorRefs>
+          <archive>
+            <manifest>
+              <mainClass>foo.bar.Foo</mainClass>
+            </manifest>
+          </archive>
+        </configuration>
+        <executions>
+          <execution>
+            <id>make-assembly</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jarsigner-plugin</artifactId>
+        <configuration>
+          <keystore>cert/key.store</keystore>
+          <alias>foo</alias>
+          <storepass>foobar</storepass>
+          <archiveDirectory>target</archiveDirectory>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <version>1.1</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>exec</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <executable>java</executable>
+          <!-- optional -->
+          <arguments>
+            <argument>-javaagent:/Users/aclement/installs/aspectj1611/lib/aspectjweaver.jar</argument>
+            <argument>-jar</argument>
+            <argument>target/aspectj-certificate-problem-1.0-SNAPSHOT-jar-with-dependencies.jar</argument>
+          </arguments>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.aspectj</groupId>
+      <artifactId>aspectjrt</artifactId>
+      <version>1.6.10</version>
+    </dependency>
+    <dependency>
+      <groupId>org.aspectj</groupId>
+      <artifactId>aspectjweaver</artifactId>
+      <version>1.6.10</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/tests/bugs1612/pr328099/readme b/tests/bugs1612/pr328099/readme
new file mode 100644 (file)
index 0000000..035feb4
--- /dev/null
@@ -0,0 +1,9 @@
+Build the src contents into a jar which will then contain class files and our manifest.  Jar typically code.jar
+
+Then sign the jar with
+ jarsigner -keystore ../cert/key.store -storepass foobar code.jar foo
+
+as per: http://introcs.cs.princeton.edu/85application/jar/sign.html
+
+then you can run it:
+java -javaagent:XXX -classpath code.jar foo.bar.Foo
diff --git a/tests/bugs1612/pr328099/src/META-INF/aop.xml b/tests/bugs1612/pr328099/src/META-INF/aop.xml
new file mode 100755 (executable)
index 0000000..d08ae41
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE aspectj PUBLIC\r
+        "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">\r
+<aspectj>\r
+  <weaver>\r
+    <include within="foo.bar..*" />\r
+  </weaver>\r
+  <aspects>\r
+    <aspect name="foo.bar.BarAspect"/>\r
+  </aspects>\r
+</aspectj>
\ No newline at end of file
diff --git a/tests/bugs1612/pr328099/src/foo/bar/BarAspect.java b/tests/bugs1612/pr328099/src/foo/bar/BarAspect.java
new file mode 100755 (executable)
index 0000000..901978d
--- /dev/null
@@ -0,0 +1,23 @@
+package foo.bar;\r
+\r
+import org.aspectj.lang.ProceedingJoinPoint;\r
+import org.aspectj.lang.annotation.Around;\r
+import org.aspectj.lang.annotation.Aspect;\r
+import org.aspectj.lang.annotation.Pointcut;\r
+\r
+@Aspect\r
+public class BarAspect {\r
+    @SuppressWarnings("unused")\r
+    @Pointcut("execution(* foo.bar.Foo.bar())")\r
+    private void pointcut() {\r
+    }\r
+\r
+    @Around("pointcut()")\r
+    public Object applyAdvice(ProceedingJoinPoint pjp) throws Throwable {\r
+        System.out.print("pre...");\r
+        Object retVal = pjp.proceed();\r
+        System.out.println("...post");\r
+        return retVal;\r
+    }\r
+\r
+}\r
diff --git a/tests/bugs1612/pr328099/src/foo/bar/Foo.java b/tests/bugs1612/pr328099/src/foo/bar/Foo.java
new file mode 100755 (executable)
index 0000000..2a35392
--- /dev/null
@@ -0,0 +1,18 @@
+package foo.bar;
+
+/**
+ * Hello world!
+ *
+ */
+public class Foo
+{
+    public void bar() {
+        System.out.print(this.getClass().getSimpleName() + ".bar()");
+    }
+
+    public static void main( String[] args )
+    {
+        Foo foo = new Foo();
+        foo.bar();
+    }
+}
diff --git a/tests/bugs1612/pr328099/src/foo/bar/FooLaunch.java b/tests/bugs1612/pr328099/src/foo/bar/FooLaunch.java
new file mode 100644 (file)
index 0000000..ed7452f
--- /dev/null
@@ -0,0 +1,7 @@
+package foo.bar;
+
+public class FooLaunch {
+  public static void main(String[]argv) {
+    Foo.main(argv);
+  }
+}