GrailsTestTargetPattern (Grails 2.4.4)
Date: 2014-10-28

Package: org.codehaus.groovy.grails.test

## [Groovy] Class GrailsTestTargetPattern

- org.codehaus.groovy.grails.test.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.

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `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

    Constructors
    Constructor and description
    `GrailsTestTargetPattern (java.lang.String pattern)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `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()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `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

    - #### final java.lang.String classPattern

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

    - #### final java.lang.String filePattern

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

    - #### final java.lang.String methodName

      The method name component if it is present

    - #### final java.lang.String rawPattern

      The pattern, unchanged

  - ### Constructor Detail

    - #### GrailsTestTargetPattern(java.lang.String pattern)

  - ### Method Detail

    - #### 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()