Skip to content

Commit

Permalink
run spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
awa-xima committed Jan 24, 2024
1 parent e392856 commit 6cdf737
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions testsrc/org/mozilla/javascript/tests/NativeRegExpTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;

import org.junit.Test;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.junit.Test;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;

public class NativeRegExpTest {

Expand Down Expand Up @@ -63,12 +61,16 @@ public void ignoreCase() throws Exception {
public void interruptLongRunningRegExpEvaluation() throws Exception {
ExecutorService executorService = Executors.newSingleThreadExecutor();
try {
Future<?> future = executorService.submit(() -> test("false", "/(.*){1,32000}[bc]/.test(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\");"));
Future<?> future =
executorService.submit(
() ->
test(
"false",
"/(.*){1,32000}[bc]/.test(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\");"));
assertThrows(TimeoutException.class, () -> future.get(1, TimeUnit.SECONDS));
executorService.shutdownNow();
assertTrue(executorService.awaitTermination(30, TimeUnit.SECONDS));
}
finally {
} finally {
executorService.shutdown();
}
}
Expand Down

0 comments on commit 6cdf737

Please sign in to comment.