示例#1
0
 @Test(expected = KeyInvalidName.class)
 public void test_keySetName_shouldFail() {
   String new_keyname = "some_random/test/stuff_or/whatever"; // initial slash missing
   Key key = Key.create(KEY_1_NAME, Key.KEY_VALUE, KEY_1_VALUE, Key.KEY_END);
   key.setName(new_keyname);
   assertEquals(new_keyname, key.getName());
 }
示例#2
0
 @Test
 public void test_keySetName_shouldPass() {
   String new_keyname = "/some_random/test/stuff_or/whatever";
   Key key = Key.create(KEY_1_NAME, Key.KEY_VALUE, KEY_1_VALUE, Key.KEY_END);
   key.setName(new_keyname);
   assertEquals(new_keyname, key.getName());
 }