public void testSimplePull()
throws Exception
{
// flush all potential changes
eventBus().post(new ConfigurationPrepareForSaveEvent(getApplicationConfiguration()));
eventBus().post(new ConfigurationCommitEvent(getApplicationConfiguration()));
// get hold on all registered reposes
Repository repo1 = getRepositoryRegistry().getRepository("repo1");
Repository repo2 = getRepositoryRegistry().getRepository("repo2");
Repository repo3 = getRepositoryRegistry().getRepository("repo3");
Repository inhouse = getRepositoryRegistry().getRepository("inhouse");
Repository inhouseSnapshot = getRepositoryRegistry().getRepository("inhouse-snapshot");
MavenGroupRepository test = getRepositoryRegistry().getRepositoryWithFacet("test", MavenGroupRepository.class);
// now change some of them
repo1.setLocalStatus(LocalStatus.OUT_OF_SERVICE);
repo3.setName("kuku");
test.setMergeMetadata(false);
// changes are not applied yet!
assertEquals("Should not be applied!", LocalStatus.IN_SERVICE, repo1.getLocalStatus());
assertEquals("Should not be applied!", "repo3", repo3.getName());
assertEquals("Should not be applied!", true, test.isMergeMetadata());
// fire prepareForSave event
ConfigurationPrepareForSaveEvent pevt = new ConfigurationPrepareForSaveEvent(getApplicationConfiguration());
eventBus().post(pevt);
assertFalse(pevt.isVetoed());
eventBus().post(new ConfigurationCommitEvent(getApplicationConfiguration()));
// changes are now applied!
assertEquals("Should be applied!", LocalStatus.OUT_OF_SERVICE, repo1.getLocalStatus());
assertEquals("Should be applied!", "kuku", repo3.getName());
assertEquals("Should be applied!", false, test.isMergeMetadata());