mirror of https://github.com/apache/jclouds.git
Updated test annotations for command-line test tool
This commit is contained in:
parent
2e67af2075
commit
19c88aa1fe
|
@ -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
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
||||
/*
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
||||
/*
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
||||
/*
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
||||
/*
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
||||
/*
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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> {
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue