Skip to content

Commit 058d3b2

Browse files
committed
move related classes, grails.plugin.geb should only be "business logic" (real override parts)
can be dropped
1 parent 459df1e commit 058d3b2

File tree

8 files changed

+16
-11
lines changed

8 files changed

+16
-11
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ By default, no test recording will be performed. Here are the system properties
7878

7979
To customize the naming convention for recording files:
8080

81-
1. Create a class that implements [`ContainerGebTestDescription`](./src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy).
82-
2. Specify its fully qualified class name in a `META-INF/services/grails.plugin.geb.ContainerGebTestDescription` file
81+
1. Create a class that implements [`ContainerGebTestDescription`](./src/testFixtures/groovy/grails/plugin/geb/serviceloader/ContainerGebTestDescription.groovy).
82+
2. Specify its fully qualified class name in a `META-INF/services/grails.plugin.geb.serviceloader.ContainerGebTestDescription` file
8383
on the classpath (e.g., `src/integration-test/resources`).
8484

8585
Once both conditions are met, the class is automatically loaded and replaces the default behavior. \
86-
You may extend the default implementation, [`DefaultContainerGebTestDescription`](./src/testFixtures/groovy/grails/plugin/geb/DefaultContainerGebTestDescription.groovy), as a base for your custom implementation.
86+
You may extend the default implementation, [`DefaultContainerGebTestDescription`](./src/testFixtures/groovy/grails/plugin/geb/serviceloader/DefaultContainerGebTestDescription.groovy), as a base for your custom implementation.
8787
To modify the naming convention, override at least the `getTestId()` method.
8888

89-
Optionally, in specific test classes, either call [`ContainerGebTestDescriptionServiceLoader.setInstance()`](./src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescriptionServiceLoader.groovy)
89+
Optionally, in specific test classes, either call [`ContainerGebTestDescriptionServiceLoader.setInstance()`](./src/testFixtures/groovy/grails/plugin/geb/serviceloader/ContainerGebTestDescriptionServiceLoader.groovy)
9090
in a Spock `setupSpec` method to apply your naming convention (And use a `cleanupSpec` to limit this to one class),
9191
or set the `testDescription` Property on your ContainerGebConfiguration annotation.
9292

spock-container-test-app/src/integration-test/groovy/org/demo/spock/ContainerGebTestDescriptionImpl.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.demo.spock
22

3-
import grails.plugin.geb.DefaultContainerGebTestDescription
3+
import grails.plugin.geb.serviceloader.DefaultContainerGebTestDescription
44
import groovy.transform.CompileStatic
55

66
@CompileStatic

src/testFixtures/groovy/grails/plugin/geb/ContainerGebConfiguration.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
package grails.plugin.geb
1717

18+
import grails.plugin.geb.serviceloader.ContainerGebTestDescription
19+
import grails.plugin.geb.serviceloader.NullContainerGebTestDescription
1820
import org.testcontainers.containers.GenericContainer
1921

2022
import java.lang.annotation.ElementType

src/testFixtures/groovy/grails/plugin/geb/GebRecordingTestListener.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package grails.plugin.geb
1717

18+
import grails.plugin.geb.serviceloader.ContainerGebTestDescription
1819
import grails.plugin.geb.serviceloader.ContainerGebTestDescriptionServiceLoader
1920
import groovy.transform.CompileStatic
2021
import org.spockframework.runtime.AbstractRunListener

src/testFixtures/groovy/grails/plugin/geb/WebDriverContainerHolder.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ import geb.Browser
2020
import geb.Configuration
2121
import geb.spock.SpockGebTestManagerBuilder
2222
import geb.test.GebTestManager
23+
import grails.plugin.geb.serviceloader.ContainerGebTestDescription
2324
import grails.plugin.geb.serviceloader.ContainerGebTestDescriptionServiceLoader
25+
import grails.plugin.geb.serviceloader.NullContainerGebTestDescription
2426
import groovy.transform.CompileStatic
2527
import groovy.transform.EqualsAndHashCode
2628
import groovy.transform.PackageScope

src/testFixtures/groovy/grails/plugin/geb/ContainerGebTestDescription.groovy renamed to src/testFixtures/groovy/grails/plugin/geb/serviceloader/ContainerGebTestDescription.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package grails.plugin.geb
16+
package grails.plugin.geb.serviceloader
1717

1818
import groovy.transform.CompileStatic
1919
import org.spockframework.runtime.model.ErrorInfo
@@ -26,7 +26,7 @@ import org.testcontainers.lifecycle.TestDescription
2626
* <p>
2727
* Implementations must provide a zero-argument constructor to ensure compatibility with {@link java.util.ServiceLoader}.
2828
*
29-
* @see GebRecordingTestListener
29+
* @see grails.plugin.geb.GebRecordingTestListener
3030
*/
3131
@CompileStatic
3232
interface ContainerGebTestDescription extends TestDescription {

src/testFixtures/groovy/grails/plugin/geb/serviceloader/ContainerGebTestDescriptionServiceLoader.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
*/
1616
package grails.plugin.geb.serviceloader
1717

18-
import grails.plugin.geb.ContainerGebTestDescription
19-
import grails.plugin.geb.DefaultContainerGebTestDescription
18+
2019
import groovy.transform.CompileStatic
2120

2221
/**

src/testFixtures/groovy/grails/plugin/geb/DefaultContainerGebTestDescription.groovy renamed to src/testFixtures/groovy/grails/plugin/geb/serviceloader/DefaultContainerGebTestDescription.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package grails.plugin.geb
16+
package grails.plugin.geb.serviceloader
17+
1718

1819
import groovy.transform.CompileStatic
1920
import org.spockframework.runtime.model.ErrorInfo
@@ -49,6 +50,6 @@ class DefaultContainerGebTestDescription implements ContainerGebTestDescription
4950
}
5051

5152
/**
52-
* Used by {@link ContainerGebConfiguration#testDescription()} interface to represent a null value.
53+
* Used by {@link grails.plugin.geb.ContainerGebConfiguration#testDescription()} interface to represent a null value.
5354
*/
5455
class NullContainerGebTestDescription extends DefaultContainerGebTestDescription {}

0 commit comments

Comments
 (0)