Beispiel #1
0
 @Test(expected = NumberFormatException.class)
 public void test_keyWithTooBigLongValue_shouldFail() {
   Key key = Key.create(KEY_7_NAME, Key.KEY_VALUE, KEY_7_VALUE, Key.KEY_END);
   // assert only to trigger key.getLong() function which throws exception
   assertEquals(false, 1 == key.getLong().longValue());
 }
Beispiel #2
0
 @Test
 public void test_keyWithLongValue_shouldPass() {
   Key key = Key.create(KEY_6_NAME, Key.KEY_VALUE, KEY_6_VALUE, Key.KEY_END);
   assertEquals(true, Long.parseLong(KEY_6_VALUE) == key.getLong().longValue());
 }