Commits

Anonymous committed 8f892b0

switch "that" to "top", fixed some tests

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@95e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits a6867f5

Comments (0)

Files changed (4)

src/java/com/opensymphony/xwork/util/CompoundRootAccessor.java

 
             return root.cutStack(index.intValue());
         } else if (name instanceof String) {
-            if ("that".equals(name)) {
+            if ("top".equals(name)) {
                 if (root.size() > 0) {
                     return root.get(0);
                 } else {

src/test/com/opensymphony/xwork/util/OgnlValueStackTest.java

         assertNull(vs.findValue("@com.nothing.here.Nothing@BLAH"));
     }
 
-    public void testThat() {
+    public void testTop() {
         OgnlValueStack vs = new OgnlValueStack();
 
         Dog dog1 = new Dog();
         vs.push(dog1);
         vs.push(dog2);
 
-        assertEquals(dog2, vs.findValue("that"));
-        assertEquals("Jack", vs.findValue("that.name"));
+        assertEquals(dog2, vs.findValue("top"));
+        assertEquals("Jack", vs.findValue("top.name"));
     }
 
     public void testThatNull() {
         OgnlValueStack vs = new OgnlValueStack();
 
-        assertNull(vs.findValue("that"));
+        assertNull(vs.findValue("top"));
     }
 
     public void testTwoDogs() {

src/test/com/opensymphony/xwork/util/XWorkConverterTest.java

         OgnlValueStack stack = new OgnlValueStack();
         stack.push(action);
         ActionContext.setContext(new ActionContext(stack.getContext()));
+        ActionContext.getContext().put("report.conversion.errors", Boolean.TRUE);
         assertNull("Conversion should have failed.", converter.convertValue(context, action, null, "date", new String[] {
                     "invalid date"
                 }, Date.class));
         stack.push(action);
         stack.push(action.getModel());
         ActionContext.setContext(new ActionContext(stack.getContext()));
+        ActionContext.getContext().put("report.conversion.errors", Boolean.TRUE);
         assertNull("Conversion should have failed.", converter.convertValue(context, action, null, "birth", new String[] {
                     "invalid date"
                 }, Date.class));

src/test/com/opensymphony/xwork/validator/ExpressionValidatorTest.java

 import com.opensymphony.xwork.TestBean;
 import com.opensymphony.xwork.ValidationAware;
 import com.opensymphony.xwork.ValidationAwareSupport;
+import com.opensymphony.xwork.util.OgnlValueStack;
 import com.opensymphony.xwork.config.ConfigurationManager;
 import com.opensymphony.xwork.config.providers.MockConfigurationProvider;
 
     }
 
     protected void setUp() throws Exception {
+        OgnlValueStack stack = new OgnlValueStack();
+        ActionContext.setContext(new ActionContext(stack.getContext()));
+
         ConfigurationManager.clearConfigurationProviders();
         ConfigurationManager.addConfigurationProvider(new MockConfigurationProvider());
         ConfigurationManager.getConfiguration().reload();