This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-jexl.git
The following commit(s) were added to refs/heads/master by this push: new 8f5f36df Better test class name 8f5f36df is described below commit 8f5f36df26db335401e7122083705212d26ad08c Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sat Aug 19 08:12:39 2023 -0400 Better test class name --- .../commons/jexl3/SynchronizedArithmetic.java | 34 +++++++++++----------- .../commons/jexl3/SynchronizedOverloadsTest.java | 12 ++++---- .../examples/{Output.java => AbstractOutput.java} | 8 ++--- .../apache/commons/jexl3/examples/ArrayTest.java | 6 ++-- .../commons/jexl3/examples/MethodPropertyTest.java | 6 ++-- .../commons/jexl3/introspection/SandboxTest.java | 4 +-- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/test/java/org/apache/commons/jexl3/SynchronizedArithmetic.java b/src/test/java/org/apache/commons/jexl3/SynchronizedArithmetic.java index aeae5632..332a9490 100644 --- a/src/test/java/org/apache/commons/jexl3/SynchronizedArithmetic.java +++ b/src/test/java/org/apache/commons/jexl3/SynchronizedArithmetic.java @@ -32,16 +32,16 @@ public class SynchronizedArithmetic extends JexlArithmetic { /** * Monitor/synchronized protected access to gets/set/iterator on maps. */ - private final Monitor monitor; + private final AbstractMonitor abstractMonitor; /** * A base synchronized arithmetic. - * @param monitor the synchronization monitor + * @param abstractMonitor the synchronization monitor * @param strict whether the arithmetic is strict or not */ - protected SynchronizedArithmetic(final Monitor monitor, final boolean strict) { + protected SynchronizedArithmetic(final AbstractMonitor abstractMonitor, final boolean strict) { super(strict); - this.monitor = monitor; + this.abstractMonitor = abstractMonitor; } @@ -50,7 +50,7 @@ public class SynchronizedArithmetic extends JexlArithmetic { * <p> * This class counts how many times we called enter & exit; they should be balanced */ - public static abstract class Monitor{ + public static abstract class AbstractMonitor { /* Counts the number of times enter is called. */ private final AtomicInteger enters = new AtomicInteger(0); /* Counts the number of times exit is called. */ @@ -122,7 +122,7 @@ public class SynchronizedArithmetic extends JexlArithmetic { /** * Crude monitor replacement... */ - static class SafeMonitor extends Monitor { + static class SafeMonitor extends AbstractMonitor { private final Map<Object, Object> monitored = new IdentityHashMap<>(); @Override @@ -172,12 +172,12 @@ public class SynchronizedArithmetic extends JexlArithmetic { SynchronizedIterator(final Object locked, final Iterator<Object> ii) { monitored = locked; - monitor.monitorEnter(monitored); + abstractMonitor.monitorEnter(monitored); try { iterator = ii; } finally { if (iterator == null) { - monitor.monitorExit(monitored); + abstractMonitor.monitorExit(monitored); } } } @@ -191,7 +191,7 @@ public class SynchronizedArithmetic extends JexlArithmetic { //@Override public void close() { if (iterator != null) { - monitor.monitorExit(monitored); + abstractMonitor.monitorExit(monitored); iterator = null; } } @@ -232,11 +232,11 @@ public class SynchronizedArithmetic extends JexlArithmetic { * @return the value associated to the key in the map */ public Object arrayGet(final Map<?, ?> map, final Object key) { - monitor.monitorEnter(map); + abstractMonitor.monitorEnter(map); try { return map.get(key); } finally { - monitor.monitorExit(map); + abstractMonitor.monitorExit(map); } } /** @@ -247,11 +247,11 @@ public class SynchronizedArithmetic extends JexlArithmetic { * @param value the value */ public void arraySet(final Map<Object, Object> map, final Object key, final Object value) { - monitor.monitorEnter(map); + abstractMonitor.monitorEnter(map); try { map.put(key, value); } finally { - monitor.monitorExit(map); + abstractMonitor.monitorExit(map); } } /** @@ -263,11 +263,11 @@ public class SynchronizedArithmetic extends JexlArithmetic { * @return the value associated to the key in the map */ public Object propertyGet(final Map<?, ?> map, final Object key) { - monitor.monitorEnter(map); + abstractMonitor.monitorEnter(map); try { return map.get(key); } finally { - monitor.monitorExit(map); + abstractMonitor.monitorExit(map); } } @@ -279,11 +279,11 @@ public class SynchronizedArithmetic extends JexlArithmetic { * @param value the value */ public void propertySet(final Map<Object, Object> map, final Object key, final Object value) { - monitor.monitorEnter(map); + abstractMonitor.monitorEnter(map); try { map.put(key, value); } finally { - monitor.monitorExit(map); + abstractMonitor.monitorExit(map); } } diff --git a/src/test/java/org/apache/commons/jexl3/SynchronizedOverloadsTest.java b/src/test/java/org/apache/commons/jexl3/SynchronizedOverloadsTest.java index 65812325..94960a4d 100644 --- a/src/test/java/org/apache/commons/jexl3/SynchronizedOverloadsTest.java +++ b/src/test/java/org/apache/commons/jexl3/SynchronizedOverloadsTest.java @@ -64,21 +64,21 @@ public class SynchronizedOverloadsTest extends JexlTestCase { @Test public void testUnsafeMonitor() throws Exception { - final SynchronizedArithmetic.Monitor monitor = new SynchronizedArithmetic.SafeMonitor(); + final SynchronizedArithmetic.AbstractMonitor abstractMonitor = new SynchronizedArithmetic.SafeMonitor(); final Map<String, Object> foo = new TreeMap<>(); foo.put("one", 1); foo.put("two", 2); foo.put("three", 3); final JexlContext jc = new SynchronizedContext(new MapContext()); - final JexlEngine jexl = new JexlBuilder().arithmetic(new SynchronizedArithmetic(monitor, true)).create(); + final JexlEngine jexl = new JexlBuilder().arithmetic(new SynchronizedArithmetic(abstractMonitor, true)).create(); final JexlScript js0 = jexl.createScript("x['four'] = 4; var t = 0.0; for(var z: x) { t += z; }; call(t, (y)->{return y});", "x"); Object t = js0.execute(jc, foo); Assert.assertEquals(10.0d, t); - Assert.assertTrue(monitor.isBalanced()); - Assert.assertEquals(2, monitor.getCount()); + Assert.assertTrue(abstractMonitor.isBalanced()); + Assert.assertEquals(2, abstractMonitor.getCount()); t = js0.execute(jc, foo); Assert.assertEquals(10.0d, t); - Assert.assertTrue(monitor.isBalanced()); - Assert.assertEquals(4, monitor.getCount()); + Assert.assertTrue(abstractMonitor.isBalanced()); + Assert.assertEquals(4, abstractMonitor.getCount()); } } diff --git a/src/test/java/org/apache/commons/jexl3/examples/Output.java b/src/test/java/org/apache/commons/jexl3/examples/AbstractOutput.java similarity index 89% rename from src/test/java/org/apache/commons/jexl3/examples/Output.java rename to src/test/java/org/apache/commons/jexl3/examples/AbstractOutput.java index 2df45271..b506f5d9 100644 --- a/src/test/java/org/apache/commons/jexl3/examples/Output.java +++ b/src/test/java/org/apache/commons/jexl3/examples/AbstractOutput.java @@ -22,11 +22,11 @@ import org.junit.Assert; /** * Abstracts using a test within Junit or through a main method. */ -public abstract class Output { +public abstract class AbstractOutput { /** * Creates an output using System.out. */ - private Output() { + private AbstractOutput() { // nothing to do } @@ -41,7 +41,7 @@ public abstract class Output { /** * The output instance for Junit TestCase calling assertEquals. */ - public static final Output JUNIT = new Output() { + public static final AbstractOutput JUNIT = new AbstractOutput() { @Override public void print(final String expr, final Object actual, final Object expected) { Assert.assertEquals(expr, expected, actual); @@ -52,7 +52,7 @@ public abstract class Output { /** * The output instance for the general outputing to System.out. */ - public static final Output SYSTEM = new Output() { + public static final AbstractOutput SYSTEM = new AbstractOutput() { @Override public void print(final String expr, final Object actual, final Object expected) { System.out.print(expr); diff --git a/src/test/java/org/apache/commons/jexl3/examples/ArrayTest.java b/src/test/java/org/apache/commons/jexl3/examples/ArrayTest.java index 4896427d..fc599146 100644 --- a/src/test/java/org/apache/commons/jexl3/examples/ArrayTest.java +++ b/src/test/java/org/apache/commons/jexl3/examples/ArrayTest.java @@ -36,7 +36,7 @@ public class ArrayTest { /** * An example for array access. */ - static void example(final Output out) throws Exception { + static void example(final AbstractOutput out) throws Exception { /* * First step is to retrieve an instance of a JexlEngine; * it might be already existing and shared or created anew. @@ -69,7 +69,7 @@ public class ArrayTest { */ @Test public void testExample() throws Exception { - example(Output.JUNIT); + example(AbstractOutput.JUNIT); } /** @@ -78,6 +78,6 @@ public class ArrayTest { * @throws Exception cos jexl does. */ public static void main(final String[] args) throws Exception { - example(Output.SYSTEM); + example(AbstractOutput.SYSTEM); } } \ No newline at end of file diff --git a/src/test/java/org/apache/commons/jexl3/examples/MethodPropertyTest.java b/src/test/java/org/apache/commons/jexl3/examples/MethodPropertyTest.java index 81a1ab0b..67d1ba52 100644 --- a/src/test/java/org/apache/commons/jexl3/examples/MethodPropertyTest.java +++ b/src/test/java/org/apache/commons/jexl3/examples/MethodPropertyTest.java @@ -33,7 +33,7 @@ public class MethodPropertyTest { /** * An example for method access. */ - public static void example(final Output out) throws Exception { + public static void example(final AbstractOutput out) throws Exception { /* * First step is to retrieve an instance of a JexlEngine; * it might be already existing and shared or created anew. @@ -122,7 +122,7 @@ public class MethodPropertyTest { */ @Test public void testExample() throws Exception { - example(Output.JUNIT); + example(AbstractOutput.JUNIT); } /** @@ -131,6 +131,6 @@ public class MethodPropertyTest { * @throws Exception cos jexl does. */ public static void main(final String[] args) throws Exception { - example(Output.SYSTEM); + example(AbstractOutput.SYSTEM); } } \ No newline at end of file diff --git a/src/test/java/org/apache/commons/jexl3/introspection/SandboxTest.java b/src/test/java/org/apache/commons/jexl3/introspection/SandboxTest.java index 93e6bac4..6c9e2905 100644 --- a/src/test/java/org/apache/commons/jexl3/introspection/SandboxTest.java +++ b/src/test/java/org/apache/commons/jexl3/introspection/SandboxTest.java @@ -66,7 +66,7 @@ public class SandboxTest extends JexlTestCase { void tryMeARiver(); } - public static abstract class CallMeNot { + public static abstract class AbstractCallMeNot { public @NoJexl String NONO = "should not be accessible!"; @@ -80,7 +80,7 @@ public class SandboxTest extends JexlTestCase { } } - public static class Foo extends CallMeNot implements CantCallMe, TryCallMe { + public static class Foo extends AbstractCallMeNot implements CantCallMe, TryCallMe { String name; public String alias;