Package com.opensymphony.xwork2.util

Examples of com.opensymphony.xwork2.util.ValueStack.findValue()


        assertEquals(5, stack.findValue("extendedMap.get(456.12).size"));

        assertEquals("1", stack.findValue("extendedMap.get(123.12).get(0)"));
        assertEquals("5", stack.findValue("extendedMap.get(456.12).get(0)"));
        assertEquals(Integer.class, stack.findValue("extendedMap.get(123.12).get(0).class"));
        assertEquals(Integer.class, stack.findValue("extendedMap.get(456.12).get(0).class"));

        assertEquals(List.class, stack.findValue("extendedMap.get(123.12).class"));
        assertEquals(List.class, stack.findValue("extendedMap.get(456.12).class"));

    }
View Full Code Here


        assertEquals("1", stack.findValue("extendedMap.get(123.12).get(0)"));
        assertEquals("5", stack.findValue("extendedMap.get(456.12).get(0)"));
        assertEquals(Integer.class, stack.findValue("extendedMap.get(123.12).get(0).class"));
        assertEquals(Integer.class, stack.findValue("extendedMap.get(456.12).get(0).class"));

        assertEquals(List.class, stack.findValue("extendedMap.get(123.12).class"));
        assertEquals(List.class, stack.findValue("extendedMap.get(456.12).class"));

    }

    public static class Foo1 {
View Full Code Here

        assertEquals("5", stack.findValue("extendedMap.get(456.12).get(0)"));
        assertEquals(Integer.class, stack.findValue("extendedMap.get(123.12).get(0).class"));
        assertEquals(Integer.class, stack.findValue("extendedMap.get(456.12).get(0).class"));

        assertEquals(List.class, stack.findValue("extendedMap.get(123.12).class"));
        assertEquals(List.class, stack.findValue("extendedMap.get(456.12).class"));

    }

    public static class Foo1 {
        public Bar1 getBar() {
View Full Code Here

        bean.setLocation(location);

        ValueStack stack = ActionContext.getContext().getValueStack();
        stack.push(bean);

        assertEquals(location, stack.findValue("location"));

        result.setLocation("${location}");
        result.execute(actionInvocation);
        assertEquals(location, result.finalLocation);
    }
View Full Code Here

                if (i < expectedValues.size()) {
                    expectedValue = (String) expectedValues.get(i);
                }

                String value = (String) stack.findValue(propertyName, String.class);
                Assert.assertEquals(expectedValue, value);
            }
        } else {
            LOG.error("One of expectedValues = " + expectedValues + " and propertyNames = " + propertyNames + " was null or empty.");
            Assert.fail();
View Full Code Here

        stack.set("myWidth", 150);

        result.execute(actionInvocation);

        EasyMock.verify(responseMock);
        assertEquals(result.getHeight(), stack.findValue("myHeight").toString());
        assertEquals(result.getWidth(), stack.findValue("myWidth").toString());
        assertEquals("250", result.getHeight().toString());
        assertEquals("150", result.getWidth().toString());
        assertTrue(os.isWritten());
    }
View Full Code Here

        result.execute(actionInvocation);

        EasyMock.verify(responseMock);
        assertEquals(result.getHeight(), stack.findValue("myHeight").toString());
        assertEquals(result.getWidth(), stack.findValue("myWidth").toString());
        assertEquals("250", result.getHeight().toString());
        assertEquals("150", result.getWidth().toString());
        assertTrue(os.isWritten());
    }
   
View Full Code Here

        }

        Object rootObject = null;
        if (this.root != null) {
            ValueStack stack = invocation.getStack();
            rootObject = stack.findValue(this.root);

            if (rootObject == null) {
                throw new RuntimeException("Invalid root expression: '" + this.root + "'.");
            }
        }
View Full Code Here

                try {
                    // If not found, then try the ValueStack
                    ctx.put(REQUEST_WRAPPER_GET_ATTRIBUTE, Boolean.TRUE);
                    ValueStack stack = ctx.getValueStack();
                    if (stack != null) {
                        attribute = stack.findValue(key);
                    }
                } finally {
                    ctx.put(REQUEST_WRAPPER_GET_ATTRIBUTE, Boolean.FALSE);
                }
            }
View Full Code Here

        proxy.execute();
        proxy.getAction();

        //then
        assertEquals("This is blah", ((SimpleAction) proxy.getAction()).getBlah());
        Object allowMethodAccess = stack.findValue("\u0023_memberAccess['allowStaticMethodAccess']");
        assertNotNull(allowMethodAccess);
        assertEquals(Boolean.FALSE, allowMethodAccess);
    }

    public void testParameters() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.