提交 7241998f authored 作者: Roy-Breeze's avatar Roy-Breeze

Make UUID string a separate string, rather than a duplicated hard-coded value

上级 04bb4fd5
...@@ -286,11 +286,13 @@ public class TestValue extends TestBase { ...@@ -286,11 +286,13 @@ public class TestValue extends TestBase {
assertEquals("00000000-0000-4000-8000-000000000000", min.getString()); assertEquals("00000000-0000-4000-8000-000000000000", min.getString());
// Test conversion from ValueJavaObject to ValueUuid // Test conversion from ValueJavaObject to ValueUuid
UUID origUUID = UUID.fromString("12345678-1234-4321-8765-123456789012"); String uuidStr = "12345678-1234-4321-8765-123456789012";
UUID origUUID = UUID.fromString(uuidStr);
ValueJavaObject valObj = ValueJavaObject.getNoCopy(origUUID, null, null); ValueJavaObject valObj = ValueJavaObject.getNoCopy(origUUID, null, null);
Value valUUID = valObj.convertTo(Value.UUID); Value valUUID = valObj.convertTo(Value.UUID);
assertTrue(valUUID instanceof ValueUuid); assertTrue(valUUID instanceof ValueUuid);
assertTrue((valUUID.getString().equals("12345678-1234-4321-8765-123456789012"))); assertTrue((valUUID.getString().equals(uuidStr)));
assertTrue(valUUID.getObject().equals(origUUID)); assertTrue(valUUID.getObject().equals(origUUID));
ValueJavaObject vo_string = ValueJavaObject.getNoCopy(new String("This is not a ValueUuid object"), null, null); ValueJavaObject vo_string = ValueJavaObject.getNoCopy(new String("This is not a ValueUuid object"), null, null);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论