Updated test annotations for command-line test tool

This commit is contained in:
Andrew Donald Kennedy 2012-04-11 22:48:48 +01:00
parent 2e67af2075
commit 19c88aa1fe
37 changed files with 154 additions and 178 deletions

View File

@ -0,0 +1,114 @@
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import java.io.IOException;
import java.net.URI;
import org.jclouds.crypto.CryptoStreams;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse;
import org.jclouds.util.Strings2;
import org.jclouds.vcloud.director.v1_5.domain.OrgList;
import org.jclouds.vcloud.director.v1_5.domain.SessionWithToken;
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
import org.jclouds.xml.internal.JAXBParser;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Iterables;
/**
* Tests live behavior of {@link AdminCatalogClient}.
*
* @author danikov
*/
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "HttpClientLiveTest")
public class HttpClientLiveTest extends BaseVCloudDirectorClientLiveTest {
private JAXBParser parser = new JAXBParser("true");
private SessionWithToken sessionWithToken;
@Override
protected void setupRequiredClients() throws Exception {
setupCredentials();
}
@Test(description = "POST /login")
public void testPostLogin() throws IOException {
testLoginWithMethod("POST");
}
@Test(description = "GET /login")
public void testGetLogin() throws IOException {
testLoginWithMethod("GET");
}
private void testLoginWithMethod(final String method) throws IOException {
String user = identity.substring(0, identity.lastIndexOf('@'));
String org = identity.substring(identity.lastIndexOf('@') + 1);
String password = credential;
String authHeader = "Basic " + CryptoStreams.base64(String.format("%s@%s:%s", checkNotNull(user), checkNotNull(org), checkNotNull(password)).getBytes("UTF-8"));
HttpResponse response = context.getUtils().getHttpClient().invoke(HttpRequest.builder()
.method(method)
.endpoint(URI.create(endpoint + "/login"))
.headers(ImmutableMultimap.<String, String>builder()
.put("Authorization", authHeader)
.put("Accept", "*/*")
.build())
.build());
sessionWithToken = SessionWithToken.builder().session(session).token(response.getFirstHeaderOrNull("x-vcloud-authorization")).build();
assertEquals(sessionWithToken.getSession().getUser(), user);
assertEquals(sessionWithToken.getSession().getOrg(), org);
assertTrue(sessionWithToken.getSession().getLinks().size() > 0);
assertNotNull(sessionWithToken.getToken());
OrgList orgList = parser.fromXML(Strings2.toStringAndClose(response.getPayload().getInput()), OrgList.class);
assertTrue(orgList.getOrgs().size() > 0, "must have orgs");
context.getApi().getOrgClient().getOrg(Iterables.getLast(orgList.getOrgs()).getHref());
}
@Test(description = "GET /schema/{schemaFileName}", dependsOnMethods = { "testPostLogin", "testGetLogin" })
public void testGetSchema() throws IOException {
String schemafileName = "master.xsd";
HttpResponse response = context.getUtils().getHttpClient().invoke(HttpRequest.builder()
.method("GET")
.endpoint(URI.create(endpoint + "/v1.5/schema/" + schemafileName))
.headers(ImmutableMultimap.<String, String>builder()
.put("x-vcloud-authorization", sessionWithToken.getToken())
.put("Accept", "*/*")
.build())
.build());
String schema = Strings2.toStringAndClose(response.getPayload().getInput());
// TODO: asserting something about the schema
}
}

View File

