Skip to content

Commit 35102c5

Browse files
authored
Merge pull request #15220 from dauer/issue-15205-docs-source-contains-license-header
2 parents 327efd6 + bcad958 commit 35102c5

File tree

16 files changed

+34
-13
lines changed

16 files changed

+34
-13
lines changed

grails-doc/src/en/guide/cache/cacheUsage/cacheConfiguration.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ supported options in the cache configuration.
4040
WARNING: Since there is no way to configure "time to live" with this plugin, all
4141
cached items have no timeout and remain cached until either the JVM restarts
4242
(since the backing store is in-memory) or the cache is partially or fully
43-
cleared (by calling a method or action annotated with \@CacheEvict or
43+
cleared (by calling a method or action annotated with @CacheEvict or
4444
programmatically).
4545

4646
If you don't need to supply any configuration to your cache, simply don't include it in the configuration.

grails-doc/src/en/guide/cache/cacheUsage/cacheUnitTests.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ include::{cacheExampleSourceDir}/grails-app/services/com/demo/BasicCachingServic
2929

3030
[source,groovy]
3131
----
32-
include::{cacheExampleSourceDir}/src/test/groovy/com/demo/BasicCachingServiceNoCacheManagerSpec.groovy[]
32+
include::{cacheExampleSourceDir}/src/test/groovy/com/demo/BasicCachingServiceNoCacheManagerSpec.groovy[tags=basic_declaration]
3333
----
3434

3535
In order for caching to be active when the unit test is running, cache manager
@@ -38,5 +38,5 @@ test.
3838

3939
[source,groovy]
4040
----
41-
include::{cacheExampleSourceDir}/src/test/groovy/com/demo/BasicCachingServiceSpec.groovy[]
41+
include::{cacheExampleSourceDir}/src/test/groovy/com/demo/BasicCachingServiceSpec.groovy[tags=basic_declaration]
4242
----

grails-doc/src/en/guide/testing/unitTesting/annotations.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ applied in conjunction with a fixture annnotation like `@Before` as shown below.
2727
[source,groovy]
2828
.src/test/groovy/grails/testing/spock/RunOnceSpec.groovy
2929
----
30-
include::{sourcedir}/grails-testing-support-core/src/test/groovy/grails/testing/spock/RunOnceSpec.groovy[indent=0]
30+
include::{sourcedir}/grails-testing-support-core/src/test/groovy/grails/testing/spock/RunOnceSpec.groovy[tags=basic_declaration,indent=0]
3131
----
3232

3333
Applying both the `@RunOnce` and `@Before` annotations to a method will yield
@@ -49,7 +49,7 @@ accomplishing the same behavior that would be accomplished by applying both the
4949
[source,groovy]
5050
.src/test/groovy/grails/testing/spock/OnceBeforeSpec.groovy
5151
----
52-
include::{sourcedir}/grails-testing-support-core/src/test/groovy/grails/testing/spock/OnceBeforeSpec.groovy[indent=0]
52+
include::{sourcedir}/grails-testing-support-core/src/test/groovy/grails/testing/spock/OnceBeforeSpec.groovy[tags=basic_declaration,indent=0]
5353
----
5454

5555
This is useful in the context of an integration test which wants to reference
@@ -58,5 +58,5 @@ dependency injected values during setup as shown below.
5858
[source,groovy]
5959
.src/integration-test/groovy/demo/DependencyInjectionSpec.groovy
6060
----
61-
include::{functionalSourceDir}/demo33/src/integration-test/groovy/demo/DependencyInjectionSpec.groovy[indent=0]
61+
include::{functionalSourceDir}/demo33/src/integration-test/groovy/demo/DependencyInjectionSpec.groovy[tags=basic_declaration,indent=0]
6262
----

grails-doc/src/en/guide/testing/unitTesting/unitTestingDomainClasses.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ trait to unit test single domain class.
2323
[source,groovy]
2424
.grails-app/domain/demo/Person.groovy
2525
----
26-
include::{functionalSourceDir}/demo33/grails-app/domain/demo/Person.groovy[indent=0]
26+
include::{functionalSourceDir}/demo33/grails-app/domain/demo/Person.groovy[tags=basic_declaration,indent=0]
2727
----
2828

2929
[source,groovy]
3030
.src/test/groovy/demo/PersonSpec.groovy
3131
----
32-
include::{functionalSourceDir}/demo33/src/test/groovy/demo/PersonSpec.groovy[indent=0]
32+
include::{functionalSourceDir}/demo33/src/test/groovy/demo/PersonSpec.groovy[tags=basic_declaration,indent=0]
3333
----
3434

3535
Alternatively, the link:{api}grails/testing/gorm/DataTest.html[`grails.testing.gorm.DataTest`]
@@ -42,7 +42,7 @@ test. This is useful when mocking more than one Domain class at a time to test p
4242
[source,groovy]
4343
.src/test/groovy/demo/DataTestTraitSpec.groovy
4444
----
45-
include::{functionalSourceDir}/demo33/src/test/groovy/demo/DataTestTraitSpec.groovy[indent=0]
45+
include::{functionalSourceDir}/demo33/src/test/groovy/demo/DataTestTraitSpec.groovy[tags=basic_declaration,indent=0]
4646
----
4747

4848
Another way to express which domain classes should be mocked for this test is
@@ -51,7 +51,7 @@ to provide a `Class[] getDomainClassesToMock()` method in the test.
5151
[source,groovy]
5252
.src/test/groovy/demo/GetDomainClassesToMockMethodSpec.groovy
5353
----
54-
include::{functionalSourceDir}/demo33/src/test/groovy/demo/GetDomainClassesToMockMethodSpec.groovy[indent=0]
54+
include::{functionalSourceDir}/demo33/src/test/groovy/demo/GetDomainClassesToMockMethodSpec.groovy[tags=basic_declaration,indent=0]
5555
----
5656

5757
When mocking domain classes in a test for another artifact type (like a
@@ -61,5 +61,5 @@ trait in order to mock the related domain classes.
6161
[source,groovy]
6262
.src/test/groovy/demo/PersonControllerSpec.groovy
6363
----
64-
include::{functionalSourceDir}/demo33/src/test/groovy/demo/PersonControllerSpec.groovy[indent=0]
64+
include::{functionalSourceDir}/demo33/src/test/groovy/demo/PersonControllerSpec.groovy[tags=basic_declaration,indent=0]
6565
----

grails-doc/src/en/guide/testing/unitTesting/unitTestingUrlMappings.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The examples assume the following mappings are being used.
2727

2828
[source,groovy]
2929
----
30-
include::{functionalSourceDir}/demo33/grails-app/controllers/demo/UrlMappings.groovy[indent=0]
30+
include::{functionalSourceDir}/demo33/grails-app/controllers/demo/UrlMappings.groovy[tags=basic_declaration,indent=0]
3131
----
3232

3333
=== Getting Started

grails-test-examples/cache/src/test/groovy/com/demo/BasicCachingServiceNoCacheManagerSpec.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* under the License.
1818
*/
1919

20+
// tag::basic_declaration[]
2021
package com.demo
2122

2223
import grails.testing.services.ServiceUnitTest
@@ -40,3 +41,4 @@ class BasicCachingServiceNoCacheManagerSpec extends Specification implements Ser
4041
service.invocationCounter == 2
4142
}
4243
}
44+
// end::basic_declaration[]

