Skip to content
Permalink
Browse files
Adjusts test to new JUnit lib
  • Loading branch information
lukaszlenart committed Dec 24, 2020
1 parent bcb08ac commit 83083297e82418cd19f2ddaa7bca68b12798b02a
Showing 1 changed file with 6 additions and 11 deletions.
@@ -27,23 +27,18 @@
/**
* Tests for {@link org.apache.commons.ognl.ASTChain}.
*/
public class ASTChainTest
extends TestCase
{
public class ASTChainTest extends TestCase {

public void test_Get_Indexed_Value()
throws Exception
{

OgnlContext context = (OgnlContext) Ognl.createDefaultContext( null );
public void test_Get_Indexed_Value() throws Exception {
OgnlContext context = (OgnlContext) Ognl.createDefaultContext(null);
IndexedSetObject root = new IndexedSetObject();

String expr = "thing[\"x\"].val";

assertEquals( 1, Ognl.getValue( expr, context, root ) );
assertEquals(1, (int) Ognl.getValue(expr, context, root));

Ognl.setValue( expr, context, root, new Integer( 2 ) );
Ognl.setValue(expr, context, root, 2);

assertEquals( 2, Ognl.getValue( expr, context, root ) );
assertEquals(2, (int) Ognl.getValue(expr, context, root));
}
}

0 comments on commit 8308329

Please sign in to comment.