(Quick Reference)

3 Configuration options - Reference Documentation

Authors: Erik Pragt (jWorks.nl), Marcin Erdmann, John Engelman

Version: 2.0.3

3 Configuration options

The following describes the list of configuration options. As in the convention over configuration principle, these configurations are not necessary, but can be used to change the behavior of the plugin a litte.

Wiki options

The Wiki Server port

The Wiki contains all the test suites. It is an embedded HTTP server which by default is accessible on port 9090, but which can be changed if needed.

This can be done by setting the grails.plugin.wiki.port option. An example can be found below:

grails {
  plugin {
    wiki {
        port = 9090
    }
  }
}

The Wiki Server directory

The Wiki pages are stored in a specific directory, <project-root>/'wiki' by default.

This can be changed if needed, by setting the grails.plugin.fitnesse.wiki.dir option. An example can be found below:

grails {
  plugin {
    wiki {
      dir = 'otherwiki'
    }
  }
}

The default Wiki Suite or Test

When supplying no arguments to grails test-app, all tests on the Fronpage will be run.

This can be changed if needed, by setting the grails.plugin.fitnesse.wiki.defaultSuite option, which is a list of Suites or Tests. An example can be found below:

grails {
    plugin {
        fitnesse {
            wiki {
                defaultSuite = ["FrontPage.GrailsTestSuite.SlimTestSystem?suite"]
            }
        }
    }
}

It is also possible to supply the testsuite to run by passing it as an argument to grails test-app.

Note: see 'Integration testing' to see which option takes presedence over the other.

Slim Server options

Slim Server Port

The SlimServer opens ports and listens to a server socket. The default is 8085 and it cycles through the next 10 ports to avoid collisions. If 8085 is not a convenient port number for you, you can set the SLIM_PORT variable in the Fitnesse Wiki to any port you like. See for more information the Fitnesse User Guide.

Changing the port in the Fitnesse Wiki also requires a change in the plugin configuration to tell the plugin on which port to listen.

To change the port in the Grails application, you can set it in the Config.groovy. Add the following:

grails {
  plugin {
    fitnesse {
      slim {
        port = 8085
      }
    }
  }
}

Logging

To add more logging to the application, add the following to the log4j DSL:

debug  'nl.jworks.grails.plugin.fitnesse'

Verbose

To enable verbose logging, which outputs more information than normally needed, set the verbose value to true:

grails {
  plugin {
    fitnesse {
      slim {
        verbose = true
      }
    }
  }
}

Disable the plugin per environment

By default, the plugin is enabled for all environments, including production. However, it is possible to selectively disable the plugin per environment. This can be done by setting the grails.plugin.fitnesse.disabled option to true.

An example from Config.groovy which disables the plugin in production:

environments {
  production {
    grails {
      plugin {
        fitnesse {
          disabled = true
        }
      }
    }
  }
}