ProxyRenewer renewer = new ProxyRenewer("hperea","hperera1234",MyProxy.DEFAULT_PORT,14400,"portal.leadproject.org");
GlobalContext context = new GlobalContext(true);
context.setHostcertsKeyFile("/etc/lead/certificates/hostcertkey.pem.hperera");
//context.setCredential(renewer.renewProxy());
DocumentRegistryClient client = new DocumentRegistryClient(context,regsitryURL);
DocData[] data;
data = client.findHosts("");
if(data != null){
for(DocData host:data){
verifyAllFeildsNotNull(host);
assertNotNull(client.getHostDesc(host.name.toString()));
}
}
data = client.findServiceDesc("");
if(data != null){
for(DocData item:data){
verifyAllFeildsNotNull(item);
assertNotNull(client.getServiceDesc(item.name));
}
}
data = client.findServiceInstance("");
if(data != null){
for(DocData item:data){
verifyAllFeildsNotNull(item);
assertNotNull(client.getConcreateWsdl(item.name));
}
}
AppData[] appdata = client.findAppDesc("");
if(data != null){
for(AppData item:appdata){
verifyAllFeildsNotNull(item);
assertNotNull(client.getAppDesc(item.name.toString(),item.secondryName));
}
}
data = client.findResource("");
if(data != null){
for(DocData item:data){
verifyAllFeildsNotNull(item);
assertNotNull(client.getResource(item.name));
}
}
QName nonExisitsResource = new QName("nonExisitsResource");
assertNull(client.getAppDesc(nonExisitsResource.toString(), "foo"));
assertNull(client.getHostDesc("foo123456"));
assertNull(client.getServiceDesc(nonExisitsResource));
assertNull(client.getConcreateWsdl(nonExisitsResource));
assertNull(client.getResource(nonExisitsResource));
// //client.registerResource(new QName("AFoo"), "bar");
// //System.out.println(client.getResource(new QName("AFoo")));
// client.removeResource(new QName("AFoo"));
// DocData[] data = client.findResource("");