Groovy Documentation

org.codehaus.groovy.grails.test.support
[Groovy] Class ControllerNameExtractor

java.lang.Object
  org.codehaus.groovy.grails.test.support.ControllerNameExtractor

class ControllerNameExtractor
extends java.lang.Object

Method Summary
static java.lang.String extractControllerNameFromTestClassName(java.lang.String testClassName, java.lang.String[] testClassSuffixes)

Derive the controller name from the given class name using the list of given suffixes, typically ['Test', 'Tests', 'Spec', 'Specification'].

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

Method Detail

extractControllerNameFromTestClassName

static java.lang.String extractControllerNameFromTestClassName(java.lang.String testClassName, java.lang.String[] testClassSuffixes)
Derive the controller name from the given class name using the list of given suffixes, typically ['Test', 'Tests', 'Spec', 'Specification']. Given something like 'com.triu.TheControllerSpec' -> 'the' 'TheControllerTests' -> 'the' 'TheControllerIntegrationTests' -> 'the' 'TheTests' -> null
Parameters:
testClassName
testClassSuffixes
Returns:
the controller name or null if nothing could be derived


 

Groovy Documentation