Пример #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()));
 }