コード例 #1
1
 public void testAddTwice() {
   DummyConfigurationItem item = new DummyConfigurationItem(_applied);
   _config.addConfigurationItem(item);
   _config.addConfigurationItem(item);
   _config.applyConfigurationItems(new MockServer());
   Assert.areEqual(1, item.prepareCount());
   assertListsAreEqual(Arrays.asList(item), _applied);
 }
コード例 #2
0
 public void testPrepareApply() {
   List<DummyConfigurationItem> items =
       Arrays.asList(new DummyConfigurationItem(_applied), new DummyConfigurationItem(_applied));
   for (DummyConfigurationItem item : items) {
     _config.addConfigurationItem(item);
     Assert.areEqual(1, item.prepareCount());
   }
   Assert.areEqual(0, _applied.size());
   _config.applyConfigurationItems(new MockServer());
   assertListsAreEqual(items, _applied);
   for (DummyConfigurationItem item : items) {
     Assert.areEqual(1, item.prepareCount());
   }
 }