grails-test-examples/cache/src/test/groovy/com/demo/BasicCachingServiceSpec.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* under the License.
1818
*/
1919

20+
// tag::basic_declaration[]
2021
package com.demo
2122

2223
import grails.plugin.cache.CustomCacheKeyGenerator
@@ -78,3 +79,4 @@ class BasicCachingServiceSpec extends Specification implements ServiceUnitTest<B
7879
service.conditionalInvocationCounter == 3
7980
}
8081
}
82+
// end::basic_declaration[]

grails-test-examples/demo33/grails-app/controllers/demo/UrlMappings.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* under the License.
1818
*/
1919

20+
// tag::basic_declaration[]
2021
package demo
2122

2223
class UrlMappings {
@@ -37,3 +38,4 @@ class UrlMappings {
3738
"404"(view:'/notFound')
3839
}
3940
}
41+
// end::basic_declaration[]

grails-test-examples/demo33/grails-app/domain/demo/Person.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
19+
// tag::basic_declaration[]
2020
package demo
2121

2222
class Person {
2323
String firstName
2424
String lastName
2525
}
26+
// end::basic_declaration[]

grails-test-examples/demo33/src/integration-test/groovy/demo/DependencyInjectionSpec.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* under the License.
1818
*/
1919

20+
// tag::basic_declaration[]
2021
package demo
2122

2223
import grails.testing.mixin.integration.Integration
@@ -36,3 +37,4 @@ class DependencyInjectionSpec extends Specification {
3637
helperService != null
3738
}
3839
}
40+
// end::basic_declaration[]

0 commit comments

Comments
 (0)