1 7 package com.inversoft.verge.mvc.model.repository.test; 8 9 10 import java.util.Map ; 11 12 import junit.framework.Assert; 13 14 import com.inversoft.verge.mvc.controller.Action; 15 import com.inversoft.verge.mvc.validator.Validator; 16 import com.inversoft.verge.repository.test.SimpleItem; 17 import com.inversoft.verge.util.WebBeanProperty; 18 19 20 29 public class TestValidator implements Validator { 30 31 public static boolean conversion = false; 32 33 34 37 public TestValidator() { 38 super(); 39 } 40 41 42 45 public boolean validate(Map modelObjects, Action action) { 46 return false; 47 } 48 49 52 public void handleConversion(Object model, WebBeanProperty property, 53 Action action) { 54 conversion = true; 55 Assert.assertTrue("model should be instance of SimpleItem", model instanceof SimpleItem); 56 Assert.assertTrue("property should be integer", property.getPropertyName().equals("age")); 57 Assert.assertTrue("property should be integer", property.getPropertyType() == Integer .class); 58 Assert.assertTrue("RequestContext should never be null", action.getRequestContext() != null); 59 } 60 } 61 | Popular Tags |