@ -1,136 +0,0 @@
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import java.io.IOException;
import java.net.URI;
import org.jclouds.crypto.CryptoStreams;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse;
import org.jclouds.util.Strings2;
import org.jclouds.vcloud.director.v1_5.domain.OrgList;
import org.jclouds.vcloud.director.v1_5.domain.SessionWithToken;
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
import org.jclouds.xml.internal.JAXBParser;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Iterables;
/**
* Tests live behavior of {@link AdminCatalogClient}.
*
* @author danikov
*/
@Test(groups = {"live", "user", "nonClient"}, singleThreaded = true, testName = "NonClientOperationsLiveTest")
public class NonClientOperationsLiveTest extends BaseVCloudDirectorClientLiveTest
{
private JAXBParser parser = new JAXBParser("true");
private SessionWithToken sessionWithToken;
@Override
protected void setupRequiredClients() throws Exception
{
setupCredentials();
}
@Test(testName = "POST /login")
public void testPostLogin() throws IOException
{
testLoginWithMethod("POST");
}
@Test(testName = "GET /login")
public void testGetLogin() throws IOException
{
testLoginWithMethod("GET");
}
private void testLoginWithMethod(final String method) throws IOException
{
String user = identity.substring(0, identity.lastIndexOf('@'));
String org = identity.substring(identity.lastIndexOf('@') + 1);
String password = credential;
String authHeader =
"Basic "
+ CryptoStreams.base64(String.format("%s@%s:%s", checkNotNull(user),
checkNotNull(org), checkNotNull(password)).getBytes("UTF-8"));
HttpResponse response =
context
.getUtils()
.getHttpClient()
.invoke(
HttpRequest
.builder()
.method(method)
.endpoint(URI.create(endpoint + "/login"))
.headers(ImmutableMultimap.of("Authorization", authHeader, "Accept", "*/*"))
.build());
sessionWithToken =
SessionWithToken.builder().session(session)
.token(response.getFirstHeaderOrNull("x-vcloud-authorization")).build();
assertEquals(sessionWithToken.getSession().getUser(), user);
assertEquals(sessionWithToken.getSession().getOrg(), org);
assertTrue(sessionWithToken.getSession().getLinks().size() > 0);
assertNotNull(sessionWithToken.getToken());
OrgList orgList =
parser.fromXML(Strings2.toStringAndClose(response.getPayload().getInput()),
OrgList.class);
assertTrue(orgList.getOrgs().size() > 0, "must have orgs");
context.getApi().getOrgClient().getOrg(Iterables.getLast(orgList.getOrgs()).getHref());
}
@Test(testName = "GET /schema/{schemaFileName}", dependsOnMethods = {"testPostLogin",
"testGetLogin"})
public void testGetSchema() throws IOException
{
String schemafileName = "master.xsd";
HttpResponse response =
context
.getUtils()
.getHttpClient()
.invoke(
HttpRequest
.builder()
.method("GET")
.endpoint(URI.create(endpoint + "/v1.5/schema/" + schemafileName))
.headers(
ImmutableMultimap.of("x-vcloud-authorization",
sessionWithToken.getToken(), "Accept", "*/*")).build());
String schema = Strings2.toStringAndClose(response.getPayload().getInput());
// TODO: asserting something about the schema
}
}

View File

@ -45,7 +45,7 @@ import com.google.common.collect.ImmutableSet;
*
* @author grkvlt@apache.org
*/
@Test(groups = { "unit", "user", "catalog" }, singleThreaded = true, testName = "CatalogClientExpectTest")
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "CatalogClientExpectTest")
public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
@Test

View File

@ -61,7 +61,7 @@ import com.google.common.collect.Iterables;
*
* @author grkvlt@apache.org
*/
@Test(groups = { "live", "user", "catalog" }, singleThreaded = true, testName = "CatalogClientLiveTest")
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "CatalogClientLiveTest")
public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
/*

View File

@ -49,7 +49,7 @@ import com.google.common.collect.ImmutableSet;
*
* @author danikov
*/
@Test(groups = { "unit", "user", "media" }, singleThreaded = true, testName = "MediaClientExpectTest")
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "MediaClientExpectTest")
public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
@Test

View File

@ -74,7 +74,7 @@ import com.google.common.collect.Iterables;
*
* @author danikov
*/
@Test(groups = { "live", "user", "media" }, singleThreaded = true, testName = "MediaClientLiveTest")
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "MediaClientLiveTest")
public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
public static final String MEDIA = "media";

View File

