Skip to content

Commit

Permalink
SONAR-22047 Remove deprecated SecurityManager code
Browse files Browse the repository at this point in the history
  • Loading branch information
alain-kermis-sonarsource authored and sonartech committed Jan 7, 2025
1 parent e54f99e commit ea8a3d0
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 417 deletions.

This file was deleted.

7 changes: 2 additions & 5 deletions server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.sonar.ce.logging.CeProcessLogging;
import org.sonar.process.MinimumViableSystem;
import org.sonar.process.Monitored;
import org.sonar.process.PluginSecurityManager;
import org.sonar.process.ProcessEntryPoint;
import org.sonar.process.Props;

Expand All @@ -56,8 +55,7 @@ public class CeServer implements Monitored {
private CeMainThread ceMainThread = null;

@VisibleForTesting
protected CeServer(ComputeEngine computeEngine, MinimumViableSystem mvs, CeSecurityManager securityManager) {
securityManager.apply();
protected CeServer(ComputeEngine computeEngine, MinimumViableSystem mvs) {
this.computeEngine = computeEngine;
mvs
.checkWritableTempDir()
Expand Down Expand Up @@ -121,8 +119,7 @@ public static void main(String[] args) {

CeServer server = new CeServer(
new ComputeEngineImpl(props, new ComputeEngineContainerImpl()),
new MinimumViableSystem(),
new CeSecurityManager(new PluginSecurityManager(), props));
new MinimumViableSystem());
entryPoint.launch(server);
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public class CeServerTest {
private CeServer underTest = null;
private Thread waitingThread = null;
private final MinimumViableSystem minimumViableSystem = mock(MinimumViableSystem.class, Mockito.RETURNS_MOCKS);
private final CeSecurityManager ceSecurityManager = mock(CeSecurityManager.class);

@After
public void tearDown() throws Exception {
Expand All @@ -76,12 +75,6 @@ public void constructor_does_not_start_a_new_Thread() {
assertThat(ceThreadExists()).isFalse();
}

@Test
public void constructor_calls_ceSecurityManager() {
newCeServer();
verify(ceSecurityManager).apply();
}

@Test
public void awaitStop_throws_ISE_if_called_before_start() {
CeServer ceServer = newCeServer();
Expand Down Expand Up @@ -269,7 +262,7 @@ private CeServer newCeServer() {

private CeServer newCeServer(ComputeEngine computeEngine) {
checkState(this.underTest == null, "Only one CeServer can be created per test method");
this.underTest = new CeServer(computeEngine, minimumViableSystem, ceSecurityManager);
this.underTest = new CeServer(computeEngine, minimumViableSystem);
return underTest;
}

Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit ea8a3d0

Please sign in to comment.