Commit f4693d6f authored by aninhacostaribeiro's avatar aninhacostaribeiro
Browse files

Added the server package.

parent f63c5e33
package org.fogbowcloud.green.server.core.plugins.openstack.copy;
import org.openstack4j.model.compute.ext.Hypervisor;
public class HypervisorTestImpl implements Hypervisor {
/**
*
*/
private static final long serialVersionUID = 4421687515550026956L;
private String hostname;
public void setHostname(String hostname) {
this.hostname = hostname;
}
@Override
public String getId() {
// TODO Auto-generated method stub
return null;
}
@Override
public int getCurrentWorkload() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getLeastDiskAvailable() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getFreeDisk() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getFreeRam() {
// TODO Auto-generated method stub
return 0;
}
@Override
public String getHypervisorHostname() {
return hostname;
}
@Override
public String getHostIP() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getType() {
// TODO Auto-generated method stub
return null;
}
@Override
public int getVersion() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getRunningVM() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getVirtualCPU() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getVirtualUsedCPU() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getLocalDisk() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getLocalDiskUsed() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getLocalMemory() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getLocalMemoryUsed() {
// TODO Auto-generated method stub
return 0;
}
@Override
public Service getService() {
// TODO Auto-generated method stub
return null;
}
}
package org.fogbowcloud.green.server.core.plugins.openstack.copy;
import java.util.List;
import org.openstack4j.api.OSClient;
import org.openstack4j.openstack.OSFactory;
import org.openstack4j.model.compute.ext.Hypervisor;
public class OpenStackCommunicationPlugin {
private OSClient os;
public OpenStackCommunicationPlugin(String endpoint, String username,
String password, String tenantname) {
this(OSFactory.builder().endpoint(endpoint)
.credentials(username, password).tenantName(tenantname)
.authenticate());
}
public OpenStackCommunicationPlugin(OSClient os) {
this.os = os;
}
public List<? extends Hypervisor> getHostInformation() {
return os.compute().hypervisors().list();
}
}
\ No newline at end of file
......@@ -3,6 +3,8 @@ package org.fogbowcloud.green.core.plugins.openstack;
import java.util.LinkedList;
import java.util.List;
import org.fogbowcloud.green.server.core.plugins.openstack.copy.HypervisorTestImpl;
import org.fogbowcloud.green.server.core.plugins.openstack.copy.OpenStackCommunicationPlugin;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment