Skip to content

Commit

Permalink
Changes for new fitnesse release
Browse files Browse the repository at this point in the history
  • Loading branch information
fhoeben committed Feb 26, 2015
1 parent 00068be commit 9f86716
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 45 deletions.
7 changes: 0 additions & 7 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Wiki symbols:
Slim tables:
- table template: scenario without need to define all parameters in first line
- storyboard: script which takes a 'screenshot' after each row
- template storyboard: 'table template' scenario where a 'screenshot' is taken for each row


This plugin is included in the FitNesse baseline installation of https://github.com/fhoeben/hsac-fitnesse-fixtures.
Expand All @@ -20,9 +19,3 @@ After starting that installation Wiki pages demonstrating the use of this plugin

To use this plugin in a 'plain vanilla' FitNesse installation:
- copy .jar it to $FITNESSE_HOME/plugins
- if there already is a $FITNESSE_HOME/plugins.properties and it contains a line starting with SymbolTypes
- add ", nl.hsac.fitnesse.symbols.MonthsFromToday, nl.hsac.fitnesse.symbols.WeekDaysFromToday, nl.hsac.fitnesse.symbols.RandomBsn, nl.hsac.fitnesse.symbols.RandomInt, nl.hsac.fitnesse.symbols.RandomString" to that line
- otherwise (create that file and) add the line: "SymbolTypes = nl.hsac.fitnesse.symbols.MonthsFromToday, nl.hsac.fitnesse.symbols.WeekDaysFromToday, nl.hsac.fitnesse.symbols.RandomBsn, nl.hsac.fitnesse.symbols.RandomInt, nl.hsac.fitnesse.symbols.RandomString"
- if there already is a line starting with SlimTables
- add ", table template:nl.hsac.fitnesse.slim.AutoArgScenarioTable, storyboard:nl.hsac.fitnesse.slim.StoryboardTable, template storyboard:nl.hsac.fitnesse.slim.StoryboardAutoArgScenarioTable"
- otherwise add the line: "SlimTables = table template:nl.hsac.fitnesse.slim.AutoArgScenarioTable, storyboard:nl.hsac.fitnesse.slim.StoryboardTable, template storyboard:nl.hsac.fitnesse.slim.StoryboardAutoArgScenarioTable"
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>nl.hsac</groupId>
<artifactId>hsac-fitnesse-plugin</artifactId>
<version>1.8.2</version>
<version>1.9.0</version>
<packaging>jar</packaging>
<url>https://github.com/fhoeben/hsac-fitnesse-plugin</url>

Expand All @@ -27,7 +27,7 @@
<dependency>
<groupId>org.fitnesse</groupId>
<artifactId>fitnesse</artifactId>
<version>20150114</version>
<version>20150226</version>
<scope>provided</scope>
</dependency>
<!-- Testing -->
Expand Down
44 changes: 44 additions & 0 deletions src/main/java/nl/hsac/fitnesse/HsacPluginFeatureFactory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package nl.hsac.fitnesse;

import fitnesse.plugins.PluginException;
import fitnesse.plugins.PluginFeatureFactoryBase;
import fitnesse.testsystems.slim.tables.SlimTable;
import fitnesse.testsystems.slim.tables.SlimTableFactory;
import fitnesse.wikitext.parser.SymbolProvider;
import fitnesse.wikitext.parser.SymbolType;
import nl.hsac.fitnesse.slim.AutoArgScenarioTable;
import nl.hsac.fitnesse.slim.StoryboardTable;
import nl.hsac.fitnesse.symbols.MonthsFromToday;
import nl.hsac.fitnesse.symbols.RandomBsn;
import nl.hsac.fitnesse.symbols.RandomInt;
import nl.hsac.fitnesse.symbols.RandomString;
import nl.hsac.fitnesse.symbols.WeekDaysFromToday;

public class HsacPluginFeatureFactory extends PluginFeatureFactoryBase {
@Override
public void registerSlimTables(SlimTableFactory slimTableFactory) throws PluginException {
super.registerSlimTables(slimTableFactory);
add(slimTableFactory, "table template", AutoArgScenarioTable.class);
add(slimTableFactory, "storyboard", StoryboardTable.class);
}

private void add(SlimTableFactory factory, String prefix, Class<? extends SlimTable> tableType) {
factory.addTableType(prefix, tableType);
LOG.info("Added Slim table type: " + prefix + ": " + tableType.getName());
}

@Override
public void registerSymbolTypes(SymbolProvider symbolProvider) throws PluginException {
super.registerSymbolTypes(symbolProvider);
add(symbolProvider, new MonthsFromToday());
add(symbolProvider, new WeekDaysFromToday());
add(symbolProvider, new RandomInt());
add(symbolProvider, new RandomString());
add(symbolProvider, new RandomBsn());
}

private void add(SymbolProvider provider, SymbolType symbolType) {
provider.add(symbolType);
LOG.info("Added symbol " + symbolType.getClass());
}
}
7 changes: 0 additions & 7 deletions src/main/java/nl/hsac/fitnesse/slim/AutoArgScenarioTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ protected void getScenarioArguments() {
}
}

private void addOutput(String argument) {
// if my pull request (https://github.com/unclebob/fitnesse/pull/592) gets
// merged output adding will have to be done that same as for input
// then this method can be deleted in this class
getOutputs().add(argument);
}

private Set<String> findArguments(Pattern pattern) {
Set<String> found = new LinkedHashSet<String>();
int rowCount = table.getRowCount();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nl.hsac.fitnesse.HsacPluginFeatureFactory

0 comments on commit 9f86716

Please sign in to comment.