EventClientLiveTest implementation.

This commit is contained in:
vijaykiran 2011-11-12 06:20:14 +01:00
parent 0dba1c4f5d
commit bdaff78658
1 changed files with 23 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import static org.testng.Assert.assertTrue;
import java.util.Set;
import org.jclouds.cloudstack.domain.Event;
import org.testng.annotations.Test;
/**
@ -33,7 +34,7 @@ import org.testng.annotations.Test;
public class EventClientLiveTest extends BaseCloudStackClientLiveTest {
public void testlistEventTypes() throws Exception {
Set<String> response = client.getEventClient().listEventTypes();
final Set<String> response = client.getEventClient().listEventTypes();
assert null != response;
assertTrue(response.size() >= 0);
for (String type : response) {
@ -41,6 +42,27 @@ public class EventClientLiveTest extends BaseCloudStackClientLiveTest {
}
}
public void testlistEvents() throws Exception {
final Set<Event> response = client.getEventClient().listEvents();
assert null != response;
assertTrue(response.size() >= 0);
for (Event event : response) {
checkEvent(event);
}
}
private void checkEvent(Event event) {
assert event.getAccount() != null : event;
assert event.getCreated() != null : event;
assert event.getDescription() != null : event;
assert event.getDomain() != null : event;
assert event.getId() != 0 : event;
assert event.getLevel() != null : event;
assert event.getState() != null : event;
assert event.getType() != null : event;
assert event.getUsername() != null : event;
}
protected void checkEventType(String eventType) {
assert eventType != null : eventType;
}