You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2018/09/27 22:24:26 UTC
svn commit: r1842194 [34/34] - in /commons/proper/configuration/trunk/src:
main/java/org/apache/commons/configuration2/
main/java/org/apache/commons/configuration2/beanutils/
main/java/org/apache/commons/configuration2/builder/
main/java/org/apache/com...
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationAttributePointer.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationAttributePointer.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationAttributePointer.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationAttributePointer.java Thu Sep 27 22:24:23 2018
@@ -56,9 +56,9 @@ public class TestConfigurationAttributeP
@Before
public void setUp() throws Exception
{
- ImmutableNode.Builder ndBuilder = new ImmutableNode.Builder();
+ final ImmutableNode.Builder ndBuilder = new ImmutableNode.Builder();
ndBuilder.name("parent").addAttribute(ATTR_NAME, ATTR_VALUE);
- ImmutableNode nd = ndBuilder.create();
+ final ImmutableNode nd = ndBuilder.create();
parent =
new ConfigurationNodePointer<>(nd, Locale.ENGLISH,
new InMemoryNodeModel(nd).getNodeHandler());
@@ -92,9 +92,9 @@ public class TestConfigurationAttributeP
@Test
public void testGetImmediateNode()
{
- Object node = pointer.getImmediateNode();
+ final Object node = pointer.getImmediateNode();
assertTrue("Wrong node class", node instanceof QueryResult);
- QueryResult<?> proxy = (QueryResult<?>) node;
+ final QueryResult<?> proxy = (QueryResult<?>) node;
assertTrue("No attribute result", proxy.isAttributeResult());
assertEquals("Wrong parent node", parent.getConfigurationNode(),
proxy.getNode());
@@ -117,7 +117,7 @@ public class TestConfigurationAttributeP
@Test
public void testGetName()
{
- QName name = pointer.getName();
+ final QName name = pointer.getName();
assertEquals("Wrong name", ATTR_NAME, name.getName());
assertNull("Prefix not null", name.getPrefix());
}
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationIteratorAttributes.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationIteratorAttributes.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationIteratorAttributes.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationIteratorAttributes.java Thu Sep 27 22:24:23 2018
@@ -56,8 +56,8 @@ public class TestConfigurationIteratorAt
super.setUp();
// Adds further attributes to the test node
- ImmutableNode orgNode = root.getChildren().get(1);
- ImmutableNode testNode =
+ final ImmutableNode orgNode = root.getChildren().get(1);
+ final ImmutableNode testNode =
orgNode.setAttribute(TEST_ATTR, "yes").setAttribute(NS_ATTR,
"configuration");
pointer =
@@ -71,13 +71,13 @@ public class TestConfigurationIteratorAt
@Test
public void testIterateAllAttributes()
{
- ConfigurationNodeIteratorAttribute<ImmutableNode> it =
+ final ConfigurationNodeIteratorAttribute<ImmutableNode> it =
new ConfigurationNodeIteratorAttribute<>(pointer,
new QName(null, "*"));
assertEquals("Wrong number of attributes", 3, iteratorSize(it));
- List<NodePointer> attrs = iterationElements(it);
- Set<String> attrNames = new HashSet<>();
- for (NodePointer np : attrs)
+ final List<NodePointer> attrs = iterationElements(it);
+ final Set<String> attrNames = new HashSet<>();
+ for (final NodePointer np : attrs)
{
attrNames.add(np.getName().getName());
}
@@ -92,7 +92,7 @@ public class TestConfigurationIteratorAt
@Test
public void testIterateSpecificAttribute()
{
- ConfigurationNodeIteratorAttribute<ImmutableNode> it =
+ final ConfigurationNodeIteratorAttribute<ImmutableNode> it =
new ConfigurationNodeIteratorAttribute<>(pointer,
new QName(null, TEST_ATTR));
assertEquals("Wrong number of attributes", 1, iteratorSize(it));
@@ -106,7 +106,7 @@ public class TestConfigurationIteratorAt
@Test
public void testIterateUnknownAttribute()
{
- ConfigurationNodeIteratorAttribute<ImmutableNode> it =
+ final ConfigurationNodeIteratorAttribute<ImmutableNode> it =
new ConfigurationNodeIteratorAttribute<>(pointer,
new QName(null, "unknown"));
assertEquals("Found attributes", 0, iteratorSize(it));
@@ -118,7 +118,7 @@ public class TestConfigurationIteratorAt
@Test
public void testIterateNamespaceUnknown()
{
- ConfigurationNodeIteratorAttribute<ImmutableNode> it =
+ final ConfigurationNodeIteratorAttribute<ImmutableNode> it =
new ConfigurationNodeIteratorAttribute<>(pointer,
new QName("test", "*"));
assertEquals("Found attributes", 0, iteratorSize(it));
@@ -130,7 +130,7 @@ public class TestConfigurationIteratorAt
@Test
public void testIterateNamespaceAttribute()
{
- ConfigurationNodeIteratorAttribute<ImmutableNode> it =
+ final ConfigurationNodeIteratorAttribute<ImmutableNode> it =
new ConfigurationNodeIteratorAttribute<>(pointer,
new QName(NAMESPACE, "attr"));
assertEquals("Wrong number of attributes", 1, iteratorSize(it));
@@ -144,7 +144,7 @@ public class TestConfigurationIteratorAt
@Test
public void testIterateNamespaceWildcard()
{
- ConfigurationNodeIteratorAttribute<ImmutableNode> it =
+ final ConfigurationNodeIteratorAttribute<ImmutableNode> it =
new ConfigurationNodeIteratorAttribute<>(pointer,
new QName(NAMESPACE, "*"));
assertEquals("Wrong number of attributes", 1, iteratorSize(it));
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationNodeIteratorChildren.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationNodeIteratorChildren.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationNodeIteratorChildren.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationNodeIteratorChildren.java Thu Sep 27 22:24:23 2018
@@ -67,7 +67,7 @@ public class TestConfigurationNodeIterat
* @return the node pointer
*/
private ConfigurationNodePointer<ImmutableNode> createPointer(
- ImmutableNode node)
+ final ImmutableNode node)
{
return new ConfigurationNodePointer<>(node,
Locale.getDefault(), handler);
@@ -79,7 +79,7 @@ public class TestConfigurationNodeIterat
@Test
public void testIterateAllChildren()
{
- ConfigurationNodeIteratorChildren<ImmutableNode> it =
+ final ConfigurationNodeIteratorChildren<ImmutableNode> it =
new ConfigurationNodeIteratorChildren<>(
rootPointer, null, false, null);
assertEquals("Wrong number of elements", CHILD_COUNT, iteratorSize(it));
@@ -92,7 +92,7 @@ public class TestConfigurationNodeIterat
@Test
public void testIterateReverse()
{
- ConfigurationNodeIteratorChildren<ImmutableNode> it =
+ final ConfigurationNodeIteratorChildren<ImmutableNode> it =
new ConfigurationNodeIteratorChildren<>(
rootPointer, null, true, null);
assertEquals("Wrong number of elements", CHILD_COUNT, iteratorSize(it));
@@ -105,8 +105,8 @@ public class TestConfigurationNodeIterat
@Test
public void testIterateWithWildcardTest()
{
- NodeNameTest test = new NodeNameTest(new QName(null, "*"));
- ConfigurationNodeIteratorChildren<ImmutableNode> it =
+ final NodeNameTest test = new NodeNameTest(new QName(null, "*"));
+ final ConfigurationNodeIteratorChildren<ImmutableNode> it =
new ConfigurationNodeIteratorChildren<>(
rootPointer, test, false, null);
assertEquals("Wrong number of elements", CHILD_COUNT, iteratorSize(it));
@@ -119,8 +119,8 @@ public class TestConfigurationNodeIterat
@Test
public void testIterateWithPrefixTest()
{
- NodeNameTest test = new NodeNameTest(new QName("prefix", "*"));
- ConfigurationNodeIteratorChildren<ImmutableNode> it =
+ final NodeNameTest test = new NodeNameTest(new QName("prefix", "*"));
+ final ConfigurationNodeIteratorChildren<ImmutableNode> it =
new ConfigurationNodeIteratorChildren<>(
rootPointer, test, false, null);
assertNull("Undefined node pointer not returned", it.getNodePointer());
@@ -133,12 +133,12 @@ public class TestConfigurationNodeIterat
@Test
public void testIterateWithNameTest()
{
- NodeNameTest test = new NodeNameTest(new QName(null, CHILD_NAME2));
- ConfigurationNodeIteratorChildren<ImmutableNode> it =
+ final NodeNameTest test = new NodeNameTest(new QName(null, CHILD_NAME2));
+ final ConfigurationNodeIteratorChildren<ImmutableNode> it =
new ConfigurationNodeIteratorChildren<>(
rootPointer, test, false, null);
assertTrue("No children found", iteratorSize(it) > 0);
- for (NodePointer nd : iterationElements(it))
+ for (final NodePointer nd : iterationElements(it))
{
assertEquals("Wrong child element", CHILD_NAME2, nd.getName().getName());
}
@@ -151,8 +151,8 @@ public class TestConfigurationNodeIterat
@Test
public void testIterateWithUnknownTest()
{
- NodeTest test = new ProcessingInstructionTest("test");
- ConfigurationNodeIteratorChildren<ImmutableNode> it =
+ final NodeTest test = new ProcessingInstructionTest("test");
+ final ConfigurationNodeIteratorChildren<ImmutableNode> it =
new ConfigurationNodeIteratorChildren<>(
rootPointer, test, false, null);
assertEquals("Unknown test was not evaluated", 0, iteratorSize(it));
@@ -164,8 +164,8 @@ public class TestConfigurationNodeIterat
@Test
public void testIterateWithNodeType()
{
- NodeTypeTest test = new NodeTypeTest(Compiler.NODE_TYPE_NODE);
- ConfigurationNodeIteratorChildren<ImmutableNode> it =
+ final NodeTypeTest test = new NodeTypeTest(Compiler.NODE_TYPE_NODE);
+ final ConfigurationNodeIteratorChildren<ImmutableNode> it =
new ConfigurationNodeIteratorChildren<>(
rootPointer, test, false, null);
assertEquals("Node type not evaluated", CHILD_COUNT, iteratorSize(it));
@@ -178,8 +178,8 @@ public class TestConfigurationNodeIterat
@Test
public void testIterateWithUnknownType()
{
- NodeTypeTest test = new NodeTypeTest(Compiler.NODE_TYPE_COMMENT);
- ConfigurationNodeIteratorChildren<ImmutableNode> it =
+ final NodeTypeTest test = new NodeTypeTest(Compiler.NODE_TYPE_COMMENT);
+ final ConfigurationNodeIteratorChildren<ImmutableNode> it =
new ConfigurationNodeIteratorChildren<>(
rootPointer, test, false, null);
assertEquals("Unknown node type not evaluated", 0, iteratorSize(it));
@@ -191,19 +191,19 @@ public class TestConfigurationNodeIterat
@Test
public void testIterateStartsWith()
{
- ConfigurationNodePointer<ImmutableNode> childPointer =
+ final ConfigurationNodePointer<ImmutableNode> childPointer =
new ConfigurationNodePointer<>(rootPointer, root
.getChildren().get(2), handler);
- ConfigurationNodeIteratorChildren<ImmutableNode> it =
+ final ConfigurationNodeIteratorChildren<ImmutableNode> it =
new ConfigurationNodeIteratorChildren<>(
rootPointer, null, false, childPointer);
assertEquals("Wrong start position", 0, it.getPosition());
- List<NodePointer> nodes = iterationElements(it);
+ final List<NodePointer> nodes = iterationElements(it);
assertEquals("Wrong size of iteration", CHILD_COUNT - 3, nodes.size());
int index = 4;
- for (NodePointer np : nodes)
+ for (final NodePointer np : nodes)
{
- ImmutableNode node = (ImmutableNode) np.getImmediateNode();
+ final ImmutableNode node = (ImmutableNode) np.getImmediateNode();
assertEquals("Wrong node value", String.valueOf(index),
node.getValue());
index++;
@@ -216,16 +216,16 @@ public class TestConfigurationNodeIterat
@Test
public void testIterateStartsWithReverse()
{
- ConfigurationNodePointer<ImmutableNode> childPointer =
+ final ConfigurationNodePointer<ImmutableNode> childPointer =
new ConfigurationNodePointer<>(rootPointer, root
.getChildren().get(3), handler);
- ConfigurationNodeIteratorChildren<ImmutableNode> it =
+ final ConfigurationNodeIteratorChildren<ImmutableNode> it =
new ConfigurationNodeIteratorChildren<>(
rootPointer, null, true, childPointer);
int value = 3;
for (int index = 1; it.setPosition(index); index++, value--)
{
- ImmutableNode node = (ImmutableNode) it.getNodePointer().getNode();
+ final ImmutableNode node = (ImmutableNode) it.getNodePointer().getNode();
assertEquals("Incorrect value at index " + index,
String.valueOf(value), node.getValue());
}
@@ -239,16 +239,16 @@ public class TestConfigurationNodeIterat
@Test
public void testIterateStartsWithInvalid()
{
- ConfigurationNodePointer<ImmutableNode> childPointer =
+ final ConfigurationNodePointer<ImmutableNode> childPointer =
new ConfigurationNodePointer<>(rootPointer,
new ImmutableNode.Builder().name("newNode").create(),
handler);
- ConfigurationNodeIteratorChildren<ImmutableNode> it =
+ final ConfigurationNodeIteratorChildren<ImmutableNode> it =
new ConfigurationNodeIteratorChildren<>(
rootPointer, null, false, childPointer);
assertEquals("Wrong size of iteration", CHILD_COUNT, iteratorSize(it));
it.setPosition(1);
- ImmutableNode node = (ImmutableNode) it.getNodePointer().getNode();
+ final ImmutableNode node = (ImmutableNode) it.getNodePointer().getNode();
assertEquals("Wrong start node", "1", node.getValue());
}
@@ -260,7 +260,7 @@ public class TestConfigurationNodeIterat
*/
private ConfigurationNodePointer<ImmutableNode> createPointerWithNamespace()
{
- ImmutableNode node =
+ final ImmutableNode node =
new ImmutableNode.Builder(2)
.addChild(root)
.addChild(
@@ -276,12 +276,12 @@ public class TestConfigurationNodeIterat
@Test
public void testIterateWithWildcardTestPrefix()
{
- NodeNameTest test = new NodeNameTest(new QName(PREFIX, "*"));
- ConfigurationNodeIteratorChildren<ImmutableNode> it =
+ final NodeNameTest test = new NodeNameTest(new QName(PREFIX, "*"));
+ final ConfigurationNodeIteratorChildren<ImmutableNode> it =
new ConfigurationNodeIteratorChildren<>(
createPointerWithNamespace(), test, false, null);
assertEquals("Wrong number of elements", 1, iteratorSize(it));
- for (NodePointer p : iterationElements(it))
+ for (final NodePointer p : iterationElements(it))
{
assertEquals("Wrong element", PREFIX + ':' + PREFIX_NODE, p
.getName().getName());
@@ -294,12 +294,12 @@ public class TestConfigurationNodeIterat
@Test
public void testIterateWithMatchingPrefixTest()
{
- NodeNameTest test = new NodeNameTest(new QName(PREFIX, PREFIX_NODE));
- ConfigurationNodeIteratorChildren<ImmutableNode> it =
+ final NodeNameTest test = new NodeNameTest(new QName(PREFIX, PREFIX_NODE));
+ final ConfigurationNodeIteratorChildren<ImmutableNode> it =
new ConfigurationNodeIteratorChildren<>(
createPointerWithNamespace(), test, false, null);
assertEquals("Wrong number of elements", 1, iteratorSize(it));
- for (NodePointer p : iterationElements(it))
+ for (final NodePointer p : iterationElements(it))
{
assertEquals("Wrong element", PREFIX + ':' + PREFIX_NODE, p
.getName().getName());
@@ -315,12 +315,12 @@ public class TestConfigurationNodeIterat
* @param iterator the iterator
* @param expectedIndices an array with the expected indices
*/
- private void checkValues(NodeIterator iterator, int... expectedIndices)
+ private void checkValues(final NodeIterator iterator, final int... expectedIndices)
{
- List<NodePointer> nodes = iterationElements(iterator);
+ final List<NodePointer> nodes = iterationElements(iterator);
for (int i = 0; i < expectedIndices.length; i++)
{
- ImmutableNode child = (ImmutableNode) nodes.get(i).getImmediateNode();
+ final ImmutableNode child = (ImmutableNode) nodes.get(i).getImmediateNode();
assertTrue("Wrong index value for child " + i, child.getValue()
.toString().endsWith(String.valueOf(expectedIndices[i])));
}
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationNodePointer.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationNodePointer.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationNodePointer.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationNodePointer.java Thu Sep 27 22:24:23 2018
@@ -55,9 +55,9 @@ public class TestConfigurationNodePointe
@Test
public void testCompareChildNodePointersChildren()
{
- NodePointer p1 = new ConfigurationNodePointer<>(
+ final NodePointer p1 = new ConfigurationNodePointer<>(
pointer, root.getChildren().get(1), handler);
- NodePointer p2 = new ConfigurationNodePointer<>(
+ final NodePointer p2 = new ConfigurationNodePointer<>(
pointer, root.getChildren().get(3), handler);
assertEquals("Incorrect order", -1, pointer.compareChildNodePointers(
p1, p2));
@@ -72,12 +72,12 @@ public class TestConfigurationNodePointe
@Test
public void testCompareChildNodePointersAttributes()
{
- ImmutableNode n1 = new ImmutableNode.Builder().name("n1").create();
- ImmutableNode n2 = new ImmutableNode.Builder().name("n2").create();
- NodePointer p1 =
+ final ImmutableNode n1 = new ImmutableNode.Builder().name("n1").create();
+ final ImmutableNode n2 = new ImmutableNode.Builder().name("n2").create();
+ final NodePointer p1 =
new ConfigurationNodePointer<>(pointer, n1,
handler);
- NodePointer p2 =
+ final NodePointer p2 =
new ConfigurationNodePointer<>(pointer, n2,
handler);
assertEquals("Incorrect order", 0,
@@ -110,7 +110,7 @@ public class TestConfigurationNodePointe
@Test
public void testIsLeafTrue()
{
- ImmutableNode leafNode =
+ final ImmutableNode leafNode =
new ImmutableNode.Builder().name("leafNode").create();
pointer =
new ConfigurationNodePointer<>(pointer, leafNode,
@@ -132,16 +132,16 @@ public class TestConfigurationNodePointe
*
* @param p the node pointer to test
*/
- private void checkIterators(NodePointer p)
+ private void checkIterators(final NodePointer p)
{
- ImmutableNode node = (ImmutableNode) p.getNode();
+ final ImmutableNode node = (ImmutableNode) p.getNode();
NodeIterator it = p.childIterator(null, false, null);
assertEquals("Iterator count differs from children count", node
.getChildren().size(), iteratorSize(it));
for (int index = 1; it.setPosition(index); index++)
{
- NodePointer pchild = it.getNodePointer();
+ final NodePointer pchild = it.getNodePointer();
assertEquals("Wrong child", node.getChildren().get(index - 1),
pchild.getNode());
checkIterators(pchild);
@@ -152,7 +152,7 @@ public class TestConfigurationNodePointe
.getAttributes().size(), iteratorSize(it));
for (int index = 1; it.setPosition(index); index++)
{
- NodePointer pattr = it.getNodePointer();
+ final NodePointer pattr = it.getNodePointer();
assertTrue("Node pointer is no attribute", pattr.isAttribute());
assertTrue("Wrong attribute name", node.getAttributes()
.containsKey(pattr.getName().getName()));
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationNodePointerFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationNodePointerFactory.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationNodePointerFactory.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestConfigurationNodePointerFactory.java Thu Sep 27 22:24:23 2018
@@ -63,8 +63,8 @@ public class TestConfigurationNodePointe
{
List<?> results = context.selectNodes(CHILD_NAME1);
assertEquals("Incorrect number of results", 2, results.size());
- for (Object result : results) {
- ImmutableNode node = (ImmutableNode) result;
+ for (final Object result : results) {
+ final ImmutableNode node = (ImmutableNode) result;
assertEquals("Incorrect node name", CHILD_NAME1, node.getNodeName());
}
@@ -89,12 +89,12 @@ public class TestConfigurationNodePointe
.valueOf(CHILD_COUNT), context.getValue(CHILD_NAME2
+ "[last()]"));
- List<?> nodes = context.selectNodes("/" + CHILD_NAME1 + "[1]/*");
+ final List<?> nodes = context.selectNodes("/" + CHILD_NAME1 + "[1]/*");
assertEquals("Wrong number of children", CHILD_COUNT, nodes.size());
int index = 1;
- for (Iterator<?> it = nodes.iterator(); it.hasNext(); index++)
+ for (final Iterator<?> it = nodes.iterator(); it.hasNext(); index++)
{
- ImmutableNode node = (ImmutableNode) it.next();
+ final ImmutableNode node = (ImmutableNode) it.next();
assertEquals("Wrong node value for child " + index, "2." + index,
node.getValue());
}
@@ -126,7 +126,7 @@ public class TestConfigurationNodePointe
@Test
public void testText()
{
- List<?> nodes = context.selectNodes("//" + CHILD_NAME2
+ final List<?> nodes = context.selectNodes("//" + CHILD_NAME2
+ "[text()='1.1.1']");
assertEquals("Incorrect number of result nodes", 1, nodes.size());
}
@@ -137,7 +137,7 @@ public class TestConfigurationNodePointe
@Test
public void testParentAxis()
{
- List<?> nodes = context.selectNodes("/" + CHILD_NAME2 + "/parent::*");
+ final List<?> nodes = context.selectNodes("/" + CHILD_NAME2 + "/parent::*");
assertEquals("Wrong number of parent nodes", 1, nodes.size());
}
@@ -147,10 +147,10 @@ public class TestConfigurationNodePointe
@Test
public void testFollowingSiblingAxis()
{
- List<?> nodes = context.selectNodes("/" + CHILD_NAME1
+ final List<?> nodes = context.selectNodes("/" + CHILD_NAME1
+ "[2]/following-sibling::*");
assertEquals("Wrong number of following siblings", 1, nodes.size());
- ImmutableNode node = (ImmutableNode) nodes.get(0);
+ final ImmutableNode node = (ImmutableNode) nodes.get(0);
assertEquals("Wrong node type", CHILD_NAME2, node.getNodeName());
assertEquals("Wrong index", String.valueOf(CHILD_COUNT), node
.getValue());
@@ -162,7 +162,7 @@ public class TestConfigurationNodePointe
@Test
public void testPrecedingSiblingAxis()
{
- List<?> nodes = context.selectNodes("/" + CHILD_NAME1
+ final List<?> nodes = context.selectNodes("/" + CHILD_NAME1
+ "[2]/preceding-sibling::*");
assertEquals("Wrong number of preceding siblings", 3, nodes.size());
for (int index = 0, value = 3; index < nodes.size(); index++, value--)
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestXPathContextFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestXPathContextFactory.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestXPathContextFactory.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestXPathContextFactory.java Thu Sep 27 22:24:23 2018
@@ -48,14 +48,14 @@ public class TestXPathContextFactory
@Test
public void testCreateContext()
{
- ImmutableNode node =
+ final ImmutableNode node =
new ImmutableNode.Builder().name("testRoot").create();
- NodeHandler<ImmutableNode> handler =
+ final NodeHandler<ImmutableNode> handler =
new InMemoryNodeModel(node).getNodeHandler();
- JXPathContext context = factory.createContext(node, handler);
+ final JXPathContext context = factory.createContext(node, handler);
assertTrue("No lenient mode", context.isLenient());
- ConfigurationNodePointerFactory.NodeWrapper<?> wrapper =
+ final ConfigurationNodePointerFactory.NodeWrapper<?> wrapper =
(ConfigurationNodePointerFactory.NodeWrapper<?>) context
.getContextBean();
assertSame("Wrong node", node, wrapper.getNode());
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestXPathExpressionEngine.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestXPathExpressionEngine.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestXPathExpressionEngine.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestXPathExpressionEngine.java Thu Sep 27 22:24:23 2018
@@ -71,9 +71,9 @@ public class TestXPathExpressionEngine
* @param results the results
* @return the mock context
*/
- private JXPathContext expectSelect(Object... results)
+ private JXPathContext expectSelect(final Object... results)
{
- JXPathContext ctx = EasyMock.createMock(JXPathContext.class);
+ final JXPathContext ctx = EasyMock.createMock(JXPathContext.class);
EasyMock.expect(ctx.selectNodes(TEST_KEY)).andReturn(
Arrays.asList(results));
EasyMock.replay(ctx);
@@ -87,9 +87,9 @@ public class TestXPathExpressionEngine
* @param ctx the context mock
* @return the test engine instance
*/
- private XPathExpressionEngine setUpEngine(JXPathContext ctx)
+ private XPathExpressionEngine setUpEngine(final JXPathContext ctx)
{
- XPathContextFactory factory =
+ final XPathContextFactory factory =
EasyMock.createMock(XPathContextFactory.class);
EasyMock.expect(factory.createContext(root, handler)).andReturn(ctx);
EasyMock.replay(factory);
@@ -102,7 +102,7 @@ public class TestXPathExpressionEngine
@Test
public void testDefaultContextFactory()
{
- XPathExpressionEngine engine = new XPathExpressionEngine();
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
assertNotNull("No context factory", engine.getContextFactory());
}
@@ -112,9 +112,9 @@ public class TestXPathExpressionEngine
@Test
public void testQueryNodeExpression()
{
- JXPathContext ctx = expectSelect(root);
- XPathExpressionEngine engine = setUpEngine(ctx);
- List<QueryResult<ImmutableNode>> result =
+ final JXPathContext ctx = expectSelect(root);
+ final XPathExpressionEngine engine = setUpEngine(ctx);
+ final List<QueryResult<ImmutableNode>> result =
engine.query(root, TEST_KEY, handler);
assertEquals("Incorrect number of results", 1, result.size());
assertSame("Wrong result node", root, result.get(0).getNode());
@@ -127,11 +127,11 @@ public class TestXPathExpressionEngine
@Test
public void testQueryAttributeExpression()
{
- QueryResult<ImmutableNode> attrResult =
+ final QueryResult<ImmutableNode> attrResult =
QueryResult.createAttributeResult(root, "attr");
- JXPathContext ctx = expectSelect(attrResult);
- XPathExpressionEngine engine = setUpEngine(ctx);
- List<QueryResult<ImmutableNode>> result =
+ final JXPathContext ctx = expectSelect(attrResult);
+ final XPathExpressionEngine engine = setUpEngine(ctx);
+ final List<QueryResult<ImmutableNode>> result =
engine.query(root, TEST_KEY, handler);
assertEquals("Incorrect number of results", 1, result.size());
assertSame("Wrong result", attrResult, result.get(0));
@@ -143,8 +143,8 @@ public class TestXPathExpressionEngine
@Test
public void testQueryWithoutResult()
{
- JXPathContext ctx = expectSelect();
- XPathExpressionEngine engine = setUpEngine(ctx);
+ final JXPathContext ctx = expectSelect();
+ final XPathExpressionEngine engine = setUpEngine(ctx);
assertTrue("Got results", engine.query(root, TEST_KEY, handler)
.isEmpty());
}
@@ -173,13 +173,13 @@ public class TestXPathExpressionEngine
*
* @param key the key
*/
- private void checkEmptyKey(String key)
+ private void checkEmptyKey(final String key)
{
- XPathContextFactory factory =
+ final XPathContextFactory factory =
EasyMock.createMock(XPathContextFactory.class);
EasyMock.replay(factory);
- XPathExpressionEngine engine = new XPathExpressionEngine(factory);
- List<QueryResult<ImmutableNode>> results =
+ final XPathExpressionEngine engine = new XPathExpressionEngine(factory);
+ final List<QueryResult<ImmutableNode>> results =
engine.query(root, key, handler);
assertEquals("Incorrect number of results", 1, results.size());
assertSame("Wrong result node", root, results.get(0).getNode());
@@ -193,10 +193,10 @@ public class TestXPathExpressionEngine
public void testNodePointerFactory()
{
JXPathContext.newContext(this);
- NodePointerFactory[] factories =
+ final NodePointerFactory[] factories =
JXPathContextReferenceImpl.getNodePointerFactories();
boolean found = false;
- for (NodePointerFactory factory : factories)
+ for (final NodePointerFactory factory : factories)
{
if (factory instanceof ConfigurationNodePointerFactory)
{
@@ -212,7 +212,7 @@ public class TestXPathExpressionEngine
@Test
public void testNodeKeyNormal()
{
- XPathExpressionEngine engine = new XPathExpressionEngine();
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
assertEquals("Wrong node key", "parent/" + ROOT_NAME,
engine.nodeKey(root, "parent", handler));
}
@@ -223,7 +223,7 @@ public class TestXPathExpressionEngine
@Test
public void testNodeKeyForRootNode()
{
- XPathExpressionEngine engine = new XPathExpressionEngine();
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
assertEquals("Wrong key for root node", "",
engine.nodeKey(root, null, handler));
}
@@ -234,7 +234,7 @@ public class TestXPathExpressionEngine
@Test
public void testNodeKeyNoNodeName()
{
- XPathExpressionEngine engine = new XPathExpressionEngine();
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
assertEquals("Null name not detected", "test", engine.nodeKey(
new ImmutableNode.Builder().create(), "test", handler));
}
@@ -245,7 +245,7 @@ public class TestXPathExpressionEngine
@Test
public void testNodeKeyForRootChild()
{
- XPathExpressionEngine engine = new XPathExpressionEngine();
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
assertEquals("Wrong key for root child node", ROOT_NAME,
engine.nodeKey(root, "", handler));
}
@@ -256,7 +256,7 @@ public class TestXPathExpressionEngine
@Test
public void testNodeKeyAttribute()
{
- XPathExpressionEngine engine = new XPathExpressionEngine();
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
assertEquals("Wrong attribute key", "node/@attr",
engine.attributeKey("node", "attr"));
}
@@ -267,7 +267,7 @@ public class TestXPathExpressionEngine
@Test
public void testAttributeKeyOfRootNode()
{
- XPathExpressionEngine engine = new XPathExpressionEngine();
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
assertEquals("Wrong key for root attribute", "@child",
engine.attributeKey(null, "child"));
}
@@ -278,9 +278,9 @@ public class TestXPathExpressionEngine
@Test
public void testPrepareAddNode()
{
- JXPathContext ctx = expectSelect(root);
- XPathExpressionEngine engine = setUpEngine(ctx);
- NodeAddData<ImmutableNode> data =
+ final JXPathContext ctx = expectSelect(root);
+ final XPathExpressionEngine engine = setUpEngine(ctx);
+ final NodeAddData<ImmutableNode> data =
engine.prepareAdd(root, TEST_KEY + " newNode", handler);
checkAddPath(data, false, "newNode");
}
@@ -291,9 +291,9 @@ public class TestXPathExpressionEngine
@Test
public void testPrepareAddAttribute()
{
- JXPathContext ctx = expectSelect(root);
- XPathExpressionEngine engine = setUpEngine(ctx);
- NodeAddData<ImmutableNode> data =
+ final JXPathContext ctx = expectSelect(root);
+ final XPathExpressionEngine engine = setUpEngine(ctx);
+ final NodeAddData<ImmutableNode> data =
engine.prepareAdd(root, TEST_KEY + "\t@newAttr", handler);
checkAddPath(data, true, "newAttr");
}
@@ -304,9 +304,9 @@ public class TestXPathExpressionEngine
@Test
public void testPrepareAddPath()
{
- JXPathContext ctx = expectSelect(root);
- XPathExpressionEngine engine = setUpEngine(ctx);
- NodeAddData<ImmutableNode> data =
+ final JXPathContext ctx = expectSelect(root);
+ final XPathExpressionEngine engine = setUpEngine(ctx);
+ final NodeAddData<ImmutableNode> data =
engine.prepareAdd(root, TEST_KEY + " \t a/full/path/node",
handler);
checkAddPath(data, false, "a", "full", "path", "node");
@@ -318,9 +318,9 @@ public class TestXPathExpressionEngine
@Test
public void testPrepareAddAttributePath()
{
- JXPathContext ctx = expectSelect(root);
- XPathExpressionEngine engine = setUpEngine(ctx);
- NodeAddData<ImmutableNode> data =
+ final JXPathContext ctx = expectSelect(root);
+ final XPathExpressionEngine engine = setUpEngine(ctx);
+ final NodeAddData<ImmutableNode> data =
engine.prepareAdd(root, TEST_KEY + " a/full/path@attr", handler);
checkAddPath(data, true, "a", "full", "path", "attr");
}
@@ -331,9 +331,9 @@ public class TestXPathExpressionEngine
@Test
public void testPrepareAddRootChild()
{
- JXPathContext ctx = expectSelect(root);
- XPathExpressionEngine engine = setUpEngine(ctx);
- NodeAddData<ImmutableNode> data =
+ final JXPathContext ctx = expectSelect(root);
+ final XPathExpressionEngine engine = setUpEngine(ctx);
+ final NodeAddData<ImmutableNode> data =
engine.prepareAdd(root, " newNode", handler);
checkAddPath(data, false, "newNode");
}
@@ -344,9 +344,9 @@ public class TestXPathExpressionEngine
@Test
public void testPrepareAddRootAttribute()
{
- JXPathContext ctx = expectSelect(root);
- XPathExpressionEngine engine = setUpEngine(ctx);
- NodeAddData<ImmutableNode> data =
+ final JXPathContext ctx = expectSelect(root);
+ final XPathExpressionEngine engine = setUpEngine(ctx);
+ final NodeAddData<ImmutableNode> data =
engine.prepareAdd(root, " @attr", handler);
checkAddPath(data, true, "attr");
}
@@ -357,8 +357,8 @@ public class TestXPathExpressionEngine
@Test(expected = IllegalArgumentException.class)
public void testPrepareAddInvalidParent()
{
- JXPathContext ctx = expectSelect();
- XPathExpressionEngine engine = setUpEngine(ctx);
+ final JXPathContext ctx = expectSelect();
+ final XPathExpressionEngine engine = setUpEngine(ctx);
engine.prepareAdd(root, TEST_KEY + " test", handler);
}
@@ -368,7 +368,7 @@ public class TestXPathExpressionEngine
@Test(expected = IllegalArgumentException.class)
public void testPrepareAddEmptyPath()
{
- XPathExpressionEngine engine = new XPathExpressionEngine();
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
engine.prepareAdd(root, TEST_KEY + " ", handler);
}
@@ -378,7 +378,7 @@ public class TestXPathExpressionEngine
@Test(expected = IllegalArgumentException.class)
public void testPrepareAddNullKey()
{
- XPathExpressionEngine engine = new XPathExpressionEngine();
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
engine.prepareAdd(root, null, handler);
}
@@ -388,7 +388,7 @@ public class TestXPathExpressionEngine
@Test(expected = IllegalArgumentException.class)
public void testPrepareAddEmptyKey()
{
- XPathExpressionEngine engine = new XPathExpressionEngine();
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
engine.prepareAdd(root, "", handler);
}
@@ -399,10 +399,10 @@ public class TestXPathExpressionEngine
* @param path the path to be tested
* @throws IllegalArgumentException if the test is successful
*/
- private void checkInvalidAddPath(String path)
+ private void checkInvalidAddPath(final String path)
{
- XPathExpressionEngine engine = new XPathExpressionEngine();
- QueryResult<ImmutableNode> res = QueryResult.createNodeResult(root);
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
+ final QueryResult<ImmutableNode> res = QueryResult.createNodeResult(root);
engine.createNodeAddData(path, res);
}
@@ -460,8 +460,8 @@ public class TestXPathExpressionEngine
@Test(expected = IllegalArgumentException.class)
public void testPrepareAddToAttributeResult()
{
- XPathExpressionEngine engine = new XPathExpressionEngine();
- QueryResult<ImmutableNode> result =
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
+ final QueryResult<ImmutableNode> result =
QueryResult.createAttributeResult(root, TEST_KEY);
engine.createNodeAddData("path", result);
}
@@ -473,14 +473,14 @@ public class TestXPathExpressionEngine
* @param attr a flag if the new node is an attribute
* @param expected an array with the expected path elements
*/
- private static void checkAddPath(NodeAddData<ImmutableNode> data,
- boolean attr, String... expected)
+ private static void checkAddPath(final NodeAddData<ImmutableNode> data,
+ final boolean attr, final String... expected)
{
assertSame("Wrong parent node", root, data.getParent());
- List<String> path = data.getPathNodes();
+ final List<String> path = data.getPathNodes();
assertEquals("Incorrect number of path nodes", expected.length - 1,
path.size());
- Iterator<String> it = path.iterator();
+ final Iterator<String> it = path.iterator();
for (int idx = 0; idx < expected.length - 1; idx++)
{
assertEquals("Wrong node at position " + idx, expected[idx],
@@ -498,15 +498,15 @@ public class TestXPathExpressionEngine
@Test
public void testCanonicalKeyNoDuplicates()
{
- ImmutableNode.Builder parentBuilder = new ImmutableNode.Builder(2);
- ImmutableNode c1 = new ImmutableNode.Builder().name("child").create();
- ImmutableNode c2 =
+ final ImmutableNode.Builder parentBuilder = new ImmutableNode.Builder(2);
+ final ImmutableNode c1 = new ImmutableNode.Builder().name("child").create();
+ final ImmutableNode c2 =
new ImmutableNode.Builder().name("child_other").create();
parentBuilder.addChildren(Arrays.asList(c2, c1));
- ImmutableNode parent = parentBuilder.create();
- NodeHandler<ImmutableNode> testHandler =
+ final ImmutableNode parent = parentBuilder.create();
+ final NodeHandler<ImmutableNode> testHandler =
new InMemoryNodeModel(parent).getNodeHandler();
- XPathExpressionEngine engine = new XPathExpressionEngine();
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
assertEquals("Wrong canonical key", "parent/child[1]",
engine.canonicalKey(c1, "parent", testHandler));
}
@@ -518,16 +518,16 @@ public class TestXPathExpressionEngine
@Test
public void testCanonicalKeyWithDuplicates()
{
- ImmutableNode.Builder parentBuilder = new ImmutableNode.Builder(3);
- ImmutableNode c1 = new ImmutableNode.Builder().name("child").create();
- ImmutableNode c2 = new ImmutableNode.Builder().name("child").create();
- ImmutableNode c3 =
+ final ImmutableNode.Builder parentBuilder = new ImmutableNode.Builder(3);
+ final ImmutableNode c1 = new ImmutableNode.Builder().name("child").create();
+ final ImmutableNode c2 = new ImmutableNode.Builder().name("child").create();
+ final ImmutableNode c3 =
new ImmutableNode.Builder().name("child_other").create();
parentBuilder.addChildren(Arrays.asList(c1, c2, c3));
- ImmutableNode parent = parentBuilder.create();
- NodeHandler<ImmutableNode> testHandler =
+ final ImmutableNode parent = parentBuilder.create();
+ final NodeHandler<ImmutableNode> testHandler =
new InMemoryNodeModel(parent).getNodeHandler();
- XPathExpressionEngine engine = new XPathExpressionEngine();
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
assertEquals("Wrong key 1", "parent/child[1]",
engine.canonicalKey(c1, "parent", testHandler));
assertEquals("Wrong key 2", "parent/child[2]",
@@ -541,12 +541,12 @@ public class TestXPathExpressionEngine
@Test
public void testCanonicalKeyNoParentKey()
{
- ImmutableNode.Builder parentBuilder = new ImmutableNode.Builder(1);
- ImmutableNode c1 = new ImmutableNode.Builder().name("child").create();
- ImmutableNode parent = parentBuilder.addChild(c1).create();
- NodeHandler<ImmutableNode> testHandler =
+ final ImmutableNode.Builder parentBuilder = new ImmutableNode.Builder(1);
+ final ImmutableNode c1 = new ImmutableNode.Builder().name("child").create();
+ final ImmutableNode parent = parentBuilder.addChild(c1).create();
+ final NodeHandler<ImmutableNode> testHandler =
new InMemoryNodeModel(parent).getNodeHandler();
- XPathExpressionEngine engine = new XPathExpressionEngine();
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
assertEquals("Wrong key", "child[1]",
engine.canonicalKey(c1, null, testHandler));
}
@@ -558,7 +558,7 @@ public class TestXPathExpressionEngine
@Test
public void testCanonicalKeyRootNoParentKey()
{
- XPathExpressionEngine engine = new XPathExpressionEngine();
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
assertEquals("Wrong key", "", engine.canonicalKey(root, null, handler));
}
@@ -569,7 +569,7 @@ public class TestXPathExpressionEngine
@Test
public void testCanonicalKeyRootWithParentKey()
{
- XPathExpressionEngine engine = new XPathExpressionEngine();
+ final XPathExpressionEngine engine = new XPathExpressionEngine();
assertEquals("Wrong key", "parent",
engine.canonicalKey(root, "parent", handler));
}
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestXPathExpressionEngineInConfig.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestXPathExpressionEngineInConfig.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestXPathExpressionEngineInConfig.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/tree/xpath/TestXPathExpressionEngineInConfig.java Thu Sep 27 22:24:23 2018
@@ -125,7 +125,7 @@ public class TestXPathExpressionEngineIn
@Test
public void testPropertiesWithNamespace() throws ConfigurationException
{
- String xml =
+ final String xml =
"<Config>\n"
+ "<dsig:Transforms xmlns:dsig=\"http://www.w3.org/2000/09/xmldsig#\">\n"
+ " <dsig:Transform Algorithm=\"http://www.w3.org/TR/1999/REC-xpath-19991116\">\n"
@@ -133,12 +133,12 @@ public class TestXPathExpressionEngineIn
+ " </dsig:Transform>\n"
+ " <dsig:Transform Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n-20010315\"/>\n"
+ "</dsig:Transforms>" + "</Config>";
- FileHandler handler = new FileHandler(config);
+ final FileHandler handler = new FileHandler(config);
handler.load(new StringReader(xml));
- for (Iterator<String> it = config.getKeys(); it.hasNext();)
+ for (final Iterator<String> it = config.getKeys(); it.hasNext();)
{
- String key = it.next();
+ final String key = it.next();
assertNotNull("No value for " + key, config.getString(key));
}
}
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestAppletConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestAppletConfiguration.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestAppletConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestAppletConfiguration.java Thu Sep 27 22:24:23 2018
@@ -56,7 +56,7 @@ public class TestAppletConfiguration ext
new Applet();
supportsApplet = true;
}
- catch (Exception ex)
+ catch (final Exception ex)
{
// cannot use applets
supportsApplet = false;
@@ -75,7 +75,7 @@ public class TestAppletConfiguration ext
if (supportsApplet)
{
- Applet applet = new Applet()
+ final Applet applet = new Applet()
{
/**
* Serial version UID.
@@ -83,7 +83,7 @@ public class TestAppletConfiguration ext
private static final long serialVersionUID = 1L;
@Override
- public String getParameter(String key)
+ public String getParameter(final String key)
{
return parameters.getProperty(key);
}
@@ -132,7 +132,7 @@ public class TestAppletConfiguration ext
super.testAddPropertyDirect();
fail("addPropertyDirect should throw an UnsupportedException");
}
- catch (UnsupportedOperationException e)
+ catch (final UnsupportedOperationException e)
{
// ok
}
@@ -150,7 +150,7 @@ public class TestAppletConfiguration ext
super.testClearProperty();
fail("testClearProperty should throw an UnsupportedException");
}
- catch (UnsupportedOperationException e)
+ catch (final UnsupportedOperationException e)
{
// ok
}
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletConfiguration.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletConfiguration.java Thu Sep 27 22:24:23 2018
@@ -45,7 +45,7 @@ public class TestServletConfiguration ex
config.setInitParameter("list", "value1, value2");
config.setInitParameter("listesc", "value1\\,value2");
- Servlet servlet = new HttpServlet() {
+ final Servlet servlet = new HttpServlet() {
/**
* Serial version UID.
*/
@@ -58,7 +58,7 @@ public class TestServletConfiguration ex
}
};
- ServletConfiguration servletConfiguration = new ServletConfiguration(servlet);
+ final ServletConfiguration servletConfiguration = new ServletConfiguration(servlet);
servletConfiguration.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
return servletConfiguration;
}
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletContextConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletContextConfiguration.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletContextConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletContextConfiguration.java Thu Sep 27 22:24:23 2018
@@ -51,10 +51,10 @@ public class TestServletContextConfigura
parameters.setProperty("listesc", "value1\\,value2");
// create a servlet context
- ServletContext context = new MockServletContext()
+ final ServletContext context = new MockServletContext()
{
@Override
- public String getInitParameter(String key)
+ public String getInitParameter(final String key)
{
return parameters.getProperty(key);
}
@@ -71,7 +71,7 @@ public class TestServletContextConfigura
config.setServletContext(context);
// create a servlet
- Servlet servlet = new HttpServlet()
+ final Servlet servlet = new HttpServlet()
{
/**
* Serial version UID.
@@ -85,7 +85,7 @@ public class TestServletContextConfigura
}
};
- ServletContextConfiguration resultConfig = new ServletContextConfiguration(servlet);
+ final ServletContextConfiguration resultConfig = new ServletContextConfiguration(servlet);
resultConfig.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
return resultConfig;
}
@@ -94,7 +94,7 @@ public class TestServletContextConfigura
protected AbstractConfiguration getEmptyConfiguration()
{
// create a servlet context
- ServletContext context = new MockServletContext()
+ final ServletContext context = new MockServletContext()
{
@Override
public Enumeration<?> getInitParameterNames()
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletFilterConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletFilterConfiguration.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletFilterConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletFilterConfiguration.java Thu Sep 27 22:24:23 2018
@@ -39,13 +39,13 @@ public class TestServletFilterConfigurat
@Override
protected AbstractConfiguration getConfiguration()
{
- MockFilterConfig config = new MockFilterConfig();
+ final MockFilterConfig config = new MockFilterConfig();
config.setInitParameter("key1", "value1");
config.setInitParameter("key2", "value2");
config.setInitParameter("list", "value1, value2");
config.setInitParameter("listesc", "value1\\,value2");
- ServletFilterConfiguration resultConfig = new ServletFilterConfiguration(config);
+ final ServletFilterConfiguration resultConfig = new ServletFilterConfiguration(config);
resultConfig.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
return resultConfig;
}
@@ -73,7 +73,7 @@ public class TestServletFilterConfigurat
}
@Override
- public String getInitParameter(String key)
+ public String getInitParameter(final String key)
{
return parameters.getProperty(key);
}
@@ -84,7 +84,7 @@ public class TestServletFilterConfigurat
return parameters.keys();
}
- public void setInitParameter(String key, String value)
+ public void setInitParameter(final String key, final String value)
{
parameters.setProperty(key, value);
}
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletRequestConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletRequestConfiguration.java?rev=1842194&r1=1842193&r2=1842194&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletRequestConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/web/TestServletRequestConfiguration.java Thu Sep 27 22:24:23 2018
@@ -59,10 +59,10 @@ public class TestServletRequestConfigura
@Override
protected AbstractConfiguration getEmptyConfiguration()
{
- ServletRequest request = new MockHttpServletRequest()
+ final ServletRequest request = new MockHttpServletRequest()
{
@Override
- public String getParameter(String key)
+ public String getParameter(final String key)
{
return null;
}
@@ -86,10 +86,10 @@ public class TestServletRequestConfigura
*/
private ServletRequestConfiguration createConfiguration(final Configuration base)
{
- ServletRequest request = new MockHttpServletRequest()
+ final ServletRequest request = new MockHttpServletRequest()
{
@Override
- public String[] getParameterValues(String key)
+ public String[] getParameterValues(final String key)
{
return base.getStringArray(key);
}
@@ -101,7 +101,7 @@ public class TestServletRequestConfigura
}
};
- ServletRequestConfiguration config = new ServletRequestConfiguration(request);
+ final ServletRequestConfiguration config = new ServletRequestConfiguration(request);
config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
return config;
}
@@ -126,16 +126,16 @@ public class TestServletRequestConfigura
@Test
public void testListWithEscapedElements()
{
- String[] values = { "test1", "test2\\,test3", "test4\\,test5" };
- String listKey = "test.list";
+ final String[] values = { "test1", "test2\\,test3", "test4\\,test5" };
+ final String listKey = "test.list";
- BaseConfiguration config = new BaseConfiguration();
+ final BaseConfiguration config = new BaseConfiguration();
config.addProperty(listKey, values);
assertEquals("Wrong number of list elements", values.length, config.getList(listKey).size());
- Configuration c = createConfiguration(config);
- List<?> v = c.getList(listKey);
+ final Configuration c = createConfiguration(config);
+ final List<?> v = c.getList(listKey);
assertEquals("Wrong number of elements in list", values.length, v.size());