• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

se-edu / addressbook-level4 / 4644
93%
master: 94%

Build:
Build:
LAST BUILD BRANCH: 453-result-message
DEFAULT BRANCH: master
Ran 09 Aug 2018 10:14AM UTC
Jobs 1
Files 90
Run time 6s
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

pending completion
4644

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

17 of 17 new or added lines in 8 files covered. (100.0%)

1430 of 1541 relevant lines covered (92.8%)

0.93 hits per line

Jobs
ID Job ID Ran Files Coverage
1 4644.1 09 Aug 2018 10:14AM UTC 0
92.8
Travis Job 4644.1
Source Files on build 4644
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #4644
  • Pull Request #898
  • PR Base - master (#4643)
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