You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Alexander Rojas <al...@mesosphere.io> on 2015/04/20 18:28:15 UTC

Re: Review Request 32163: Added a function which checks if a json object is contained within another.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/32163/
-----------------------------------------------------------

(Updated April 20, 2015, 6:28 p.m.)


Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Marco Massenzio, Niklas Nielsen, and Till Toenshoff.


Changes
-------

Rebased


Bugs: MESOS-2510
    https://issues.apache.org/jira/browse/MESOS-2510


Repository: mesos


Description
-------

Adds a function which allows to perform comparison tests on subsets of json blobs. i.e.

```cpp
JSON::Value expected = JSON::parse(
    "{"
    "  \"key\" : true"
	"}").get();

// Returned json:
// {
//   "uptime" : 45234.123,
//   "key" : true
// }
JSON::Value actual = bar();

// I'm only interested on the "key" entry and ignore the rest.
EXPECT_TRUE(contains(actual, expected));
```

Increasing readability for tests that include json.

For more information on the reason of why this patch is needed, please check the JIRA entry.


Diffs (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp 334c898906018be6e663f53815abbe047806b95c 
  3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp f60d1bbe60f2e2b6460c06bba98e8b85ebb6a3f9 

Diff: https://reviews.apache.org/r/32163/diff/


Testing
-------

make check


Thanks,

Alexander Rojas


Re: Review Request 32163: Added a function which checks if a json object is contained within another.

Posted by Alexander Rojas <al...@mesosphere.io>.

> On April 21, 2015, 1:50 a.m., Marco Massenzio wrote:
> > 3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp, line 315
> > <https://reviews.apache.org/r/32163/diff/8/?file=935461#file935461line315>
> >
> >     while I appreciate being thorough, strictly speaking this should not be here: you're actually unittesting `JSON::parse()` with this `CHECK`
> >     
> >     two downsides:
> >     
> >     1. your test code is more verbose (and less readable);
> >     2. you may have failures here that are entirely unrelated to `Contains` (causing folks to go scratching their head)
> >      
> >     Also, I would add some variety to your tests:
> >     ```
> >     {"an_array_of_doubles": [1.0, -22.33, 99.876]}
> >     {"an_array_of_arrays": [[2, 3], [99, -1]]}
> >     {"an_array_of_objects":[{"foo": 1, "bar": 2, "values": [5, 8, -1]}
> >     ```

The array of objects existed before, but it is after the objects tests.


- Alexander


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/32163/#review80854
-----------------------------------------------------------


On April 20, 2015, 6:28 p.m., Alexander Rojas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/32163/
> -----------------------------------------------------------
> 
> (Updated April 20, 2015, 6:28 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Marco Massenzio, Niklas Nielsen, and Till Toenshoff.
> 
> 
> Bugs: MESOS-2510
>     https://issues.apache.org/jira/browse/MESOS-2510
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a function which allows to perform comparison tests on subsets of json blobs. i.e.
> 
> ```cpp
> JSON::Value expected = JSON::parse(
>     "{"
>     "  \"key\" : true"
> 	"}").get();
> 
> // Returned json:
> // {
> //   "uptime" : 45234.123,
> //   "key" : true
> // }
> JSON::Value actual = bar();
> 
> // I'm only interested on the "key" entry and ignore the rest.
> EXPECT_TRUE(contains(actual, expected));
> ```
> 
> Increasing readability for tests that include json.
> 
> For more information on the reason of why this patch is needed, please check the JIRA entry.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp 334c898906018be6e663f53815abbe047806b95c 
>   3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp f60d1bbe60f2e2b6460c06bba98e8b85ebb6a3f9 
> 
> Diff: https://reviews.apache.org/r/32163/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Alexander Rojas
> 
>


Re: Review Request 32163: Added a function which checks if a json object is contained within another.

Posted by Marco Massenzio <ma...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/32163/#review80854
-----------------------------------------------------------

Ship it!


Looks good to me!
Very minor nits, if you can fix them, happy for you to merge this without another round.

Thanks for adding tests too!


3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp
<https://reviews.apache.org/r/32163/#comment130965>

    nit: `foreach(i)`



3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp
<https://reviews.apache.org/r/32163/#comment130967>

    what happens if one of `this.key` is `null` and `other.key` is missing (and vice versa)?
    
    in other words: do we treat a `null` differently from a key's absence?
    
    (I don't have an opinion on the matter, just suggesting we should document behavior)



3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp
<https://reviews.apache.org/r/32163/#comment130992>

    while I appreciate being thorough, strictly speaking this should not be here: you're actually unittesting `JSON::parse()` with this `CHECK`
    
    two downsides:
    
    1. your test code is more verbose (and less readable);
    2. you may have failures here that are entirely unrelated to `Contains` (causing folks to go scratching their head)
     
    Also, I would add some variety to your tests:
    ```
    {"an_array_of_doubles": [1.0, -22.33, 99.876]}
    {"an_array_of_arrays": [[2, 3], [99, -1]]}
    {"an_array_of_objects":[{"foo": 1, "bar": 2, "values": [5, 8, -1]}
    ```



3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp
<https://reviews.apache.org/r/32163/#comment130993>

    nit: you may want to call the key something different (`"should_be_null"` or whatever) or the error messages are going to be real confusing :)


- Marco Massenzio


On April 20, 2015, 4:28 p.m., Alexander Rojas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/32163/
> -----------------------------------------------------------
> 
> (Updated April 20, 2015, 4:28 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Marco Massenzio, Niklas Nielsen, and Till Toenshoff.
> 
> 
> Bugs: MESOS-2510
>     https://issues.apache.org/jira/browse/MESOS-2510
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a function which allows to perform comparison tests on subsets of json blobs. i.e.
> 
> ```cpp
> JSON::Value expected = JSON::parse(
>     "{"
>     "  \"key\" : true"
> 	"}").get();
> 
> // Returned json:
> // {
> //   "uptime" : 45234.123,
> //   "key" : true
> // }
> JSON::Value actual = bar();
> 
> // I'm only interested on the "key" entry and ignore the rest.
> EXPECT_TRUE(contains(actual, expected));
> ```
> 
> Increasing readability for tests that include json.
> 
> For more information on the reason of why this patch is needed, please check the JIRA entry.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp 334c898906018be6e663f53815abbe047806b95c 
>   3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp f60d1bbe60f2e2b6460c06bba98e8b85ebb6a3f9 
> 
> Diff: https://reviews.apache.org/r/32163/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Alexander Rojas
> 
>


Re: Review Request 32163: Added a function which checks if a json object is contained within another.

Posted by Alexander Rojas <al...@mesosphere.io>.

> On May 4, 2015, 10:56 p.m., Niklas Nielsen wrote:
> > 3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp, line 448
> > <https://reviews.apache.org/r/32163/diff/10/?file=947348#file947348line448>
> >
> >     should 'json' be capitalized in our comments?

Yes, fixing it.


- Alexander


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/32163/#review82410
-----------------------------------------------------------


On May 5, 2015, 6:26 p.m., Alexander Rojas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/32163/
> -----------------------------------------------------------
> 
> (Updated May 5, 2015, 6:26 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Marco Massenzio, Niklas Nielsen, and Till Toenshoff.
> 
> 
> Bugs: MESOS-2510
>     https://issues.apache.org/jira/browse/MESOS-2510
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a function which allows to perform comparison tests on subsets of json blobs. i.e.
> 
> ```cpp
> JSON::Value expected = JSON::parse(
>     "{"
>     "  \"key\" : true"
> 	"}").get();
> 
> // Returned json:
> // {
> //   "uptime" : 45234.123,
> //   "key" : true
> // }
> JSON::Value actual = bar();
> 
> // I'm only interested on the "key" entry and ignore the rest.
> EXPECT_TRUE(contains(actual, expected));
> ```
> 
> Increasing readability for tests that include json.
> 
> For more information on the reason of why this patch is needed, please check the JIRA entry.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp 334c898906018be6e663f53815abbe047806b95c 
>   3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp f60d1bbe60f2e2b6460c06bba98e8b85ebb6a3f9 
> 
> Diff: https://reviews.apache.org/r/32163/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Alexander Rojas
> 
>


Re: Review Request 32163: Added a function which checks if a json object is contained within another.

Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/32163/#review82410
-----------------------------------------------------------



3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp
<https://reviews.apache.org/r/32163/#comment133138>

    s/Note/NOTE/



3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp
<https://reviews.apache.org/r/32163/#comment133144>

    How about testing that it doesn't match a string?



3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp
<https://reviews.apache.org/r/32163/#comment133149>

    I start to think it makes sense to break this test up in sub tests for the value types. What do you think?



3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp
<https://reviews.apache.org/r/32163/#comment133150>

    Want to test strings too?



3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp
<https://reviews.apache.org/r/32163/#comment133151>

    Same question: want to check that it doesn't match a string?



3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp
<https://reviews.apache.org/r/32163/#comment133152>

    Want to check that it doesn't match an array?



3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp
<https://reviews.apache.org/r/32163/#comment133174>

    should 'json' be capitalized in our comments?


- Niklas Nielsen


On May 1, 2015, 11:55 a.m., Alexander Rojas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/32163/
> -----------------------------------------------------------
> 
> (Updated May 1, 2015, 11:55 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Marco Massenzio, Niklas Nielsen, and Till Toenshoff.
> 
> 
> Bugs: MESOS-2510
>     https://issues.apache.org/jira/browse/MESOS-2510
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a function which allows to perform comparison tests on subsets of json blobs. i.e.
> 
> ```cpp
> JSON::Value expected = JSON::parse(
>     "{"
>     "  \"key\" : true"
> 	"}").get();
> 
> // Returned json:
> // {
> //   "uptime" : 45234.123,
> //   "key" : true
> // }
> JSON::Value actual = bar();
> 
> // I'm only interested on the "key" entry and ignore the rest.
> EXPECT_TRUE(contains(actual, expected));
> ```
> 
> Increasing readability for tests that include json.
> 
> For more information on the reason of why this patch is needed, please check the JIRA entry.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp 334c898906018be6e663f53815abbe047806b95c 
>   3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp f60d1bbe60f2e2b6460c06bba98e8b85ebb6a3f9 
> 
> Diff: https://reviews.apache.org/r/32163/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Alexander Rojas
> 
>


Re: Review Request 32163: Added a function which checks if a json object is contained within another.

Posted by Alexander Rojas <al...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/32163/
-----------------------------------------------------------

(Updated May 7, 2015, 9:10 p.m.)


Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Marco Massenzio, Niklas Nielsen, and Till Toenshoff.


Changes
-------

Till's comments.


Bugs: MESOS-2510
    https://issues.apache.org/jira/browse/MESOS-2510


Repository: mesos


Description
-------

Adds a function which allows to perform comparison tests on subsets of json blobs. i.e.

```cpp
JSON::Value expected = JSON::parse(
    "{"
    "  \"key\" : true"
	"}").get();

// Returned json:
// {
//   "uptime" : 45234.123,
//   "key" : true
// }
JSON::Value actual = bar();

// I'm only interested on the "key" entry and ignore the rest.
EXPECT_TRUE(contains(actual, expected));
```

Increasing readability for tests that include json.

For more information on the reason of why this patch is needed, please check the JIRA entry.


Diffs (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp 334c898906018be6e663f53815abbe047806b95c 
  3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp f60d1bbe60f2e2b6460c06bba98e8b85ebb6a3f9 

Diff: https://reviews.apache.org/r/32163/diff/


Testing
-------

make check


Thanks,

Alexander Rojas


Re: Review Request 32163: Added a function which checks if a json object is contained within another.

Posted by Till Toenshoff <to...@me.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/32163/#review82870
-----------------------------------------------------------

Ship it!



3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp
<https://reviews.apache.org/r/32163/#comment133711>

    `const Value& other` please.


- Till Toenshoff


On May 5, 2015, 4:26 p.m., Alexander Rojas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/32163/
> -----------------------------------------------------------
> 
> (Updated May 5, 2015, 4:26 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Marco Massenzio, Niklas Nielsen, and Till Toenshoff.
> 
> 
> Bugs: MESOS-2510
>     https://issues.apache.org/jira/browse/MESOS-2510
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a function which allows to perform comparison tests on subsets of json blobs. i.e.
> 
> ```cpp
> JSON::Value expected = JSON::parse(
>     "{"
>     "  \"key\" : true"
> 	"}").get();
> 
> // Returned json:
> // {
> //   "uptime" : 45234.123,
> //   "key" : true
> // }
> JSON::Value actual = bar();
> 
> // I'm only interested on the "key" entry and ignore the rest.
> EXPECT_TRUE(contains(actual, expected));
> ```
> 
> Increasing readability for tests that include json.
> 
> For more information on the reason of why this patch is needed, please check the JIRA entry.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp 334c898906018be6e663f53815abbe047806b95c 
>   3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp f60d1bbe60f2e2b6460c06bba98e8b85ebb6a3f9 
> 
> Diff: https://reviews.apache.org/r/32163/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Alexander Rojas
> 
>


Re: Review Request 32163: Added a function which checks if a json object is contained within another.

Posted by Till Toenshoff <to...@me.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/32163/#review82073
-----------------------------------------------------------



3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp
<https://reviews.apache.org/r/32163/#comment132735>

    



3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp
<https://reviews.apache.org/r/32163/#comment132737>

    s/other/'other'/g && s/self/'self'/g


- Till Toenshoff


On May 5, 2015, 4:26 p.m., Alexander Rojas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/32163/
> -----------------------------------------------------------
> 
> (Updated May 5, 2015, 4:26 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Marco Massenzio, Niklas Nielsen, and Till Toenshoff.
> 
> 
> Bugs: MESOS-2510
>     https://issues.apache.org/jira/browse/MESOS-2510
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a function which allows to perform comparison tests on subsets of json blobs. i.e.
> 
> ```cpp
> JSON::Value expected = JSON::parse(
>     "{"
>     "  \"key\" : true"
> 	"}").get();
> 
> // Returned json:
> // {
> //   "uptime" : 45234.123,
> //   "key" : true
> // }
> JSON::Value actual = bar();
> 
> // I'm only interested on the "key" entry and ignore the rest.
> EXPECT_TRUE(contains(actual, expected));
> ```
> 
> Increasing readability for tests that include json.
> 
> For more information on the reason of why this patch is needed, please check the JIRA entry.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp 334c898906018be6e663f53815abbe047806b95c 
>   3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp f60d1bbe60f2e2b6460c06bba98e8b85ebb6a3f9 
> 
> Diff: https://reviews.apache.org/r/32163/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Alexander Rojas
> 
>


Re: Review Request 32163: Added a function which checks if a json object is contained within another.

Posted by Alexander Rojas <al...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/32163/
-----------------------------------------------------------

(Updated May 5, 2015, 6:26 p.m.)


Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Marco Massenzio, Niklas Nielsen, and Till Toenshoff.


Changes
-------

Updates comments, breaks containment test into smaller more localized tests.


Bugs: MESOS-2510
    https://issues.apache.org/jira/browse/MESOS-2510


Repository: mesos


Description
-------

Adds a function which allows to perform comparison tests on subsets of json blobs. i.e.

```cpp
JSON::Value expected = JSON::parse(
    "{"
    "  \"key\" : true"
	"}").get();

// Returned json:
// {
//   "uptime" : 45234.123,
//   "key" : true
// }
JSON::Value actual = bar();

// I'm only interested on the "key" entry and ignore the rest.
EXPECT_TRUE(contains(actual, expected));
```

Increasing readability for tests that include json.

For more information on the reason of why this patch is needed, please check the JIRA entry.


Diffs (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp 334c898906018be6e663f53815abbe047806b95c 
  3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp f60d1bbe60f2e2b6460c06bba98e8b85ebb6a3f9 

Diff: https://reviews.apache.org/r/32163/diff/


Testing
-------

make check


Thanks,

Alexander Rojas


Re: Review Request 32163: Added a function which checks if a json object is contained within another.

Posted by Alexander Rojas <al...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/32163/
-----------------------------------------------------------

(Updated May 1, 2015, 8:55 p.m.)


Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Marco Massenzio, Niklas Nielsen, and Till Toenshoff.


Changes
-------

Adding tests for larger array.


Bugs: MESOS-2510
    https://issues.apache.org/jira/browse/MESOS-2510


Repository: mesos


Description
-------

Adds a function which allows to perform comparison tests on subsets of json blobs. i.e.

```cpp
JSON::Value expected = JSON::parse(
    "{"
    "  \"key\" : true"
	"}").get();

// Returned json:
// {
//   "uptime" : 45234.123,
//   "key" : true
// }
JSON::Value actual = bar();

// I'm only interested on the "key" entry and ignore the rest.
EXPECT_TRUE(contains(actual, expected));
```

Increasing readability for tests that include json.

For more information on the reason of why this patch is needed, please check the JIRA entry.


Diffs (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp 334c898906018be6e663f53815abbe047806b95c 
  3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp f60d1bbe60f2e2b6460c06bba98e8b85ebb6a3f9 

Diff: https://reviews.apache.org/r/32163/diff/


Testing
-------

make check


Thanks,

Alexander Rojas


Re: Review Request 32163: Added a function which checks if a json object is contained within another.

Posted by Alexander Rojas <al...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/32163/
-----------------------------------------------------------

(Updated April 21, 2015, 2:07 p.m.)


Review request for mesos, Benjamin Hindman, Bernd Mathiske, Joerg Schad, Marco Massenzio, Niklas Nielsen, and Till Toenshoff.


Changes
-------

Addresses Marco's comments.


Bugs: MESOS-2510
    https://issues.apache.org/jira/browse/MESOS-2510


Repository: mesos


Description
-------

Adds a function which allows to perform comparison tests on subsets of json blobs. i.e.

```cpp
JSON::Value expected = JSON::parse(
    "{"
    "  \"key\" : true"
	"}").get();

// Returned json:
// {
//   "uptime" : 45234.123,
//   "key" : true
// }
JSON::Value actual = bar();

// I'm only interested on the "key" entry and ignore the rest.
EXPECT_TRUE(contains(actual, expected));
```

Increasing readability for tests that include json.

For more information on the reason of why this patch is needed, please check the JIRA entry.


Diffs (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp 334c898906018be6e663f53815abbe047806b95c 
  3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp f60d1bbe60f2e2b6460c06bba98e8b85ebb6a3f9 

Diff: https://reviews.apache.org/r/32163/diff/


Testing
-------

make check


Thanks,

Alexander Rojas