@ -53,7 +53,7 @@ import com.google.common.collect.ImmutableSet;
*
* @author danikov
*/
@Test(groups = { "unit", "user", "network" }, singleThreaded = true, testName = "NetworkClientExpectTest")
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "NetworkClientExpectTest")
public class NetworkClientExpectTest extends VCloudDirectorAdminClientExpectTest {
@Test

View File

@ -49,7 +49,7 @@ import com.google.common.collect.Iterables;
*
* @author danikov
*/
@Test(groups = { "live", "user", "network" }, singleThreaded = true, testName = "NetworkClientLiveTest")
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "NetworkClientLiveTest")
public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest {
public static final String NETWORK = "network";

View File

@ -46,7 +46,7 @@ import com.google.common.collect.Iterables;
*
* @author Adrian Cole
*/
@Test(groups = { "unit", "user", "org" }, singleThreaded = true, testName = "OrgClientExpectTest")
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "OrgClientExpectTest")
public class OrgClientExpectTest extends VCloudDirectorAdminClientExpectTest {
@Test

View File

@ -53,7 +53,7 @@ import com.google.common.collect.Iterables;
*
* @author grkvlt@apache.org
*/
@Test(groups = { "live", "user", "org" }, singleThreaded = true, testName = "OrgClientLiveTest")
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "OrgClientLiveTest")
public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
/*

View File

@ -41,7 +41,7 @@ import com.google.common.collect.ImmutableMultimap;
*
* @author grkvlt@apache.org
*/
@Test(groups = { "unit", "user", "query" }, singleThreaded = true, testName = "QueryClientExpectTest")
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "QueryClientExpectTest")
public class QueryClientExpectTest extends VCloudDirectorAdminClientExpectTest {
@Test

View File

@ -61,7 +61,7 @@ import com.google.common.collect.Iterables;
*
* @author grkvlt@apache.org
*/
@Test(groups = { "live", "user", "query" }, singleThreaded = true, testName = "QueryClientLiveTest")
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "QueryClientLiveTest")
public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
/*

View File

@ -43,7 +43,7 @@ import com.google.common.collect.ImmutableMultimap;
*
* @author grkvlt@apache.org
*/
@Test(groups = { "unit", "user", "task" }, singleThreaded = true, testName = "TaskClientExpectTest")
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "TaskClientExpectTest")
public class TaskClientExpectTest extends VCloudDirectorAdminClientExpectTest {
@Test

View File

@ -43,7 +43,7 @@ import com.google.common.collect.Iterables;
*
* @author grkvlt@apache.org
*/
@Test(groups = { "live", "user", "task" }, singleThreaded = true, testName = "TaskClientLiveTest")
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "TaskClientLiveTest")
public class TaskClientLiveTest extends BaseVCloudDirectorClientLiveTest {
/*

View File

@ -27,7 +27,7 @@ import org.testng.annotations.Test;
*
* @author danikov
*/
@Test(groups = { "live", "user", "upload" }, singleThreaded = true, testName = "UploadClientLiveTest")
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "UploadClientLiveTest")
public class UploadClientLiveTest extends BaseVCloudDirectorClientLiveTest {
public static final String UPLOAD = "upload";

View File

@ -64,7 +64,7 @@ import com.google.common.collect.Multimaps;
*
* @author grkvlt@apache.org
*/
@Test(groups = { "unit", "user", "vapp" }, singleThreaded = true, testName = "VAppClientExpectTest")
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "VAppClientExpectTest")
public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
private String vAppId = "vapp-d0e2b6b9-4381-4ddc-9572-cdfae54059be";

View File

@ -129,7 +129,7 @@ import com.google.common.collect.Sets;
*
* @author grkvlt@apache.org
*/
@Test(groups = { "live", "user", "vapp" }, singleThreaded = true, testName = "VAppClientLiveTest")
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "VAppClientLiveTest")
public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
private MetadataValue metadataValue;

View File

@ -77,7 +77,7 @@ import com.google.common.collect.ImmutableSet;
*
* @author Adam Lowe
*/
@Test(groups = { "unit", "user", "vapptemplate" }, testName = "VAppTemplateClientExpectTest")
@Test(groups = { "unit", "user" }, testName = "VAppTemplateClientExpectTest")
public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpectTest {
public VAppTemplateClientExpectTest() {

View File

@ -84,7 +84,7 @@ import com.google.common.collect.Iterables;
*
* @author Aled Sage
*/
@Test(groups = { "live", "user", "vapptemplate" }, singleThreaded = true, testName = "VAppTemplateClientLiveTest")
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "VAppTemplateClientLiveTest")
public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
private String key;

View File

@ -56,7 +56,7 @@ import org.testng.annotations.Test;
*
* @author danikov
*/
@Test(groups = { "unit", "user", "vdc" }, singleThreaded = true, testName = "VdcClientExpectTest")
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "VdcClientExpectTest")
public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
private URI vdcURI;

View File

