id
stringlengths
36
36
text
stringlengths
1
1.25M
88f5bc9c-9103-4115-9993-f2be3d42e250
public static Font getFont(String name, int height, int style) { return getFont(name, height, style, false, false); }
9c652f4b-1883-471d-aecc-c0c60235f7aa
public static Font getFont(String name, int size, int style, boolean strikeout, boolean underline) { String fontName = name + '|' + size + '|' + style + '|' + strikeout + '|' + underline; Font font = m_fontMap.get(fontName); if (font == null) { FontData fontData = new FontData(name, size, style); if (strikeout || underline) { try { Class<?> logFontClass = Class.forName("org.eclipse.swt.internal.win32.LOGFONT"); //$NON-NLS-1$ Object logFont = FontData.class.getField("data").get(fontData); //$NON-NLS-1$ if (logFont != null && logFontClass != null) { if (strikeout) { logFontClass.getField("lfStrikeOut").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$ } if (underline) { logFontClass.getField("lfUnderline").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$ } } } catch (Throwable e) { System.err.println("Unable to set underline or strikeout" + " (probably on a non-Windows platform). " + e); //$NON-NLS-1$ //$NON-NLS-2$ } } font = new Font(Display.getCurrent(), fontData); m_fontMap.put(fontName, font); } return font; }
1c7964a6-9475-4085-8cbc-90b77cf576ff
public static Font getBoldFont(Font baseFont) { Font font = m_fontToBoldFontMap.get(baseFont); if (font == null) { FontData fontDatas[] = baseFont.getFontData(); FontData data = fontDatas[0]; font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD); m_fontToBoldFontMap.put(baseFont, font); } return font; }
a7947397-a8b0-4f85-8d88-763d4187f811
public static void disposeFonts() { // clear fonts for (Font font : m_fontMap.values()) { font.dispose(); } m_fontMap.clear(); // clear bold fonts for (Font font : m_fontToBoldFontMap.values()) { font.dispose(); } m_fontToBoldFontMap.clear(); }
66006e4b-0af2-4c18-8df9-05b5d2046152
public static Cursor getCursor(int id) { Integer key = Integer.valueOf(id); Cursor cursor = m_idToCursorMap.get(key); if (cursor == null) { cursor = new Cursor(Display.getDefault(), id); m_idToCursorMap.put(key, cursor); } return cursor; }
c5ceef7d-a4c3-4da6-8fe7-6c06833d9f86
public static void disposeCursors() { for (Cursor cursor : m_idToCursorMap.values()) { cursor.dispose(); } m_idToCursorMap.clear(); }
6ad2542c-e62b-4604-a527-10dfc877dfd3
public static void dispose() { disposeColors(); disposeImages(); disposeFonts(); disposeCursors(); }
b66a20ad-8190-4ff9-931a-2b1f06c006cc
@Test public void test() { TimeTrackerController controller = new TimeTrackerController(); assertNull(controller.getCurrentTask()); controller.setCurrentTask("foo"); assertNotNull(controller.getCurrentTask()); controller.getTime(); }
1b15688a-ab21-4026-a325-2ea22b4715d6
String format(Result result);
e899bfde-ae3c-4acd-8acf-45d4da6b3526
List<Rule> load() throws IOException, IllegalAccessException, InstantiationException;
2816b583-c32b-4596-9bd2-a26461d6a55b
String getContent();
8929d54b-679c-45f7-b15f-37ff61ecdfeb
Map<String, Object> getMetaDatas();
8eb1d6a1-8033-4ff4-b3ee-bbd3928b4a7a
Map<KeyPair<Entry, Rule>, Result> process(List<Entry> entries, List<Rule> rules);
e5af48cf-8f6f-4a41-afbd-9e437adb49f5
boolean stopAfterFirstError();
ca621ce8-f358-456d-b876-3d7028bbd790
boolean skipEmptyLines();
e1c35d40-3cbc-466e-920a-0856d2091443
int getSeverity();
b0e21d35-b9d7-4091-9841-6132162a3d9a
String getCode();
ca525255-6e12-45fc-a71e-cc9b22509913
String getDescription();
85f78a54-1797-46ee-8773-36a65955c484
String getPossibleResolution();
271dc87e-c69a-4efc-a2d6-276969d17575
boolean isErrorStatus();
0b859c41-16b7-43c5-9a36-dea86ba05e8c
Result apply(Entry entry);
719e0019-2322-47c1-829a-6c7c320fddd3
String getDescription();
7f4eb51f-e428-495a-b8c1-bf9ec223f145
long getPriority();
f0e0c6cf-c239-431d-bad0-480310b4df13
Status getStatus();
4662e614-b7bf-4021-a65d-21fca14c65e0
void setStatus(Status status);
2b4ef1fc-e47a-40d3-8fb8-d7f8fa705d8a
KeyPair<Entry, Rule> getEntryRuleKeyPair();
4921b2c8-5a2e-4f3c-ac5d-81cc70756145
void setEntryRuleKeyPair(KeyPair<Entry, Rule> entryRuleKeyPair);
dcf611ed-43ae-4793-982c-83b72d976d3d
boolean isError();
ad7bd2b4-29ba-4e94-b59a-95b35b620cef
First getFirst();
de741353-4de1-45a5-9259-279c52b6e122
Second getSecond();
be671425-ce48-421e-8a4c-fede4653ede4
public KeyPairImpl(First first, Second second) { checkNull(first, second); this.first = first; this.second = second; }
198d21e0-de09-4e1b-9771-85f8b4efaf4b
public First getFirst() { return first; }
c72cb04b-1e1b-4277-a358-d9a88a2eea03
public Second getSecond() { return second; }
66746d15-9be2-449a-a2cd-1ac039b3d488
private void checkNull(Object... os) { for (Object o : os) { if (o == null) { String message = "Argument must not be null"; if (LOG.isEnabledFor(Level.ERROR)) { LOG.error(message); } throw new IllegalArgumentException(message); } } }
e6830434-e6b0-46e6-bebe-f74d32ddf555
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; KeyPair keyPair = (KeyPairImpl) o; if (!first.equals(keyPair.getFirst())) return false; if (!second.equals(keyPair.getSecond())) return false; return true; }
b660ac35-b0d0-41d7-a545-ae522a1c48e4
@Override public int hashCode() { int result = first.hashCode(); result = 31 * result + second.hashCode(); return result; }
b0dd10bb-a7c6-421e-84df-356bac57420b
public DefaultResult(Status status, KeyPair<Entry, Rule> entryRuleKeyPair) { this.status = status; this.entryRuleKeyPair = entryRuleKeyPair; }
36df4dce-e2ca-4f63-8330-a36ef03da9d2
@Override public Status getStatus() { return status; }
2e0259c9-aa55-4e32-aa2f-2a1753ed2f54
@Override public void setStatus(Status status) { this.status = status; }
e2e1b706-a292-4e11-822b-b30f0a3642cb
@Override public KeyPair<Entry, Rule> getEntryRuleKeyPair() { return entryRuleKeyPair; }
dd00be5f-92fe-48b1-84c7-2fe2cd839299
@Override public void setEntryRuleKeyPair(KeyPair<Entry, Rule> entryRuleKeyPair) { this.entryRuleKeyPair = entryRuleKeyPair; }
be3f1ebe-79d7-4c3f-90d5-5d1fae55bdd3
@Override public boolean isError() { if(status == null) { return true; } return status.isErrorStatus(); }
22b627c3-bbbe-4c19-9017-a3a2df1dbc1a
@Override public boolean accept(File pathname) { return pathname.getName().endsWith(".groovy"); }
4bada8e1-9dfa-4bbc-aa0f-f1fd60f60eb5
public GroovyRulesLoader(File[] groovyClassDirectories) { this.groovyClassDirectories = groovyClassDirectories; }
9e8d7dd9-6dc2-4abd-8ce1-52120fe8ce22
@Override public List<Rule> load() throws IOException, IllegalAccessException, InstantiationException { GroovyClassLoader ccl = new GroovyClassLoader(getClass().getClassLoader()); List<Rule> rules = Lists.newArrayList(); for (File groovyClassDirectory : groovyClassDirectories) { for (File groovyScript : groovyClassDirectory.listFiles(GROOVY_SCRIPT_FILE_FILTER)) { Class groovyClass = ccl.parseClass(groovyScript); if (Rule.class.isAssignableFrom(groovyClass)) { Rule rule = (Rule) groovyClass.newInstance(); rule.setApplicationContext(context); rules.add(rule); } } } return rules; }
b7891470-6f45-4f18-997f-63c2f9d1e714
@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.context = applicationContext; }
ac808c19-4d8e-42b9-8ca7-7c27ad0414c0
@Override public String format(Result result) { StringBuilder sb = new StringBuilder(); KeyPair<Entry,Rule> entryRuleKeyPair = result.getEntryRuleKeyPair(); sb.append("Result for \n\tEntry (").append(entryRuleKeyPair.getFirst().toString()); sb.append("),\n\tRule (").append(entryRuleKeyPair.getSecond().getDescription()).append(")\n"); sb.append("\tStatus:\tseverity=").append(result.getStatus().getSeverity()).append("\n"); sb.append("\t\t\t\tdescription=").append(result.getStatus().getDescription()).append("\n"); sb.append("\t\t\t\tpossible resolution=").append(result.getStatus().getPossibleResolution()).append("\n"); return sb.toString(); }
8f4afc7c-a612-4414-a3f5-88dfe4125fe2
@Override public Map<KeyPair<Entry, Rule>, Result> process(List<Entry> entries, List<Rule> rules) { Map<KeyPair<Entry, Rule>, Result> results = Maps.newLinkedHashMap(); Collections.sort(rules); for (Entry entry : entries) { if(skipEmptyLines() && entry.getContent().isEmpty()) { continue; } for (Rule rule : rules) { Result result = rule.apply(entry); results.put(new KeyPairImpl<>(entry, rule), result); if(stopAfterFirstError() && result.isError()) { return results; } } } return results; }
5b6ffbd6-ab5c-4439-b6eb-62b7652bd938
@Override public boolean stopAfterFirstError() { return false; }
76b6ddf5-3590-44d4-8842-d8d68660bf88
@Override public boolean skipEmptyLines() { return true; }
5c603744-12ff-421f-86e7-77290ef83394
Item(double xgeo, double ygeo) { this.xgeo = xgeo; this.ygeo = ygeo; this.xymatrix = conversionGeoMatrix(xgeo, ygeo); this.xmatrix = xymatrix[0]; this.ymatrix = xymatrix[1]; //this.afficher(); }
38e763b0-78d2-4b33-9f42-aed5e608545a
Item(double xgeo, double ygeo, String property) { this.xgeo = xgeo; this.ygeo = ygeo; this.xymatrix = conversionGeoMatrix(xgeo, ygeo); this.xmatrix = xymatrix[0]; this.ymatrix = xymatrix[1]; this.property.add(property); //this.afficher(); }
a68452d5-7653-48fb-b233-d53bfd3d98d1
Item(Integer xmatrix, Integer ymatrix) { this.xymatrix[0] = xmatrix; this.xymatrix[1] = ymatrix; this.xmatrix = xymatrix[0]; this.ymatrix = xymatrix[1]; }
6d7e5b97-252f-4e51-982a-7502623050f6
Item(Integer xmatrix, Integer ymatrix, String property) { this.xmatrix = xmatrix; this.ymatrix = ymatrix; this.xymatrix[0] = xmatrix; this.xymatrix[1]=ymatrix; this.property.add(property); }
e8586903-0e33-4c9b-9aef-39d8f0561983
Item(Item item){ this.xgeo=item.getXgeo(); this.ygeo=item.getYgeo(); this.xmatrix=item.getXmatrix(); this.ymatrix=item.getYmatrix(); this.property.addAll(item.getProperty()); }
dac0d800-f11e-4cb9-9e09-071db1077e92
public Vector<String> getProperty() { return property; }
8a3a5cf6-d1da-4328-b86a-dd71a9c7d10b
public double getXgeo() { return xgeo; }
1ba30b84-5257-4f17-a3e6-d81ca61ee0dd
public double getYgeo() { return ygeo; }
d96190e4-8241-41e7-9989-345157f1fe26
public Integer getXmatrix() { return xmatrix; }
dbcf22f1-9ded-40d2-9c05-89d8489063aa
public Integer getYmatrix() { return ymatrix; }
4a3348a7-ca13-4c8e-a8b4-7a82ed221855
public Integer[] getXymatrix() { return xymatrix; }
cbed3264-b821-468d-946b-7a5da8c14fde
public Integer[] getCood() { return xymatrix; }
33d3cf34-79fe-4dd1-8036-ced7cdcea890
public void afficher() { System.out.println("GéoCoord:" + xgeo + "," + ygeo); System.out.println("MatCoord:" + xmatrix + "," + ymatrix); System.out.println("Properties:" + property.toString()); }
fab20492-6c23-42c6-a173-7b2a350ce5f2
public void alterProperties(String newproperty, boolean value) { if (value) {if (!this.property.contains(newproperty)) this.property.add(newproperty);} else this.property.add(newproperty); }
3701fe16-942b-48e8-9fc2-6e8afb3b6004
private Integer[] conversionGeoMatrix(double xgeo, double ygeo) { /* 51.100/-5.160/42.400/8.235 */ /*8700/13395-4465*/ Integer[] value = {0, 0}; Integer x = (int) (xgeo * 333); Integer y = (int) (ygeo * 1000); y -= 42400; x += 1720; value[0] = x; value[1] = y; return value; }
099699bd-3d27-4122-827d-d94f163e880e
maprender(Map carte){ this.carte=carte; }
fc3c7cbe-9a9d-4987-9265-b6f360114ad6
public void paintComponent(Graphics g){ try { Integer x0=788;//828; Integer y0=828; Integer jvar=300; Integer ivar=300; Integer xrapport=x0/(8700/ivar); Integer yrapport=y0/(4465/jvar); Image img = ImageIO.read(new File("map.png")); g.drawImage(img, 0, 0, this); //829x788 for(int j=0; j<4465; j=j+jvar) for(int i=0; i<8700; i=i+ivar){ int somme=0; Color colzone; for(int k=j; k<j+jvar; k++) for (int l=i; l<i+ivar; l++){ if (carte.getprop(l,k)>7) somme += 7; else somme +=carte.getprop(l,k); } int indice=somme/200; if(indice>255) indice=255; Integer x=(829*i)/8700; Integer y=y0-(j*788)/4465; if(indice>0){ colzone = new Color(indice,0,(255-indice),127); g.setColor(colzone); g.fillRect(x,y,xrapport,yrapport); }else if (indice==0){ colzone = new Color(255,255,255,127); g.setColor(colzone); g.fillRect(x,y,xrapport,yrapport); } } } catch (IOException e) { e.printStackTrace(); } }
2328d9ea-a808-4c7a-a4b7-e44757512ef4
public Integer getField() { return field; }
2396e14a-8a7e-4ac1-9053-e8e3d2063a94
public Vector<Item> getSetofitem() { return setofitem; }
df6cc3f8-a788-42b5-839a-0ad8de2f072f
Dataset(String namefile, Integer field) { typeof=namefile; this.field=field; this.setofitem.clear(); Create_dataset_fromfile(namefile); }
c51fd166-26da-49e0-b646-6dcda4c8a4fe
@Test private void Create_dataset_fromfile(String namefile) { String ext = namefile.substring(namefile.lastIndexOf(".")); if (ext.equals(".osm")) { try { File fXmlFile = new File(namefile); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(fXmlFile); doc.getDocumentElement().normalize(); NodeList nList = doc.getElementsByTagName("node"); for (int temp = 0; temp < nList.getLength(); temp++) { Node nNode = nList.item(temp); if (nNode.getNodeType() == Node.ELEMENT_NODE) { Element eElement = (Element) nNode; Double xgeo=new Double(eElement.getAttribute("lon")); Double ygeo=new Double(eElement.getAttribute("lat")); setofitem.add(new Item(xgeo, ygeo, namefile)); } } } catch (Exception e) { e.printStackTrace(); } } //assertFalse("Not yet implemented", ext.equals(".osm")); }
a6d6b6f9-b4ca-44cd-90ba-7f9a10f5bb8e
public Visualisation(Map carte){ this.setTitle("Rendu de carte"); this.setSize(830, 790); //829x788 this.setLocationRelativeTo(null); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setContentPane(new maprender(carte)); this.setVisible(true); }
3e6d1c06-3fba-4d1d-80ce-3c94ced676d1
private void AsciiOutput() { assertTrue("Not Implented Yet", true); }
7f946200-da9e-4517-883c-cf3634de0fc4
public static void main(String[] argv) throws IOException { Vector <Dataset> setofdata= new Vector<Dataset>(); setofdata.clear(); setofdata.add(new Dataset("master_hospital_soft.osm",3000)); setofdata.add(new Dataset("master_school_soft.osm",1000)); //setofdata.add(new Dataset("master_restaurant.osm",3000)); Map temp=new Map(setofdata); }
8fb08a0a-6d97-413f-ac60-db0506bcff40
public Integer getprop(Integer X, Integer Y){ if (Y>=4465 || Y<0 || X<0 || X>=8700) return 0; else{ //if (items[X][Y]!=null) items[X][Y].afficher(); if (items[X][Y]==null) return 0; else return items[X][Y].getProperty().size(); } }
f858a027-0859-4845-9480-49e5e5d24a3f
Map(Vector<Dataset> data){ for(int j=0; j<4465; j++) for(int i=0; i<8700; i++) items[i][j]=null; for(int i=0;i<data.size();i++){ for (int j=0; j<data.elementAt(i).getSetofitem().size(); j++){ DefineBorne(data.elementAt(i).getSetofitem().elementAt(j),data.elementAt(i).getField(),data.elementAt(i).typeof); } } }
0d269876-3e4a-40aa-955d-2af09814a4c9
private void DefineBorne(Item center, Integer distance, String Properties, boolean set) { Integer i, j; Integer[] xy = center.getCood(); Integer d = conversionMeterMatrix(distance); Integer[] borne_xy = {xy[0] - d - 1, xy[1] - d - 1, xy[0] + d + 1, xy[1] + d + 1}; if(borne_xy[0]<0) borne_xy[0]=0; if(borne_xy[1]<0) borne_xy[1]=0; if(borne_xy[2]>=8700) borne_xy[2]=8700; if(borne_xy[3]>=4465) borne_xy[3]=4465; for (i = borne_xy[0];i < borne_xy[2]; i++) { for (j = borne_xy[1]; j < borne_xy[3]; j++) { if (Math.sqrt(Math.pow(i - xy[0], 2) + Math.pow(j - xy[1], 2)) < d) { if( items[i][j] == null ) items[i][j]=new Item(i,j,Properties); else items[i][j].alterProperties(Properties, set); } } } }
986e04d3-11c7-42c5-8ebd-b31843814fcd
private void DefineBorne(Item center, Integer distance, String Properties) { DefineBorne(center, distance, Properties, true); }
e6e4cff8-1948-47a8-b897-19f22c0f119f
public Integer conversionMeterMatrix(Integer distance) { Integer d = (int) (distance * 4.034) / 300; return d; }
3772e3d9-f2e5-4973-bbb5-533344144fbd
@Before public void setUp() { this.block = new Block(); }
33db590a-fda4-4c77-8828-36962644e8c3
@Test public void testGetCells() { Cell[] cells = this.block.getCells(); assertNotNull(cells); assertEquals(9, cells.length); for (int i = 0; i < cells.length; i++) { Cell cell = cells[i]; assertNotNull(cell); } }
db247ba8-0bfb-4ba6-8479-68851af86f84
@Before public void setUp() { this.cell = new Cell(); }
1a83fefa-b120-4b40-bb5d-a45c319c4a39
@Test public void testCellCreatedEmpty() { assertEquals(Cell.Empty, this.cell.getValue()); }
a2e8901e-9a63-4bf7-b76a-83e0acdb84e3
@Test public void testGetValue() { int cellValue = this.cell.getValue(); assertEquals(Cell.Empty, cellValue); }
f878141a-796e-4686-af6d-734605f32310
@Test public void testSetValue() { for (int i = 1; i < 10; i++) { int target = i; this.cell.setValue(target); assertEquals(target, this.cell.getValue()); assertEquals(0, this.cell.getValuePossibilities().size()); } }
810d5314-78d8-4ffe-a72c-8b13a43968aa
@Test(expected=IllegalArgumentException.class) public void testSetInvalidValue() { this.cell.setValue(10); }
3df24669-5367-4310-8a81-9834d93cf458
@Test public void testSetEmptyValue() { this.cell.setValue(3); this.cell.setValue(Cell.Empty); assertEquals(Cell.Empty, this.cell.getValue()); assertEquals(9, this.cell.getValuePossibilities().size()); }
2b739d05-a3c9-4370-9271-387313f8ddeb
@Test public void testClearValue() { this.cell.setValue(3); this.cell.clearValue(); assertEquals(Cell.Empty, this.cell.getValue()); assertEquals(9, this.cell.getValuePossibilities().size()); }
3b03d9d7-c66b-4ee5-8e3e-2dfeebcf3881
@Test public void testGetBlock() { assertNull(this.cell.getBlock()); }
1dd44502-bb90-4d23-a80d-ffbdb44d3292
@Test public void testGetValuePossibilities() { ArrayList<Integer> valuePossibilites = this.cell.getValuePossibilities(); assertNotNull(valuePossibilites); assertEquals(9, valuePossibilites.size()); for (int i = 0; i < valuePossibilites.size(); i++) { int valuePossibility = valuePossibilites.get(i); assertEquals(i + 1, valuePossibility); } }
863f08e2-3fa9-423b-97c4-26cd6f62564e
@Test public void testAddValuePossibility() { for (int i = 1; i < 10; i++) { this.cell.addValuePossibility(i); assertEquals(9, this.cell.getValuePossibilities().size()); } }
19c23f2c-b072-4bf6-bbfd-cb849876a964
@Test(expected=IllegalArgumentException.class) public void testAddEmptyValuePossibility() { this.cell.addValuePossibility(Cell.Empty); }
e064211d-3385-43e9-9ba0-290ec3c19223
@Test(expected=IllegalArgumentException.class) public void testAddInvalidValuePossibility() { this.cell.addValuePossibility(10); }
edbc6d05-ae18-4d71-984f-7ebe2e475e56
@Test public void testRemoveValuePossibility() { for (int i = 1; i < 10; i++) { this.cell.removeValuePossibility(i); assertEquals(9 - i, this.cell.getValuePossibilities().size()); } }
0f31fcef-9fa7-4963-bdb4-43634879948e
@Test public void testRemoveValuePossibilityTwice() { this.cell.removeValuePossibility(3); this.cell.removeValuePossibility(3); }
8cabfd93-716b-4391-b37d-6c6534e3aa27
@Before public void setUp() { this.board = new Board(); }
e9e0800d-55cd-470f-80fd-7ba1ffad2db5
@Test public void testGetCells() { Block[] blocks = this.board.getBlocks(); Cell[][] cells = this.board.getCells(); assertNotNull(cells); Cell[] currentBlockCells = blocks[0].getCells(); assertSame(currentBlockCells[0], cells[0][0]); assertSame(currentBlockCells[1], cells[0][1]); assertSame(currentBlockCells[2], cells[0][2]); assertSame(currentBlockCells[3], cells[1][0]); assertSame(currentBlockCells[4], cells[1][1]); assertSame(currentBlockCells[5], cells[1][2]); assertSame(currentBlockCells[6], cells[2][0]); assertSame(currentBlockCells[7], cells[2][1]); assertSame(currentBlockCells[8], cells[2][2]); currentBlockCells = blocks[1].getCells(); assertSame(currentBlockCells[0], cells[0][3]); assertSame(currentBlockCells[1], cells[0][4]); assertSame(currentBlockCells[2], cells[0][5]); assertSame(currentBlockCells[3], cells[1][3]); assertSame(currentBlockCells[4], cells[1][4]); assertSame(currentBlockCells[5], cells[1][5]); assertSame(currentBlockCells[6], cells[2][3]); assertSame(currentBlockCells[7], cells[2][4]); assertSame(currentBlockCells[8], cells[2][5]); currentBlockCells = blocks[2].getCells(); assertSame(currentBlockCells[0], cells[0][6]); assertSame(currentBlockCells[1], cells[0][7]); assertSame(currentBlockCells[2], cells[0][8]); assertSame(currentBlockCells[3], cells[1][6]); assertSame(currentBlockCells[4], cells[1][7]); assertSame(currentBlockCells[5], cells[1][8]); assertSame(currentBlockCells[6], cells[2][6]); assertSame(currentBlockCells[7], cells[2][7]); assertSame(currentBlockCells[8], cells[2][8]); currentBlockCells = blocks[3].getCells(); assertSame(currentBlockCells[0], cells[3][0]); assertSame(currentBlockCells[1], cells[3][1]); assertSame(currentBlockCells[2], cells[3][2]); assertSame(currentBlockCells[3], cells[4][0]); assertSame(currentBlockCells[4], cells[4][1]); assertSame(currentBlockCells[5], cells[4][2]); assertSame(currentBlockCells[6], cells[5][0]); assertSame(currentBlockCells[7], cells[5][1]); assertSame(currentBlockCells[8], cells[5][2]); currentBlockCells = blocks[4].getCells(); assertSame(currentBlockCells[0], cells[3][3]); assertSame(currentBlockCells[1], cells[3][4]); assertSame(currentBlockCells[2], cells[3][5]); assertSame(currentBlockCells[3], cells[4][3]); assertSame(currentBlockCells[4], cells[4][4]); assertSame(currentBlockCells[5], cells[4][5]); assertSame(currentBlockCells[6], cells[5][3]); assertSame(currentBlockCells[7], cells[5][4]); assertSame(currentBlockCells[8], cells[5][5]); currentBlockCells = blocks[5].getCells(); assertSame(currentBlockCells[0], cells[3][6]); assertSame(currentBlockCells[1], cells[3][7]); assertSame(currentBlockCells[2], cells[3][8]); assertSame(currentBlockCells[3], cells[4][6]); assertSame(currentBlockCells[4], cells[4][7]); assertSame(currentBlockCells[5], cells[4][8]); assertSame(currentBlockCells[6], cells[5][6]); assertSame(currentBlockCells[7], cells[5][7]); assertSame(currentBlockCells[8], cells[5][8]); currentBlockCells = blocks[6].getCells(); assertSame(currentBlockCells[0], cells[6][0]); assertSame(currentBlockCells[1], cells[6][1]); assertSame(currentBlockCells[2], cells[6][2]); assertSame(currentBlockCells[3], cells[7][0]); assertSame(currentBlockCells[4], cells[7][1]); assertSame(currentBlockCells[5], cells[7][2]); assertSame(currentBlockCells[6], cells[8][0]); assertSame(currentBlockCells[7], cells[8][1]); assertSame(currentBlockCells[8], cells[8][2]); currentBlockCells = blocks[7].getCells(); assertSame(currentBlockCells[0], cells[6][3]); assertSame(currentBlockCells[1], cells[6][4]); assertSame(currentBlockCells[2], cells[6][5]); assertSame(currentBlockCells[3], cells[7][3]); assertSame(currentBlockCells[4], cells[7][4]); assertSame(currentBlockCells[5], cells[7][5]); assertSame(currentBlockCells[6], cells[8][3]); assertSame(currentBlockCells[7], cells[8][4]); assertSame(currentBlockCells[8], cells[8][5]); currentBlockCells = blocks[8].getCells(); assertSame(currentBlockCells[0], cells[6][6]); assertSame(currentBlockCells[1], cells[6][7]); assertSame(currentBlockCells[2], cells[6][8]); assertSame(currentBlockCells[3], cells[7][6]); assertSame(currentBlockCells[4], cells[7][7]); assertSame(currentBlockCells[5], cells[7][8]); assertSame(currentBlockCells[6], cells[8][6]); assertSame(currentBlockCells[7], cells[8][7]); assertSame(currentBlockCells[8], cells[8][8]); }
f17aa04c-ca45-473f-93a0-0ae26238734e
@Test public void testGetBlocks() { Block[] blocks = this.board.getBlocks(); assertNotNull(blocks); assertEquals(9, blocks.length); }
db2b7a51-2e31-4c7f-b3a8-899e79083d68
@Test public void testUpdateCellPosibilities() { fail("Not yet implemented"); }
5db36ec9-2523-4ea7-adb7-8c66f6de4ebd
public Block() { this.cells = new Cell[9]; for (int index = 0; index < this.cells.length; index++) { this.cells[index] = new Cell(); } }