diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/VCloudAsyncClientTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/VCloudAsyncClientTest.java index d45a40752e..3c4f0796c9 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/VCloudAsyncClientTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/VCloudAsyncClientTest.java @@ -43,6 +43,7 @@ import org.jclouds.vcloud.internal.BaseVCloudAsyncClientTest; import org.jclouds.vcloud.options.CaptureVAppOptions; import org.jclouds.vcloud.options.CloneVAppOptions; import org.jclouds.vcloud.options.InstantiateVAppTemplateOptions; +import org.jclouds.vcloud.utils.TestUtils; import org.jclouds.vcloud.xml.CatalogHandler; import org.jclouds.vcloud.xml.CatalogItemHandler; import org.jclouds.vcloud.xml.OrgHandler; @@ -55,6 +56,7 @@ import org.jclouds.vcloud.xml.VAppTemplateHandler; import org.jclouds.vcloud.xml.VDCHandler; import org.jclouds.vcloud.xml.VmHandler; import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import com.google.inject.TypeLiteral; @@ -116,6 +118,7 @@ public class VCloudAsyncClientTest extends BaseVCloudAsyncClientTest checkFilters(request); } + @Test(dataProvider = "ignoreOnWindows", description = "see http://code.google.com/p/jclouds/issues/detail?id=402") public void testUpdateGuestConfiguration() throws SecurityException, NoSuchMethodException, IOException { Method method = VmAsyncClient.class.getMethod("updateGuestCustomizationOfVm", GuestCustomizationSection.class, URI.class); @@ -316,4 +319,10 @@ public class VmAsyncClientTest extends BaseVCloudAsyncClientTest checkFilters(request); } + @DataProvider + public Object[][] ignoreOnWindows() { + return (TestUtils.isWindowsOs() ? TestUtils.NO_INVOCATIONS + : TestUtils.SINGLE_NO_ARG_INVOCATION); + } + } diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/utils/TestUtils.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/utils/TestUtils.java new file mode 100644 index 0000000000..1831852f10 --- /dev/null +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/utils/TestUtils.java @@ -0,0 +1,34 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed 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.utils; + + +/** + * Utility class for test + * + * @author Andrew Phillips + */ +public class TestUtils { + public static final Object[][] NO_INVOCATIONS = new Object[0][0]; + public static final Object[][] SINGLE_NO_ARG_INVOCATION = new Object[][] { new Object[0] }; + + public static boolean isWindowsOs() { + return System.getProperty("os.name", "").toLowerCase().contains("windows"); + } +}