@Test public void getVmmClientTest() { Configuration.providerRegistryEndpoint = mBaseURL; String collection = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" + "<collection xmlns=\"http: "<items offset=\"0\" total=\"2\">" + "<provider href=\"/1\">" + "<id>1</id>" + "<name>default</name>" + "<vmm-url>http: "<slam-url>http: "<amqp-url>amqp: "<link rel=\"parent\" href=\"/\" type=\"application/xml\"/>" + "<link rel=\"self\" href=\"/1\" type=\"application/xml\"/>" + "</provider>" + "<provider href=\"/2\">" + "<id>2</id>" + "<name>default</name>" + "<vmm-url>http: "<slam-url>http: "<amqp-url>amqp: "<link rel=\"parent\" href=\"/\" type=\"application/xml\"/>" + "<link rel=\"self\" href=\"/1\" type=\"application/xml\"/>" + "</provider>" + "</items>" + "<link rel=\"self\" href=\"/\" type=\"application/xml\"/>" + "</collection>"; mServer.addPath("/", collection); PRClient prClient = new PRClient(); assertEquals("http: assertEquals("http: assertEquals("http: assertEquals(null, prClient.getVMMClient(3)); }
public VmManagerClient getVMMClient(int id) { List<Provider> providers = getProviders(); if(providers.size() >= 1) { if(id == -1) { return new VmManagerClientBSSC(providers.get(0).getVmmUrl()); } else { for(Provider provider : providers) { if(id == provider.getId()) { return new VmManagerClientBSSC(provider.getVmmUrl()); } } } } return null; }
PRClient { public VmManagerClient getVMMClient(int id) { List<Provider> providers = getProviders(); if(providers.size() >= 1) { if(id == -1) { return new VmManagerClientBSSC(providers.get(0).getVmmUrl()); } else { for(Provider provider : providers) { if(id == provider.getId()) { return new VmManagerClientBSSC(provider.getVmmUrl()); } } } } return null; } }
PRClient { public VmManagerClient getVMMClient(int id) { List<Provider> providers = getProviders(); if(providers.size() >= 1) { if(id == -1) { return new VmManagerClientBSSC(providers.get(0).getVmmUrl()); } else { for(Provider provider : providers) { if(id == provider.getId()) { return new VmManagerClientBSSC(provider.getVmmUrl()); } } } } return null; } PRClient(); }
PRClient { public VmManagerClient getVMMClient(int id) { List<Provider> providers = getProviders(); if(providers.size() >= 1) { if(id == -1) { return new VmManagerClientBSSC(providers.get(0).getVmmUrl()); } else { for(Provider provider : providers) { if(id == provider.getId()) { return new VmManagerClientBSSC(provider.getVmmUrl()); } } } } return null; } PRClient(); List<Provider> getProviders(); VmManagerClient getVMMClient(int id); }
PRClient { public VmManagerClient getVMMClient(int id) { List<Provider> providers = getProviders(); if(providers.size() >= 1) { if(id == -1) { return new VmManagerClientBSSC(providers.get(0).getVmmUrl()); } else { for(Provider provider : providers) { if(id == provider.getId()) { return new VmManagerClientBSSC(provider.getVmmUrl()); } } } } return null; } PRClient(); List<Provider> getProviders(); VmManagerClient getVMMClient(int id);  }