Changeset 11874 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/SequenceCommand.java
r11747 r11874 28 28 private final String name; 29 29 /** Determines if the sequence execution should continue after one of its commands fails. */ 30 public boolean continueOnError; 30 protected final boolean continueOnError; 31 32 /** 33 * Create the command by specifying the list of commands to execute. 34 * @param name The description text 35 * @param sequenz The sequence that should be executed 36 * @param continueOnError Determines if the sequence execution should continue after one of its commands fails 37 * @since 11874 38 */ 39 public SequenceCommand(String name, Collection<Command> sequenz, boolean continueOnError) { 40 this.name = name; 41 this.sequence = sequenz.toArray(new Command[sequenz.size()]); 42 this.continueOnError = continueOnError; 43 } 31 44 32 45 /** … … 36 49 */ 37 50 public SequenceCommand(String name, Collection<Command> sequenz) { 38 super(); 39 this.name = name; 40 this.sequence = sequenz.toArray(new Command[sequenz.size()]); 51 this(name, sequenz, false); 41 52 } 42 53 -
trunk/test/unit/org/openstreetmap/josm/command/SequenceCommandTest.java
r11734 r11874 122 122 FailingCommand command2 = new FailingCommand(); 123 123 TestCommand command3 = new TestCommand(null); 124 SequenceCommand command = new SequenceCommand("seq", Arrays.<Command>asList(command1, command2, command3)); 125 command.continueOnError = true; 124 SequenceCommand command = new SequenceCommand("seq", Arrays.<Command>asList(command1, command2, command3), true); 126 125 assertTrue(command.executeCommand()); 127 126 assertTrue(command1.executed);
Note:
See TracChangeset
for help on using the changeset viewer.