예제 #1
0
 public boolean matches(Object obj0, Object obj1) {
   return (obj0 instanceof Double
       || obj1 instanceof Double
       || obj0 instanceof Float
       || obj1 instanceof Float
       || (obj0 instanceof String && ELSupport.isStringFloat((String) obj0))
       || (obj1 instanceof String && ELSupport.isStringFloat((String) obj1)));
 }
예제 #2
0
 public void testCoerceEnumAToEnumA() {
   Object output = null;
   try {
     output = ELSupport.coerceToEnum(TestEnumA.VALA1, TestEnumA.class);
   } finally {
     assertEquals(TestEnumA.VALA1, output);
   }
 }
예제 #3
0
 public void testCoerceEnumAToEnumC() {
   Object output = null;
   try {
     output = ELSupport.coerceToEnum(TestEnumA.VALA1, TestEnumC.class);
   } catch (ELException ele) {
     // Ignore
   }
   assertNull(output);
 }
예제 #4
0
 public void testCoerceNullToNumber() {
   Object output = ELSupport.coerceToType(null, Number.class);
   assertEquals(Long.valueOf(0), output);
 }
예제 #5
0
 public void testCoerceIntegerToNumber() {
   Integer input = 4390241;
   Object output = ELSupport.coerceToType(input, Number.class);
   assertEquals(input, output);
 }
예제 #6
0
 public void testEquals() {
   assertTrue(ELSupport.equals("01", Long.valueOf(1)));
 }
예제 #7
0
 private static void testIsSame(Object value) {
   assertEquals(value, ELSupport.coerceToNumber(value, value.getClass()));
 }