because extensions from plugins (including license-manager) are loaded at startup level
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.server.edition;
-
-import org.sonar.core.platform.Module;
-
-public class EditionManagementCommitModule extends Module {
- @Override
- protected void configureModule() {
- add(
- // TODO add cluster ready implementation when not running Standalone
- // Edition management WebServices also depend on this class
- StandaloneEditionManagementStateImpl.class,
- CommitPendingEditionOnStartup.class);
- }
-}
@Override
protected void configureModule() {
add(
+ StandaloneEditionManagementStateImpl.class,
StatusAction.class,
ApplyLicenseAction.class,
PreviewAction.class,
import org.sonar.api.utils.UriReader;
import org.sonar.core.util.DefaultHttpDownloader;
-import org.sonar.server.edition.EditionManagementCommitModule;
import org.sonar.server.organization.DefaultOrganizationProviderImpl;
import org.sonar.server.organization.OrganizationFlagsImpl;
import org.sonar.server.platform.ServerIdManager;
UriReader.class,
DefaultHttpDownloader.class,
DefaultOrganizationProviderImpl.class,
- OrganizationFlagsImpl.class,
- EditionManagementCommitModule.class);
+ OrganizationFlagsImpl.class);
}
}
package org.sonar.server.platform.platformlevel;
import org.sonar.server.app.ProcessCommandWrapper;
+import org.sonar.server.edition.CommitPendingEditionOnStartup;
import org.sonar.server.es.IndexerStartupTask;
import org.sonar.server.organization.DefaultOrganizationEnforcer;
import org.sonar.server.platform.ServerLifecycleNotifier;
add(GeneratePluginIndex.class,
RegisterPlugins.class,
ServerLifecycleNotifier.class,
- DefaultOrganizationEnforcer.class);
+ DefaultOrganizationEnforcer.class,
+ CommitPendingEditionOnStartup.class);
addIfStartupLeader(
IndexerStartupTask.class,
public ExpectedException expectedException = ExpectedException.none();
@Rule
public LogTester logTester = new LogTester()
- .setLevel(LoggerLevel.DEBUG);
+ .setLevel(LoggerLevel.DEBUG);
private MutableEditionManagementState editionManagementState = mock(MutableEditionManagementState.class);
private LicenseCommit licenseCommit = mock(LicenseCommit.class);
verifyZeroInteractions(licenseCommit);
assertThat(logTester.logs()).hasSize(1);
assertThat(logTester.logs(LoggerLevel.DEBUG))
- .containsOnly("No LicenseCommit instance is not available, can not finalize installation");
+ .containsOnly("No LicenseCommit instance is not available, can not finalize installation");
}
@Test
verifyZeroInteractions(licenseCommit);
assertThat(logTester.logs()).hasSize(1);
assertThat(logTester.logs(LoggerLevel.DEBUG))
- .containsOnly("No LicenseCommit instance is not available, can not finalize installation");
+ .containsOnly("No LicenseCommit instance is not available, can not finalize installation");
}
@Test
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.server.edition;
-
-import org.junit.Test;
-import org.sonar.core.platform.ComponentContainer;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.sonar.core.platform.ComponentContainer.COMPONENTS_IN_EMPTY_COMPONENT_CONTAINER;
-
-public class EditionManagementCommitModuleTest {
- private EditionManagementCommitModule underTest = new EditionManagementCommitModule();
-
- @Test
- public void verify_component_count() {
- ComponentContainer container = new ComponentContainer();
- underTest.configure(container);
-
- assertThat(container.getPicoContainer().getComponentAdapters())
- .hasSize(COMPONENTS_IN_EMPTY_COMPONENT_CONTAINER + 2);
- }
-
-}
underTest.configure(container);
assertThat(container.getPicoContainer().getComponentAdapters())
- .hasSize(COMPONENTS_IN_EMPTY_COMPONENT_CONTAINER + 7);
+ .hasSize(COMPONENTS_IN_EMPTY_COMPONENT_CONTAINER + 8);
}
}