summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/policy-security-jsr250/src/test
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-11-14 14:08:48 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-11-14 14:08:48 +0000
commitc53c843b6fa38adcaadabfe8bce57a0d13943ca3 (patch)
tree68f73ed1a6788f7b2b12e6699ffd4ff55c6ff846 /sca-java-2.x/trunk/modules/policy-security-jsr250/src/test
parent4bf0a7052b448315eda710857acafe24bb112a5b (diff)
Deal with a couple of cases where the order of results differs depending on whether I'm on the IBM or Oracle JDK.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1201712 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/policy-security-jsr250/src/test')
-rw-r--r--sca-java-2.x/trunk/modules/policy-security-jsr250/src/test/java/org/apache/tuscany/sca/policy/security/jsr250/PolicyProcessorTestCase.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/sca-java-2.x/trunk/modules/policy-security-jsr250/src/test/java/org/apache/tuscany/sca/policy/security/jsr250/PolicyProcessorTestCase.java b/sca-java-2.x/trunk/modules/policy-security-jsr250/src/test/java/org/apache/tuscany/sca/policy/security/jsr250/PolicyProcessorTestCase.java
index b6bd00e345..de8e0ccacf 100644
--- a/sca-java-2.x/trunk/modules/policy-security-jsr250/src/test/java/org/apache/tuscany/sca/policy/security/jsr250/PolicyProcessorTestCase.java
+++ b/sca-java-2.x/trunk/modules/policy-security-jsr250/src/test/java/org/apache/tuscany/sca/policy/security/jsr250/PolicyProcessorTestCase.java
@@ -177,26 +177,30 @@ public class PolicyProcessorTestCase extends TestCase {
}
public void testSingleInterfaceWithRolesAllowedAtMethodLevel() throws Exception {
- runProcessors(Service4.class, Service4.class.getMethods()[1], type);
- Operation op = getOperationModel(Service4.class.getMethods()[1], type);
+ Method aMethod = Service4.class.getDeclaredMethod("method2");
+ runProcessors(Service4.class, aMethod, type);
+ Operation op = getOperationModel(aMethod, type);
Assert.assertEquals(1, op.getPolicySets().size());
}
public void testSingleInterfaceWithPermitAllAtMethodLevel() throws Exception {
- runProcessors(Service4.class, Service4.class.getMethods()[2], type);
- Operation op = getOperationModel(Service4.class.getMethods()[2], type);
+ Method aMethod = Service4.class.getDeclaredMethod("method3");
+ runProcessors(Service4.class, aMethod, type);
+ Operation op = getOperationModel(aMethod, type);
Assert.assertEquals(1, op.getPolicySets().size());
}
public void testSingleInterfaceWithDenyAllAtMethodLevel() throws Exception {
- runProcessors(Service4.class, Service4.class.getMethods()[3], type);
- Operation op = getOperationModel(Service4.class.getMethods()[3], type);
+ Method aMethod = Service4.class.getDeclaredMethod("method4");
+ runProcessors(Service4.class, aMethod, type);
+ Operation op = getOperationModel(aMethod, type);
Assert.assertEquals(1, op.getPolicySets().size());
}
public void testSingleInterfaceWithNothingAtMethodLevel() throws Exception {
- runProcessors(Service4.class, Service4.class.getMethods()[0], type);
- Operation op = getOperationModel(Service4.class.getMethods()[0], type);
+ Method aMethod = Service4.class.getDeclaredMethod("method1");
+ runProcessors(Service4.class, aMethod, type);
+ Operation op = getOperationModel(aMethod, type);
Assert.assertEquals(0, op.getPolicySets().size());
}
@@ -210,13 +214,11 @@ public class PolicyProcessorTestCase extends TestCase {
}
private Operation getOperationModel(Method method, JavaImplementation type){
-
for(Operation op : type.getOperations()){
if (((JavaOperation)op).getJavaMethod().equals(method)){
return op;
}
}
-
return null;
}
}