Skip to content

Commit 1e0f706

Browse files
committed
Revert "Fix Thread test to run test in additional threads"
This reverts commit 8918099.
1 parent 8918099 commit 1e0f706

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

jansi/src/test/java/org/fusesource/jansi/AnsiTest.java

+10-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2009-2018 the original author(s).
2+
* Copyright (C) 2009-2017 the original author(s).
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
1818
import org.fusesource.jansi.Ansi.Color;
1919
import org.junit.Test;
2020

21-
import static org.junit.Assert.*;
21+
import static org.junit.Assert.assertEquals;
2222

2323
/**
2424
* Tests for the {@link Ansi} class.
@@ -27,38 +27,26 @@
2727
*/
2828
public class AnsiTest {
2929
@Test
30-
public void testSetEnabled() throws InterruptedException {
31-
30+
public void testSetEnabled() throws Exception {
3231
Ansi.setEnabled(false);
33-
Thread threadDisabled = new Thread() {
32+
new Thread() {
3433
@Override
3534
public void run() {
36-
System.out.println(Ansi.ansi().fgRed().a("ANSI disabled").reset());
37-
assertFalse( Ansi.isEnabled() );
35+
assertEquals(false, Ansi.isEnabled());
3836
}
39-
};
37+
}.run();
4038

4139
Ansi.setEnabled(true);
42-
Thread threadEnabled =new Thread() {
40+
new Thread() {
4341
@Override
4442
public void run() {
45-
System.out.println(Ansi.ansi().fgBlue().a("ANSI enabled").reset());
46-
assertTrue( Ansi.isEnabled() );
43+
assertEquals(true, Ansi.isEnabled());
4744
}
48-
};
49-
50-
Ansi.setEnabled(false);
51-
System.out.println(Ansi.ansi().fgBlue().a("Ansi test thread start").reset());
52-
53-
threadDisabled.start();
54-
threadEnabled.start();
55-
56-
threadEnabled.join();
57-
threadDisabled.join();
45+
}.run();
5846
}
5947

6048
@Test
61-
public void testClone() {
49+
public void testClone() throws CloneNotSupportedException {
6250
Ansi ansi = Ansi.ansi().a("Some text").bg(Color.BLACK).fg(Color.WHITE);
6351
Ansi clone = new Ansi(ansi);
6452

0 commit comments

Comments
 (0)