Enable plugins to create config stores for repository config

Therefore we have to
- add an API to create stores for repository ids, not only for
  repositories,
- make v1 properties available in scm-core
- make sure that properties are extracted from repositories before the
  update step of a plugin runs (this is done by sorting the update steps
  in a way so that "core" update steps are executed before plugin update
  steps with the same version)
This commit is contained in:
René Pfeuffer
2019-06-20 16:12:16 +02:00
parent d3b65ac3bd
commit 9581bf946b
29 changed files with 220 additions and 66 deletions

View File

@@ -32,7 +32,21 @@ class UpdateEngineTest {
updateEngine.update();
assertThat(processedUpdates)
.containsExactly("1.1.0", "1.1.1", "1.2.0");
.containsExactly("test:1.1.0", "test:1.1.1", "test:1.2.0");
}
@Test
void shouldProcessCoreStepsBeforeOther() {
LinkedHashSet<UpdateStep> updateSteps = new LinkedHashSet<>();
updateSteps.add(new FixedVersionUpdateStep("test", "1.2.0"));
updateSteps.add(new CoreFixedVersionUpdateStep("core", "1.2.0"));
UpdateEngine updateEngine = new UpdateEngine(updateSteps, storeFactory);
updateEngine.update();
assertThat(processedUpdates)
.containsExactly("core:1.2.0", "test:1.2.0");
}
@Test
@@ -67,7 +81,7 @@ class UpdateEngineTest {
updateEngine = new UpdateEngine(updateSteps, storeFactory);
updateEngine.update();
assertThat(processedUpdates).containsExactly("1.1.1");
assertThat(processedUpdates).containsExactly("other:1.1.1");
}
class FixedVersionUpdateStep implements UpdateStep {
@@ -91,7 +105,13 @@ class UpdateEngineTest {
@Override
public void doUpdate() {
processedUpdates.add(version);
processedUpdates.add(type + ":" + version);
}
}
class CoreFixedVersionUpdateStep extends FixedVersionUpdateStep implements CoreUpdateStep {
CoreFixedVersionUpdateStep(String type, String version) {
super(type, version);
}
}
}