You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Ignasi Barrera <no...@github.com> on 2013/09/10 12:57:27 UTC

[jclouds-chef] Cleanup tests (#17)

Cleanup tests:

* Use TestNG assertions
* Formatted code in compute tests
* Removed unnecessary local variables in tests to avoid using them by
  mistake between independent tests.
You can merge this Pull Request by running:

  git pull https://github.com/nacx/jclouds-chef cleanup-tests

Or you can view, comment on it, or merge it online at:

  https://github.com/jclouds/jclouds-chef/pull/17

-- Commit Summary --

  * Cleanup tests

-- File Changes --

    M compute/src/test/java/org/jclouds/chef/compute/ChefComputeServiceLiveTest.java (15)
    M compute/src/test/java/org/jclouds/chef/compute/internal/BaseComputeServiceIntegratedChefClientLiveTest.java (129)
    M core/src/test/java/org/jclouds/chef/internal/BaseChefApiLiveTest.java (24)

-- Patch Links --

https://github.com/jclouds/jclouds-chef/pull/17.patch
https://github.com/jclouds/jclouds-chef/pull/17.diff

Re: [jclouds-chef] Cleanup tests (#17)

Posted by BuildHive <no...@github.com>.
[jclouds ยป jclouds-chef #363](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-chef/363/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/17#issuecomment-24153555

Re: [jclouds-chef] Cleanup tests (#17)

Posted by Ignasi Barrera <no...@github.com>.
Closed #17.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/17

Re: [jclouds-chef] Cleanup tests (#17)

Posted by Ignasi Barrera <no...@github.com>.
> @@ -94,9 +88,8 @@ public void testRunNodesWithBootstrap() throws IOException {
>           URI uri = URI.create("http://" + getLast(node.getPublicAddresses()));
>           InputStream content = computeContext.utils().http().get(uri);
>           String string = Strings2.toStringAndClose(content);
> -         assert string.indexOf("It works!") >= 0 : string;
> +         assertTrue(string.indexOf("It works!") >= 0, string);

This test installs an Apache web server in the deployed node. The assertion just performs an HTTP request and expects to get the default HTML page of the web server. It just looks for the desired string (ignoring the HTML tags), to check that the web server has been properly installed and started.

Now that I see it again, will add the message but a more convenient one :)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/17/files#r6263080

Re: [jclouds-chef] Cleanup tests (#17)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-chef-pull-requests #39](https://jclouds.ci.cloudbees.com/job/jclouds-chef-pull-requests/39/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/17#issuecomment-24153683

Re: [jclouds-chef] Cleanup tests (#17)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-chef-pull-requests #36](https://jclouds.ci.cloudbees.com/job/jclouds-chef-pull-requests/36/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/17#issuecomment-24151635

Re: [jclouds-chef] Cleanup tests (#17)

Posted by Andrew Phillips <no...@github.com>.
>  
> -	// isolate tests from eachother, as default credentialStore is static
> -	protected Module credentialStoreModule = new CredentialStoreModule(
> -			new CopyInputStreamInputSupplierMap(
> -					new ConcurrentHashMap<String, InputSupplier<InputStream>>()));
> +   // isolate tests from eachother, as default credentialStore is static

"each other"

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/17/files#r6262842

Re: [jclouds-chef] Cleanup tests (#17)

Posted by Andrew Phillips <no...@github.com>.
+1 - good to go as far as I'm concerned!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/17#issuecomment-24155224

Re: [jclouds-chef] Cleanup tests (#17)

Posted by Andrew Phillips <no...@github.com>.
> @@ -94,9 +88,8 @@ public void testRunNodesWithBootstrap() throws IOException {
>           URI uri = URI.create("http://" + getLast(node.getPublicAddresses()));
>           InputStream content = computeContext.utils().http().get(uri);
>           String string = Strings2.toStringAndClose(content);
> -         assert string.indexOf("It works!") >= 0 : string;
> +         assertTrue(string.indexOf("It works!") >= 0, string);

```
assertTrue(string.contains("It works!"), "Expected '%s' to contain 'It works!", string);
```

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/17/files#r6262835