[refactoring][minor] Replaced all tabs with four spaces.

This commit is contained in:
North 2012-06-19 23:50:20 +03:00
parent e646e4768d
commit 239a4fb100
2891 changed files with 79411 additions and 79411 deletions

View file

@ -13,69 +13,69 @@ import org.junit.Ignore;
@Ignore
public class StartMultiGamesTest {
private final static Logger logger = Logger.getLogger(StartMultiGamesTest.class);
private final static Logger logger = Logger.getLogger(StartMultiGamesTest.class);
/**
* Amount of games to be started from this test.
*/
private final static Integer GAME_START_COUNT = 10;
private MageFrame frame = null;
private Object sync = new Object();
private MageUI ui;
/**
* Amount of games to be started from this test.
*/
private final static Integer GAME_START_COUNT = 10;
public static void main(String[] argv) throws Exception {
new StartMultiGamesTest().startMultiGames();
}
//@Test
public void testEmpty() {
}
public void startMultiGames() throws Exception {
for (int i = 0; i < GAME_START_COUNT; i++) {
logger.info("Starting game");
startGame();
}
}
private MageFrame frame = null;
private Object sync = new Object();
private MageUI ui;
private void startGame() throws Exception {
frame = null;
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
public void uncaughtException(Thread t, Throwable e) {
logger.fatal(null, e);
}
});
SwingUtilities.invokeLater(new Runnable() {
public void run() {
synchronized (sync) {
frame = new MageFrame();
frame.setVisible(true);
sync.notify();
}
}
});
synchronized (sync) {
if (frame == null) {
sync.wait();
}
ui = MageFrame.getUI();
ui.doClick(MageComponents.TABLES_MENU_BUTTON);
ui.doClick(MageComponents.NEW_GAME_BUTTON);
ui.doClick(MageComponents.NEW_TABLE_OK_BUTTON, 500);
ui.doClick(MageComponents.TABLE_WAITING_START_BUTTON);
}
public static void main(String[] argv) throws Exception {
new StartMultiGamesTest().startMultiGames();
}
sleep(3000);
frame.setVisible(false);
}
//@Test
public void testEmpty() {
private void sleep(int ms) {
try {
Thread.sleep(ms);
} catch (Exception e) {
e.printStackTrace();
}
}
}
public void startMultiGames() throws Exception {
for (int i = 0; i < GAME_START_COUNT; i++) {
logger.info("Starting game");
startGame();
}
}
private void startGame() throws Exception {
frame = null;
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
public void uncaughtException(Thread t, Throwable e) {
logger.fatal(null, e);
}
});
SwingUtilities.invokeLater(new Runnable() {
public void run() {
synchronized (sync) {
frame = new MageFrame();
frame.setVisible(true);
sync.notify();
}
}
});
synchronized (sync) {
if (frame == null) {
sync.wait();
}
ui = MageFrame.getUI();
ui.doClick(MageComponents.TABLES_MENU_BUTTON);
ui.doClick(MageComponents.NEW_GAME_BUTTON);
ui.doClick(MageComponents.NEW_TABLE_OK_BUTTON, 500);
ui.doClick(MageComponents.TABLE_WAITING_START_BUTTON);
}
sleep(3000);
frame.setVisible(false);
}
private void sleep(int ms) {
try {
Thread.sleep(ms);
} catch (Exception e) {
e.printStackTrace();
}
}
}