Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fogbow
fogbow-green-sitter
Commits
f4693d6f
Commit
f4693d6f
authored
Sep 26, 2014
by
aninhacostaribeiro
Browse files
Added the server package.
parent
f63c5e33
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/fogbowcloud/green/server/core/plugins/openstack/copy/HypervisorTestImpl.java
0 → 100644
View file @
f4693d6f
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
;
}
}
src/main/java/org/fogbowcloud/green/server/core/plugins/openstack/copy/OpenStackCommunicationPlugin.java
0 → 100644
View file @
f4693d6f
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
src/test/java/org/fogbowcloud/green/core/plugins/openstack/TestOpenStackCommunicationPlugin.java
View file @
f4693d6f
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment