[jbosstools-issues] [JBoss JIRA] (LOCUS-21) Add FestAssert to the TP
Max Rydahl Andersen (JIRA)
issues at jboss.org
Sat Mar 7 06:16:49 EST 2015
[ https://issues.jboss.org/browse/LOCUS-21?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Max Rydahl Andersen updated LOCUS-21:
-------------------------------------
Project: JBoss Tools Locus (was: Tools (JBoss Tools))
Key: LOCUS-21 (was: JBIDE-12972)
Affects Version/s: 1.0.0
(was: 4.0.0.Beta1)
Release Notes Text: (was: Replaced by JBIDE-19220 which is about adding AssertJ in the TP (FestAssert is not evolving, AssertJ is a fork/replacement))
Component/s: (was: target-platform)
Fix Version/s: (was: 4.2.x)
> Add FestAssert to the TP
> ------------------------
>
> Key: LOCUS-21
> URL: https://issues.jboss.org/browse/LOCUS-21
> Project: JBoss Tools Locus
> Issue Type: Feature Request
> Affects Versions: 1.0.0
> Reporter: Xavier Coulon
> Assignee: Xavier Coulon
> Priority: Minor
>
> It would be great if we could use in our tests. We would have to add it to our target platform (TP) for our plugins to use it.
> Reason: FestAssert provides us with a Fluent API to write test assertions.
> License and owner: Apache License 2.0 / http://code.google.com/p/fest/
> Original repository: (not an Eclipse bundle yet). Source and binaries available on Maven (https://repository.jboss.org/nexus/content/groups/public/org/easytesting/fest-assert/1.4/ and https://repository.jboss.org/nexus/content/groups/public/org/easytesting/fest-util/1.1.6/)
> JBoss Mirrored repository: http://downloads.jboss.org/jbosstools/updates/requirements/fest-assert ?
> Source: https://github.com/alexruiz/fest-assert-1.x
> Affected projects: LiveReload for now, JAX-RS in the future
> Required in devstudio: No for now (if LiveReload is considered incubation)
> Type of dependency: testing
> List of bundles added/removed: fest-assert, fest-util
> Fest-assert provides a fluent API to perform asertions in JUnit tests. It is also nice to use when the objects to tests are collections.
> To convince you of the interest of fest-assert, here are a few syntax examples:
> - In LiveReload-test plugin:
> {code}
> assertThat(new String(modifiedContent)).doesNotContain(addition + "</body>");
> {code}
> - a more complete example of usage in openShift-java-client (not an Eclipse plugin, though, but it gives an idea of the chained assertions that can be performed)
> {code}
> assertThat(new GearGroupsAssert(gearGroups))
> .assertGroup(0).hasUUID().hasGears()
> .assertGear(0).hasId().hasState();
> {code}
> - in case of assertion failure on such a statement:
> {code}
> Assertions.assertThat(commands).hasSize(2);
> {code}
> the exception message will look like this:
> {code}
> java.lang.AssertionError: expected size:<2> but was:<1> for <['{"command":"reload","path":null,"liveCSS":true}']>
> at org.fest.assertions.Fail.failure(Fail.java:228)
> at org.fest.assertions.Assert.failure(Assert.java:149)
> at org.fest.assertions.GroupAssert.hasSize(GroupAssert.java:89)
> at org.jboss.tools.livereload.internal.service.LiveReloadCommandGeneratorTestCase.shouldGenerateCommandForIndexHtmlFileAfterSingleChange(LiveReloadCommandGeneratorTestCase.java:45)
> at ...
> {code}
> See more examples here: http://code.google.com/p/fest/#Fluent_Assertions
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
More information about the jbosstools-issues
mailing list