Skip to content
Snippets Groups Projects

Routing v4: Rescue Mode

2 open threads

Based on !119 (merged), merge that first.

Edited by Ghost User

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 559 this.clock.setTime(TIME_IN_DISTANT_FUTURE);
    560 this.hostAttachedToApp.setLocation(new Coord(1, 1));
    561 DisasterData[] usefulData = new DisasterData[ITEMS_PER_MESSAGE];
    562 DisasterData[] uselessData = new DisasterData[ITEMS_PER_MESSAGE];
    563 for (int i = 0; i < ITEMS_PER_MESSAGE; i++) {
    564 usefulData[i] =
    565 DatabaseApplicationTest.createUsefulData(DisasterData.DataType.SKILL, this.hostAttachedToApp);
    566 uselessData[i] = new DisasterData(DisasterData.DataType.RESOURCE, 0, SimClock.getTime(), new Coord(0, 0));
    567 DisasterDataNotifier.dataCreated(this.hostAttachedToApp, usefulData[i]);
    568 DisasterDataNotifier.dataCreated(this.hostAttachedToApp, uselessData[i]);
    569 }
    570
    571 // Create messages.
    572 List<DataMessage> messages = floodingApp.wrapRecentUsefulDataIntoMessages(this.hostAttachedToApp, 1);
    573 TestCase.assertEquals(UNEXPECTED_NUMBER_DATA_MESSAGES, TWO_DATA_MESSAGES, messages.size());
    574 TestCase.assertTrue("Expected all useful data in one message.",
  • 125 }
    126
    127 public void testConstructorThrowsForPowerThresholdAbove1() {
    128 try {
    129 this.ts.setNameSpace(DisasterRouter.DISASTER_ROUTER_NS);
    130 this.ts.putSetting(DisasterRouter.POWER_THRESHOLD, Double.toString(VALUE_ABOVE_ONE));
    131 this.ts.restoreNameSpace();
    132
    133 new DisasterRouter(this.ts);
    134 fail();
    135 } catch (SettingsError e) {
    136 Assert.assertEquals("Expected different error.",
    137 "Power threshold should be in [0, 1], but is " + VALUE_ABOVE_ONE + "!", e.getMessage());
    138 }
    139 }
    140
  • Ghost User added 1 commit

    added 1 commit

    • 757658bf - Increase a test's readability.

    Compare with previous version

  • Ghost User added 2 commits

    added 2 commits

    Compare with previous version

  • Nils Weidmann mentioned in commit cdab6cf2

    mentioned in commit cdab6cf2

  • Please register or sign in to reply
    Loading