Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

antichess
Class TestCylinder  view TestCylinder download TestCylinder.java

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byantichess.TestCylinder
All Implemented Interfaces:
junit.framework.Test

public class TestCylinder
extends junit.framework.TestCase

Tests the Cylindrical board


Field Summary
(package private)  java.lang.String testEndGameDir
           
(package private)  java.lang.String testEndGameFile
           
(package private)  java.lang.String testfilesDir
           
(package private)  java.lang.String testfilesFile
           
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
TestCylinder(java.lang.String name)
           
 
Method Summary
private  java.lang.String fileRead(java.lang.String filename, boolean readAll)
          This function only returns all text before the first ";" and sets comments to contain all text after the first ";"
private  java.util.List linesToSortedList(java.lang.String s)
          Converts a string of line into a List of sorted strings
protected  void setUp()
          Sets up the fixture, for example, open a network connection.
static junit.framework.Test suite()
           
 void testEndGame()
          Tests for end game conditions.
 void testIsValidMove()
          Tests if a move is valid.
 void testMakeMove()
          Tests making a move and updating of the board
 void testUndoMove()
          Tests undoing a move after making a move and updating of the board
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

testfilesFile

java.lang.String testfilesFile

testfilesDir

java.lang.String testfilesDir

testEndGameFile

java.lang.String testEndGameFile

testEndGameDir

java.lang.String testEndGameDir
Constructor Detail

TestCylinder

public TestCylinder(java.lang.String name)
Method Detail

linesToSortedList

private java.util.List linesToSortedList(java.lang.String s)
Converts a string of line into a List of sorted strings


fileRead

private java.lang.String fileRead(java.lang.String filename,
                                  boolean readAll)
This function only returns all text before the first ";" and sets comments to contain all text after the first ";"


setUp

protected void setUp()
Description copied from class: junit.framework.TestCase
Sets up the fixture, for example, open a network connection. This method is called before a test is executed.


testMakeMove

public void testMakeMove()
Tests making a move and updating of the board


testUndoMove

public void testUndoMove()
Tests undoing a move after making a move and updating of the board


testIsValidMove

public void testIsValidMove()
Tests if a move is valid. The move is specified after the first semicolon in the file, and ends with a second semicolon. The expected answer is true/false, and ends with a semicolon too;


testEndGame

public void testEndGame()
Tests for end game conditions. The first semicolon is the end of boardinfo in the file. The line after board info gives true/false ending with the second semicolon indicating if the game is over or not. The line after that is true/false indicating if the game is a draw or not, and ends with a third semicolon;


suite

public static junit.framework.Test suite()