Fixed code to comply with uuid property rename to id
This commit is contained in:
parent
d8d2a1a2d6
commit
a7fcf00921
|
@ -118,10 +118,10 @@ public class ResourceRegistryContextClientImpl implements ResourceRegistryContex
|
||||||
|
|
||||||
protected String internalCreate(Context context) throws ContextAlreadyPresentException, ResourceRegistryException {
|
protected String internalCreate(Context context) throws ContextAlreadyPresentException, ResourceRegistryException {
|
||||||
try {
|
try {
|
||||||
UUID uuid = context.getUUID();
|
UUID uuid = context.getID();
|
||||||
if(uuid == null) {
|
if(uuid == null) {
|
||||||
uuid = UUIDManager.getInstance().generateValidUUID();
|
uuid = UUIDManager.getInstance().generateValidUUID();
|
||||||
context.setUUID(uuid);
|
context.setID(uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ public class ResourceRegistryContextClientImpl implements ResourceRegistryContex
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Context read(Context context) throws ContextNotFoundException, ResourceRegistryException {
|
public Context read(Context context) throws ContextNotFoundException, ResourceRegistryException {
|
||||||
return read(context.getUUID());
|
return read(context.getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -234,7 +234,7 @@ public class ResourceRegistryContextClientImpl implements ResourceRegistryContex
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
forceCacheRefresh();
|
forceCacheRefresh();
|
||||||
Context c = contextCache.getContextByUUID(context.getUUID());
|
Context c = contextCache.getContextByUUID(context.getID());
|
||||||
if(c!=null){
|
if(c!=null){
|
||||||
context = c;
|
context = c;
|
||||||
}else {
|
}else {
|
||||||
|
@ -291,7 +291,7 @@ public class ResourceRegistryContextClientImpl implements ResourceRegistryContex
|
||||||
String contextString = ElementMapper.marshal(context);
|
String contextString = ElementMapper.marshal(context);
|
||||||
logger.trace("Going to update {}", contextString);
|
logger.trace("Going to update {}", contextString);
|
||||||
|
|
||||||
UUID uuid = context.getUUID();
|
UUID uuid = context.getID();
|
||||||
|
|
||||||
GXHTTPStringRequest gxHTTPStringRequest = getGXHTTPStringRequest();
|
GXHTTPStringRequest gxHTTPStringRequest = getGXHTTPStringRequest();
|
||||||
gxHTTPStringRequest.header(ACCEPT_HTTP_HEADER_KEY, GXConnection.APPLICATION_JSON_CHARSET_UTF_8);
|
gxHTTPStringRequest.header(ACCEPT_HTTP_HEADER_KEY, GXConnection.APPLICATION_JSON_CHARSET_UTF_8);
|
||||||
|
@ -346,7 +346,7 @@ public class ResourceRegistryContextClientImpl implements ResourceRegistryContex
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean delete(Context context) throws ContextNotFoundException, ResourceRegistryException {
|
public boolean delete(Context context) throws ContextNotFoundException, ResourceRegistryException {
|
||||||
return delete(context.getUUID());
|
return delete(context.getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -42,10 +42,10 @@ public class ResourceRegistryContextClientTest extends ContextTest {
|
||||||
|
|
||||||
public static void checkUUIDAndMetadata(IdentifiableElement er, UUID uuid, boolean create) {
|
public static void checkUUIDAndMetadata(IdentifiableElement er, UUID uuid, boolean create) {
|
||||||
Assert.assertTrue(er.getMetadata() != null);
|
Assert.assertTrue(er.getMetadata() != null);
|
||||||
Assert.assertTrue(er.getUUID() != null);
|
Assert.assertTrue(er.getID() != null);
|
||||||
|
|
||||||
if(uuid != null) {
|
if(uuid != null) {
|
||||||
Assert.assertTrue(er.getUUID().compareTo(uuid) == 0);
|
Assert.assertTrue(er.getID().compareTo(uuid) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
String user = getUser();
|
String user = getUser();
|
||||||
|
@ -63,7 +63,7 @@ public class ResourceRegistryContextClientTest extends ContextTest {
|
||||||
protected void assertions(Context pre, Context post, boolean checkParent, boolean create) {
|
protected void assertions(Context pre, Context post, boolean checkParent, boolean create) {
|
||||||
if(checkParent) {
|
if(checkParent) {
|
||||||
if(pre.getMetadata() != null) {
|
if(pre.getMetadata() != null) {
|
||||||
checkUUIDAndMetadata(post, pre.getUUID(), create);
|
checkUUIDAndMetadata(post, pre.getID(), create);
|
||||||
} else {
|
} else {
|
||||||
checkUUIDAndMetadata(post, null, create);
|
checkUUIDAndMetadata(post, null, create);
|
||||||
}
|
}
|
||||||
|
@ -80,8 +80,8 @@ public class ResourceRegistryContextClientTest extends ContextTest {
|
||||||
protected Context read(UUID uuid) throws ResourceRegistryException, IOException {
|
protected Context read(UUID uuid) throws ResourceRegistryException, IOException {
|
||||||
Context c = resourceRegistryContextClient.read(uuid);
|
Context c = resourceRegistryContextClient.read(uuid);
|
||||||
Assert.assertTrue(c.getMetadata() != null);
|
Assert.assertTrue(c.getMetadata() != null);
|
||||||
Assert.assertTrue(c.getUUID() != null);
|
Assert.assertTrue(c.getID() != null);
|
||||||
Assert.assertTrue(c.getUUID().compareTo(uuid) == 0);
|
Assert.assertTrue(c.getID().compareTo(uuid) == 0);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ public class ResourceRegistryContextClientTest extends ContextTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean delete(Context context) throws ResourceRegistryException {
|
protected boolean delete(Context context) throws ResourceRegistryException {
|
||||||
return delete(context.getUUID());
|
return delete(context.getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void invalidCreate(Context context) throws ResourceRegistryException, IOException {
|
protected void invalidCreate(Context context) throws ResourceRegistryException, IOException {
|
||||||
|
@ -317,7 +317,7 @@ public class ResourceRegistryContextClientTest extends ContextTest {
|
||||||
delete(contextA5);
|
delete(contextA5);
|
||||||
} catch(ContextNotFoundException e) {
|
} catch(ContextNotFoundException e) {
|
||||||
logger.debug("The context with uuid {} was not found. (Was already deleted)",
|
logger.debug("The context with uuid {} was not found. (Was already deleted)",
|
||||||
contextA5.getUUID());
|
contextA5.getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
delete(contextB3);
|
delete(contextB3);
|
||||||
|
@ -441,11 +441,11 @@ public class ResourceRegistryContextClientTest extends ContextTest {
|
||||||
|
|
||||||
|
|
||||||
for(Context c : contexts) {
|
for(Context c : contexts) {
|
||||||
UUID uuid = c.getUUID();
|
UUID uuid = c.getID();
|
||||||
if(c.getParent()!=null) {
|
if(c.getParent()!=null) {
|
||||||
IsParentOf isParentOf = c.getParent();
|
IsParentOf isParentOf = c.getParent();
|
||||||
Context parentContext = isParentOf.getSource();
|
Context parentContext = isParentOf.getSource();
|
||||||
UUID parentUUID = parentContext.getUUID();
|
UUID parentUUID = parentContext.getID();
|
||||||
Assert.assertEquals(parentContext, contextCache.getContextByUUID(parentUUID));
|
Assert.assertEquals(parentContext, contextCache.getContextByUUID(parentUUID));
|
||||||
List<IsParentOf> children = parentContext.getChildren();
|
List<IsParentOf> children = parentContext.getChildren();
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
|
@ -456,9 +456,9 @@ public class ResourceRegistryContextClientTest extends ContextTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Assert.assertTrue(found);
|
Assert.assertTrue(found);
|
||||||
logger.debug("{} : {} (parent {} : {})", c.getUUID(), contextCache.getContextFullNameByUUID(uuid), parentUUID, contextCache.getContextFullNameByUUID(parentUUID));
|
logger.debug("{} : {} (parent {} : {})", c.getID(), contextCache.getContextFullNameByUUID(uuid), parentUUID, contextCache.getContextFullNameByUUID(parentUUID));
|
||||||
}else {
|
}else {
|
||||||
logger.debug("{} : {}", c.getUUID(), contextCache.getContextFullNameByUUID(uuid));
|
logger.debug("{} : {}", c.getID(), contextCache.getContextFullNameByUUID(uuid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -466,7 +466,7 @@ public class ResourceRegistryContextClientTest extends ContextTest {
|
||||||
logger.debug("Current context : {}", currentContext);
|
logger.debug("Current context : {}", currentContext);
|
||||||
|
|
||||||
for(Context c : contexts) {
|
for(Context c : contexts) {
|
||||||
UUID uuid = c.getUUID();
|
UUID uuid = c.getID();
|
||||||
Context context = resourceRegistryContextClient.read(uuid);
|
Context context = resourceRegistryContextClient.read(uuid);
|
||||||
String fullName = ContextCache.getInstance().getContextFullNameByUUID(uuid);
|
String fullName = ContextCache.getInstance().getContextFullNameByUUID(uuid);
|
||||||
logger.debug("{} - {} : {}", uuid, fullName, context);
|
logger.debug("{} - {} : {}", uuid, fullName, context);
|
||||||
|
|
Loading…
Reference in New Issue