aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2005-12-12 11:16:19 +0000
committeraclement <aclement>2005-12-12 11:16:19 +0000
commit96c97433a198c2960be1afc282081886fb84bb46 (patch)
treee8ba9b0e7d111b91e3f1c5604683dbb7129615ff /tests
parent979124d0fe6ac23df1dd5ee41838056bbaed6789 (diff)
downloadaspectj-96c97433a198c2960be1afc282081886fb84bb46.tar.gz
aspectj-96c97433a198c2960be1afc282081886fb84bb46.zip
tests for 119657. from matthew.
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs150/pr119657/accounts/recovery/Recovery.aj13
-rw-r--r--tests/bugs150/pr119657/accounts/recovery/RecoveryNotSelf.aj11
-rw-r--r--tests/bugs150/pr119657/aop-noinline.xml8
-rw-r--r--tests/bugs150/pr119657/aop-notself.xml8
-rw-r--r--tests/bugs150/pr119657/aop-selfandnotself.xml9
-rw-r--r--tests/bugs150/pr119657/aop.xml8
-rw-r--r--tests/bugs150/pr119657/services/account/AccountReport.java9
-rw-r--r--tests/bugs150/pr119657/services/account/StockQuoteServiceTest.java26
-rw-r--r--tests/bugs150/pr119657/services/accountdata/StockAccount.java37
-rw-r--r--tests/bugs150/pr119657/services/stockquote/StockQuoteService.java5
-rw-r--r--tests/bugs150/pr119657/services/stockquote/StockQuoteServiceImpl.java11
11 files changed, 145 insertions, 0 deletions
diff --git a/tests/bugs150/pr119657/accounts/recovery/Recovery.aj b/tests/bugs150/pr119657/accounts/recovery/Recovery.aj
new file mode 100644
index 000000000..f3864b92d
--- /dev/null
+++ b/tests/bugs150/pr119657/accounts/recovery/Recovery.aj
@@ -0,0 +1,13 @@
+package accounts.recovery;
+
+import services.stockquote.StockQuoteService;
+
+public aspect Recovery {
+
+ declare precedence : Recovery, *;
+
+ Object around () : call(public * *(..)) && target(StockQuoteService) {
+ System.out.println("Recovery.around() " + thisJoinPoint);
+ return proceed();
+ }
+}
diff --git a/tests/bugs150/pr119657/accounts/recovery/RecoveryNotSelf.aj b/tests/bugs150/pr119657/accounts/recovery/RecoveryNotSelf.aj
new file mode 100644
index 000000000..9abec1867
--- /dev/null
+++ b/tests/bugs150/pr119657/accounts/recovery/RecoveryNotSelf.aj
@@ -0,0 +1,11 @@
+package accounts.recovery;
+
+import services.stockquote.StockQuoteService;
+
+public aspect RecoveryNotSelf {
+
+ Object around () : call(public * *(..)) && target(StockQuoteService) && !within(RecoveryNotSelf) {
+ System.out.println("RecoveryNotSelf.around() " + thisJoinPoint);
+ return proceed();
+ }
+}
diff --git a/tests/bugs150/pr119657/aop-noinline.xml b/tests/bugs150/pr119657/aop-noinline.xml
new file mode 100644
index 000000000..fc3d6c3c0
--- /dev/null
+++ b/tests/bugs150/pr119657/aop-noinline.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<aspectj>
+ <aspects>
+ <aspect name="accounts.recovery.Recovery"/>
+ </aspects>
+ <weaver options="-verbose -showWeaveInfo -XnoInline"/>
+</aspectj>
+
diff --git a/tests/bugs150/pr119657/aop-notself.xml b/tests/bugs150/pr119657/aop-notself.xml
new file mode 100644
index 000000000..263efb16c
--- /dev/null
+++ b/tests/bugs150/pr119657/aop-notself.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<aspectj>
+ <aspects>
+ <aspect name="accounts.recovery.RecoveryNotSelf"/>
+ </aspects>
+ <weaver options="-verbose -showWeaveInfo"/>
+</aspectj>
+
diff --git a/tests/bugs150/pr119657/aop-selfandnotself.xml b/tests/bugs150/pr119657/aop-selfandnotself.xml
new file mode 100644
index 000000000..5760e6524
--- /dev/null
+++ b/tests/bugs150/pr119657/aop-selfandnotself.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<aspectj>
+ <aspects>
+ <aspect name="accounts.recovery.Recovery"/>
+ <aspect name="accounts.recovery.RecoveryNotSelf"/>
+ </aspects>
+ <weaver options="-verbose -showWeaveInfo"/>
+</aspectj>
+
diff --git a/tests/bugs150/pr119657/aop.xml b/tests/bugs150/pr119657/aop.xml
new file mode 100644
index 000000000..1ecbf981b
--- /dev/null
+++ b/tests/bugs150/pr119657/aop.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<aspectj>
+ <aspects>
+ <aspect name="accounts.recovery.Recovery"/>
+ </aspects>
+ <weaver options="-verbose -showWeaveInfo"/>
+</aspectj>
+
diff --git a/tests/bugs150/pr119657/services/account/AccountReport.java b/tests/bugs150/pr119657/services/account/AccountReport.java
new file mode 100644
index 000000000..618de4d99
--- /dev/null
+++ b/tests/bugs150/pr119657/services/account/AccountReport.java
@@ -0,0 +1,9 @@
+package services.account;
+
+import java.util.List;
+
+public interface AccountReport {
+
+ public List getAccountSummaries();
+
+}
diff --git a/tests/bugs150/pr119657/services/account/StockQuoteServiceTest.java b/tests/bugs150/pr119657/services/account/StockQuoteServiceTest.java
new file mode 100644
index 000000000..365505a30
--- /dev/null
+++ b/tests/bugs150/pr119657/services/account/StockQuoteServiceTest.java
@@ -0,0 +1,26 @@
+package services.account;
+
+import services.accountdata.StockAccount;
+import services.stockquote.StockQuoteService;
+import services.stockquote.StockQuoteServiceImpl;
+
+public class StockQuoteServiceTest {
+
+// private StockQuoteService stockQuoteService = new StockQuoteServiceImpl();
+ private StockQuoteService stockQuoteService;
+
+ public static void main (String[] args) {
+
+ new StockQuoteServiceTest().getAccountReport("123456");
+
+ }
+
+ public AccountReport getAccountReport(String customerID) {
+ StockAccount stockAccount = new StockAccount();
+ stockQuoteService = new StockQuoteServiceImpl();
+ float balance = (stockQuoteService.getQuote(stockAccount.getSymbol()))*stockAccount.getQuantity();
+ return null;
+ }
+
+
+}
diff --git a/tests/bugs150/pr119657/services/accountdata/StockAccount.java b/tests/bugs150/pr119657/services/accountdata/StockAccount.java
new file mode 100644
index 000000000..4e6cf1986
--- /dev/null
+++ b/tests/bugs150/pr119657/services/accountdata/StockAccount.java
@@ -0,0 +1,37 @@
+package services.accountdata;
+
+public class StockAccount {
+ private String accountNumber;
+
+ private String symbol;
+
+ private int quantity = 9999;
+
+// public StockAccount (String n) {
+// this.accountNumber = n;
+// }
+
+ public String getAccountNumber() {
+ return accountNumber;
+ }
+
+ public void setAccountNumber(String accountNumber) {
+ this.accountNumber = accountNumber;
+ }
+
+ public int getQuantity() {
+ return quantity;
+ }
+
+ public void setQuantity(int quantity) {
+ this.quantity = quantity;
+ }
+
+ public String getSymbol() {
+ return symbol;
+ }
+
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
+}
diff --git a/tests/bugs150/pr119657/services/stockquote/StockQuoteService.java b/tests/bugs150/pr119657/services/stockquote/StockQuoteService.java
new file mode 100644
index 000000000..0e4844c79
--- /dev/null
+++ b/tests/bugs150/pr119657/services/stockquote/StockQuoteService.java
@@ -0,0 +1,5 @@
+package services.stockquote;
+
+public interface StockQuoteService {
+ public float getQuote(String symbol);
+}
diff --git a/tests/bugs150/pr119657/services/stockquote/StockQuoteServiceImpl.java b/tests/bugs150/pr119657/services/stockquote/StockQuoteServiceImpl.java
new file mode 100644
index 000000000..a7169bdd2
--- /dev/null
+++ b/tests/bugs150/pr119657/services/stockquote/StockQuoteServiceImpl.java
@@ -0,0 +1,11 @@
+package services.stockquote;
+
+import services.stockquote.StockQuoteService;
+
+public class StockQuoteServiceImpl implements StockQuoteService {
+
+ public float getQuote(String symbol) {
+ return 99;
+ }
+
+}