Martin Gainty created WW-4411:
---------------------------------
Summary: OgnlValueStackTest issues
Key: WW-4411
URL: https://issues.apache.org/jira/browse/WW-4411
Project: Struts 2
Issue Type: Bug
Components: Value Stack
Affects Versions: 2.3.4
Environment: Downloaded Struts 2.3.4
JDK 1.7.0_45
Maven 3.1.1
Reporter: Martin Gainty
Priority: Minor
Fix For: Future
Downloaded Struts 2.3.4 last week and ran into alot of issues with
com.opensymphony.xwork2.ognl.OgnlValueStackTest setValue /Ognl findValue
Background:: accessing objects the 'Ognl hierarchy' I always found what i was
looking for e.g.
Foo foo=new Foo();
Dog dog = new Dog();
foo.setDog(dog);
vs.setValue("foo", foo);
Object o=vs.findValue("Foo.Dog") //returns dog object embedded in foo
if(o instanceof Dog) //always true no problem here
{
Dog dog=(Dog)o; //Cast is correct without errors or exceptions
}
but failure when using OGNL to access orphaned objects e.g.
public void testDoesNotFailOnNonActionObjects() {
//if a value is not found, then it will check for missing properties
//it needs to check in all objects in the stack, not only actions, see //WW-3306
OgnlValueStack vs = createValueStack();
Dog dog = new Dog();
dog.setHates(null);
vs.push(dog); //dog is set into vs
Object o =vs.findValue("hates"); //o returns null
}
Has anyone been able to run OgnlValueStackTest w/o failures and errors recently?
Thanks,
Martin-
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)