@ -66,7 +66,7 @@ import com.google.common.collect.Iterables;
*
* @author danikov
*/
@Test(groups = { "live", "user", "vdc" }, singleThreaded = true, testName = "VdcClientLiveTest")
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "VdcClientLiveTest")
public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
public static final String VDC = "vdc";

View File

@ -40,7 +40,7 @@ import com.google.common.collect.ImmutableSet;
*
* @author grkvlt@apache.org
*/
@Test(groups = { "unit", "admin", "catalog" }, singleThreaded = true, testName = "CatalogClientExpectTest")
@Test(groups = { "unit", "admin" }, singleThreaded = true, testName = "CatalogClientExpectTest")
public class AdminCatalogClientExpectTest extends VCloudDirectorAdminClientExpectTest {
private Reference catalogRef = Reference.builder()

View File

@ -54,7 +54,7 @@ import com.google.common.collect.Iterables;
*
* @author danikov
*/
@Test(groups = { "live", "admin", "catalog" }, singleThreaded = true, testName = "CatalogClientLiveTest")
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "CatalogClientLiveTest")
public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
public static final String CATALOG = "admin catalog";

View File

@ -39,7 +39,7 @@ import com.google.common.collect.ImmutableSet;
*
* @author danikov
*/
@Test(groups = { "unit", "admin", "network"}, singleThreaded = true, testName = "AdminNetworkClientExpectTest")
@Test(groups = { "unit", "admin" }, singleThreaded = true, testName = "AdminNetworkClientExpectTest")
public class AdminNetworkClientExpectTest extends VCloudDirectorAdminClientExpectTest {
Reference networkRef = Reference.builder()

View File

@ -51,7 +51,7 @@ import org.testng.annotations.Test;
*
* @author danikov
*/
@Test(groups = { "live", "admin", "network" }, singleThreaded = true, testName = "AdminNetworkLiveTest")
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "AdminNetworkLiveTest")
public class AdminNetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest {
public static final String NETWORK = "AdminNetwork";

View File

@ -43,7 +43,7 @@ import org.testng.annotations.Test;
*
* @author danikov
*/
@Test(groups = { "unit", "user", "org"}, singleThreaded = true, testName = "AdminOrgClientExpectTest")
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "AdminOrgClientExpectTest")
public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTest {
private Reference orgRef = Reference.builder()

View File

@ -47,7 +47,7 @@ import com.google.common.collect.Iterables;
*
* @author danikov
*/
@Test(groups = { "live", "admin", "org" }, singleThreaded = true, testName = "AdminOrgClientLiveTest")
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "AdminOrgClientLiveTest")
public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
public static final String ORG = "admin org";

View File

@ -39,7 +39,7 @@ import com.google.common.collect.ImmutableMultimap;
*
* @author Aled Sage
*/
@Test(groups = { "unit", "admin", "query" }, singleThreaded = true, testName = "AdminQueryClientExpectTest")
@Test(groups = { "unit", "admin" }, singleThreaded = true, testName = "AdminQueryClientExpectTest")
public class AdminQueryClientExpectTest extends VCloudDirectorAdminClientExpectTest {
// TODO Write expect tests for all other admin-query operations

View File

@ -40,7 +40,7 @@ import org.testng.annotations.Test;
*
* @author Aled Sage
*/
@Test(groups = { "live", "admin", "query" }, singleThreaded = true, testName = "AdminQueryClientLiveTest")
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "AdminQueryClientLiveTest")
public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
/*

View File

@ -35,7 +35,7 @@ import org.testng.annotations.Test;
*
* @author danikov
*/
@Test(groups = { "unit", "admin", "vdc" }, singleThreaded = true, testName = "AdminVdcClientExpectTest")
@Test(groups = { "unit", "admin" }, singleThreaded = true, testName = "AdminVdcClientExpectTest")
public class AdminVdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
private Reference vdcRef = Reference.builder()

View File

@ -45,7 +45,7 @@ import org.testng.annotations.Test;
*
* @author danikov
*/
@Test(groups = { "live", "admin", "vdc" }, singleThreaded = true, testName = "AdminVdcClientLiveTest")
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "AdminVdcClientLiveTest")
public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
public static final String VDC = "admin vdc";

View File

