So to be clear, the Management REST API has it's own set of test classes for "unit" tests. When it comes to integration testing, I took advantage of the fact the Management REST API just exposes an interface for the Gfsh commands that are executed on the Manager over HTTP. I.e. they use the same Management command DUnit tests, but effectively the difference, as seen from the perspective of a user using Gfsh, is this...
// HTTP gfsh> connect *--use-http* [--url=http[s]://host:http-port/gemfire/v1] Vs. // JMX RMI gfsh> connect [--jmx-manager=localhost[1099] | --locator=localhost[10334]] I would have to think on this more, but this is really not the purpose of the @Parameterized annotation in JUnit, since the Gfsh/Manager connection is setup before any individual Management test class runs. My first reaction is no, @Parameterized will not work and it really was not intended to handle situations like these. On Thu, Oct 22, 2015 at 2:00 PM, Kirk Lund <[email protected]> wrote: > If you want to use annotations or other JUnit 4 syntax in a DUnit, it'll > have to wait until after I merge feature/GEODE-217 to develop. We'll also > need an engineer to spend one or more weeks updating all of the relevant > management dunit tests to use JUnit 4 syntax. > > -Kirk > > > On Thu, Oct 22, 2015 at 1:53 PM, Anthony Baker <[email protected]> wrote: > > > Can we apply the @Parameterized annotation here? Two code paths, one > test > > (as the old saying goes…) > > > > Anthony > > > > > On Oct 22, 2015, at 1:46 PM, Kirk Lund <[email protected]> wrote: > > > > > > This would similar to having to rerun all of the "region" tests with a > > > system property specifying "replicated" or "partitioned". Perhaps all > of > > > the management (integration or distributed) tests that have an HTTP > REST > > > counterpart need to be subclassed with a test case that overrides some > > bit > > > of configuration to use HTTP REST instead of JMX RMI. In this way, the > > same > > > test would be executed but configured in a different way. > > > > > > -Kirk > > > > > > > > > On Thu, Oct 22, 2015 at 1:35 PM, John Blum <[email protected]> wrote: > > > > > >> Well, there are 2 scenarios under which Management tests should run, 1 > > with > > >> JMX RMI and the other with HTTP. So you you will need to incorporate > > some > > >> elaborate code in the Gradle-based build to handle this and capture > the > > >> results without stomping on nearly identical runs, since it share the > > same > > >> test classes. > > >> > > >> So while I agree with your statement, it does not solve the problem by > > >> simply saying the tests should be run without a special flag. > > >> > > >> > > >> On Thu, Oct 22, 2015 at 1:31 PM, Dan Smith <[email protected]> wrote: > > >> > > >>> I don't think there is a counterpart in the gradle build. And I don't > > >>> think there should be - if this is something that needs to be tested > it > > >>> should be running in every nightly build, not just when you pass a > > >> special > > >>> flag. > > >>> > > >>> -Dan > > >>> > > >>> On Thu, Oct 22, 2015 at 12:12 PM, Kirk Lund <[email protected]> > wrote: > > >>> > > >>>> This is from the old Ant build (which Geode doesn't use): > > >>>> > > >>>> $build.sh run-management-tests -DuseHTTP=true > > >>>> > > >>>> What's the counterpart in the Geode gradle build? > > >>>> > > >>>> -Kirk > > >>>> > > >>>> > > >>>> On Thu, Oct 22, 2015 at 11:55 AM, John Blum <[email protected]> > wrote: > > >>>> > > >>>>> > > >>>>> ----------------------------------------------------------- > > >>>>> This is an automatically generated e-mail. To reply, visit: > > >>>>> https://reviews.apache.org/r/39023/#review103635 > > >>>>> ----------------------------------------------------------- > > >>>>> > > >>>>> > > >>>>> You will also need to run the Management test suite using HTTP > > >>>> (especially > > >>>>> for v8.x and earlier) with... > > >>>>> > > >>>>> $build.sh run-management-tests -DuseHTTP=true > > >>>>> > > >>>>> This will run all the Manager/Gfsh commands over HTTP using the > > >>>> Management > > >>>>> REST API. I am not exactly sure how to do this with the Apache > Geode > > >>>>> codebase and Gradle build, or even if the Management test suite is > > >> part > > >>>> of > > >>>>> the Apache Geode codebase yet. > > >>>>> > > >>>>> > > >>>>> > > >>>> > > >> > > > gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/AbstractCommandsController.java > > >>>>> (line 255) > > >>>>> <https://reviews.apache.org/r/39023/#comment161695> > > >>>>> > > >>>>> Make the "scheme" parameter final for consistency. > > >>>>> > > >>>>> Typically, you should add parameters to the end of the method > > >>>>> parameter list and also include a method such as... > > >>>>> > > >>>>> protected static final String DEFAULT_SCHEME = "http"; > > >>>>> > > >>>>> ... > > >>>>> > > >>>>> protected URI toUri(final String path) { > > >>>>> return toUri(path, DEFAULT_SCHEME); > > >>>>> } > > >>>>> > > >>>>> This will help minimize the necessary code changes in areas of > the > > >>>>> code that are not affected by the scheme. > > >>>>> > > >>>>> > > >>>>> > > >>>>> > > >>>> > > >> > > > gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/AbstractCommandsController.java > > >>>>> (line 256) > > >>>>> <https://reviews.apache.org/r/39023/#comment161703> > > >>>>> > > >>>>> Structure as... > > >>>>> > > >>>>> return > > >>>>> ServletUriComponentsBuilder.fromCurrentContextPath().scheme(scheme) > > >>>>> .path(REST_API_VERSION).path(path).build().toUri(); > > >>>>> > > >>>>> > > >>>>> > > >>>>> > > >>>> > > >> > > > gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/ShellCommandsController.java > > >>>>> (line 146) > > >>>>> <https://reviews.apache.org/r/39023/#comment161700> > > >>>>> > > >>>>> Make the "scheme" parameter final for consistency. > > >>>>> > > >>>>> > > >>>>> > > >>>>> > > >>>> > > >> > > > gemfire-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/ShellCommandsControllerJUnitTest.java > > >>>>> (line 215) > > >>>>> <https://reviews.apache.org/r/39023/#comment161702> > > >>>>> > > >>>>> +1 > > >>>>> > > >>>>> > > >>>>> - John Blum > > >>>>> > > >>>>> > > >>>>> On Oct. 5, 2015, 10:10 p.m., Jens Deppe wrote: > > >>>>>> > > >>>>>> ----------------------------------------------------------- > > >>>>>> This is an automatically generated e-mail. To reply, visit: > > >>>>>> https://reviews.apache.org/r/39023/ > > >>>>>> ----------------------------------------------------------- > > >>>>>> > > >>>>>> (Updated Oct. 5, 2015, 10:10 p.m.) > > >>>>>> > > >>>>>> > > >>>>>> Review request for geode and John Blum. > > >>>>>> > > >>>>>> > > >>>>>> Repository: geode > > >>>>>> > > >>>>>> > > >>>>>> Description > > >>>>>> ------- > > >>>>>> > > >>>>>> GEODE-381 enable gfsh https usage through SSL terminated > > >> environments > > >>>>>> > > >>>>>> > > >>>>>> Diffs > > >>>>>> ----- > > >>>>>> > > >>>>>> > > >>>>> > > >>>> > > >> > > > gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ShellCommands.java > > >>>>> 4bdab90ef905731c19568b0d7638ebb5bbe577bb > > >>>>>> > > >>>>> > > >>>> > > >> > > > gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/AbstractCommandsController.java > > >>>>> 73ce9265eb0f4d260b18919d3478738656fec073 > > >>>>>> > > >>>>> > > >>>> > > >> > > > gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/web/controllers/ShellCommandsController.java > > >>>>> ef4c49f1a5434cfae1e7fac2db3577cef7a0c834 > > >>>>>> gemfire-web/build.gradle b9629d30a66d70e9283987ab2db8d4bb2b2f08a1 > > >>>>>> > > >>>>> > > >>>> > > >> > > > gemfire-web/src/test/java/com/gemstone/gemfire/management/internal/web/controllers/ShellCommandsControllerJUnitTest.java > > >>>>> 34aa28589cf1c30dbf37abe1c17f92749dea835a > > >>>>>> > > >>>>>> Diff: https://reviews.apache.org/r/39023/diff/ > > >>>>>> > > >>>>>> > > >>>>>> Testing > > >>>>>> ------- > > >>>>>> > > >>>>>> Ran Management JUnit tests > > >>>>>> > > >>>>>> > > >>>>>> Thanks, > > >>>>>> > > >>>>>> Jens Deppe > > >>>>>> > > >>>>>> > > >>>>> > > >>>>> > > >>>> > > >>> > > >>> > > >> > > >> > > >> -- > > >> -John > > >> 503-504-8657 > > >> john.blum10101 (skype) > > >> > > > > > -- -John 503-504-8657 john.blum10101 (skype)
