> +         assertEquals(dataCenter.version(), 1);
> +      } finally {
> +         pbApi.close();
> +         server.shutdown();
> +      }
> +   }
> +
> +   @Test
> +   public void testCreateDataCenterWithIllegalArguments() throws Exception {
> +      String[] names = {"JCl@ouds", "JC|ouds", "^clouds", ""};
> +      for (String name : names)
> +         try {
> +            DataCenter.Request.CreatePayload.create(name, Location.US_LAS);
> +            fail("Should have failed for name: ".concat(name));
> +         } catch (Exception ex) {
> +            assertTrue(ex instanceof IllegalArgumentException);

Hmm. I was thinking that if (for some reason) <code>CreatePayload#create</code> 
throws a different kind of exception, it would skip the <code>fail()</code> and 
<code>catch</code> clause; thus, the test becoming a success. So... should just 
<code>IllegalArgumentException</code> be okay?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/72/files#r22500916

Reply via email to