@ -34,7 +34,7 @@ import org.testng.annotations.Test;
*
* @author danikov
*/
@Test(groups = { "unit", "admin", "group"}, singleThreaded = true, testName = "GroupClientExpectTest")
@Test(groups = { "unit", "admin" }, singleThreaded = true, testName = "GroupClientExpectTest")
public class GroupClientExpectTest extends VCloudDirectorAdminClientExpectTest {
private Reference groupRef = Reference.builder()

View File

@ -38,7 +38,7 @@ import org.testng.annotations.Test;
*
* @author danikov
*/
@Test(groups = { "live", "admin", "group" }, singleThreaded = true, testName = "GroupClientLiveTest")
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "GroupClientLiveTest")
public class GroupClientLiveTest extends BaseVCloudDirectorClientLiveTest {
public static final String GROUP = "admin group";

View File

@ -37,7 +37,7 @@ import org.testng.annotations.Test;
*
* @author danikov
*/
@Test(groups = { "unit", "admin", "adminUser"}, singleThreaded = true, testName = "UserClientExpectTest")
@Test(groups = { "unit", "admin" }, singleThreaded = true, testName = "UserClientExpectTest")
public class UserClientExpectTest extends VCloudDirectorAdminClientExpectTest {
private Reference orgRef = Reference.builder()

View File

@ -48,7 +48,7 @@ import com.google.common.collect.Iterables;
*
* @author danikov
*/
@Test(groups = { "live", "admin", "adminUser" }, singleThreaded = true, testName = "UserClientLiveTest")
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "UserClientLiveTest")
public class UserClientLiveTest extends BaseVCloudDirectorClientLiveTest {
public static final String USER = "admin user";
@ -89,16 +89,14 @@ public class UserClientLiveTest extends BaseVCloudDirectorClientLiveTest {
checkUser(newUser);
}
@Test(description = "GET /admin/user/{id}",
dependsOnMethods = { "testCreateUser" })
@Test(description = "GET /admin/user/{id}", dependsOnMethods = { "testCreateUser" })
public void testGetUser() {
user = userClient.getUser(user.getHref());
checkUser(user);
}
@Test(description = "PUT /admin/user/{id}",
dependsOnMethods = { "testGetUser" })
@Test(description = "PUT /admin/user/{id}", dependsOnMethods = { "testGetUser" })
public void testUpdateUser() {
User oldUser = user.toBuilder().build();
User newUser = user.toBuilder()

View File

@ -40,7 +40,7 @@ import com.google.common.collect.ImmutableMultimap;
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "SessionClientExpectTest")
@Test(groups = { "unit", "user" }, testName = "SessionClientExpectTest")
// only needed as SessionClient is not registered in rest.properties
@RegisterContext(sync = SessionClient.class, async = SessionAsyncClient.class)
public class SessionClientExpectTest extends BaseRestClientExpectTest<SessionClient> {

View File

@ -48,7 +48,7 @@ import com.google.inject.Module;
* @author Adrian Cole
*/
@Listeners(FormatApiResultsListener.class)
@Test(groups = { "live", "user", "login" }, testName = "SessionClientLiveTest")
@Test(groups = { "live", "user" }, testName = "SessionClientLiveTest")
public class SessionClientLiveTest extends BaseVersionedServiceLiveTest {
public SessionClientLiveTest() {
provider = "vcloud-director";
@ -73,7 +73,7 @@ public class SessionClientLiveTest extends BaseVersionedServiceLiveTest {
private SessionClient client;
private SessionWithToken sessionWithToken;
@Test(testName = "POST /sessions")
@Test(description = "POST /sessions")
public void testLogin() {
String user = identity.substring(0, identity.lastIndexOf('@'));
String org = identity.substring(identity.lastIndexOf('@') + 1);
@ -86,13 +86,13 @@ public class SessionClientLiveTest extends BaseVersionedServiceLiveTest {
assertNotNull(sessionWithToken.getToken());
}
@Test(testName = "GET /session", dependsOnMethods = "testLogin")
@Test(description = "GET /session", dependsOnMethods = "testLogin")
public void testGetSession() {
assertEquals(client.getSessionWithToken(sessionWithToken.getSession().getHref(), sessionWithToken.getToken()),
sessionWithToken.getSession());
}
@Test(testName = "DELETE /session", dependsOnMethods = "testGetSession")
@Test(description = "DELETE /session", dependsOnMethods = "testGetSession")
public void testLogout() {
client.logoutSessionWithToken(sessionWithToken.getSession().getHref(), sessionWithToken.getToken());
}