incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1467949 - in /sling/trunk/contrib/extensions/muppet: muppet-core/src/main/java/org/apache/sling/muppet/api/ muppet-core/src/test/java/org/apache/sling/muppet/impl/ muppet-rules/src/test/java/org/apache/sling/muppet/rules/impl/ muppet-sling...
Date Mon, 15 Apr 2013 11:58:07 GMT
Author: bdelacretaz
Date: Mon Apr 15 11:58:07 2013
New Revision: 1467949

URL: http://svn.apache.org/r1467949
Log:
SLING-2822 - rename evaluate() to execute()

Modified:
    sling/trunk/contrib/extensions/muppet/muppet-core/src/main/java/org/apache/sling/muppet/api/EvaluationResult.java
    sling/trunk/contrib/extensions/muppet/muppet-core/src/main/java/org/apache/sling/muppet/api/Rule.java
    sling/trunk/contrib/extensions/muppet/muppet-core/src/test/java/org/apache/sling/muppet/impl/RuleTest.java
    sling/trunk/contrib/extensions/muppet/muppet-rules/src/test/java/org/apache/sling/muppet/rules/impl/JmxBeansRuleBuilderTest.java
    sling/trunk/contrib/extensions/muppet/muppet-sling/src/test/java/org/apache/sling/muppet/sling/LoginRuleBuilderTest.java

Modified: sling/trunk/contrib/extensions/muppet/muppet-core/src/main/java/org/apache/sling/muppet/api/EvaluationResult.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/muppet/muppet-core/src/main/java/org/apache/sling/muppet/api/EvaluationResult.java?rev=1467949&r1=1467948&r2=1467949&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/muppet/muppet-core/src/main/java/org/apache/sling/muppet/api/EvaluationResult.java
(original)
+++ sling/trunk/contrib/extensions/muppet/muppet-core/src/main/java/org/apache/sling/muppet/api/EvaluationResult.java
Mon Apr 15 11:58:07 2013
@@ -30,7 +30,7 @@ public class EvaluationResult {
     
     public EvaluationResult(Rule r) {
         rule = r;
-        status = r.execute();
+        status = r.evaluate();
     }
     
     public Rule getRule() {

Modified: sling/trunk/contrib/extensions/muppet/muppet-core/src/main/java/org/apache/sling/muppet/api/Rule.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/muppet/muppet-core/src/main/java/org/apache/sling/muppet/api/Rule.java?rev=1467949&r1=1467948&r2=1467949&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/muppet/muppet-core/src/main/java/org/apache/sling/muppet/api/Rule.java
(original)
+++ sling/trunk/contrib/extensions/muppet/muppet-core/src/main/java/org/apache/sling/muppet/api/Rule.java
Mon Apr 15 11:58:07 2013
@@ -38,7 +38,7 @@ public class Rule {
         this.evaluator = e;
     }
     
-    public EvaluationResult.Status execute() {
+    public EvaluationResult.Status evaluate() {
         return evaluator.evaluate(attribute, expression);
     }
     

Modified: sling/trunk/contrib/extensions/muppet/muppet-core/src/test/java/org/apache/sling/muppet/impl/RuleTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/muppet/muppet-core/src/test/java/org/apache/sling/muppet/impl/RuleTest.java?rev=1467949&r1=1467948&r2=1467949&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/muppet/muppet-core/src/test/java/org/apache/sling/muppet/impl/RuleTest.java
(original)
+++ sling/trunk/contrib/extensions/muppet/muppet-core/src/test/java/org/apache/sling/muppet/impl/RuleTest.java
Mon Apr 15 11:58:07 2013
@@ -35,8 +35,8 @@ public class RuleTest {
     
     @Test
     public void testWithDefaultEvaluator() {
-        assertEquals("== 5", OK, new Rule(five,"5").execute());
-        assertEquals("> 2", OK, new Rule(five,"> 2").execute());
-        assertEquals("> 12 is false", ERROR, new Rule(five,"> 12").execute());
+        assertEquals("== 5", OK, new Rule(five,"5").evaluate());
+        assertEquals("> 2", OK, new Rule(five,"> 2").evaluate());
+        assertEquals("> 12 is false", ERROR, new Rule(five,"> 12").evaluate());
     }
 }

Modified: sling/trunk/contrib/extensions/muppet/muppet-rules/src/test/java/org/apache/sling/muppet/rules/impl/JmxBeansRuleBuilderTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/muppet/muppet-rules/src/test/java/org/apache/sling/muppet/rules/impl/JmxBeansRuleBuilderTest.java?rev=1467949&r1=1467948&r2=1467949&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/muppet/muppet-rules/src/test/java/org/apache/sling/muppet/rules/impl/JmxBeansRuleBuilderTest.java
(original)
+++ sling/trunk/contrib/extensions/muppet/muppet-rules/src/test/java/org/apache/sling/muppet/rules/impl/JmxBeansRuleBuilderTest.java
Mon Apr 15 11:58:07 2013
@@ -33,20 +33,20 @@ public class JmxBeansRuleBuilderTest {
         // Assuming this attribute is present in all JVMs that we use to run tests...
         final Rule r = jmxRuleBuilder.buildRule("jmxbeans", "java.lang:type=ClassLoading",
"LoadedClassCount", "> 100");
         assertNotNull("Expecting to get a jmxbean Rule", r);
-        assertEquals(EvaluationResult.Status.OK, r.execute());
+        assertEquals(EvaluationResult.Status.OK, r.evaluate());
     }
     
     @Test
     public void testHashSeparatorInBeanName() {
         final Rule r = jmxRuleBuilder.buildRule("jmxbeans", "java.lang#type=ClassLoading",
"LoadedClassCount", "> 100");
         assertNotNull("Expecting to get a jmxbean Rule", r);
-        assertEquals(EvaluationResult.Status.OK, r.execute());
+        assertEquals(EvaluationResult.Status.OK, r.evaluate());
     }
     
     @Test
     public void testNonExistentBean() {
         final Rule r = jmxRuleBuilder.buildRule("jmxbeans", "java.lang:type=DoesNotExist",
"LoadedClassCount", "5");
         assertNotNull("Expecting to get a jmxbean Rule", r);
-        assertEquals(EvaluationResult.Status.ERROR, r.execute());
+        assertEquals(EvaluationResult.Status.ERROR, r.evaluate());
     }
 }

Modified: sling/trunk/contrib/extensions/muppet/muppet-sling/src/test/java/org/apache/sling/muppet/sling/LoginRuleBuilderTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/muppet/muppet-sling/src/test/java/org/apache/sling/muppet/sling/LoginRuleBuilderTest.java?rev=1467949&r1=1467948&r2=1467949&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/muppet/muppet-sling/src/test/java/org/apache/sling/muppet/sling/LoginRuleBuilderTest.java
(original)
+++ sling/trunk/contrib/extensions/muppet/muppet-sling/src/test/java/org/apache/sling/muppet/sling/LoginRuleBuilderTest.java
Mon Apr 15 11:58:07 2013
@@ -44,18 +44,18 @@ public class LoginRuleBuilderTest {
     @Test
     public void testAdminLoginSucceeds() {
         final Rule r = builder.buildRule("sling", "login", "admin#admin", "LOGIN_OK");
-        assertEquals("Expecting admin login to succeed", EvaluationResult.Status.OK, r.execute());
+        assertEquals("Expecting admin login to succeed", EvaluationResult.Status.OK, r.evaluate());
     }
     
     @Test
     public void testAdminBadPasswordFails() {
         final Rule r = builder.buildRule("sling", "login", "admin#bad", "OK");
-        assertEquals("Expecting admin login to succeed", EvaluationResult.Status.ERROR, r.execute());
+        assertEquals("Expecting admin login to succeed", EvaluationResult.Status.ERROR, r.evaluate());
     }
     
     @Test
     public void testFooLoginFails() {
         final Rule r = builder.buildRule("sling", "login", "foo#bar", "OK");
-        assertEquals("Expecting admin login to succeed", EvaluationResult.Status.ERROR, r.execute());
+        assertEquals("Expecting admin login to succeed", EvaluationResult.Status.ERROR, r.evaluate());
     }
 }



Mime
View raw message