rhbz1110627 zanata init

https://bugzilla.redhat.com/show_bug.cgi?id=1110627
and https://bugzilla.redhat.com/show_bug.cgi?id=1038852

Depends on https://github.com/zanata/zanata-api/pull/15 and https://github.com/zanata/zanata-server/pull/520
I deliberately choose not to. Because mockito has a set of same methods (using hamcrest underneath). For tests definitely without mockito I will use static import. Otherwise leaving them like that. 

----- Original Message -----

> From: "David Mason" <notifications@github.com>
> To: "zanata/zanata-client" <zanata-client@noreply.github.com>
> Cc: "Patrick Huang" <pahuang@redhat.com>
> Sent: Friday, July 18, 2014 6:22:12 PM
> Subject: Re: [zanata-client] rhbz1110627 zanata init (#27)

> In
> zanata-client-commands/src/test/java/org/zanata/client/commands/init/ProjectConfigHandlerTest.java:
> > +                MockConsoleInteractiveable.getCapturedPrompts(console);
> > +        String lastMessage = capturedPrompts.get(capturedPrompts.size() -
> > 1);
> > +        assertThat(lastMessage,
> > +                Matchers.containsString("Old project config is renamed to
> > "));
> > +
> > +        String backupPath =
> > +                lastMessage.replace("Old project config is renamed to ",
> > "");
> > +        assertThat(new File(backupPath).exists(), Matchers.is(true));
> > +        assertThat(opts.getProj(), Matchers.nullValue());
> > +        assertThat(opts.getProjectVersion(), Matchers.nullValue());
> > +        assertThat(opts.getProjectType(), Matchers.nullValue());
> > +        assertThat(opts.getProjectConfig(), Matchers.nullValue());
> > +        assertThat(opts.getSrcDir(), Matchers.nullValue());
> > +        assertThat(opts.getTransDir(), Matchers.nullValue());
> > +        assertThat(opts.getIncludes(), Matchers.emptyIterable());
> > +        assertThat(opts.getExcludes(), Matchers.emptyIterable());

> All these matcher methods could be static imported to make this more
> readable.

> —
> Reply to this email directly or view it on GitHub .