• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
Build has been canceled!

se-edu / addressbook-level4 / 4649 / 1
93%
master: 94%

Build:
Build:
LAST BUILD BRANCH: 453-result-message
DEFAULT BRANCH: master
Ran 13 Aug 2018 06:10AM UTC
Files 90
Run time 4s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Aug 2018 06:06AM UTC coverage: 92.797% (+0.05%) from 92.75%
4649.1

Pull #898

travis-ci

web-flow
Command: combine setData(...) and execute() together

To execute a command, (e.g. AddCommand), we need to

  1. Construct it:

         AddCommand addCommand = new AddCommand(person);

  2. Bind the model and command history to it:

         addCommand.setData(model, commandHistory);

  3. And then execute it:

         addCommand.execute();

However, there is no reason why step (2) and step (3) must be separate,
when it could just be:

    addCommand.execute(model, commandHistory);

In fact, it causes more trouble:

  * Since the model and commandHistory are stored as protected fields in
    the Command base class, many commands forget to handle them
    appropriately. For example, all commands don't consider the model
    and commandHistory in their `#equals(...)` methods, even though
    these fields are part of their state.

  * Many command tests need to introduce a helper `prepareCommand(...)`
    method to streamline the command "setData and execute" process.

So, let's fix this by combining Command#setData(...) and
Command#execute() together. We can then simplify all the command tests
by removing their `prepareCommand(...)` helper methods.
Pull Request #898: Combine Command#setData(...) and Command#execute() together

1430 of 1541 relevant lines covered (92.8%)

0.93 hits per line

Source Files on job 4649.1
  • Tree
  • List 0
  • Changed 15
  • Source Changed 15
  • Coverage Changed 15
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 4404
  • Travis Job 4649.1
  • 24a0492f on github
  • Prev Job for on command-stateless (#4643.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc