forked from unclebob/fitnesse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reintroduced public members of Fixture class for compatibility
- Loading branch information
1 parent
20d7ef4
commit 33d5e65
Showing
4 changed files
with
155 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright (C) 2013 by Object Mentor, Inc. All rights reserved. | ||
// Released under the terms of the CPL Common Public License version 1.0. | ||
package fit; | ||
|
||
import java.text.ParseException; | ||
|
||
import junit.framework.TestCase; | ||
|
||
|
||
public class DispatcherTest extends TestCase { | ||
@Override | ||
protected void setUp() throws Exception { | ||
super.setUp(); | ||
} | ||
|
||
@Override | ||
protected void tearDown() throws Exception { | ||
super.tearDown(); | ||
} | ||
|
||
public void testRelationalMatching() throws Exception { | ||
final String[][] table = { | ||
{"fitnesse.fixtures.ColumnFixtureTestFixture"}, | ||
{"input", "output?"}, | ||
{"1", "_>0"} | ||
}; | ||
Parse page = executeFixture(table); | ||
String colTwoResult = page.at(0, 2, 1).body; | ||
assertTrue(colTwoResult.contains("<b>1</b>>0")); | ||
String colTwoTag = page.at(0, 2, 1).tag; | ||
assertTrue(colTwoTag.contains("pass")); | ||
} | ||
|
||
public static Parse executeFixture(String[][] table) throws ParseException { | ||
String pageString = makeFixtureTable(table); | ||
Parse page = new Parse(pageString); | ||
Dispatcher dispatcher = new Dispatcher(); | ||
dispatcher.doTables(page); | ||
return page; | ||
} | ||
|
||
private static String makeFixtureTable(String table[][]) { | ||
StringBuffer buf = new StringBuffer(); | ||
buf.append("<table>\n"); | ||
for (int ri = 0; ri < table.length; ri++) { | ||
buf.append(" <tr>"); | ||
String[] row = table[ri]; | ||
for (int ci = 0; ci < row.length; ci++) { | ||
String cell = row[ci]; | ||
buf.append("<td>").append(cell).append("</td>"); | ||
} | ||
buf.append("</tr>\n"); | ||
} | ||
buf.append("</table>\n"); | ||
return buf.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters