}
}
- private void stopAwait() {
- stopAwait = true;
- Thread t = awaitThread.get();
- if (t != null) {
- t.interrupt();
- try {
- t.join(1000);
- } catch (InterruptedException e) {
- // Ignored
- }
- }
- }
-
private class CeMainThread extends Thread {
private static final int CHECK_FOR_STOP_DELAY = 50;
private volatile boolean stop = false;
// interrupt current thread in case its waiting for WebServer
interrupt();
}
+
+ private void stopAwait() {
+ stopAwait = true;
+ Thread t = awaitThread.get();
+ if (t != null) {
+ t.interrupt();
+ try {
+ t.join(1000);
+ } catch (InterruptedException e) {
+ // Ignored
+ }
+ }
+ }
}
}
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.junit.rules.TemporaryFolder;
import org.junit.rules.Timeout;
import org.mockito.Mockito;
import org.sonar.ce.ComputeEngine;
public Timeout timeout = Timeout.seconds(50);
@Rule
public ExpectedException expectedException = ExpectedException.none();
- @Rule
- public TemporaryFolder temp = new TemporaryFolder();
private CeServer underTest = null;
private Thread waitingThread = null;
* <ul>
* <li>First byte contains {@link #EMPTY} until process is UP and writes {@link #UP}</li>
* <li>Second byte contains {@link #EMPTY} until any process requests current one to stop by writing value {@link #STOP}</li>
- * <li>Third byte contains {@link #EMPTY} until any process requests current one to restart by writing value {@link #RESTART}. Process acknowledges restart by writing back {@link #EMPTY}</li>
- * <li>Fourth byte will always contain {@link #EMPTY} unless process declares that it is operational by writing {@link #OPERATIONAL}. This does not imply that is done starting.</li>
+ * <li>Third byte contains {@link #EMPTY} until any process requests current one to restart by writing value {@link #RESTART}.
+ * Process acknowledges restart by writing back {@link #EMPTY}</li>
+ * <li>Fourth byte will always contain {@link #EMPTY} unless process declares that it is operational by writing {@link #OPERATIONAL}.
+ * This does not imply that is done starting.</li>
* <li>The next 8 bytes contains a long (value of {@link System#currentTimeMillis()}) which represents the date of the last ping</li>
* </ul>
* </p>
private static final byte UP = (byte) 0x01;
private static final byte EMPTY = (byte) 0x00;
- //VisibleForTesting
+ // VisibleForTesting
final MappedByteBuffer mappedByteBuffer;
private final RandomAccessFile sharedMemory;
@Override
public CeTaskResult process(CeTask task) {
- throw new UnsupportedOperationException("process must not be called in WebServer");
+ throw new UnsupportedOperationException("process must not be called in WebServer");
}
}
stringBuilder.append(metric);
if (alertPeriod != null && !condition.getMetric().getKey().startsWith(VARIATION_METRIC_PREFIX)) {
- String variation = i18n.message(Locale.ENGLISH, VARIATION, VARIATION).toLowerCase();
+ String variation = i18n.message(Locale.ENGLISH, VARIATION, VARIATION).toLowerCase(Locale.ENGLISH);
stringBuilder.append(" ").append(variation);
}
import com.google.common.base.Optional;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
-import org.sonar.ce.taskprocessor.CeTaskProcessor;
-import org.sonar.core.util.logs.Profiler;
-import org.sonar.db.ce.CeActivityDto;
import org.sonar.ce.log.CeLogging;
-import org.sonar.ce.queue.CeQueue;
import org.sonar.ce.queue.CeTask;
import org.sonar.ce.queue.CeTaskResult;
+import org.sonar.ce.taskprocessor.CeTaskProcessor;
+import org.sonar.core.util.logs.Profiler;
+import org.sonar.db.ce.CeActivityDto;
import org.sonar.server.computation.queue.InternalCeQueue;
import static java.lang.String.format;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.junit.rules.TemporaryFolder;
import org.sonar.api.config.Settings;
import org.sonar.api.utils.log.LogTester;
import org.sonar.api.utils.log.LoggerLevel;
@Rule
public ExpectedException expectedException = ExpectedException.none();
@Rule
- public TemporaryFolder temp = new TemporaryFolder();
- @Rule
public LogTester logTester = new LogTester();
private Settings settings = new Settings();