From 9ca399049a01ff85a15d91a3a9acc2060df4e212 Mon Sep 17 00:00:00 2001 From: Richard Downer Date: Mon, 23 Jan 2012 13:12:45 +0200 Subject: [PATCH] Add empty Vlan[Async]Client module and tests --- .../CloudStackGlobalAsyncClient.java | 7 ++++ .../cloudstack/CloudStackGlobalClient.java | 7 ++++ .../config/CloudStackRestClientModule.java | 3 ++ .../features/GlobalVlanAsyncClient.java | 37 +++++++++++++++++++ .../cloudstack/features/GlobalVlanClient.java | 36 ++++++++++++++++++ .../features/GlobalVlanClientExpectTest.java | 37 +++++++++++++++++++ .../features/GlobalVlanClientLiveTest.java | 36 ++++++++++++++++++ 7 files changed, 163 insertions(+) create mode 100644 apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalVlanAsyncClient.java create mode 100644 apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalVlanClient.java create mode 100644 apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/GlobalVlanClientExpectTest.java create mode 100644 apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/GlobalVlanClientLiveTest.java diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackGlobalAsyncClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackGlobalAsyncClient.java index dbbb6ced8b..521251719c 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackGlobalAsyncClient.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackGlobalAsyncClient.java @@ -30,6 +30,7 @@ import org.jclouds.cloudstack.features.GlobalPodAsyncClient; import org.jclouds.cloudstack.features.GlobalStoragePoolAsyncClient; import org.jclouds.cloudstack.features.GlobalUsageAsyncClient; import org.jclouds.cloudstack.features.GlobalUserAsyncClient; +import org.jclouds.cloudstack.features.GlobalVlanAsyncClient; import org.jclouds.cloudstack.features.GlobalZoneAsyncClient; import org.jclouds.rest.annotations.Delegate; @@ -122,4 +123,10 @@ public interface CloudStackGlobalAsyncClient extends CloudStackDomainAsyncClient */ @Delegate GlobalPodAsyncClient getPodClient(); + + /** + * Provides asynchronous access to Vlan + */ + @Delegate + GlobalVlanAsyncClient getVlanClient(); } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackGlobalClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackGlobalClient.java index 005719eab4..4ed21766a2 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackGlobalClient.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackGlobalClient.java @@ -31,6 +31,7 @@ import org.jclouds.cloudstack.features.GlobalPodClient; import org.jclouds.cloudstack.features.GlobalStoragePoolClient; import org.jclouds.cloudstack.features.GlobalUsageClient; import org.jclouds.cloudstack.features.GlobalUserClient; +import org.jclouds.cloudstack.features.GlobalVlanClient; import org.jclouds.cloudstack.features.GlobalZoneClient; import org.jclouds.concurrent.Timeout; import org.jclouds.rest.annotations.Delegate; @@ -125,4 +126,10 @@ public interface CloudStackGlobalClient extends CloudStackDomainClient { */ @Delegate GlobalPodClient getPodClient(); + + /** + * Provides synchronous access to Vlan + */ + @Delegate + GlobalVlanClient getVlanClient(); } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java index 1c11d63063..68023513f3 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java @@ -72,6 +72,8 @@ import org.jclouds.cloudstack.features.GlobalUsageAsyncClient; import org.jclouds.cloudstack.features.GlobalUsageClient; import org.jclouds.cloudstack.features.GlobalUserAsyncClient; import org.jclouds.cloudstack.features.GlobalUserClient; +import org.jclouds.cloudstack.features.GlobalVlanAsyncClient; +import org.jclouds.cloudstack.features.GlobalVlanClient; import org.jclouds.cloudstack.features.GlobalZoneAsyncClient; import org.jclouds.cloudstack.features.GlobalZoneClient; import org.jclouds.cloudstack.features.GuestOSAsyncClient; @@ -172,6 +174,7 @@ public class CloudStackRestClientModule extends RestClientModule + * + * @see org.jclouds.cloudstack.features.GlobalVlanClient + * @see + * @author Richard Downer + */ +@RequestFilters(QuerySigner.class) +@QueryParams(keys = "response", values = "json") +public interface GlobalVlanAsyncClient { + +} diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalVlanClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalVlanClient.java new file mode 100644 index 0000000000..7a6f10400a --- /dev/null +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/features/GlobalVlanClient.java @@ -0,0 +1,36 @@ +/** + * 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.cloudstack.features; + +import org.jclouds.concurrent.Timeout; + +import java.util.concurrent.TimeUnit; + +/** + * Provides synchronous access to CloudStack VLAN features. + *

+ * + * @see GlobalOfferingAsyncClient + * @see + * @author Richard Downer + */ +@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS) +public interface GlobalVlanClient { + +} diff --git a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/GlobalVlanClientExpectTest.java b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/GlobalVlanClientExpectTest.java new file mode 100644 index 0000000000..8529fce4d5 --- /dev/null +++ b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/GlobalVlanClientExpectTest.java @@ -0,0 +1,37 @@ +/** + * 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.cloudstack.features; + +import org.jclouds.cloudstack.CloudStackContext; +import org.testng.annotations.Test; + +/** + * Test the CloudStack VlanClient + * + * @author Richard Downer + */ +@Test(groups = "unit", testName = "GlobalVlanClientExpectTest") +public class GlobalVlanClientExpectTest extends BaseCloudStackRestClientExpectTest { + + + @Override + protected GlobalVlanClient clientFrom(CloudStackContext context) { + return context.getGlobalContext().getApi().getVlanClient(); + } +} \ No newline at end of file diff --git a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/GlobalVlanClientLiveTest.java b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/GlobalVlanClientLiveTest.java new file mode 100644 index 0000000000..b77054fee0 --- /dev/null +++ b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/GlobalVlanClientLiveTest.java @@ -0,0 +1,36 @@ +/** + * 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.cloudstack.features; + +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +/** + * Tests behavior of {@code GlobalVlanClient} + * + * @author Richard Downer + */ +@Test(groups = "live", singleThreaded = true, testName = "GlobalVlanClientLiveTest") +public class GlobalVlanClientLiveTest extends BaseCloudStackClientLiveTest { + + @AfterClass + public void testFixtureTearDown() { + } + +}