summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Clement <aclement@gopivotal.com>2014-03-13 09:03:38 -0700
committerAndy Clement <aclement@gopivotal.com>2014-03-13 09:03:38 -0700
commita9da693f8a3016edf96cfe4b29d304afdfb6b1b8 (patch)
treed5a772df687cac277cc3a5a29c57f4b0b3c1d5f5
parent3030eb6cfde33d57de3fb28220defa91deb6cfe1 (diff)
downloadaspectj-a9da693f8a3016edf96cfe4b29d304afdfb6b1b8.tar.gz
aspectj-a9da693f8a3016edf96cfe4b29d304afdfb6b1b8.zip
testcode for 430243
-rw-r--r--tests/bugs175/pr430243/PackageManagerAspect.java32
-rw-r--r--tests/bugs175/pr430243/PolicyManager.java20
-rw-r--r--tests/bugs175/pr430243/PolicyProviderConstants.java38
-rw-r--r--tests/bugs175/pr430243/PolicyProviderInterface.java32
-rw-r--r--tests/src/org/aspectj/systemtest/ajc175/Ajc175Tests.java5
-rw-r--r--tests/src/org/aspectj/systemtest/ajc175/ajc175.xml7
6 files changed, 133 insertions, 1 deletions
diff --git a/tests/bugs175/pr430243/PackageManagerAspect.java b/tests/bugs175/pr430243/PackageManagerAspect.java
new file mode 100644
index 000000000..56c609e5f
--- /dev/null
+++ b/tests/bugs175/pr430243/PackageManagerAspect.java
@@ -0,0 +1,32 @@
+package com.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.test2.PolicyManager;
+
+public aspect PackageManagerAspect {
+ pointcut intentquery () : execution(* foo(..));
+ private static final String TAG = "PackageManagerAspect";
+
+ Object around(): intentquery() {
+// return compute();
+ switch (PolicyManager.getOpenInPolicy(false)) {
+ case UNRESTRICTED: break;
+ case RESTRICTED: break;
+ case BLOCKED:
+ default: break;
+ }
+ return "";
+ }
+
+ public Object compute() {
+ switch (PolicyManager.getOpenInPolicy(false)) {
+ case UNRESTRICTED: break;
+ case RESTRICTED: break;
+ case BLOCKED:
+ default: break;
+ }
+ return "";
+ }
+}
diff --git a/tests/bugs175/pr430243/PolicyManager.java b/tests/bugs175/pr430243/PolicyManager.java
new file mode 100644
index 000000000..f6e508f33
--- /dev/null
+++ b/tests/bugs175/pr430243/PolicyManager.java
@@ -0,0 +1,20 @@
+package com.test2;
+
+import com.test2.PolicyProviderConstants.OpenInPolicyValues;
+
+public class PolicyManager {
+ public static OpenInPolicyValues getOpenInPolicy (boolean showDialog)
+ {
+ OpenInPolicyValues value = PolicyProviderInterface.getOpenInPolicy();
+
+ return value;
+ }
+
+ public static void main(String[] args) {
+ new PolicyManager().foo();
+ }
+
+ public String foo() {
+ return "";
+ }
+} \ No newline at end of file
diff --git a/tests/bugs175/pr430243/PolicyProviderConstants.java b/tests/bugs175/pr430243/PolicyProviderConstants.java
new file mode 100644
index 000000000..9a56fe1e6
--- /dev/null
+++ b/tests/bugs175/pr430243/PolicyProviderConstants.java
@@ -0,0 +1,38 @@
+package com.test2;
+
+public interface PolicyProviderConstants
+{
+ public static final String featureSMS = "Sms";
+ public static final String featureCamera = "Camera";
+ public static final String featureAudio = "Microphone";
+ public static final String featureLocation = "Location";
+ public static final String featureSensor = "Sensor";
+ public static final String featureSnapshot = "ScreenCapture";
+ public static final String featureNFC = "nfc";
+
+ public static final String featureClipboard = "CutAndCopy";
+ public static final String featureOpenIn = "DocumentExchange";
+
+ public static final String policySecurityGroup = "SecurityGroup";
+
+ public static final String featureNetworkAccess = "NetworkAccess";
+
+ public static final String featureAuthSupport = "AuthSupport";
+ public static final String featureNETWORKACCESSMODE = "PreferredVpnMode";
+ public static final String policyOpenInExclusionList = "OpenInExclusionList";
+
+ public enum CutCopyPolicyValues
+ {
+ BLOCKED,
+ RESTRICTED,
+ UNRESTRICTED,
+ };
+
+ public enum OpenInPolicyValues
+ {
+ BLOCKED,
+ RESTRICTED,
+ UNRESTRICTED,
+ };
+
+}
diff --git a/tests/bugs175/pr430243/PolicyProviderInterface.java b/tests/bugs175/pr430243/PolicyProviderInterface.java
new file mode 100644
index 000000000..5b14b85d5
--- /dev/null
+++ b/tests/bugs175/pr430243/PolicyProviderInterface.java
@@ -0,0 +1,32 @@
+package com.test2;
+
+import com.test2.PolicyProviderConstants.OpenInPolicyValues;
+
+//import android.content.ContentResolver;
+//import android.database.Cursor;
+//import android.net.Uri;
+//import android.os.Binder;
+//import android.text.TextUtils;
+//import android.util.Log;
+
+
+// Interface to calls to ManagedAppInfoProvider. this queries the policies and exposes interfaces for checks
+public class PolicyProviderInterface
+{
+ private static final String TAG = "PolicyProviderInterface";
+
+ private static final String STR_SECURITY_GROUP = "SecurityGroup";
+ private static final String STR_BLOCKED = "blocked";
+ private static final String VALUE_SECUREBROWSE = "SecureBrowse";
+
+// private static final String STR_PROVIDER_URI = PolicyProviderColumns.AUTHORITY + "." + PolicyManager.getPackageName() + "/" + PolicyProviderColumns.POLICY_INFO;
+// private static final Uri providerURI = Uri.parse("content://"+ STR_PROVIDER_URI);
+
+
+
+ public static OpenInPolicyValues getOpenInPolicy()
+ {
+ return OpenInPolicyValues.RESTRICTED;
+ }
+
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc175/Ajc175Tests.java b/tests/src/org/aspectj/systemtest/ajc175/Ajc175Tests.java
index 54b38a265..7a31126c5 100644
--- a/tests/src/org/aspectj/systemtest/ajc175/Ajc175Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc175/Ajc175Tests.java
@@ -21,6 +21,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
*/
public class Ajc175Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+// public void testIllegalAccessError_430243() throws Exception {
+// runTest("illegalaccesserror");
+// }
+
public void testVertxVerifyError_423257() throws Exception {
runTest("vertx verify error");
}
@@ -31,7 +35,6 @@ public class Ajc175Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
return XMLBasedAjcTestCase.loadSuite(Ajc175Tests.class);
}
- @Override
protected File getSpecFile() {
return new File("../tests/src/org/aspectj/systemtest/ajc175/ajc175.xml");
}
diff --git a/tests/src/org/aspectj/systemtest/ajc175/ajc175.xml b/tests/src/org/aspectj/systemtest/ajc175/ajc175.xml
index dff61dd4a..2db4a984a 100644
--- a/tests/src/org/aspectj/systemtest/ajc175/ajc175.xml
+++ b/tests/src/org/aspectj/systemtest/ajc175/ajc175.xml
@@ -2,6 +2,13 @@
<suite>
+ <ajc-test dir="bugs175/pr430243" title="illegalaccesserror">
+ <compile files="PackageManagerAspect.java PolicyManager.java PolicyProviderConstants.java PolicyProviderInterface.java" options="-1.6">
+ </compile>
+ <run class="com.test2.PolicyManager">
+ </run>
+ </ajc-test>
+
<ajc-test dir="bugs175/pr423257" title="vertx verify error">
<compile files="Test.java AspectX.java" options="-1.7">
</compile>