@Test public void testToBoard() { try { toBoard(null); } catch (final FENException e) { fail(e.toString()); } catch (final NullPointerException e) { } try { toBoard(""); } catch (final FENException e) { } try { toBoard("pppppppp/8/8/8/8/8/8/8/PPPPPPPP w - - 0 1"); } catch (final FENException e) { } try { toBoard("pppppppp/8/8/4P4/8/8/8/PPPPPPPP w - - 0 1"); } catch (final FENException e) { } try { toBoard("pppppppp/8/8/4Z3/8/8/8/PPPPPPPP w - - 0 1"); } catch (final FENException e) { } try { toBoard("pppppppp/8/8/8/8/8/8/PPPPPPPP ? - - 0 1"); } catch (final FENException e) { } try { toBoard("pppppppp/8/8/8/8/8/8/PPPPPPPP w KQkqKQ - 0 1"); } catch (final FENException e) { } try { toBoard("pppppppp/8/8/8/8/8/8/PPPPPPPP w DRdr - 0 1"); } catch (final FENException e) { } try { toBoard("pppppppp/8/8/8/8/8/8/PPPPPPPP w KQkq xe9 0 1"); } catch (final FENException e) { } try { toBoard("pppppppp/8/8/8/8/8/8/PPPPPPPP w KQkq e9 0 1"); } catch (final FENException e) { } try { toBoard("pppppppp/8/8/8/8/8/8/PPPPPPPP w KQkq - -1 1"); } catch (final FENException e) { } try { toBoard("pppppppp/8/8/8/8/8/8/PPPPPPPP w KQkq - ? 1"); } catch (final FENException e) { } try { toBoard("pppppppp/8/8/8/8/8/8/PPPPPPPP w KQkq - 0 0"); } catch (final FENException e) { } try { toBoard("pppppppp/8/8/8/8/8/8/PPPPPPPP w KQkq - 0 ?"); } catch (final FENException e) { } try { assertEquals(toBoard(STANDART_STARTING_FEN), BoardFactory.valueOf(ARRAY, STARTING)); assertEquals(toBoard(EMPTY_FEN), BoardFactory.valueOf(ARRAY, EMPTY)); } catch (final FENException e) { fail(e.toString()); } }
public static Board toBoard(final String pFEN) throws FENException { if (pFEN == null) { throw new NullPointerException("Missing FEN string"); } final String [] fields = pFEN.split(" "); if (fields.length != 6) { throw new FENException("Invalid FEN string [" + pFEN + ']', null); } final MutableBoard res = new MutableBoard(); parseFENPlacement(fields[0], res); parseFENActiveColor(fields[1], res); parseFENCastling(fields[2], res); parseFENEnPassant(fields[3], res); parseFENHalfmove(fields[4], res); parseFENFullmove(fields[5], res); return res; }
FENUtils { public static Board toBoard(final String pFEN) throws FENException { if (pFEN == null) { throw new NullPointerException("Missing FEN string"); } final String [] fields = pFEN.split(" "); if (fields.length != 6) { throw new FENException("Invalid FEN string [" + pFEN + ']', null); } final MutableBoard res = new MutableBoard(); parseFENPlacement(fields[0], res); parseFENActiveColor(fields[1], res); parseFENCastling(fields[2], res); parseFENEnPassant(fields[3], res); parseFENHalfmove(fields[4], res); parseFENFullmove(fields[5], res); return res; } }
FENUtils { public static Board toBoard(final String pFEN) throws FENException { if (pFEN == null) { throw new NullPointerException("Missing FEN string"); } final String [] fields = pFEN.split(" "); if (fields.length != 6) { throw new FENException("Invalid FEN string [" + pFEN + ']', null); } final MutableBoard res = new MutableBoard(); parseFENPlacement(fields[0], res); parseFENActiveColor(fields[1], res); parseFENCastling(fields[2], res); parseFENEnPassant(fields[3], res); parseFENHalfmove(fields[4], res); parseFENFullmove(fields[5], res); return res; } private  FENUtils(); }
FENUtils { public static Board toBoard(final String pFEN) throws FENException { if (pFEN == null) { throw new NullPointerException("Missing FEN string"); } final String [] fields = pFEN.split(" "); if (fields.length != 6) { throw new FENException("Invalid FEN string [" + pFEN + ']', null); } final MutableBoard res = new MutableBoard(); parseFENPlacement(fields[0], res); parseFENActiveColor(fields[1], res); parseFENCastling(fields[2], res); parseFENEnPassant(fields[3], res); parseFENHalfmove(fields[4], res); parseFENFullmove(fields[5], res); return res; } private  FENUtils(); static Board toBoard(final String pFEN); static String toFEN(final Board pEtat); static String toFENKey(final Board pEtat); }
FENUtils { public static Board toBoard(final String pFEN) throws FENException { if (pFEN == null) { throw new NullPointerException("Missing FEN string"); } final String [] fields = pFEN.split(" "); if (fields.length != 6) { throw new FENException("Invalid FEN string [" + pFEN + ']', null); } final MutableBoard res = new MutableBoard(); parseFENPlacement(fields[0], res); parseFENActiveColor(fields[1], res); parseFENCastling(fields[2], res); parseFENEnPassant(fields[3], res); parseFENHalfmove(fields[4], res); parseFENFullmove(fields[5], res); return res; } private  FENUtils(); static Board toBoard(final String pFEN); static String toFEN(final Board pEtat); static String toFENKey(final Board pEtat); static final String STANDART_STARTING_FEN; }