Split app name and version in Capabilities.

To enhance capability matching and to select the latest version of the app to test if the
app version is not provided by the users. This enhancement still retains the backward 
compatibility when users specified an AUT as "appName:appVersion".

Signed-off-by: Binh Vu <bvu@paypal.com>
I see. I think we should either:

1. Send only one string, "com.example:1.0" or "com.example" and do the
parsing by splitting by ':'. That should be fairly easy.
or
2. Don't be backwards compatible and require clients to send two separate
strings: app ("com.example"), and optionally also version ("1.0").

The possibility to mix 1. and 2. by sending both app "com.example:1.0" and
version "2.0" is IMHO a confusing API.

I'm fine with either 1. or 2. If you chose 2. I can adapt our client to
send both the app and version.

On Wed, Dec 10, 2014 at 1:17 AM, Binh Vu <notifications@github.com> wrote:

> In
> selendroid-common/src/test/java/io/selendroid/common/SelendroidCapabilitiesSplitNameTest.java
> <https://github.com/selendroid/selendroid/pull/736#discussion-diff-21578065>
> :
>
> > +  @Test
> > +  public void testAutOriginal() throws Exception {
> > +    JSONObject jsonSource = new JSONObject();
> > +    jsonSource.put("aut", "io.selendroid.test:0.11.0");
> > +
> > +    SelendroidCapabilities capa = new SelendroidCapabilities(jsonSource);
> > +
> > +    String defaultApp = capa.getDefaultApp(keys);
> > +    Assert.assertEquals("io.selendroid.test:0.11.0", defaultApp);
> > +  }
> > +
> > +  @Test
> > +  public void testAutVersionBothDifferent() throws Exception {
> > +    JSONObject jsonSource = new JSONObject();
> > +    jsonSource.put("aut", "io.selendroid.test:0.11.0");
> > +    jsonSource.put("autVersion", "0.12.0");
>
> If the client is conformed to this format then I don't even need "version"
> from the SelednroidCapabilities, and it is much simpler in term of coding
> for me, also less unit test cases.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/selendroid/selendroid/pull/736/files#r21578065>.
>