-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2664617
commit 6ebb8cf
Showing
11 changed files
with
155 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
== Testing Controllers With Traits | ||
|
||
== Controller | ||
|
||
[source,groovy] | ||
---- | ||
include::{projectdir}/3.3.x/grails-app/controllers/demo/DemoController.groovy[] | ||
---- | ||
|
||
== Command Object Unit Test | ||
|
||
[source,groovy] | ||
---- | ||
include::{projectdir}/3.3.x/src/test/groovy/demo/DemoControllerSpec.groovy[tags=class_begin;command_object_spec;class_end] | ||
---- | ||
|
||
== String Conversion Unit Test | ||
|
||
[source,yml] | ||
---- | ||
include::{projectdir}/3.3.x/grails-app/conf/application.yml[tags=string_conversion] | ||
---- | ||
|
||
[source,groovy] | ||
---- | ||
include::{projectdir}/3.3.x/src/test/groovy/demo/DemoControllerSpec.groovy[tags=class_begin;string_conversion_spec;class_end] | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
== Testing Domain Classes With Traits | ||
|
||
== Domain Class | ||
|
||
[source,groovy] | ||
---- | ||
include::{projectdir}/3.3.x/grails-app/domain/demo/Person.groovy[] | ||
---- | ||
|
||
== Domain Class Validation Unit Test | ||
|
||
[source,groovy] | ||
---- | ||
include::{projectdir}/3.3.x/src/test/groovy/demo/PersonSpec.groovy[tags=person_spec] | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
= Grails 3 Testing Overview | ||
Jeff Scott Brown <brownj@objectcomputing.com> - @jeffscottbrown | ||
:deckjs_transition: fade | ||
= Groovy And Grails Testing Techniques | ||
:deckjs_transition: horizontal-slide | ||
:navigation: | ||
:menu: | ||
:goto: | ||
:status: | ||
|
||
|
||
include::oci.adoc[] | ||
|
||
== Agenda | ||
|
||
* Domain Classes | ||
* Command Objects | ||
* Tag Libraries | ||
* Grails 3.3 Trait Based Testing Library | ||
* GEB | ||
* REST APIs | ||
* Running Tests | ||
|
||
|
@@ -24,6 +26,14 @@ include::services.adoc[] | |
|
||
include::tag_libraries.adoc[] | ||
|
||
include::domain_classes_traits.adoc[] | ||
|
||
include::controllers_traits.adoc[] | ||
|
||
include::services_traits.adoc[] | ||
|
||
include::tag_libraries_traits.adoc[] | ||
|
||
include::geb.adoc[] | ||
|
||
include::rest.adoc[] | ||
|
@@ -32,7 +42,7 @@ include::running_tests.adoc[] | |
|
||
== Thank you! | ||
|
||
* Slides and code : https://github.com/jeffbrown/testingdemo | ||
* Slides and code : https://github.com/jeffbrown/ggtesting | ||
* Jeff Scott Brown | ||
* [email protected] | ||
* @jeffscottbrown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,15 +11,17 @@ | |
|
||
* May 2015 | ||
** Jeff Brown and Graeme Rocher | ||
* May 2017 | ||
** 17 Full Time | ||
** 11 U.S. - 5 Europe - 1 Australia | ||
* November 2017 | ||
** 18 Full Time | ||
** 13 U.S. - 4 Europe - 1 Australia | ||
* We Need More | ||
** [email protected] | ||
|
||
|
||
== Grails At OCI | ||
|
||
* 30+ Releases Per Year | ||
** 2.5.x, 3.0.x, 3.1.x, 3.2.x | ||
** Working On 3.3 | ||
** 2.5.x, 3.0.x, 3.1.x, 3.2.x, 3.3.x | ||
** Shorter Release Cycles | ||
*** Easier To Upgrade | ||
*** Less Time To Wait For Enhancements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
== Testing Services With Traits | ||
|
||
== Services | ||
|
||
[source,groovy] | ||
---- | ||
include::{projectdir}/3.3.x/grails-app/services/demo/MoneyService.groovy[] | ||
---- | ||
|
||
[source,groovy] | ||
---- | ||
include::{projectdir}/3.3.x/grails-app/services/demo/BankService.groovy[] | ||
---- | ||
|
||
== Configuring Beans In Test | ||
|
||
[source,groovy] | ||
---- | ||
include::{projectdir}/3.3.x/src/test/groovy/demo/MoneyServiceSpec.groovy[] | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
== Testing Tag Libraries With Traits | ||
|
||
== Tag Library | ||
|
||
[source,groovy] | ||
---- | ||
include::{projectdir}/3.3.x/grails-app/taglib/demo/HelperTagLib.groovy[] | ||
---- | ||
|
||
== Testing Simple Tag | ||
|
||
[source,groovy] | ||
---- | ||
include::{projectdir}/3.3.x/src/test/groovy/demo/HelperTagLibSpec.groovy[tags=class_begin;test_simple_tag;class_end] | ||
---- | ||
|
||
== Testing Tag With Body | ||
|
||
[source,groovy] | ||
---- | ||
include::{projectdir}/3.3.x/src/test/groovy/demo/HelperTagLibSpec.groovy[tags=class_begin;test_repeat;class_end] | ||
---- | ||
|
||
== Testing Tag With Body | ||
|
||
[source,groovy] | ||
---- | ||
include::{projectdir}/3.3.x/src/test/groovy/demo/HelperTagLibSpec.groovy[tags=class_begin;test_repeat_no_count;class_end] | ||
---- | ||
|
||
== Testing Tag Method Call | ||
|
||
[source,groovy] | ||
---- | ||
include::{projectdir}/3.3.x/src/test/groovy/demo/HelperTagLibSpec.groovy[tags=class_begin;test_method_call;class_end] | ||
---- |