GrailsTestTargetPattern (Grails 2.3.8)
Date: 2014-04-24

Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD

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

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

    @groovy.transform.CompileStatic
    class GrailsTestTargetPattern
    extends java.lang.Object

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.String pattern)`
  `protected boolean` | `containsMethodName(java.lang.String pattern)`
  `boolean` | `isMethodTargeting()`
  `boolean` | `matches(java.lang.String className, java.lang.String methodName, java.lang.String[] suffixes)`
  `boolean` | `matchesClass(java.lang.String className, java.lang.String[] suffixes)`
  `protected boolean` | `matchesClassWithExtension(java.lang.String className)`
  `protected boolean` | `matchesClassWithoutExtension(java.lang.String className, java.lang.String[] suffixes)`
  `boolean` | `matchesMethod(java.lang.String methodName)`
  `java.lang.String` | `toString()`

  Methods inherited from class java.lang.Object
  java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), 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.String pattern)

  ### containsMethodName

      protected boolean containsMethodName(java.lang.String pattern)

  ### isMethodTargeting

      boolean isMethodTargeting()

  ### matches

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

  ### matchesClass

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

  ### matchesClassWithExtension

      protected boolean matchesClassWithExtension(java.lang.String className)

  ### matchesClassWithoutExtension

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

  ### matchesMethod

      boolean matchesMethod(java.lang.String methodName)

  ### toString

      java.lang.String toString()

  Groovy Documentation