Groovy Documentation

## org.codehaus.groovy.grails.test
[Groovy] Class GrailsTestTargetPattern

    java.lang.Object
      org.codehaus.groovy.grails.test.GrailsTestTargetPattern

    class GrailsTestTargetPattern

A pattern passed to `grails test-app` that targets one or more tests and potentially a single method Examples:

- SomeController // filePattern: `**/SomeController`, classPattern: `SomeController`, methodName: `null`
- *Controller* // filePattern: `**/*Controller*`, classPattern: `*Controller*`, methodName: `null`
- SomeController.testSomeAction // filePattern: `**/SomeController`, classPattern: `SomeController`, methodName: `testSomeAction`
- org.SomeController // filePattern: `org/SomeController`, classPattern: `org.SomeController`, methodName: `null` Note: the interpretation of a target pattern is largely the responsibility of a test type.

  Property Summary
  `java.lang.String` | `classPattern` The target pattern as it applies to class names, without a methodName component
  `java.lang.String` | `filePattern` The target pattern as it applies to the file system (i.e. suitable for use with a PathMatchingResourcePatternResolver)
  `java.lang.String` | `methodName` The method name component if it is present
  `java.lang.String` | `rawPattern` The pattern, unchanged

  Constructor Summary
  `GrailsTestTargetPattern(java.lang.String pattern)`

  Method Summary
  `protected java.lang.Object` | `classPatternToFilePattern(java.lang.Object pattern)`
  `protected boolean` | `containsMethodName(java.lang.Object pattern)`
  `boolean` | `isMethodTargeting()`
  `boolean` | `matches(java.lang.String className, java.lang.String methodName, String[] suffixes)`
  `boolean` | `matchesClass(java.lang.String className, String[] suffixes)`
  `protected boolean` | `matchesClassWithExtension(java.lang.String className)`
  `protected boolean` | `matchesClassWithoutExtension(java.lang.String className, String[] suffixes)`
  `boolean` | `matchesMethod(java.lang.String methodName)`
  `java.lang.String` | `toString()`

  Methods inherited from class java.lang.Object
  java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

  Property Detail

  ### classPattern

      final java.lang.String classPattern

    The target pattern as it applies to class names, without a methodName component

  ### filePattern

      final java.lang.String filePattern

    The target pattern as it applies to the file system (i.e. suitable for use with a PathMatchingResourcePatternResolver)

  ### methodName

      final java.lang.String methodName

    The method name component if it is present

  ### rawPattern

      final java.lang.String rawPattern

    The pattern, unchanged

  Constructor Detail

  ### GrailsTestTargetPattern

      GrailsTestTargetPattern(java.lang.String pattern)

  Method Detail

  ### classPatternToFilePattern

      protected java.lang.Object classPatternToFilePattern(java.lang.Object pattern)

  ### containsMethodName

      protected boolean containsMethodName(java.lang.Object pattern)

  ### isMethodTargeting

      boolean isMethodTargeting()

  ### matches

      boolean matches(java.lang.String className, java.lang.String methodName, String[] suffixes)

  ### matchesClass

      boolean matchesClass(java.lang.String className, String[] suffixes)

  ### matchesClassWithExtension

      protected boolean matchesClassWithExtension(java.lang.String className)

  ### matchesClassWithoutExtension

      protected boolean matchesClassWithoutExtension(java.lang.String className, String[] suffixes)

  ### matchesMethod

      boolean matchesMethod(java.lang.String methodName)

  ### toString

      java.lang.String toString()

  Groovy Documentation