├── integrationTests ├── config │ ├── firefox-profile │ │ ├── .parentlock │ │ ├── cert8.db │ │ └── cert_override.txt │ ├── self-signed-certificate │ │ ├── cert │ │ ├── keystore │ │ └── properties │ └── gebConfig │ │ └── GebConfig.groovy ├── grettyLogging_logback │ ├── .gitignore │ ├── README.md │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── webapp │ │ │ └── WEB-INF │ │ │ │ └── web.xml │ │ └── resources │ │ │ └── logback.xml │ │ └── integrationTest │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── examples │ │ └── gretty │ │ └── PageSpec.groovy ├── helloJersey │ ├── gradle.properties │ ├── src │ │ └── main │ │ │ ├── webapp │ │ │ └── WEB-INF │ │ │ │ └── filter.groovy │ │ │ └── java │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── hellojersey │ │ │ ├── TestResource.java │ │ │ └── JerseyApp.java │ ├── README.md │ └── build.gradle ├── farmSecure │ ├── security │ │ ├── jetty-realm.properties │ │ └── tomcat-users.xml │ ├── MyWebApp │ │ ├── src │ │ │ └── main │ │ │ │ └── webapp │ │ │ │ ├── WEB-INF │ │ │ │ └── filter.groovy │ │ │ │ ├── images │ │ │ │ └── photo.jpg │ │ │ │ ├── css │ │ │ │ └── default.css │ │ │ │ └── js │ │ │ │ └── functions.js │ │ └── build.gradle │ ├── MyWebService │ │ └── build.gradle │ └── README.md ├── helloGrettySecure │ ├── security │ │ ├── jetty-realm.properties │ │ └── tomcat-users.xml │ ├── src │ │ └── main │ │ │ ├── webapp │ │ │ ├── WEB-INF │ │ │ │ └── filter.groovy │ │ │ ├── images │ │ │ │ └── photo.jpg │ │ │ ├── css │ │ │ │ └── default.css │ │ │ └── content │ │ │ │ └── index.html │ │ │ └── resources │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── hellogretty │ │ │ └── templates │ │ │ └── servletpage.html │ ├── README.md │ └── build.gradle ├── spring-boot-farm-secure │ ├── security │ │ ├── jetty-realm.properties │ │ └── tomcat-users.xml │ ├── spring-boot-app │ │ ├── src │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ └── logback.groovy │ │ │ │ ├── webapp │ │ │ │ ├── WEB-INF │ │ │ │ │ └── filter.groovy │ │ │ │ ├── images │ │ │ │ │ └── photo.jpg │ │ │ │ ├── css │ │ │ │ │ └── default.css │ │ │ │ └── js │ │ │ │ │ └── functions.js │ │ │ │ └── groovy │ │ │ │ └── org │ │ │ │ └── akhikhl │ │ │ │ └── examples │ │ │ │ └── gretty │ │ │ │ └── springbootapp │ │ │ │ └── Application.groovy │ │ └── build.gradle │ ├── jee-webservice │ │ └── build.gradle │ └── spring-boot-webservice │ │ ├── build.gradle │ │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ └── web.xml │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── examples │ │ └── gretty │ │ └── springbootwebservice │ │ ├── MyController.groovy │ │ └── Application.groovy ├── buildSrc │ ├── settings.gradle │ ├── gretty-integrationTest │ │ ├── src │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ ├── META-INF │ │ │ │ │ └── gradle-plugins │ │ │ │ │ │ ├── org.akhikhl.gretty.internal.integrationTests.BasePlugin.properties │ │ │ │ │ │ ├── org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin.properties │ │ │ │ │ │ └── org.akhikhl.gretty.internal.integrationTests.FarmIntegrationTestPlugin.properties │ │ │ │ └── org │ │ │ │ │ └── akhikhl │ │ │ │ │ └── gretty │ │ │ │ │ └── internal │ │ │ │ │ └── integrationTests │ │ │ │ │ └── project.properties │ │ │ │ └── groovy │ │ │ │ └── org │ │ │ │ └── akhikhl │ │ │ │ └── gretty │ │ │ │ └── internal │ │ │ │ └── integrationTests │ │ │ │ └── ProjectProperties.groovy │ │ └── build.gradle │ └── gradle.properties ├── webhost │ ├── src │ │ └── main │ │ │ └── webapp │ │ │ └── WEB-INF │ │ │ ├── filter.groovy │ │ │ └── web.xml │ ├── README.md │ └── build.gradle ├── filterWebapp │ ├── src │ │ ├── main │ │ │ └── webapp │ │ │ │ ├── WEB-INF │ │ │ │ └── filter.groovy │ │ │ │ ├── css │ │ │ │ └── default.css │ │ │ │ └── index.html │ │ └── integrationTest │ │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── hellogretty │ │ │ └── PageSpec.groovy │ ├── build.gradle │ └── README.md ├── helloGretty │ ├── src │ │ ├── main │ │ │ ├── webapp │ │ │ │ ├── WEB-INF │ │ │ │ │ └── filter.groovy │ │ │ │ ├── css │ │ │ │ │ └── default.css │ │ │ │ └── index.html │ │ │ └── resources │ │ │ │ └── org │ │ │ │ └── akhikhl │ │ │ │ └── examples │ │ │ │ └── gretty │ │ │ │ └── hellogretty │ │ │ │ └── templates │ │ │ │ └── servletpage.html │ │ └── integrationTest │ │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── hellogretty │ │ │ └── PageSpec.groovy │ ├── README.md │ └── build.gradle ├── farm │ ├── MyWebApp │ │ ├── src │ │ │ ├── main │ │ │ │ └── webapp │ │ │ │ │ ├── WEB-INF │ │ │ │ │ ├── filter.groovy │ │ │ │ │ └── web.xml │ │ │ │ │ ├── css │ │ │ │ │ └── default.css │ │ │ │ │ └── js │ │ │ │ │ └── functions.js │ │ │ └── integrationTest │ │ │ │ └── groovy │ │ │ │ └── org │ │ │ │ └── akhikhl │ │ │ │ └── examples │ │ │ │ └── gretty │ │ │ │ └── mywebapp │ │ │ │ └── WebAppSpec.groovy │ │ └── build.gradle │ ├── MyWebService │ │ ├── build.gradle │ │ └── src │ │ │ ├── main │ │ │ └── webapp │ │ │ │ └── WEB-INF │ │ │ │ └── web.xml │ │ │ └── integrationTest │ │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── mywebservice │ │ │ └── WebServiceSpec.groovy │ └── README.md ├── jacocoExample │ ├── src │ │ ├── main │ │ │ ├── webapp │ │ │ │ ├── WEB-INF │ │ │ │ │ └── filter.groovy │ │ │ │ ├── css │ │ │ │ │ └── default.css │ │ │ │ └── index.html │ │ │ └── resources │ │ │ │ └── org │ │ │ │ └── akhikhl │ │ │ │ └── examples │ │ │ │ └── gretty │ │ │ │ └── hellogretty │ │ │ │ └── templates │ │ │ │ └── servletpage.html │ │ └── integrationTest │ │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── hellogretty │ │ │ └── PageSpec.groovy │ └── README.md ├── spring-boot-farm │ ├── spring-boot-app │ │ ├── src │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ └── logback.groovy │ │ │ │ ├── webapp │ │ │ │ ├── WEB-INF │ │ │ │ │ ├── filter.groovy │ │ │ │ │ └── web.xml │ │ │ │ └── css │ │ │ │ │ └── default.css │ │ │ │ └── groovy │ │ │ │ └── org │ │ │ │ └── akhikhl │ │ │ │ └── examples │ │ │ │ └── gretty │ │ │ │ └── springbootapp │ │ │ │ └── Application.groovy │ │ └── build.gradle │ ├── jee-webservice │ │ ├── build.gradle │ │ └── src │ │ │ ├── main │ │ │ └── webapp │ │ │ │ └── WEB-INF │ │ │ │ └── web.xml │ │ │ └── integrationTest │ │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── mywebservice │ │ │ └── RequestResponseIT.groovy │ ├── spring-boot-webservice1 │ │ ├── build.gradle │ │ └── src │ │ │ ├── main │ │ │ └── groovy │ │ │ │ └── org │ │ │ │ └── akhikhl │ │ │ │ └── examples │ │ │ │ └── gretty │ │ │ │ └── springbootwebservice1 │ │ │ │ ├── MyController.groovy │ │ │ │ └── Application.groovy │ │ │ └── integrationTest │ │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── springbootwebservice1 │ │ │ └── RequestResponseIT.groovy │ └── spring-boot-webservice2 │ │ ├── build.gradle │ │ └── src │ │ ├── main │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── springbootwebservice2 │ │ │ ├── MyController.groovy │ │ │ └── Application.groovy │ │ └── integrationTest │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── examples │ │ └── gretty │ │ └── springbootwebservice2 │ │ └── RequestResponseIT.groovy ├── testAnnotations │ ├── src │ │ ├── main │ │ │ ├── webapp │ │ │ │ ├── WEB-INF │ │ │ │ │ ├── filter.groovy │ │ │ │ │ └── web.xml │ │ │ │ └── css │ │ │ │ │ └── default.css │ │ │ └── resources │ │ │ │ └── org │ │ │ │ └── akhikhl │ │ │ │ └── examples │ │ │ │ └── gretty │ │ │ │ └── hellogretty │ │ │ │ └── templates │ │ │ │ └── servletpage.html │ │ └── integrationTest │ │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── hellogretty │ │ │ └── PageSpec.groovy │ ├── README.md │ └── build.gradle ├── testInitParameter │ ├── src │ │ └── main │ │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ └── filter.groovy │ │ │ ├── css │ │ │ └── default.css │ │ │ └── index.html │ ├── README.md │ └── build.gradle ├── extraResourceBases │ ├── src │ │ └── main │ │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ └── filter.groovy │ │ │ └── css │ │ │ └── default.css │ └── build.gradle ├── farmJacoco │ ├── MyWebApp │ │ └── src │ │ │ ├── main │ │ │ └── webapp │ │ │ │ ├── WEB-INF │ │ │ │ ├── filter.groovy │ │ │ │ └── web.xml │ │ │ │ ├── css │ │ │ │ └── default.css │ │ │ │ └── js │ │ │ │ └── functions.js │ │ │ └── integrationTest │ │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── mywebapp │ │ │ └── WebAppSpec.groovy │ ├── README.md │ └── MyWebService │ │ ├── src │ │ ├── main │ │ │ └── webapp │ │ │ │ └── WEB-INF │ │ │ │ └── web.xml │ │ └── integrationTest │ │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── mywebservice │ │ │ └── WebServiceSpec.groovy │ │ └── build.gradle ├── jacocoInstantiateTasks │ ├── src │ │ ├── main │ │ │ ├── webapp │ │ │ │ ├── WEB-INF │ │ │ │ │ └── filter.groovy │ │ │ │ ├── css │ │ │ │ │ └── default.css │ │ │ │ └── index.html │ │ │ └── resources │ │ │ │ └── org │ │ │ │ └── akhikhl │ │ │ │ └── examples │ │ │ │ └── gretty │ │ │ │ └── hellogretty │ │ │ │ └── templates │ │ │ │ └── servletpage.html │ │ └── integrationTest │ │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── hellogretty │ │ │ └── PageSpec.groovy │ └── README.md ├── multifarm │ ├── MyWebApp │ │ ├── src │ │ │ ├── main │ │ │ │ └── webapp │ │ │ │ │ ├── WEB-INF │ │ │ │ │ ├── filter.groovy │ │ │ │ │ └── web.xml │ │ │ │ │ ├── css │ │ │ │ │ └── default.css │ │ │ │ │ └── js │ │ │ │ │ └── functions.js │ │ │ └── integrationTest │ │ │ │ └── groovy │ │ │ │ └── org │ │ │ │ └── akhikhl │ │ │ │ └── examples │ │ │ │ └── gretty │ │ │ │ └── mywebapp │ │ │ │ └── WebAppSpec.groovy │ │ └── build.gradle │ ├── MyWebApp2 │ │ ├── src │ │ │ ├── main │ │ │ │ └── webapp │ │ │ │ │ ├── WEB-INF │ │ │ │ │ ├── filter.groovy │ │ │ │ │ └── web.xml │ │ │ │ │ ├── css │ │ │ │ │ └── default.css │ │ │ │ │ └── js │ │ │ │ │ └── functions.js │ │ │ └── integrationTest │ │ │ │ └── groovy │ │ │ │ └── org │ │ │ │ └── akhikhl │ │ │ │ └── examples │ │ │ │ └── gretty │ │ │ │ └── mywebapp │ │ │ │ └── WebAppSpec.groovy │ │ └── build.gradle │ ├── MyWebService │ │ ├── build.gradle │ │ └── src │ │ │ ├── main │ │ │ └── webapp │ │ │ │ └── WEB-INF │ │ │ │ └── web.xml │ │ │ └── integrationTest │ │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── mywebservice │ │ │ └── WebServiceSpec.groovy │ ├── MyWebService2 │ │ ├── build.gradle │ │ └── src │ │ │ ├── main │ │ │ └── webapp │ │ │ │ └── WEB-INF │ │ │ │ └── web.xml │ │ │ └── integrationTest │ │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── mywebservice │ │ │ └── WebServiceSpec.groovy │ ├── AllFarms │ │ └── build.gradle │ └── README.md ├── spring-boot-simple │ ├── src │ │ └── main │ │ │ ├── webapp │ │ │ ├── WEB-INF │ │ │ │ ├── filter.groovy │ │ │ │ └── web.xml │ │ │ ├── css │ │ │ │ └── default.css │ │ │ └── js │ │ │ │ └── functions.js │ │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── logback.groovy │ │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── springbootsimple │ │ │ ├── MyController.groovy │ │ │ └── Application.groovy │ ├── README.md │ └── build.gradle ├── testJettyContextConfig │ ├── src │ │ └── main │ │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ ├── filter.groovy │ │ │ └── jetty-env.xml │ │ │ └── css │ │ │ └── default.css │ ├── README.md │ └── build.gradle ├── testJettyServerConfig │ ├── src │ │ └── main │ │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ └── filter.groovy │ │ │ └── css │ │ │ └── default.css │ ├── README.md │ ├── build.gradle │ └── jetty │ │ ├── jetty.xml │ │ ├── jetty7.xml │ │ └── jetty8.xml ├── testTomcatServerConfig │ ├── src │ │ ├── main │ │ │ ├── webapp │ │ │ │ ├── WEB-INF │ │ │ │ │ └── filter.groovy │ │ │ │ ├── css │ │ │ │ │ └── default.css │ │ │ │ └── index.html │ │ │ └── resources │ │ │ │ └── org │ │ │ │ └── akhikhl │ │ │ │ └── examples │ │ │ │ └── gretty │ │ │ │ └── hellogretty │ │ │ │ └── templates │ │ │ │ └── servletpage.html │ │ └── integrationTest │ │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── hellogretty │ │ │ └── RequestResponseIT.groovy │ ├── README.md │ └── build.gradle ├── testTomcatContextConfig │ ├── src │ │ ├── main │ │ │ └── webapp │ │ │ │ ├── WEB-INF │ │ │ │ └── filter.groovy │ │ │ │ ├── META-INF │ │ │ │ └── context.xml │ │ │ │ ├── css │ │ │ │ └── default.css │ │ │ │ └── index.html │ │ └── integrationTest │ │ │ └── groovy │ │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── hellogretty │ │ │ └── RequestResponseIT.groovy │ ├── README.md │ └── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gretty-taglib-example │ ├── README.md │ ├── build.gradle │ └── src │ │ ├── main │ │ └── webapp │ │ │ └── WEB-INF │ │ │ └── web.xml │ │ └── integrationTest │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── examples │ │ └── gretty │ │ └── CheckIfWebInfLibsNotEmptySpec.groovy ├── gradle.properties ├── webfragment │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── META-INF │ │ │ ├── resources │ │ │ └── images │ │ │ │ └── webfragment.png │ │ │ └── web-fragment.xml │ └── build.gradle ├── helloGrettyOverlay │ ├── README.md │ └── build.gradle ├── testAnnotationsOverlay │ ├── README.md │ ├── build.gradle │ └── src │ │ └── integrationTest │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── examples │ │ └── gretty │ │ └── hellogretty │ │ └── PageSpec.groovy ├── websocket │ ├── build.gradle │ └── src │ │ └── main │ │ ├── webapp │ │ ├── js │ │ │ └── index.js │ │ └── index.html │ │ └── resources │ │ └── logback.groovy ├── springBootWebSocket │ ├── build.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── akhikhl │ │ │ └── examples │ │ │ └── gretty │ │ │ └── springbootwebsocket │ │ │ ├── HelloMessage.java │ │ │ ├── Greeting.java │ │ │ ├── GreetingController.java │ │ │ └── Application.java │ │ └── resources │ │ └── logback.groovy ├── testDuplicatingResources │ ├── build.gradle │ └── src │ │ ├── main │ │ └── webapp │ │ │ └── WEB-INF │ │ │ └── web.xml │ │ └── integrationTest │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── examples │ │ └── gretty │ │ └── CheckIfWebInfLibsNotEmpty.groovy ├── testWar │ └── build.gradle └── testDependency │ └── src │ └── integrationTest │ └── groovy │ └── org │ └── akhikhl │ └── examples │ └── gretty │ └── hellogretty │ └── PageSpec.groovy ├── .gitignore ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── libs ├── gretty │ └── src │ │ └── main │ │ ├── resources │ │ ├── META-INF │ │ │ └── gradle-plugins │ │ │ │ └── org.akhikhl.gretty.properties │ │ └── logback-config-template │ │ │ └── logback.groovy │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── gretty │ │ ├── FarmWebappType.groovy │ │ ├── AppRedeployTask.groovy │ │ ├── JacocoHelper.groovy │ │ ├── AppStopTask.groovy │ │ ├── AppRestartTask.groovy │ │ ├── FarmStopTask.groovy │ │ ├── FarmRestartTask.groovy │ │ ├── GrettyStartTask.groovy │ │ ├── FileReloadSpec.groovy │ │ ├── GrettyServiceTask.groovy │ │ ├── JettyStartTask.groovy │ │ ├── TomcatStartTask.groovy │ │ ├── FarmsExtension.groovy │ │ ├── ScannerManager.groovy │ │ ├── JettyStopTask.groovy │ │ ├── ProductsExtension.groovy │ │ ├── JettyRestartTask.groovy │ │ ├── JettyServiceTask.groovy │ │ ├── JettyAfterIntegrationTestTask.groovy │ │ ├── JettyBeforeIntegrationTestTask.groovy │ │ └── GrettyExtension.groovy ├── gretty-runner-jetty │ ├── build.gradle │ └── src │ │ └── main │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── gretty │ │ ├── BaseResourceConfiguration.groovy │ │ └── ServerManagerFactory.groovy ├── gretty-starter │ ├── build.gradle │ └── src │ │ └── main │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── gretty │ │ └── PlatformUtils.groovy ├── gretty-spock │ └── build.gradle ├── gretty-runner │ ├── build.gradle │ └── src │ │ └── main │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── gretty │ │ ├── ServerStartEvent.groovy │ │ ├── ServerDefaults.groovy │ │ ├── ServerManager.groovy │ │ └── WebappUtils.groovy ├── gretty-runner-tomcat7 │ └── build.gradle ├── gretty-springboot │ ├── build.gradle │ └── src │ │ └── main │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── gretty │ │ └── AppServletInitializer.java ├── gretty-core │ └── src │ │ └── main │ │ ├── groovy │ │ └── org │ │ │ └── akhikhl │ │ │ └── gretty │ │ │ ├── StartConfig.groovy │ │ │ ├── WebAppClassPathResolver.groovy │ │ │ ├── Launcher.groovy │ │ │ ├── LauncherConfig.groovy │ │ │ ├── FarmsConfig.groovy │ │ │ └── Externalized.groovy │ │ └── resources │ │ └── org │ │ └── akhikhl │ │ └── gretty │ │ └── Externalized.properties ├── gretty-filter │ └── build.gradle ├── gretty-runner-tomcat │ ├── build.gradle │ └── src │ │ └── main │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── gretty │ │ ├── ServerManagerFactory.groovy │ │ └── TomcatConfigurer.groovy ├── gretty-runner-jetty8 │ ├── build.gradle │ └── src │ │ └── main │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── gretty │ │ └── LifeCycleListenerAdapter.java ├── gretty-runner-jetty7 │ ├── build.gradle │ └── src │ │ └── main │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── gretty │ │ └── LifeCycleListenerAdapter.java ├── gretty-runner-tomcat8 │ └── build.gradle ├── gretty-runner-jetty9 │ ├── build.gradle │ └── src │ │ └── main │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── gretty │ │ └── LifeCycleListenerAdapter.java ├── gretty-runner-jetty93 │ ├── build.gradle │ └── src │ │ └── main │ │ └── groovy │ │ └── org │ │ └── akhikhl │ │ └── gretty │ │ └── LifeCycleListenerAdapter.java └── gretty-runner-jetty94 │ ├── build.gradle │ └── src │ └── main │ └── groovy │ └── org │ └── akhikhl │ └── gretty │ └── LifeCycleListenerAdapter.java ├── pluginScripts ├── gretty.plugin ├── gretty-1.3.0.plugin ├── gretty-1.4.0.plugin ├── gretty-1.4.1.plugin ├── gretty-1.4.2.plugin ├── gretty-2.0.0.plugin ├── gretty-1.1.0.plugin ├── gretty-1.1.1.plugin ├── gretty-1.1.2.plugin ├── gretty-1.1.3.plugin ├── gretty-1.1.4.plugin ├── gretty-1.1.5.plugin ├── gretty-1.1.6.plugin ├── gretty-1.1.7.plugin ├── gretty-1.1.8.plugin ├── gretty-1.1.9.plugin ├── gretty-1.2.0.plugin ├── gretty-1.2.1.plugin ├── gretty-1.2.2.plugin ├── gretty-1.2.3.plugin ├── gretty-1.2.4.plugin ├── gretty-1.2.5.plugin └── gretty-SNAPSHOT.plugin ├── CONTRIBUTORS ├── settings.gradle ├── gradle.properties └── LICENSE /integrationTests/config/firefox-profile/.parentlock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /integrationTests/grettyLogging_logback/.gitignore: -------------------------------------------------------------------------------- 1 | logs 2 | -------------------------------------------------------------------------------- /integrationTests/helloJersey/gradle.properties: -------------------------------------------------------------------------------- 1 | jersey_version=2.15 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | .gradle 3 | .groovy 4 | .settings 5 | .nb-* 6 | .idea 7 | *.iml 8 | -------------------------------------------------------------------------------- /integrationTests/farmSecure/security/jetty-realm.properties: -------------------------------------------------------------------------------- 1 | test: test123, testuser 2 | -------------------------------------------------------------------------------- /integrationTests/helloGrettySecure/security/jetty-realm.properties: -------------------------------------------------------------------------------- 1 | test: test123, testuser 2 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm-secure/security/jetty-realm.properties: -------------------------------------------------------------------------------- 1 | test: test123, testuser 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akhikhl/gretty/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /integrationTests/buildSrc/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = rootProjectName 2 | include 'gretty-integrationTest' 3 | -------------------------------------------------------------------------------- /integrationTests/webhost/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/filterWebapp/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/helloGretty/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/farm/MyWebApp/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/grettyLogging_logback/README.md: -------------------------------------------------------------------------------- 1 | # grettyLogging_logback 2 | 3 | Example of simple web-app with logback logging. 4 | -------------------------------------------------------------------------------- /integrationTests/helloJersey/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'testresource' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/jacocoExample/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/spring-boot-app/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | http.mappers.json-pretty-print=true 2 | -------------------------------------------------------------------------------- /integrationTests/testAnnotations/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/testInitParameter/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/extraResourceBases/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/farmJacoco/MyWebApp/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/jacocoInstantiateTasks/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebApp/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebApp2/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm-secure/spring-boot-app/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | http.mappers.json-pretty-print=true 2 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-simple/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/testJettyContextConfig/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/testJettyServerConfig/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/testTomcatServerConfig/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/farmSecure/MyWebApp/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'content/index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/helloGrettySecure/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'content/index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/testTomcatContextConfig/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /libs/gretty/src/main/resources/META-INF/gradle-plugins/org.akhikhl.gretty.properties: -------------------------------------------------------------------------------- 1 | implementation-class=org.akhikhl.gretty.GrettyPlugin 2 | -------------------------------------------------------------------------------- /integrationTests/config/firefox-profile/cert8.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akhikhl/gretty/HEAD/integrationTests/config/firefox-profile/cert8.db -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/spring-boot-app/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'index.html' 3 | } 4 | -------------------------------------------------------------------------------- /integrationTests/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akhikhl/gretty/HEAD/integrationTests/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /integrationTests/config/self-signed-certificate/cert: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akhikhl/gretty/HEAD/integrationTests/config/self-signed-certificate/cert -------------------------------------------------------------------------------- /integrationTests/config/self-signed-certificate/keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akhikhl/gretty/HEAD/integrationTests/config/self-signed-certificate/keystore -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm-secure/spring-boot-app/src/main/webapp/WEB-INF/filter.groovy: -------------------------------------------------------------------------------- 1 | filter relPath: '/', { 2 | redirect 'content/index.html' 3 | } 4 | -------------------------------------------------------------------------------- /libs/gretty-runner-jetty/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: rootProject.file('common.gradle') 2 | 3 | dependencies { 4 | compile project(':libs:gretty-runner') 5 | } 6 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-simple/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jackson.serialization.INDENT_OUTPUT=true 2 | spring.groovy.template.check-template-location=false -------------------------------------------------------------------------------- /integrationTests/testTomcatContextConfig/src/main/webapp/META-INF/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /integrationTests/farmSecure/MyWebApp/src/main/webapp/images/photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akhikhl/gretty/HEAD/integrationTests/farmSecure/MyWebApp/src/main/webapp/images/photo.jpg -------------------------------------------------------------------------------- /integrationTests/gretty-taglib-example/README.md: -------------------------------------------------------------------------------- 1 | gretty-getResourcePaths 2 | ====================== 3 | 4 | This projects shows that Gretty provides access to fake /WEB-INF/libs folder. -------------------------------------------------------------------------------- /integrationTests/helloGrettySecure/src/main/webapp/images/photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akhikhl/gretty/HEAD/integrationTests/helloGrettySecure/src/main/webapp/images/photo.jpg -------------------------------------------------------------------------------- /integrationTests/gradle.properties: -------------------------------------------------------------------------------- 1 | rootProjectName = gretty-integrationTests 2 | group=org.akhikhl.gretty.internal.integrationTests 3 | # other properties are copied by gradle script from top-level project 4 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm-secure/spring-boot-app/src/main/webapp/images/photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akhikhl/gretty/HEAD/integrationTests/spring-boot-farm-secure/spring-boot-app/src/main/webapp/images/photo.jpg -------------------------------------------------------------------------------- /integrationTests/testJettyContextConfig/src/main/webapp/WEB-INF/jetty-env.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | /abc 4 | 5 | -------------------------------------------------------------------------------- /integrationTests/webfragment/src/main/resources/META-INF/resources/images/webfragment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akhikhl/gretty/HEAD/integrationTests/webfragment/src/main/resources/META-INF/resources/images/webfragment.png -------------------------------------------------------------------------------- /integrationTests/farm/MyWebService/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | defineIntegrationTest() 6 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebService/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | defineIntegrationTest() 6 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebService2/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | defineIntegrationTest() 6 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/FarmWebappType.groovy: -------------------------------------------------------------------------------- 1 | package org.akhikhl.gretty 2 | 3 | /** 4 | * @author sala 5 | */ 6 | enum FarmWebappType { 7 | PROJECT, WAR_FILE, WAR_DEPENDENCY, DEPENDENCY_TO_PROJECT 8 | } 9 | -------------------------------------------------------------------------------- /integrationTests/buildSrc/gretty-integrationTest/src/main/resources/META-INF/gradle-plugins/org.akhikhl.gretty.internal.integrationTests.BasePlugin.properties: -------------------------------------------------------------------------------- 1 | implementation-class=org.akhikhl.gretty.internal.integrationTests.BasePlugin 2 | -------------------------------------------------------------------------------- /integrationTests/farmSecure/security/tomcat-users.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /integrationTests/helloGrettySecure/security/tomcat-users.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/jee-webservice/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | defineIntegrationTest() 6 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm-secure/security/tomcat-users.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /integrationTests/buildSrc/gretty-integrationTest/src/main/resources/META-INF/gradle-plugins/org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin.properties: -------------------------------------------------------------------------------- 1 | implementation-class=org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin 2 | -------------------------------------------------------------------------------- /libs/gretty-starter/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: rootProject.file('common.gradle') 2 | 3 | dependencies { 4 | compile project(':libs:gretty-core') 5 | } 6 | 7 | jar { 8 | manifest { attributes 'Main-Class': 'org.akhikhl.gretty.GrettyStarter' } 9 | } 10 | -------------------------------------------------------------------------------- /integrationTests/buildSrc/gretty-integrationTest/src/main/resources/META-INF/gradle-plugins/org.akhikhl.gretty.internal.integrationTests.FarmIntegrationTestPlugin.properties: -------------------------------------------------------------------------------- 1 | implementation-class=org.akhikhl.gretty.internal.integrationTests.FarmIntegrationTestPlugin 2 | -------------------------------------------------------------------------------- /integrationTests/webhost/README.md: -------------------------------------------------------------------------------- 1 | # webhost 2 | 3 | Example showing use of web-fragments. 4 | 5 | ## Usage 6 | 7 | - Run from command-line: 8 | 9 | ``` 10 | gradle appRun 11 | ``` 12 | 13 | - Open in browser: 14 | 15 | ``` 16 | http://localhost:8080/webhost/ 17 | ``` 18 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jun 20 20:35:15 PDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-bin.zip 7 | -------------------------------------------------------------------------------- /integrationTests/filterWebapp/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-weight: 400; 9 | font-size: 40px; 10 | } 11 | 12 | .margin-base-vertical { 13 | margin: 40px 0; 14 | } 15 | -------------------------------------------------------------------------------- /integrationTests/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jun 20 20:36:11 PDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-bin.zip 7 | -------------------------------------------------------------------------------- /integrationTests/helloGretty/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-weight: 400; 9 | font-size: 40px; 10 | } 11 | 12 | .margin-base-vertical { 13 | margin: 40px 0; 14 | } 15 | -------------------------------------------------------------------------------- /libs/gretty-spock/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: rootProject.file('common.gradle') 2 | 3 | dependencies { 4 | compile "org.codehaus.groovy:groovy-all:${groovy_version}" 5 | compile "org.spockframework:spock-core:$spock_version" 6 | compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1' 7 | } 8 | -------------------------------------------------------------------------------- /integrationTests/helloGrettyOverlay/README.md: -------------------------------------------------------------------------------- 1 | # helloGrettyOverlay 2 | 3 | Gretty webapp-overlay example. 4 | 5 | ## Usage 6 | 7 | - Run from command-line: 8 | 9 | ``` 10 | gradle appRun 11 | ``` 12 | 13 | - Open in browser: 14 | 15 | ``` 16 | http://localhost:8080/helloGrettyOverlay/ 17 | ``` 18 | -------------------------------------------------------------------------------- /integrationTests/helloGrettySecure/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-weight: 400; 9 | font-size: 40px; 10 | } 11 | 12 | .margin-base-vertical { 13 | margin: 40px 0; 14 | } 15 | -------------------------------------------------------------------------------- /integrationTests/testInitParameter/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-weight: 400; 9 | font-size: 40px; 10 | } 11 | 12 | .margin-base-vertical { 13 | margin: 40px 0; 14 | } 15 | -------------------------------------------------------------------------------- /integrationTests/extraResourceBases/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-weight: 400; 9 | font-size: 40px; 10 | } 11 | 12 | .margin-base-vertical { 13 | margin: 40px 0; 14 | } 15 | -------------------------------------------------------------------------------- /integrationTests/testAnnotations/README.md: -------------------------------------------------------------------------------- 1 | # testAnnotations 2 | 3 | Gretty example, shows usage of JEE annotations. 4 | 5 | ## Usage 6 | 7 | - Run from command-line: 8 | 9 | ``` 10 | gradle appRun 11 | ``` 12 | 13 | - Open in browser: 14 | 15 | ``` 16 | http://localhost:8080/testAnnotations/ 17 | ``` 18 | -------------------------------------------------------------------------------- /integrationTests/testTomcatServerConfig/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-weight: 400; 9 | font-size: 40px; 10 | } 11 | 12 | .margin-base-vertical { 13 | margin: 40px 0; 14 | } 15 | -------------------------------------------------------------------------------- /integrationTests/testTomcatContextConfig/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-weight: 400; 9 | font-size: 40px; 10 | } 11 | 12 | .margin-base-vertical { 13 | margin: 40px 0; 14 | } 15 | -------------------------------------------------------------------------------- /integrationTests/buildSrc/gradle.properties: -------------------------------------------------------------------------------- 1 | rootProjectName = gretty-integrationTests-buildsrc 2 | geckoDriverVersion = 0.17.0 3 | gradle_download_task_version = 3.1.1 4 | commons_configuration_version = 1.10 5 | gebVersion=1.1.1 6 | seleniumVersion=3.4.0 7 | # other properties are copied by gradle script from higher-level projects 8 | -------------------------------------------------------------------------------- /integrationTests/config/gebConfig/GebConfig.groovy: -------------------------------------------------------------------------------- 1 | import org.openqa.selenium.firefox.FirefoxDriver 2 | import org.openqa.selenium.firefox.FirefoxProfile 3 | 4 | driver = { 5 | // we pass profile with trusted localhost ssl certificate 6 | new FirefoxDriver(new FirefoxProfile(new File(System.getProperty('firefox.profile.path')))) 7 | } 8 | -------------------------------------------------------------------------------- /integrationTests/jacocoExample/README.md: -------------------------------------------------------------------------------- 1 | # jacocoExample 2 | 3 | Example of client-side and server-side Jacoco code coverage with webapp. 4 | 5 | ## How to test 6 | 7 | ```bash 8 | cd examples/jacocoExample 9 | gradle integrationTest 10 | ``` 11 | 12 | Gradle will tell about the locations of the created Jacoco reports. 13 | 14 | -------------------------------------------------------------------------------- /integrationTests/farmJacoco/README.md: -------------------------------------------------------------------------------- 1 | # farmJacoco 2 | 3 | Example of client-side and server-side Jacoco code coverage with webapp farm. 4 | 5 | ## How to test 6 | 7 | ```bash 8 | cd examples/farmJacoco/MyWebApp 9 | gradle farmIntegrationTest 10 | ``` 11 | 12 | Gradle will tell about the locations of the created Jacoco reports. 13 | 14 | -------------------------------------------------------------------------------- /integrationTests/farmSecure/MyWebService/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | gretty { 6 | httpEnabled = false 7 | httpsEnabled = true 8 | realm = 'auth' 9 | realmConfigFile = '../security' 10 | } 11 | -------------------------------------------------------------------------------- /integrationTests/jacocoExample/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-family: 'Open Sans', sans-serif; 9 | font-weight: 400; 10 | font-size: 40px; 11 | } 12 | 13 | .margin-base-vertical { 14 | margin: 40px 0; 15 | } 16 | -------------------------------------------------------------------------------- /integrationTests/testAnnotations/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-family: 'Open Sans', sans-serif; 9 | font-weight: 400; 10 | font-size: 40px; 11 | } 12 | 13 | .margin-base-vertical { 14 | margin: 40px 0; 15 | } 16 | -------------------------------------------------------------------------------- /integrationTests/testAnnotationsOverlay/README.md: -------------------------------------------------------------------------------- 1 | # testAnnotationsOverlay 2 | 3 | Gretty example, shows usage of JEE annotations in overlay web-app. 4 | 5 | ## Usage 6 | 7 | - Run from command-line: 8 | 9 | ``` 10 | gradle appRun 11 | ``` 12 | 13 | - Open in browser: 14 | 15 | ``` 16 | http://localhost:8080/testAnnotationsOverlay/ 17 | ``` 18 | -------------------------------------------------------------------------------- /integrationTests/jacocoInstantiateTasks/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-family: 'Open Sans', sans-serif; 9 | font-weight: 400; 10 | font-size: 40px; 11 | } 12 | 13 | .margin-base-vertical { 14 | margin: 40px 0; 15 | } 16 | -------------------------------------------------------------------------------- /integrationTests/testJettyContextConfig/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-family: 'Open Sans', sans-serif; 9 | font-weight: 400; 10 | font-size: 40px; 11 | } 12 | 13 | .margin-base-vertical { 14 | margin: 40px 0; 15 | } 16 | -------------------------------------------------------------------------------- /integrationTests/testJettyServerConfig/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-family: 'Open Sans', sans-serif; 9 | font-weight: 400; 10 | font-size: 40px; 11 | } 12 | 13 | .margin-base-vertical { 14 | margin: 40px 0; 15 | } 16 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-simple/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-weight: 400; 9 | font-size: 40px; 10 | } 11 | 12 | .margin-base-vertical { 13 | margin: 40px 0; 14 | } 15 | 16 | #result { 17 | margin-top: 16px; 18 | } 19 | -------------------------------------------------------------------------------- /pluginScripts/gretty.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:2.0.0' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | -------------------------------------------------------------------------------- /integrationTests/grettyLogging_logback/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile 'ch.qos.logback:logback-classic:1.1.2' 7 | } 8 | 9 | defineIntegrationTest() 10 | testAll.dependsOn defineIntegrationTestAllContainers() 11 | -------------------------------------------------------------------------------- /integrationTests/multifarm/AllFarms/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.akhikhl.gretty' 2 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.BasePlugin' 3 | 4 | farm { 5 | include ':multifarm:MyWebApp' 6 | include ':multifarm:MyWebApp2' 7 | } 8 | 9 | task('testAll') { 10 | dependsOn 'farmIntegrationTest' 11 | rootProject.tasks.testAll.dependsOn it 12 | } 13 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.3.0.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'ru.shadam.gretty:gretty:1.3.0' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.4.0.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.4.0' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.4.1.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.4.1' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.4.2.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.4.2' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | -------------------------------------------------------------------------------- /pluginScripts/gretty-2.0.0.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:2.0.0' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | -------------------------------------------------------------------------------- /libs/gretty-runner/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: rootProject.file('common.gradle') 2 | 3 | dependencies { 4 | compile "org.codehaus.groovy:groovy:$groovy_version" 5 | compile "org.codehaus.groovy:groovy-json:$groovy_version" 6 | compile 'commons-cli:commons-cli:1.2' 7 | compile 'commons-io:commons-io:2.4' 8 | compile "ch.qos.logback:logback-classic:$logback_version" 9 | } 10 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.1.0.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.1.0' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.1.1.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.1.1' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.1.2.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.1.2' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.1.3.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.1.3' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.1.4.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.1.4' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.1.5.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.1.5' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.1.6.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.1.6' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.1.7.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.1.7' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.1.8.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.1.8' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.1.9.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.1.9' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.2.0.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.2.0' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.2.1.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.2.1' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.2.2.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.2.2' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.2.3.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.2.3' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.2.4.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'org.akhikhl.gretty:gretty:1.2.4' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /pluginScripts/gretty-1.2.5.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'ru.shadam.gretty:gretty:1.2.5' 8 | } 9 | } 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 16 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 17 | 18 | -------------------------------------------------------------------------------- /integrationTests/config/self-signed-certificate/properties: -------------------------------------------------------------------------------- 1 | #Sat Oct 15 22:00:58 CEST 2016 2 | sslKeyStorePassword=zML1tjrlqPwb90MnQfRVHilxfMaiwWozNTpDkiWkjGVwUwBJxdGRMbqMMbH3ZvCq97e7HOO5EUBjGoX8XTgajXHnuXGrCF25AmO62UzSY3XVA6DmwMbfeNKtDycL4g8z 3 | sslKeyManagerPassword=eZnY3wrc5piRjgHxfTWeSdazvNzqEG4YRIOoUO2bkCynlMUA3LM3i3LPP3aqihETdQuXkbRBsUvubBRwRqxAYuBbXX6T6YbYyLUVEE88pZuA5aJU96xJ37xXhjQny35k 4 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm-secure/jee-webservice/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | gretty { 6 | httpEnabled = false 7 | httpsEnabled = true 8 | realm = 'auth' 9 | realmConfigFile = '../security' 10 | } 11 | 12 | defineIntegrationTest() 13 | -------------------------------------------------------------------------------- /integrationTests/webhost/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile project(':webfragment') 7 | } 8 | 9 | defineIntegrationTest() 10 | testAll.dependsOn defineIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat7', 'tomcat8']) 11 | -------------------------------------------------------------------------------- /libs/gretty-runner-tomcat7/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: rootProject.file('common.gradle') 2 | 3 | dependencies { 4 | compile project(':libs:gretty-runner-tomcat') 5 | compile "org.apache.tomcat.embed:tomcat-embed-el:$tomcat7_version" 6 | compile "org.apache.tomcat.embed:tomcat-embed-jasper:$tomcat7_version" 7 | compile "org.apache.tomcat.embed:tomcat-embed-websocket:$tomcat7_version" 8 | } 9 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/AppRedeployTask.groovy: -------------------------------------------------------------------------------- 1 | package org.akhikhl.gretty 2 | 3 | /** 4 | * @author sala 5 | */ 6 | class AppRedeployTask extends AppServiceTask { 7 | List webapps = [] 8 | 9 | def webapp(String webapp) { 10 | webapps.add(webapp) 11 | } 12 | 13 | @Override 14 | String getCommand() { 15 | return "redeploy ${webapps.join(' ')}" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /integrationTests/farm/README.md: -------------------------------------------------------------------------------- 1 | # farm 2 | 3 | Example of webapp farm. 4 | 5 | ## How to run 6 | 7 | ```bash 8 | cd examples/farm/MyWebApp 9 | gradle farmRun 10 | ``` 11 | 12 | ## How to test 13 | 14 | ```bash 15 | cd examples/farm/MyWebApp 16 | gradle farmIntegrationTest 17 | ``` 18 | 19 | ## How to build a product 20 | 21 | 22 | ```bash 23 | cd examples/farm/MyWebApp 24 | gradle buildProduct 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /integrationTests/helloGrettyOverlay/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | gretty { 6 | contextPath = '/helloGrettyOverlay' 7 | overlay ':helloGretty' 8 | servletContainer = 'jetty7' 9 | } 10 | 11 | defineIntegrationTest() 12 | testAll.dependsOn defineIntegrationTestAllContainers() 13 | -------------------------------------------------------------------------------- /integrationTests/testAnnotationsOverlay/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | gretty { 6 | overlay ':testAnnotations' 7 | } 8 | 9 | // annotations are not supported in jetty7 10 | 11 | testAll.dependsOn defineIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat7', 'tomcat8']) 12 | -------------------------------------------------------------------------------- /libs/gretty-springboot/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: rootProject.file('common.gradle') 2 | 3 | dependencies { 4 | providedCompile 'javax.servlet:javax.servlet-api:3.0.1' 5 | compile "org.codehaus.groovy:groovy:$groovy_version" 6 | compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion", { 7 | exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat' 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /integrationTests/config/firefox-profile/cert_override.txt: -------------------------------------------------------------------------------- 1 | # PSM Certificate Override Settings file 2 | # This is a generated file! Do not edit. 3 | localhost:8443 OID.2.16.840.1.101.3.4.2.1 F8:7B:6A:3F:0F:D7:EC:A8:EE:8A:B7:71:72:81:59:DE:2A:F0:24:0B:2C:93:57:B8:59:CC:8E:93:C2:60:A4:09 U AAAAAAAAAAAAAAAEAAAAWCVW4tkwVjEWMBQGA1UEAwwNZ3JldHR5LWlzc3VlcjENMAsGA1UECwwETm9uZTEPMA0GA1UECgwGR3JldHR5MQ0wCwYDVQQHDAROb25lMQ0wCwYDVQQGEwROb25l 4 | -------------------------------------------------------------------------------- /integrationTests/helloGretty/README.md: -------------------------------------------------------------------------------- 1 | # helloGretty 2 | 3 | Simple gretty example. 4 | 5 | ## How to run 6 | 7 | ```bash 8 | cd examples/helloGretty 9 | gradle appRun 10 | ``` 11 | 12 | ## How to test 13 | 14 | ```bash 15 | cd examples/helloGretty 16 | gradle integrationTest 17 | ``` 18 | 19 | ## How to build a product 20 | 21 | 22 | ```bash 23 | cd examples/helloGretty 24 | gradle buildProduct 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebApp/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile 'org.webjars:bootstrap:3.2.0' 7 | compile 'org.webjars:jquery:2.1.1' 8 | } 9 | 10 | farm { 11 | webapp project 12 | webapp ':multifarm:MyWebService' 13 | } 14 | 15 | defineIntegrationTest() 16 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebApp2/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile 'org.webjars:bootstrap:3.2.0' 7 | compile 'org.webjars:jquery:2.1.1' 8 | } 9 | 10 | farm { 11 | webapp project 12 | webapp ':multifarm:MyWebService2' 13 | } 14 | 15 | defineIntegrationTest() 16 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/spring-boot-app/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-weight: 400; 9 | font-size: 40px; 10 | } 11 | 12 | .margin-base-vertical { 13 | margin: 40px 0; 14 | } 15 | 16 | button { 17 | margin: 8px 0 8px 0; 18 | } 19 | 20 | .result { 21 | margin: 8px 0 16px 0; 22 | } 23 | -------------------------------------------------------------------------------- /integrationTests/jacocoInstantiateTasks/README.md: -------------------------------------------------------------------------------- 1 | # jacocoInstantiateTasks 2 | 3 | Example of client-side and server-side Jacoco code coverage with webapp. 4 | This example shows how to instantiate integration test and jacoco tasks. 5 | 6 | ## How to test 7 | 8 | ```bash 9 | cd examples/jacocoInstantiateTasks 10 | gradle myIntegrationTest 11 | ``` 12 | 13 | Gradle will tell about the locations of the created Jacoco reports. 14 | 15 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm-secure/spring-boot-app/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-weight: 400; 9 | font-size: 40px; 10 | } 11 | 12 | .margin-base-vertical { 13 | margin: 40px 0; 14 | } 15 | 16 | button { 17 | margin: 8px 0 8px 0; 18 | } 19 | 20 | .result { 21 | margin: 8px 0 16px 0; 22 | } 23 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/JacocoHelper.groovy: -------------------------------------------------------------------------------- 1 | package org.akhikhl.gretty 2 | 3 | import org.gradle.api.internal.TaskInternal 4 | import org.gradle.api.plugins.ExtensionAware 5 | import org.gradle.process.JavaForkOptions 6 | import org.gradle.testing.jacoco.plugins.JacocoTaskExtension 7 | 8 | interface JacocoHelper extends TaskInternal, JavaForkOptions, ExtensionAware { 9 | 10 | JacocoTaskExtension getJacoco() 11 | } -------------------------------------------------------------------------------- /integrationTests/multifarm/README.md: -------------------------------------------------------------------------------- 1 | # farm 2 | 3 | Example of composite farms. 4 | 5 | ## How to run 6 | 7 | ```bash 8 | cd examples/multifarm/AllFarms 9 | gradle farmRun 10 | ``` 11 | 12 | ## How to test 13 | 14 | ```bash 15 | cd examples/multifarm/AllFarms 16 | gradle farmIntegrationTest 17 | ``` 18 | 19 | ## How to build a product 20 | 21 | 22 | ```bash 23 | cd examples/multifarm/AllFarms 24 | gradle buildProduct 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /integrationTests/websocket/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | gretty { 6 | servletContainer = 'jetty9' 7 | } 8 | 9 | dependencies { 10 | compile 'org.webjars:jquery:2.1.1' 11 | } 12 | 13 | defineIntegrationTest() 14 | testAll.dependsOn defineIntegrationTestAllContainers(['jetty9', 'tomcat7', 'tomcat8']) 15 | -------------------------------------------------------------------------------- /integrationTests/gretty-taglib-example/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile 'javax.servlet:jstl:1.2' 7 | } 8 | 9 | gretty { 10 | servletContainer = 'jetty9' 11 | contextPath = '/' 12 | } 13 | 14 | defineIntegrationTest() 15 | testAll.dependsOn defineIntegrationTestAllContainers() 16 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-simple/README.md: -------------------------------------------------------------------------------- 1 | # spring-boot-simple 2 | 3 | Spring-boot webapp with gretty. 4 | 5 | ## How to run 6 | 7 | ```bash 8 | cd examples/spring-boot-simple 9 | gradle appRun 10 | ``` 11 | 12 | ## How to test 13 | 14 | ```bash 15 | cd examples/spring-boot-simple 16 | gradle integrationTest 17 | ``` 18 | 19 | ## How to build a product 20 | 21 | 22 | ```bash 23 | cd examples/spring-boot-simple 24 | gradle buildProduct 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /integrationTests/webfragment/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | repositories { 4 | maven { 5 | url "file:$privateRepoDir" 6 | } 7 | jcenter() 8 | } 9 | 10 | dependencies { 11 | compile 'javax.servlet:javax.servlet-api:3.0.1' 12 | compile 'org.webjars:bootstrap:3.2.0' 13 | compile 'org.webjars:jquery:2.1.1' 14 | // We use Velocity for example of template processing within the webapp. 15 | compile 'org.apache.velocity:velocity:1.7' 16 | } 17 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/spring-boot-webservice1/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.akhikhl.gretty' 2 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 3 | 4 | dependencies { 5 | compile "org.codehaus.groovy:groovy-all:$groovy_version" 6 | } 7 | 8 | gretty { 9 | springBoot = true 10 | } 11 | 12 | defineIntegrationTest() 13 | testAll.dependsOn defineIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat7', 'tomcat8']) 14 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/spring-boot-webservice2/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.akhikhl.gretty' 2 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 3 | 4 | dependencies { 5 | compile "org.codehaus.groovy:groovy-all:$groovy_version" 6 | } 7 | 8 | gretty { 9 | springBoot = true 10 | } 11 | 12 | defineIntegrationTest() 13 | testAll.dependsOn defineIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat7', 'tomcat8']) 14 | -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This is the official list of people who contributed code to Gretty project. 2 | # Each line represents an existing github user and/or pair username 3 | 4 | @akhikhl -- Andrey Hihlovskiy 5 | @dpanelli - Davide Panelli 6 | @gaborbernat - Gábor Bernát 7 | @munnja001 -- Justin Munn 8 | @riceyeh -- Rice Yeh 9 | @saladinkzn -- Timur Shakurov 10 | -------------------------------------------------------------------------------- /integrationTests/farm/MyWebApp/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-weight: 400; 9 | font-size: 40px; 10 | } 11 | 12 | .margin-base-vertical { 13 | margin: 40px 0; 14 | } 15 | 16 | #result { 17 | margin-top: 40px; 18 | padding: 8px; 19 | -webkit-border-radius: 5px; 20 | -moz-border-radius: 5px; 21 | border-radius: 5px; 22 | } 23 | -------------------------------------------------------------------------------- /integrationTests/helloGrettySecure/README.md: -------------------------------------------------------------------------------- 1 | # secureGretty 2 | 3 | Gretty example showing how to secure webapp with HTTPS and security realms. 4 | 5 | ## How to run 6 | 7 | ```bash 8 | cd examples/secureGretty 9 | gradle appRun 10 | ``` 11 | 12 | ## How to test 13 | 14 | ```bash 15 | cd examples/secureGretty 16 | gradle integrationTest 17 | ``` 18 | 19 | ## How to build product 20 | 21 | ```bash 22 | cd examples/secureGretty 23 | gradle buildProduct 24 | ``` 25 | 26 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebApp/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-weight: 400; 9 | font-size: 40px; 10 | } 11 | 12 | .margin-base-vertical { 13 | margin: 40px 0; 14 | } 15 | 16 | #result { 17 | margin-top: 40px; 18 | padding: 8px; 19 | -webkit-border-radius: 5px; 20 | -moz-border-radius: 5px; 21 | border-radius: 5px; 22 | } 23 | -------------------------------------------------------------------------------- /integrationTests/testInitParameter/README.md: -------------------------------------------------------------------------------- 1 | # testInitParameter 2 | 3 | Example of passing initParameter to the web-application 4 | 5 | ## How to run 6 | 7 | ```bash 8 | cd examples/testInitParameter 9 | gradle appRun 10 | ``` 11 | 12 | ## How to test 13 | 14 | ```bash 15 | cd examples/testInitParameter 16 | gradle integrationTest 17 | ``` 18 | 19 | ## How to build a product 20 | 21 | 22 | ```bash 23 | cd examples/testInitParameter 24 | gradle buildProduct 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /integrationTests/buildSrc/gretty-integrationTest/src/main/resources/org/akhikhl/gretty/internal/integrationTests/project.properties: -------------------------------------------------------------------------------- 1 | projectGroup=@projectGroup@ 2 | projectName=@projectName@ 3 | projectVersion=@projectVersion@ 4 | buildDate=@buildDate@ 5 | buildUser=@buildUser@ 6 | buildOrigin=@buildOrigin@ 7 | gebVersion=@gebVersion@ 8 | geckoDriverVersion=@geckoDriverVersion@ 9 | groovy_version=@groovy_version@ 10 | seleniumVersion=@seleniumVersion@ 11 | spock_version=@spock_version@ 12 | -------------------------------------------------------------------------------- /integrationTests/farmJacoco/MyWebApp/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-weight: 400; 9 | font-size: 40px; 10 | } 11 | 12 | .margin-base-vertical { 13 | margin: 40px 0; 14 | } 15 | 16 | #result { 17 | margin-top: 40px; 18 | padding: 8px; 19 | -webkit-border-radius: 5px; 20 | -moz-border-radius: 5px; 21 | border-radius: 5px; 22 | } 23 | -------------------------------------------------------------------------------- /integrationTests/farmSecure/MyWebApp/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-weight: 400; 9 | font-size: 40px; 10 | } 11 | 12 | .margin-base-vertical { 13 | margin: 40px 0; 14 | } 15 | 16 | #result { 17 | margin-top: 40px; 18 | padding: 8px; 19 | -webkit-border-radius: 5px; 20 | -moz-border-radius: 5px; 21 | border-radius: 5px; 22 | } 23 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebApp2/src/main/webapp/css/default.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 18px; 5 | } 6 | 7 | h1 { 8 | font-weight: 400; 9 | font-size: 40px; 10 | } 11 | 12 | .margin-base-vertical { 13 | margin: 40px 0; 14 | } 15 | 16 | #result { 17 | margin-top: 40px; 18 | padding: 8px; 19 | -webkit-border-radius: 5px; 20 | -moz-border-radius: 5px; 21 | border-radius: 5px; 22 | } 23 | -------------------------------------------------------------------------------- /integrationTests/farmSecure/README.md: -------------------------------------------------------------------------------- 1 | # secureFarm 2 | 3 | Example of webapp farm, secured with HTTPS protocol and security realms. 4 | 5 | ## How to run 6 | 7 | ```bash 8 | cd examples/secureFarm/MyWebApp 9 | gradle farmRun 10 | ``` 11 | 12 | ## How to test 13 | 14 | ```bash 15 | cd examples/secureFarm/MyWebApp 16 | gradle farmIntegrationTest 17 | ``` 18 | 19 | ## How to build a product 20 | 21 | 22 | ```bash 23 | cd examples/secureFarm/MyWebApp 24 | gradle buildProduct 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /libs/gretty-runner/src/main/groovy/org/akhikhl/gretty/ServerStartEvent.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | interface ServerStartEvent { 16 | 17 | void onServerStart(Map serverStartInfo) 18 | } 19 | 20 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/AppStopTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | class AppStopTask extends AppServiceTask { 16 | 17 | String getCommand() { 18 | 'stop' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /integrationTests/helloJersey/README.md: -------------------------------------------------------------------------------- 1 | # helloJersey 2 | 3 | Minimalistic Jersey web-service running on Gretty. 4 | 5 | ## How to run 6 | 7 | ```bash 8 | cd examples/helloJersey 9 | gradle appRun 10 | ``` 11 | 12 | open in browser: http://localhost:8080/helloJersey 13 | 14 | ## How to test 15 | 16 | ```bash 17 | cd examples/helloJersey 18 | gradle integrationTest 19 | ``` 20 | 21 | ## How to build a product 22 | 23 | 24 | ```bash 25 | cd examples/helloJersey 26 | gradle buildProduct 27 | ``` 28 | 29 | -------------------------------------------------------------------------------- /integrationTests/springBootWebSocket/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.akhikhl.gretty' 2 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 3 | 4 | dependencies { 5 | compile 'org.webjars:sockjs-client:0.3.4-1' 6 | compile 'org.webjars:stomp-websocket:2.3.3' 7 | } 8 | 9 | gretty { 10 | springBoot = true 11 | servletContainer = 'tomcat7' 12 | } 13 | 14 | defineIntegrationTest() 15 | testAll.dependsOn defineIntegrationTestAllContainers(['jetty9', 'tomcat7', 'tomcat8']) 16 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/AppRestartTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | class AppRestartTask extends AppServiceTask { 16 | 17 | String getCommand() { 18 | 'restart' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/FarmStopTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | class FarmStopTask extends FarmServiceTask { 16 | 17 | @Override 18 | String getCommand() { 19 | 'stop' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /integrationTests/testDuplicatingResources/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile 'io.reactivex:rxjava:1.1.5' 7 | } 8 | 9 | ext { 10 | integrationTestContainers = ['tomcat7', 'tomcat8'] 11 | } 12 | 13 | gretty { 14 | servletContainer = 'tomcat7' 15 | contextPath = '/bug' 16 | } 17 | 18 | defineIntegrationTest() 19 | testAll.dependsOn defineIntegrationTestAllContainers() 20 | -------------------------------------------------------------------------------- /integrationTests/testJettyServerConfig/README.md: -------------------------------------------------------------------------------- 1 | # testJettyServerConfig 2 | 3 | Example of configuring jetty server via jetty-specific configuration file "jetty.xml". 4 | 5 | ## How to run 6 | 7 | ```bash 8 | cd examples/testJettyServerConfig 9 | gradle appRun 10 | ``` 11 | 12 | ## How to test 13 | 14 | ```bash 15 | cd examples/testJettyServerConfig 16 | gradle integrationTest 17 | ``` 18 | 19 | ## How to build a product 20 | 21 | 22 | ```bash 23 | cd examples/testJettyServerConfig 24 | gradle buildProduct 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /libs/gretty-core/src/main/groovy/org/akhikhl/gretty/StartConfig.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | interface StartConfig { 16 | 17 | ServerConfig getServerConfig() 18 | 19 | Iterable getWebAppConfigs() 20 | } 21 | 22 | -------------------------------------------------------------------------------- /libs/gretty-core/src/main/groovy/org/akhikhl/gretty/WebAppClassPathResolver.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | interface WebAppClassPathResolver { 16 | 17 | Collection resolveWebAppClassPath(WebAppConfig wconfig) 18 | } 19 | 20 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/FarmRestartTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | class FarmRestartTask extends FarmServiceTask { 16 | 17 | @Override 18 | String getCommand() { 19 | 'restart' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /pluginScripts/gretty-SNAPSHOT.plugin: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' } 5 | } 6 | 7 | dependencies { 8 | classpath 'org.akhikhl.gretty:gretty:2.0.1-SNAPSHOT' 9 | } 10 | } 11 | 12 | repositories { 13 | jcenter() 14 | maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' } 15 | } 16 | 17 | if (!project.plugins.findPlugin(org.akhikhl.gretty.GrettyPlugin)) 18 | project.apply(plugin: org.akhikhl.gretty.GrettyPlugin) 19 | -------------------------------------------------------------------------------- /integrationTests/testTomcatServerConfig/README.md: -------------------------------------------------------------------------------- 1 | # testTomcatServerConfig 2 | 3 | Example of configuring tomcat server via tomcat-specific configuration file "server.xml". 4 | 5 | ## How to run 6 | 7 | ```bash 8 | cd examples/testTomcatServerConfig 9 | gradle appRun 10 | ``` 11 | 12 | ## How to test 13 | 14 | ```bash 15 | cd examples/testTomcatServerConfig 16 | gradle integrationTest 17 | ``` 18 | 19 | ## How to build a product 20 | 21 | 22 | ```bash 23 | cd examples/testTomcatServerConfig 24 | gradle buildProduct 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/GrettyStartTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * This class is deprecated, please use AppStartTask instead. 13 | * 14 | * @author akhikhl 15 | */ 16 | @Deprecated 17 | class GrettyStartTask extends AppStartTask { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /integrationTests/testJettyContextConfig/README.md: -------------------------------------------------------------------------------- 1 | # testJettyContextConfig 2 | 3 | Example of configuring webapp context via jetty-specific configuration file "jetty-env.xml". 4 | 5 | ## How to run 6 | 7 | ```bash 8 | cd examples/testJettyContextConfig 9 | gradle appRun 10 | ``` 11 | 12 | ## How to test 13 | 14 | ```bash 15 | cd examples/testJettyContextConfig 16 | gradle integrationTest 17 | ``` 18 | 19 | ## How to build a product 20 | 21 | 22 | ```bash 23 | cd examples/testJettyContextConfig 24 | gradle buildProduct 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /libs/gretty-runner-jetty/src/main/groovy/org/akhikhl/gretty/BaseResourceConfiguration.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | interface BaseResourceConfiguration { 12 | 13 | void addBaseResourceListener(Closure closure) 14 | 15 | void setExtraResourceBases(List extraResourceBases) 16 | } 17 | 18 | -------------------------------------------------------------------------------- /integrationTests/helloJersey/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile "org.glassfish.jersey.containers:jersey-container-servlet-core:$jersey_version" 7 | integrationTestCompile "javax.servlet:servlet-api:$jetty7_servlet_api_version" 8 | } 9 | 10 | war { 11 | archiveName 'helloJersey.war' 12 | } 13 | 14 | defineIntegrationTest() 15 | testAll.dependsOn defineIntegrationTestAllContainers() 16 | -------------------------------------------------------------------------------- /integrationTests/testTomcatContextConfig/README.md: -------------------------------------------------------------------------------- 1 | # testTomcatContextConfig 2 | 3 | Example of configuring webapp context via tomcat-specific configuration file "context.xml". 4 | 5 | ## How to run 6 | 7 | ```bash 8 | cd examples/testTomcatContextConfig 9 | gradle appRun 10 | ``` 11 | 12 | ## How to test 13 | 14 | ```bash 15 | cd examples/testTomcatContextConfig 16 | gradle integrationTest 17 | ``` 18 | 19 | ## How to build a product 20 | 21 | 22 | ```bash 23 | cd examples/testTomcatContextConfig 24 | gradle buildProduct 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /libs/gretty-filter/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: rootProject.file('common.gradle') 2 | 3 | dependencies { 4 | compile 'javax.servlet:servlet-api:2.5' 5 | compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1', { 6 | exclude group: 'commons-logging', module: 'commons-logging' 7 | } 8 | compile "org.codehaus.groovy:groovy:${groovy_version}" 9 | compile "org.codehaus.groovy:groovy-servlet:${groovy_version}" 10 | compile "org.codehaus.groovy:groovy-jmx:${groovy_version}" 11 | compile "org.slf4j:slf4j-api:$slf4j_version" 12 | } 13 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/FileReloadSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | import groovy.transform.ToString 12 | 13 | /** 14 | * 15 | * @author akhikhl 16 | */ 17 | @ToString 18 | class FileReloadSpec { 19 | File baseDir 20 | def pattern 21 | def excludesPattern 22 | } 23 | 24 | -------------------------------------------------------------------------------- /integrationTests/testJettyContextConfig/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile 'org.webjars:bootstrap:3.2.0' 7 | compile 'org.webjars:jquery:2.1.1' 8 | // We use Velocity for example of template processing within the webapp. 9 | compile 'org.apache.velocity:velocity:1.7' 10 | } 11 | 12 | defineIntegrationTest() 13 | testAll.dependsOn defineIntegrationTestAllContainers(['jetty7', 'jetty8', 'jetty9']) 14 | -------------------------------------------------------------------------------- /integrationTests/testJettyServerConfig/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile 'org.webjars:bootstrap:3.2.0' 7 | compile 'org.webjars:jquery:2.1.1' 8 | // We use Velocity for example of template processing within the webapp. 9 | compile 'org.apache.velocity:velocity:1.7' 10 | } 11 | 12 | defineIntegrationTest() 13 | testAll.dependsOn defineIntegrationTestAllContainers(['jetty7', 'jetty8', 'jetty9']) 14 | -------------------------------------------------------------------------------- /libs/gretty-starter/src/main/groovy/org/akhikhl/gretty/PlatformUtils.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | class PlatformUtils { 16 | 17 | static boolean isWindows() { 18 | System.getProperty('os.name', 'generic').toLowerCase().indexOf('win') >= 0 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /libs/gretty-core/src/main/groovy/org/akhikhl/gretty/Launcher.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | interface Launcher { 16 | 17 | void afterLaunch() 18 | 19 | void beforeLaunch() 20 | 21 | void dispose() 22 | 23 | void launch() 24 | 25 | Thread launchThread() 26 | } 27 | -------------------------------------------------------------------------------- /integrationTests/springBootWebSocket/src/main/java/org/akhikhl/examples/gretty/springbootwebsocket/HelloMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootwebsocket; 10 | 11 | public class HelloMessage { 12 | 13 | private String name; 14 | 15 | public String getName() { 16 | return name; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /libs/gretty-runner/src/main/groovy/org/akhikhl/gretty/ServerDefaults.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | class ServerDefaults { 16 | 17 | static final String defaultHost = '0.0.0.0' 18 | static final int defaultHttpPort = 8080 19 | static final int defaultHttpsPort = 8443 20 | } 21 | -------------------------------------------------------------------------------- /integrationTests/extraResourceBases/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile 'org.webjars:bootstrap:3.2.0' 7 | compile 'org.webjars:jquery:2.1.1' 8 | // We use Velocity for example of template processing within the webapp. 9 | compile 'org.apache.velocity:velocity:1.7' 10 | } 11 | 12 | gretty { 13 | extraResourceBase 'extra1' 14 | } 15 | 16 | defineIntegrationTest() 17 | testAll.dependsOn defineIntegrationTestAllContainers() 18 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm-secure/spring-boot-webservice/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.akhikhl.gretty' 2 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 3 | 4 | dependencies { 5 | compile "org.codehaus.groovy:groovy-all:$groovy_version" 6 | } 7 | 8 | gretty { 9 | springBoot = true 10 | httpEnabled = false 11 | httpsEnabled = true 12 | realm = 'auth' 13 | realmConfigFile = '../security' 14 | } 15 | 16 | defineIntegrationTest() 17 | testAll.dependsOn defineIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat7', 'tomcat8']) 18 | -------------------------------------------------------------------------------- /libs/gretty-runner-tomcat/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: rootProject.file('common.gradle') 2 | 3 | dependencies { 4 | compile project(':libs:gretty-runner') 5 | compile "org.slf4j:log4j-over-slf4j:$slf4j_version" 6 | // These dependencies are needed for compiling gretty-runner-tomcat. 7 | // They are replaced by "real" dependencies at runtime. 8 | compile "javax.servlet:javax.servlet-api:$tomcat7_servlet_api_version" 9 | compile "org.apache.tomcat.embed:tomcat-embed-core:$tomcat7_version" 10 | compile "org.apache.tomcat.embed:tomcat-embed-logging-log4j:$tomcat7_version" 11 | } 12 | -------------------------------------------------------------------------------- /integrationTests/testAnnotations/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile 'org.webjars:bootstrap:3.2.0' 7 | compile 'org.webjars:jquery:2.1.1' 8 | // We use Velocity for example of template processing within the webapp. 9 | compile 'org.apache.velocity:velocity:1.7' 10 | } 11 | 12 | // annotations are not supported in jetty7 13 | 14 | testAll.dependsOn defineIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat7', 'tomcat8']) 15 | -------------------------------------------------------------------------------- /integrationTests/testJettyServerConfig/jetty/jetty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 5 | 2000 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 7777 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /integrationTests/testJettyServerConfig/jetty/jetty7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 6 | 1000 7 | 8 | 9 | 10 | 11 | 12 | 7777 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /integrationTests/testJettyServerConfig/jetty/jetty8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 6 | 1000 7 | 8 | 9 | 10 | 11 | 12 | 7777 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /libs/gretty-runner/src/main/groovy/org/akhikhl/gretty/ServerManager.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | interface ServerManager { 16 | void setParams(Map params) 17 | void startServer(ServerStartEvent startEvent) 18 | void stopServer() 19 | void redeploy(List webapps) 20 | } 21 | 22 | -------------------------------------------------------------------------------- /integrationTests/testInitParameter/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile 'org.webjars:bootstrap:3.2.0' 7 | compile 'org.webjars:jquery:2.1.1' 8 | // We use Velocity for example of template processing within the webapp. 9 | compile 'org.apache.velocity:velocity:1.7' 10 | } 11 | 12 | gretty { 13 | initParameter 'myParam', 'Hello, world!' 14 | } 15 | 16 | defineIntegrationTest() 17 | testAll.dependsOn defineIntegrationTestAllContainers() 18 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-simple/src/main/webapp/js/functions.js: -------------------------------------------------------------------------------- 1 | jQuery.noConflict(); 2 | 3 | jQuery(function($) { 4 | $('#result').addClass('hide') 5 | $('#sendRequest').click(function() { 6 | $.ajax({ type: 'POST', url: 'mycontroller/getdate', dataType: 'json' }).done(function(data) { 7 | $('#result').removeClass('hide bg-danger').addClass('bg-success').text('Got from server: ' + data.date); 8 | }).fail(function(jqXHR, textStatus, errorThrown) { 9 | $('#result').removeClass('hide bg-success').addClass('bg-danger').text('error: ' + errorThrown); 10 | }); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /integrationTests/testTomcatContextConfig/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile 'org.webjars:bootstrap:3.2.0' 7 | compile 'org.webjars:jquery:2.1.1' 8 | // We use Velocity for example of template processing within the webapp. 9 | compile 'org.apache.velocity:velocity:1.7' 10 | } 11 | 12 | gretty { 13 | servletContainer = 'tomcat8' 14 | } 15 | 16 | defineIntegrationTest() 17 | testAll.dependsOn defineIntegrationTestAllContainers(['tomcat7', 'tomcat8']) 18 | -------------------------------------------------------------------------------- /integrationTests/farm/MyWebApp/src/main/webapp/js/functions.js: -------------------------------------------------------------------------------- 1 | jQuery.noConflict(); 2 | 3 | jQuery(function($) { 4 | try { 5 | $('#sendRequest').click(function() { 6 | $.ajax({ type: 'POST', url: '/MyWebService/getdate', dataType: 'json' }).done(function(data) { 7 | $('#result').removeClass('hide bg-danger').addClass('bg-success').text('Got from server: ' + data.date); 8 | }).fail(function(jqXHR, textStatus, errorThrown) { 9 | $('#result').removeClass('hide bg-success').addClass('bg-danger').text('error: ' + errorThrown); 10 | }); 11 | }); 12 | } catch(e) { 13 | alert(e); 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /integrationTests/farmJacoco/MyWebApp/src/main/webapp/js/functions.js: -------------------------------------------------------------------------------- 1 | jQuery.noConflict(); 2 | 3 | jQuery(function($) { 4 | try { 5 | $('#sendRequest').click(function() { 6 | $.ajax({ type: 'POST', url: '/MyWebService/getdate', dataType: 'json' }).done(function(data) { 7 | $('#result').removeClass('hide bg-danger').addClass('bg-success').text('Got from server: ' + data.date); 8 | }).fail(function(jqXHR, textStatus, errorThrown) { 9 | $('#result').removeClass('hide bg-success').addClass('bg-danger').text('error: ' + errorThrown); 10 | }); 11 | }); 12 | } catch(e) { 13 | alert(e); 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /integrationTests/farmSecure/MyWebApp/src/main/webapp/js/functions.js: -------------------------------------------------------------------------------- 1 | jQuery.noConflict(); 2 | 3 | jQuery(function($) { 4 | try { 5 | $('#sendRequest').click(function() { 6 | $.ajax({ type: 'POST', url: '/MyWebService/getdate', dataType: 'json' }).done(function(data) { 7 | $('#result').removeClass('hide bg-danger').addClass('bg-success').text('Got from server: ' + data.date); 8 | }).fail(function(jqXHR, textStatus, errorThrown) { 9 | $('#result').removeClass('hide bg-success').addClass('bg-danger').text('error: ' + errorThrown); 10 | }); 11 | }); 12 | } catch(e) { 13 | alert(e); 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebApp/src/main/webapp/js/functions.js: -------------------------------------------------------------------------------- 1 | jQuery.noConflict(); 2 | 3 | jQuery(function($) { 4 | try { 5 | $('#sendRequest').click(function() { 6 | $.ajax({ type: 'POST', url: '/MyWebService/getdate', dataType: 'json' }).done(function(data) { 7 | $('#result').removeClass('hide bg-danger').addClass('bg-success').text('Got from server: ' + data.date); 8 | }).fail(function(jqXHR, textStatus, errorThrown) { 9 | $('#result').removeClass('hide bg-success').addClass('bg-danger').text('error: ' + errorThrown); 10 | }); 11 | }); 12 | } catch(e) { 13 | alert(e); 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebApp2/src/main/webapp/js/functions.js: -------------------------------------------------------------------------------- 1 | jQuery.noConflict(); 2 | 3 | jQuery(function($) { 4 | try { 5 | $('#sendRequest').click(function() { 6 | $.ajax({ type: 'POST', url: '/MyWebService2/getdate', dataType: 'json' }).done(function(data) { 7 | $('#result').removeClass('hide bg-danger').addClass('bg-success').text('Got from server: ' + data.date); 8 | }).fail(function(jqXHR, textStatus, errorThrown) { 9 | $('#result').removeClass('hide bg-success').addClass('bg-danger').text('error: ' + errorThrown); 10 | }); 11 | }); 12 | } catch(e) { 13 | alert(e); 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /integrationTests/farm/MyWebApp/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.FarmIntegrationTestPlugin' 5 | 6 | dependencies { 7 | compile 'org.webjars:bootstrap:3.2.0' 8 | compile 'org.webjars:jquery:2.1.1' 9 | } 10 | 11 | farm { 12 | webapp project 13 | webapp ':farm:MyWebService' 14 | } 15 | 16 | defineIntegrationTest() 17 | 18 | testAll.dependsOn defineFarmIntegrationTestAllContainers({ 19 | webapp project 20 | webapp ':farm:MyWebService' 21 | }) 22 | -------------------------------------------------------------------------------- /integrationTests/testTomcatServerConfig/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile 'org.webjars:bootstrap:3.2.0' 7 | compile 'org.webjars:jquery:2.1.1' 8 | // We use Velocity for example of template processing within the webapp. 9 | compile 'org.apache.velocity:velocity:1.7' 10 | } 11 | 12 | gretty { 13 | servletContainer = 'tomcat8' 14 | // httpsEnabled = true 15 | } 16 | 17 | defineIntegrationTest() 18 | testAll.dependsOn defineIntegrationTestAllContainers(['tomcat7', 'tomcat8']) 19 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/GrettyServiceTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * This class is deprecated, please use AppStopTask and AppRestartTask instead. 13 | * 14 | * @author akhikhl 15 | */ 16 | @Deprecated 17 | class GrettyServiceTask extends AppServiceTask { 18 | 19 | String command 20 | 21 | String getCommand() { 22 | command 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/JettyStartTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | class JettyStartTask extends AppStartTask { 16 | 17 | @Override 18 | protected String getCompatibleServletContainer(String servletContainer) { 19 | ServletContainerConfig.getJettyCompatibleServletContainer(project, servletContainer) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/TomcatStartTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | class TomcatStartTask extends AppStartTask { 16 | 17 | @Override 18 | protected String getCompatibleServletContainer(String servletContainer) { 19 | ServletContainerConfig.getTomcatCompatibleServletContainer(project, servletContainer) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-simple/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.akhikhl.gretty' 2 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 3 | 4 | dependencies { 5 | compile "org.codehaus.groovy:groovy-all:$groovy_version" 6 | compile 'org.webjars:bootstrap:3.2.0' 7 | compile 'org.webjars:jquery:2.1.1' 8 | // We use Velocity for example of template processing within the webapp. 9 | compile 'org.apache.velocity:velocity:1.7' 10 | } 11 | 12 | gretty { 13 | springBoot = true 14 | } 15 | 16 | defineIntegrationTest() 17 | testAll.dependsOn defineIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat7', 'tomcat8']) 18 | -------------------------------------------------------------------------------- /integrationTests/helloJersey/src/main/java/org/akhikhl/examples/gretty/hellojersey/TestResource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.hellojersey; 10 | 11 | import javax.ws.rs.GET; 12 | import javax.ws.rs.Path; 13 | import javax.ws.rs.Produces; 14 | 15 | @Path("testresource") 16 | public class TestResource { 17 | @GET 18 | @Produces("text/plain") 19 | public String hello() { 20 | return "Hello World!"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /integrationTests/springBootWebSocket/src/main/java/org/akhikhl/examples/gretty/springbootwebsocket/Greeting.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootwebsocket; 10 | 11 | public class Greeting { 12 | 13 | private String content; 14 | 15 | public Greeting(String content) { 16 | this.content = content; 17 | } 18 | 19 | public String getContent() { 20 | return content; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /integrationTests/gretty-taglib-example/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 6 | Servlet 3.0 Web Application 7 | 8 | 9 | hello 10 | HelloServlet 11 | 12 | 13 | hello 14 | /* 15 | 16 | 17 | -------------------------------------------------------------------------------- /integrationTests/testAnnotations/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | RedirectFilter 8 | org.akhikhl.gretty.RedirectFilter 9 | 10 | 11 | RedirectFilter 12 | /* 13 | REQUEST 14 | FORWARD 15 | 16 | 17 | -------------------------------------------------------------------------------- /libs/gretty-runner-jetty/src/main/groovy/org/akhikhl/gretty/ServerManagerFactory.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | class ServerManagerFactory { 16 | 17 | static ServerManager createServerManager() { 18 | def JettyConfigurer = Class.forName('org.akhikhl.gretty.JettyConfigurerImpl', true, ServerManagerFactory.classLoader) 19 | new JettyServerManager(JettyConfigurer.newInstance()) 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/FarmsExtension.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | import org.gradle.api.Project 12 | 13 | /** 14 | * 15 | * @author akhikhl 16 | */ 17 | class FarmsExtension extends FarmsConfig { 18 | 19 | final Project project 20 | 21 | FarmsExtension(Project project) { 22 | this.project = project 23 | } 24 | 25 | @Override 26 | FarmConfig createFarm() { 27 | new FarmExtension(project) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /libs/gretty-runner-tomcat/src/main/groovy/org/akhikhl/gretty/ServerManagerFactory.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | class ServerManagerFactory { 16 | 17 | static ServerManager createServerManager() { 18 | def TomcatConfigurer = Class.forName('org.akhikhl.gretty.TomcatConfigurerImpl', true, ServerManagerFactory.classLoader) 19 | new TomcatServerManager(TomcatConfigurer.newInstance()) 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/ScannerManager.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | interface ScannerManager { 16 | 17 | void startScanner() 18 | void stopScanner() 19 | 20 | void registerFastReloadCallbacks(Closure before, Closure after) 21 | // 22 | void registerRestartCallbacks(Closure before, Closure after) 23 | // 24 | void registerReloadCallbacks(Closure before, Closure after) 25 | } 26 | 27 | -------------------------------------------------------------------------------- /integrationTests/testDuplicatingResources/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | Servlet 3.0 Web Application 8 | 9 | 10 | hello 11 | HelloServlet2 12 | 13 | 14 | hello 15 | /* 16 | 17 | 18 | -------------------------------------------------------------------------------- /integrationTests/grettyLogging_logback/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | ExampleServlet 8 | ExampleServlet 9 | org.akhikhl.examples.gretty.ExampleServlet 10 | 1 11 | 12 | 13 | 14 | ExampleServlet 15 | /* 16 | 17 | 18 | -------------------------------------------------------------------------------- /integrationTests/farm/MyWebService/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | ExampleServlet 8 | ExampleServlet 9 | org.akhikhl.examples.gretty.mywebservice.ExampleServlet 10 | 1 11 | 12 | 13 | 14 | ExampleServlet 15 | /getdate 16 | 17 | 18 | -------------------------------------------------------------------------------- /integrationTests/farmJacoco/MyWebService/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | ExampleServlet 8 | ExampleServlet 9 | org.akhikhl.examples.gretty.mywebservice.ExampleServlet 10 | 1 11 | 12 | 13 | 14 | ExampleServlet 15 | /getdate 16 | 17 | 18 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebService/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | ExampleServlet 8 | ExampleServlet 9 | org.akhikhl.examples.gretty.mywebservice.ExampleServlet 10 | 1 11 | 12 | 13 | 14 | ExampleServlet 15 | /getdate 16 | 17 | 18 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebService2/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | ExampleServlet 8 | ExampleServlet 9 | org.akhikhl.examples.gretty.mywebservice.ExampleServlet 10 | 1 11 | 12 | 13 | 14 | ExampleServlet 15 | /getdate 16 | 17 | 18 | -------------------------------------------------------------------------------- /integrationTests/grettyLogging_logback/src/integrationTest/groovy/org/akhikhl/examples/gretty/PageSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class PageSpec extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | } 20 | 21 | def 'should get expected static page'() { 22 | when: 23 | go "${baseURI}" 24 | then: 25 | $('body').text() == 'Hello, world!' 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/jee-webservice/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | ExampleServlet 8 | ExampleServlet 9 | org.akhikhl.examples.gretty.mywebservice.ExampleServlet 10 | 1 11 | 12 | 13 | 14 | ExampleServlet 15 | /myservlet/* 16 | 17 | 18 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = rootProjectName 2 | include 'libs:gretty-core' 3 | include 'libs:gretty' 4 | include 'libs:gretty-filter' 5 | include 'libs:gretty-runner' 6 | include 'libs:gretty-runner-jetty' 7 | include 'libs:gretty-runner-jetty7' 8 | include 'libs:gretty-runner-jetty8' 9 | include 'libs:gretty-runner-jetty9' 10 | // we don't try to compile gretty-runner-jetty93/4 against jdk prior to 8 11 | if(JavaVersion.current().isJava8Compatible()) { 12 | include 'libs:gretty-runner-jetty93' 13 | include 'libs:gretty-runner-jetty94' 14 | } 15 | include 'libs:gretty-runner-tomcat' 16 | include 'libs:gretty-runner-tomcat7' 17 | include 'libs:gretty-runner-tomcat8' 18 | include 'libs:gretty-spock' 19 | include 'libs:gretty-springboot' 20 | include 'libs:gretty-starter' 21 | -------------------------------------------------------------------------------- /integrationTests/websocket/src/main/webapp/js/index.js: -------------------------------------------------------------------------------- 1 | jQuery(function($) { 2 | 3 | var sock = new WebSocket("ws://localhost:8080/websocket/hello"); 4 | 5 | sock.onopen = function() { 6 | console.log('open'); 7 | }; 8 | 9 | sock.onclose = function() { 10 | console.log('close'); 11 | }; 12 | 13 | sock.onmessage = function(e) { 14 | var content = JSON.parse(e.data); 15 | $('#chat-content').val(function(i, text) { 16 | return text + 'User ' + content.username + ': ' + content.message + '\n'; 17 | }); 18 | }; 19 | 20 | $('#btnSend').click(function() { 21 | console.log('about to send'); 22 | var message = $('#message').val(); 23 | var username = $('#username').val(); 24 | sock.send(JSON.stringify({ message: message, username: username })); 25 | }); 26 | 27 | }); 28 | -------------------------------------------------------------------------------- /integrationTests/helloGretty/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile 'org.webjars:bootstrap:3.2.0' 7 | compile 'org.webjars:jquery:2.1.1' 8 | // We use Velocity for example of template processing within the webapp. 9 | compile 'org.apache.velocity:velocity:1.7' 10 | } 11 | 12 | gretty { 13 | // Possible servletContainer values are 'jetty7', 'jetty8', 'jetty9', 'tomcat7', 'tomcat8'. Default is 'jetty9'. 14 | // servletContainer = 'tomcat8' 15 | // httpsEnabled = true 16 | } 17 | 18 | war { 19 | archiveName 'helloGretty.war' 20 | } 21 | 22 | defineIntegrationTest() 23 | testAll.dependsOn defineIntegrationTestAllContainers() 24 | -------------------------------------------------------------------------------- /libs/gretty-runner/src/main/groovy/org/akhikhl/gretty/WebappUtils.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | import org.apache.commons.io.FilenameUtils 12 | 13 | /** 14 | * 15 | * @author akhikhl 16 | */ 17 | class WebappUtils { 18 | 19 | static String getWebAppDestinationDirName(String resourceBase) { 20 | def file = resourceBase 21 | if(!(file instanceof File)) 22 | file = new File(file.toString()) 23 | FilenameUtils.getBaseName(file.name).replaceAll(/([\da-zA-Z_.-]+?)-((\d+\.)+[\da-zA-Z_.-]*)/, '$1') 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/JettyStopTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | import org.slf4j.Logger 12 | import org.slf4j.LoggerFactory 13 | 14 | /** 15 | * 16 | * @author ahi 17 | */ 18 | class JettyStopTask extends AppStopTask { 19 | 20 | protected static final Logger log = LoggerFactory.getLogger(JettyBeforeIntegrationTestTask) 21 | 22 | JettyStopTask() { 23 | doFirst { 24 | log.warn 'JettyStopTask is deprecated and will be removed in Gretty 2.0. Please use AppStopTask instead.' 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /integrationTests/webfragment/src/main/resources/META-INF/web-fragment.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | ExampleServlet 8 | ExampleServlet 9 | org.akhikhl.examples.gretty.webfragment.ExampleServlet 10 | 1 11 | 12 | 13 | 14 | ExampleServlet 15 | /dynamic 16 | 17 | 18 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/ProductsExtension.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | class ProductsExtension { 16 | 17 | Map productsMap = [:] 18 | 19 | void product(String name = null, Closure closure) { 20 | if(name == null) 21 | name = '' 22 | def p = productsMap[name] 23 | if(p == null) 24 | p = productsMap[name] = new ProductExtension() 25 | closure.delegate = p 26 | closure.resolveStrategy = Closure.DELEGATE_FIRST 27 | closure() 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /integrationTests/helloJersey/src/main/java/org/akhikhl/examples/gretty/hellojersey/JerseyApp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.hellojersey; 10 | 11 | import javax.ws.rs.ApplicationPath; 12 | import javax.ws.rs.core.Application; 13 | import java.util.HashSet; 14 | import java.util.Set; 15 | 16 | @ApplicationPath("/") 17 | public class JerseyApp extends Application { 18 | @Override 19 | public Set> getClasses() { 20 | final Set> classes = new HashSet>(); 21 | classes.add(TestResource.class); 22 | return classes; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /integrationTests/websocket/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Websocket chat 6 | 7 | 8 |

Websocket chat

9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /libs/gretty-runner-jetty8/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: rootProject.file('common.gradle') 2 | 3 | configurations { 4 | compile { 5 | exclude group: 'org.eclipse.jetty.orbit', module: 'javax.servlet' 6 | } 7 | } 8 | 9 | dependencies { 10 | compile project(':libs:gretty-runner-jetty') 11 | compile "javax.servlet:javax.servlet-api:$jetty8_servlet_api_version" 12 | compile "org.eclipse.jetty:jetty-server:$jetty8_version" 13 | compile "org.eclipse.jetty:jetty-servlet:$jetty8_version" 14 | compile "org.eclipse.jetty:jetty-webapp:$jetty8_version" 15 | compile "org.eclipse.jetty:jetty-security:$jetty8_version" 16 | compile "org.eclipse.jetty:jetty-jsp:$jetty8_version" 17 | compile "org.eclipse.jetty:jetty-annotations:$jetty8_version" 18 | compile "org.eclipse.jetty:jetty-plus:$jetty8_version" 19 | } 20 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/JettyRestartTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | import org.slf4j.Logger 12 | import org.slf4j.LoggerFactory 13 | 14 | /** 15 | * 16 | * @author akhikhl 17 | */ 18 | class JettyRestartTask extends AppRestartTask { 19 | 20 | protected static final Logger log = LoggerFactory.getLogger(JettyBeforeIntegrationTestTask) 21 | 22 | JettyRestartTask() { 23 | doFirst { 24 | log.warn 'JettyRestartTask is deprecated and will be removed in Gretty 2.0. Please use AppRestartTask instead.' 25 | } 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/JettyServiceTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | import org.slf4j.Logger 12 | import org.slf4j.LoggerFactory 13 | 14 | /** 15 | * 16 | * @author akhikhl 17 | */ 18 | abstract class JettyServiceTask extends AppServiceTask { 19 | 20 | protected static final Logger log = LoggerFactory.getLogger(JettyBeforeIntegrationTestTask) 21 | 22 | JettyServiceTask() { 23 | doFirst { 24 | log.warn 'JettyServiceTask is deprecated and will be removed in Gretty 2.0. Please use AppServiceTask instead.' 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /integrationTests/testAnnotations/src/integrationTest/groovy/org/akhikhl/examples/gretty/hellogretty/PageSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.hellogretty 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class PageSpec extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | } 20 | 21 | def 'should get expected response from the server'() { 22 | when: 23 | go "${baseURI}/annotations/whatever" 24 | then: 25 | $('h1').text() == /Hello, world!/ 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /integrationTests/webhost/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | RedirectFilter 8 | org.akhikhl.gretty.RedirectFilter 9 | 10 | 11 | RedirectFilter 12 | /* 13 | REQUEST 14 | FORWARD 15 | 16 | 17 | 18 | jsp 19 | *.html 20 | 21 | 22 | -------------------------------------------------------------------------------- /libs/gretty-core/src/main/resources/org/akhikhl/gretty/Externalized.properties: -------------------------------------------------------------------------------- 1 | grettyVersion=@grettyVersion@ 2 | jetty7Version=@jetty7Version@ 3 | jetty7ServletApiVersion=@jetty7ServletApiVersion@ 4 | jetty8Version=@jetty8Version@ 5 | jetty8ServletApiVersion=@jetty8ServletApiVersion@ 6 | jetty9Version=@jetty9Version@ 7 | jetty93Version=@jetty93Version@ 8 | jetty94Version=@jetty94Version@ 9 | jetty9ServletApiVersion=@jetty9ServletApiVersion@ 10 | tomcat7Version=@tomcat7Version@ 11 | tomcat7ServletApiVersion=@tomcat7ServletApiVersion@ 12 | tomcat8Version=@tomcat8Version@ 13 | tomcat8ServletApiVersion=@tomcat8ServletApiVersion@ 14 | springBootVersion=@springBootVersion@ 15 | springLoadedVersion=@springLoadedVersion@ 16 | springVersion=@springVersion@ 17 | slf4jVersion=@slf4jVersion@ 18 | logbackVersion=@logbackVersion@ 19 | asmVersion=@asmVersion@ -------------------------------------------------------------------------------- /integrationTests/farm/MyWebApp/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | RedirectFilter 8 | org.akhikhl.gretty.RedirectFilter 9 | 10 | 11 | RedirectFilter 12 | /* 13 | REQUEST 14 | FORWARD 15 | 16 | 17 | 18 | jsp 19 | *.html 20 | 21 | 22 | -------------------------------------------------------------------------------- /integrationTests/farmJacoco/MyWebApp/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | RedirectFilter 8 | org.akhikhl.gretty.RedirectFilter 9 | 10 | 11 | RedirectFilter 12 | /* 13 | REQUEST 14 | FORWARD 15 | 16 | 17 | 18 | jsp 19 | *.html 20 | 21 | 22 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebApp/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | RedirectFilter 8 | org.akhikhl.gretty.RedirectFilter 9 | 10 | 11 | RedirectFilter 12 | /* 13 | REQUEST 14 | FORWARD 15 | 16 | 17 | 18 | jsp 19 | *.html 20 | 21 | 22 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebApp2/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | RedirectFilter 8 | org.akhikhl.gretty.RedirectFilter 9 | 10 | 11 | RedirectFilter 12 | /* 13 | REQUEST 14 | FORWARD 15 | 16 | 17 | 18 | jsp 19 | *.html 20 | 21 | 22 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-simple/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | RedirectFilter 8 | org.akhikhl.gretty.RedirectFilter 9 | 10 | 11 | RedirectFilter 12 | /* 13 | REQUEST 14 | FORWARD 15 | 16 | 17 | 18 | jsp 19 | *.html 20 | 21 | 22 | -------------------------------------------------------------------------------- /integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/ProjectProperties.groovy: -------------------------------------------------------------------------------- 1 | package org.akhikhl.gretty.internal.integrationTests 2 | 3 | import org.apache.commons.configuration.PropertiesConfiguration 4 | 5 | class ProjectProperties { 6 | 7 | private static PropertiesConfiguration config 8 | 9 | static synchronized String getString(String key) { 10 | if(config == null) { 11 | config = new PropertiesConfiguration() 12 | URLConnection resConn = ProjectProperties.getResource('project.properties').openConnection() 13 | // this fixes exceptions when reloading classes in running application 14 | resConn.setUseCaches(false) 15 | resConn.getInputStream().withStream { 16 | config.load(it) 17 | } 18 | } 19 | config.getString(key) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /integrationTests/farmSecure/MyWebApp/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.FarmIntegrationTestPlugin' 5 | 6 | dependencies { 7 | compile 'org.webjars:bootstrap:3.2.0' 8 | compile 'org.webjars:jquery:2.1.1' 9 | } 10 | 11 | gretty { 12 | httpEnabled = false 13 | httpsEnabled = true 14 | //servletContainer = 'tomcat8' 15 | realm = 'auth' 16 | realmConfigFile = '../security' 17 | singleSignOn = true 18 | } 19 | 20 | farm { 21 | webapp project 22 | webapp ':farmSecure:MyWebService' 23 | } 24 | 25 | defineIntegrationTest() 26 | 27 | testAll.dependsOn defineFarmIntegrationTestAllContainers({ 28 | webapp project 29 | webapp ':farmSecure:MyWebService' 30 | }) 31 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/spring-boot-app/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | RedirectFilter 8 | org.akhikhl.gretty.RedirectFilter 9 | 10 | 11 | RedirectFilter 12 | /* 13 | REQUEST 14 | FORWARD 15 | 16 | 17 | 18 | jsp 19 | *.html 20 | 21 | 22 | -------------------------------------------------------------------------------- /integrationTests/testDuplicatingResources/src/integrationTest/groovy/org/akhikhl/examples/gretty/CheckIfWebInfLibsNotEmpty.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.hellogretty 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class RequestResponseIT extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | } 20 | 21 | def 'should get expected static page'() { 22 | when: 23 | go "${baseURI}" 24 | then: 25 | waitFor { $('p').text() == 'list size: 1' } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /libs/gretty-runner-jetty7/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: rootProject.file('common.gradle') 2 | 3 | configurations { 4 | compile { 5 | exclude group: 'org.eclipse.jetty.orbit', module: 'javax.servlet' 6 | exclude group: 'org.slf4j', module: 'slf4j-simple' 7 | exclude group: 'org.slf4j', module: 'jcl104-over-slf4j' 8 | } 9 | } 10 | 11 | dependencies { 12 | compile project(':libs:gretty-runner-jetty') 13 | compile "javax.servlet:servlet-api:$jetty7_servlet_api_version" 14 | compile "org.eclipse.jetty:jetty-server:$jetty7_version" 15 | compile "org.eclipse.jetty:jetty-servlet:$jetty7_version" 16 | compile "org.eclipse.jetty:jetty-webapp:$jetty7_version" 17 | compile "org.eclipse.jetty:jetty-security:$jetty7_version" 18 | compile "org.eclipse.jetty:jetty-jsp:$jetty7_version" 19 | compile "org.eclipse.jetty:jetty-plus:$jetty7_version" 20 | } 21 | -------------------------------------------------------------------------------- /integrationTests/gretty-taglib-example/src/integrationTest/groovy/org/akhikhl/examples/gretty/CheckIfWebInfLibsNotEmptySpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.hellogretty 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class CheckIfWebInfLibsNotEmptySpec extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | } 20 | 21 | def 'should get expected static page'() { 22 | when: 23 | go "${baseURI}" 24 | then: 25 | $('p').text() == '/WEB-INF/lib is not empty' 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-simple/src/main/groovy/org/akhikhl/examples/gretty/springbootsimple/MyController.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootsimple 10 | 11 | import org.springframework.web.bind.annotation.RestController 12 | import org.springframework.web.bind.annotation.RequestMapping 13 | import org.springframework.web.bind.annotation.RequestMethod 14 | 15 | @RestController 16 | @RequestMapping('/mycontroller') 17 | class MyController { 18 | 19 | @RequestMapping(value = '/getdate', method = RequestMethod.POST) 20 | Map home() { 21 | return [ date: new Date().format('EEE, d MMM yyyy') ] 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /libs/gretty-core/src/main/groovy/org/akhikhl/gretty/LauncherConfig.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | interface LauncherConfig { 16 | 17 | boolean getDebug() 18 | 19 | int getDebugPort() 20 | 21 | boolean getDebugSuspend() 22 | 23 | boolean getInteractive() 24 | 25 | boolean getManagedClassReload() 26 | 27 | ServerConfig getServerConfig() 28 | 29 | String getStopCommand() 30 | 31 | File getBaseDir() 32 | 33 | boolean getProductMode() 34 | 35 | WebAppClassPathResolver getWebAppClassPathResolver() 36 | 37 | Iterable getWebAppConfigs() 38 | } 39 | 40 | -------------------------------------------------------------------------------- /libs/gretty-springboot/src/main/groovy/org/akhikhl/gretty/AppServletInitializer.java: -------------------------------------------------------------------------------- 1 | package org.akhikhl.gretty; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.support.SpringBootServletInitializer; 5 | 6 | public class AppServletInitializer extends SpringBootServletInitializer { 7 | 8 | public static String springBootMainClass; 9 | 10 | public static void setSpringBootMainClass(String newValue) { 11 | springBootMainClass = newValue; 12 | } 13 | 14 | @Override 15 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 16 | try { 17 | return application.sources(Class.forName(springBootMainClass, true, AppServletInitializer.class.getClassLoader())); 18 | } catch (ClassNotFoundException e) { 19 | e.printStackTrace(); 20 | return application; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm-secure/spring-boot-webservice/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | Protected Area 9 | /* 10 | 11 | 12 | testuser 13 | 14 | 15 | 16 | testuser 17 | 18 | 19 | auth 20 | BASIC 21 | 22 | 23 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/spring-boot-webservice1/src/main/groovy/org/akhikhl/examples/gretty/springbootwebservice1/MyController.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootwebservice1 10 | 11 | import org.springframework.web.bind.annotation.RestController 12 | import org.springframework.web.bind.annotation.RequestMapping 13 | import org.springframework.web.bind.annotation.RequestMethod 14 | 15 | @RestController 16 | @RequestMapping('/mycontroller') 17 | class MyController { 18 | 19 | @RequestMapping(value = '/getdate', method = RequestMethod.POST) 20 | Map home() { 21 | return [ date: new Date().format('EEE, d MMM yyyy') ] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/spring-boot-webservice2/src/main/groovy/org/akhikhl/examples/gretty/springbootwebservice2/MyController.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootwebservice2 10 | 11 | import org.springframework.web.bind.annotation.RestController 12 | import org.springframework.web.bind.annotation.RequestMapping 13 | import org.springframework.web.bind.annotation.RequestMethod 14 | 15 | @RestController 16 | @RequestMapping('/mycontroller') 17 | class MyController { 18 | 19 | @RequestMapping(value = '/getdate', method = RequestMethod.POST) 20 | Map home() { 21 | return [ date: new Date().format('EEE, d MMM yyyy') ] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm-secure/spring-boot-webservice/src/main/groovy/org/akhikhl/examples/gretty/springbootwebservice/MyController.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootwebservice 10 | 11 | import org.springframework.web.bind.annotation.RestController 12 | import org.springframework.web.bind.annotation.RequestMapping 13 | import org.springframework.web.bind.annotation.RequestMethod 14 | 15 | @RestController 16 | @RequestMapping('/mycontroller') 17 | class MyController { 18 | 19 | @RequestMapping(value = '/getdate', method = RequestMethod.POST) 20 | Map home() { 21 | return [ date: new Date().format('EEE, d MMM yyyy') ] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /integrationTests/filterWebapp/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | import org.apache.tools.ant.filters.* 6 | 7 | dependencies { 8 | compile 'org.webjars:bootstrap:3.2.0' 9 | compile 'org.webjars:jquery:2.1.1' 10 | // We use Velocity for example of template processing within the webapp. 11 | compile 'org.apache.velocity:velocity:1.7' 12 | } 13 | 14 | gretty { 15 | webappCopy { 16 | // Enable filtering on all xml files in WEB-INF 17 | filesMatching 'WEB-INF/*.xml', { FileCopyDetails fileDetails -> 18 | logger.warn 'File filtered: {}', fileDetails.path 19 | filter ReplaceTokens, tokens: [ 20 | 'paramValue' : 'test123' 21 | ] 22 | } 23 | } 24 | } 25 | 26 | defineIntegrationTest() 27 | testAll.dependsOn defineIntegrationTestAllContainers() 28 | -------------------------------------------------------------------------------- /libs/gretty-runner-tomcat8/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: rootProject.file('common.gradle') 2 | 3 | dependencies { 4 | compile project(':libs:gretty-runner-tomcat'), { 5 | exclude group: 'org.apache.tomcat.embed' 6 | exclude group: 'javax.servlet', module: 'javax.servlet-api' 7 | } 8 | compile "org.apache.tomcat.embed:tomcat-embed-core:$tomcat8_version" 9 | compile "org.apache.tomcat.embed:tomcat-embed-el:$tomcat8_version" 10 | compile "org.apache.tomcat.embed:tomcat-embed-jasper:$tomcat8_version" 11 | compile "org.apache.tomcat.embed:tomcat-embed-logging-log4j:$tomcat8_version" 12 | compile "org.apache.tomcat.embed:tomcat-embed-websocket:$tomcat8_version" 13 | // this fixes incorrect dependency of tomcat-8.0.9 on ecj-4.4RC4 14 | if(tomcat8_version == '8.0.9') 15 | compile 'org.eclipse.jdt.core.compiler:ecj:4.4' 16 | compile "javax.servlet:javax.servlet-api:$tomcat8_servlet_api_version" 17 | } 18 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-simple/src/main/groovy/org/akhikhl/examples/gretty/springbootsimple/Application.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootsimple 10 | 11 | import java.util.Arrays 12 | 13 | import org.springframework.boot.SpringApplication 14 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration 15 | import org.springframework.context.annotation.ComponentScan 16 | import org.springframework.context.annotation.Configuration 17 | 18 | @Configuration 19 | @EnableAutoConfiguration 20 | @ComponentScan 21 | class Application { 22 | 23 | static void main(String[] args) { 24 | SpringApplication.run(Application.class, args) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /integrationTests/testAnnotationsOverlay/src/integrationTest/groovy/org/akhikhl/examples/gretty/hellogretty/PageSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.hellogretty 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class PageSpec extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | } 20 | 21 | def 'should get expected response from the server'() { 22 | when: 23 | go "${baseURI}/annotations/whatever" 24 | then: 25 | $('h1').text() == /Hello, world!/ 26 | $('p strong').text() == /The template for this page comes from webapp overlay./ 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/spring-boot-app/src/main/groovy/org/akhikhl/examples/gretty/springbootapp/Application.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootapp 10 | 11 | import java.util.Arrays 12 | 13 | import org.springframework.boot.SpringApplication 14 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration 15 | import org.springframework.context.annotation.ComponentScan 16 | import org.springframework.context.annotation.Configuration 17 | 18 | @Configuration 19 | @EnableAutoConfiguration 20 | @ComponentScan 21 | class Application { 22 | 23 | static void main(String[] args) { 24 | SpringApplication.run(Application.class, args) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /integrationTests/springBootWebSocket/src/main/java/org/akhikhl/examples/gretty/springbootwebsocket/GreetingController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootwebsocket; 10 | 11 | import org.springframework.messaging.handler.annotation.MessageMapping; 12 | import org.springframework.messaging.handler.annotation.SendTo; 13 | import org.springframework.stereotype.Controller; 14 | 15 | @Controller 16 | public class GreetingController { 17 | 18 | 19 | @MessageMapping("/hello") 20 | @SendTo("/topic/greetings") 21 | public Greeting greeting(HelloMessage message) throws Exception { 22 | return new Greeting("Hello, " + message.getName() + "!"); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm-secure/spring-boot-app/src/main/groovy/org/akhikhl/examples/gretty/springbootapp/Application.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootapp 10 | 11 | import java.util.Arrays 12 | 13 | import org.springframework.boot.SpringApplication 14 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration 15 | import org.springframework.context.annotation.ComponentScan 16 | import org.springframework.context.annotation.Configuration 17 | 18 | @Configuration 19 | @EnableAutoConfiguration 20 | @ComponentScan 21 | class Application { 22 | 23 | static void main(String[] args) { 24 | SpringApplication.run(Application.class, args) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /libs/gretty-core/src/main/groovy/org/akhikhl/gretty/FarmsConfig.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | class FarmsConfig { 16 | 17 | protected final Map farmsMap_ = [:] 18 | 19 | FarmConfig createFarm() { 20 | new FarmConfig() 21 | } 22 | 23 | void farm(String name = null, Closure closure) { 24 | if(name == null) 25 | name = '' 26 | def f = farmsMap_[name] 27 | if(f == null) 28 | f = farmsMap_[name] = createFarm() 29 | closure.delegate = f 30 | closure.resolveStrategy = Closure.DELEGATE_FIRST 31 | closure() 32 | } 33 | 34 | Map getFarmsMap() { 35 | farmsMap_.asImmutable() 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /libs/gretty/src/main/resources/logback-config-template/logback.groovy: -------------------------------------------------------------------------------- 1 | scan '30 seconds' 2 | 3 | String encoderPattern = '%-12date{HH:mm:ss} %-5level %logger{35} - %msg%n' 4 | String logDir = "$logDir" 5 | String logFileName = "$logFileName" 6 | 7 | def appenders = [] 8 | 9 | <% if(consoleLogEnabled) { %> 10 | appender('CONSOLE', ConsoleAppender) { 11 | encoder(PatternLayoutEncoder) { 12 | pattern = encoderPattern 13 | } 14 | } 15 | appenders.add('CONSOLE') 16 | <% } %> 17 | 18 | <% if(fileLogEnabled) { %> 19 | appender('FILE', RollingFileAppender) { 20 | file = "\${logDir}/\${logFileName}.log" 21 | append = true 22 | rollingPolicy(TimeBasedRollingPolicy) { 23 | fileNamePattern = "\${logDir}/\${logFileName}-%d{yyyy-MM-dd_HH}.log" 24 | maxHistory = 7 25 | } 26 | encoder(PatternLayoutEncoder) { 27 | pattern = encoderPattern 28 | } 29 | } 30 | appenders.add('FILE') 31 | <% } %> 32 | 33 | root $loggingLevel, appenders 34 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/spring-boot-webservice1/src/main/groovy/org/akhikhl/examples/gretty/springbootwebservice1/Application.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootwebservice1 10 | 11 | import java.util.Arrays 12 | 13 | import org.springframework.boot.SpringApplication 14 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration 15 | import org.springframework.context.annotation.ComponentScan 16 | import org.springframework.context.annotation.Configuration 17 | 18 | @Configuration 19 | @EnableAutoConfiguration 20 | @ComponentScan 21 | class Application { 22 | 23 | static void main(String[] args) { 24 | SpringApplication.run(Application.class, args) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/spring-boot-webservice2/src/main/groovy/org/akhikhl/examples/gretty/springbootwebservice2/Application.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootwebservice2 10 | 11 | import java.util.Arrays 12 | 13 | import org.springframework.boot.SpringApplication 14 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration 15 | import org.springframework.context.annotation.ComponentScan 16 | import org.springframework.context.annotation.Configuration 17 | 18 | @Configuration 19 | @EnableAutoConfiguration 20 | @ComponentScan 21 | class Application { 22 | 23 | static void main(String[] args) { 24 | SpringApplication.run(Application.class, args) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm-secure/spring-boot-webservice/src/main/groovy/org/akhikhl/examples/gretty/springbootwebservice/Application.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootwebservice 10 | 11 | import java.util.Arrays 12 | 13 | import org.springframework.boot.SpringApplication 14 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration 15 | import org.springframework.context.annotation.ComponentScan 16 | import org.springframework.context.annotation.Configuration 17 | 18 | @Configuration 19 | @EnableAutoConfiguration 20 | @ComponentScan 21 | class Application { 22 | 23 | static void main(String[] args) { 24 | SpringApplication.run(Application.class, args) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /libs/gretty-runner-tomcat/src/main/groovy/org/akhikhl/gretty/TomcatConfigurer.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | import org.apache.catalina.core.StandardContext 12 | import org.apache.catalina.startup.ContextConfig 13 | import org.apache.catalina.startup.Tomcat 14 | import org.apache.tomcat.JarScanner 15 | import org.slf4j.Logger 16 | 17 | /** 18 | * 19 | * @author akhikhl 20 | */ 21 | interface TomcatConfigurer { 22 | 23 | ContextConfig createContextConfig(URL[] classpathUrls) 24 | 25 | JarScanner createJarScanner(JarScanner jarScanner, JarSkipPatterns skipPatterns) 26 | 27 | void setBaseDir(Tomcat tomcat, File baseDir) 28 | 29 | void setResourceBase(StandardContext context, Map webappParams) 30 | } 31 | 32 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/JettyAfterIntegrationTestTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | import org.slf4j.Logger 12 | import org.slf4j.LoggerFactory 13 | 14 | /** 15 | * This class is deprecated, please use AppAfterIntegrationTestTask instead. 16 | * 17 | * @author akhikhl 18 | */ 19 | class JettyAfterIntegrationTestTask extends AppAfterIntegrationTestTask { 20 | 21 | protected static final Logger log = LoggerFactory.getLogger(JettyAfterIntegrationTestTask) 22 | 23 | JettyAfterIntegrationTestTask() { 24 | doFirst { 25 | log.warn 'JettyAfterIntegrationTestTask is deprecated and will be removed in Gretty 2.0. Please use AppAfterIntegrationTestTask instead.' 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/JettyBeforeIntegrationTestTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | import org.slf4j.Logger 12 | import org.slf4j.LoggerFactory 13 | 14 | /** 15 | * This class is deprecated, please use AppBeforeIntegrationTestTask instead. 16 | * 17 | * @author akhikhl 18 | */ 19 | class JettyBeforeIntegrationTestTask extends AppBeforeIntegrationTestTask { 20 | 21 | protected static final Logger log = LoggerFactory.getLogger(JettyBeforeIntegrationTestTask) 22 | 23 | JettyBeforeIntegrationTestTask() { 24 | doFirst { 25 | log.warn 'JettyBeforeIntegrationTestTask is deprecated and will be removed in Gretty 2.0. Please use AppBeforeIntegrationTestTask instead.' 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /libs/gretty-runner-jetty9/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: rootProject.file('common.gradle') 2 | 3 | configurations { 4 | compile { 5 | exclude group: 'org.eclipse.jetty.orbit', module: 'javax.servlet' 6 | } 7 | } 8 | 9 | dependencies { 10 | compile project(':libs:gretty-runner-jetty') 11 | compile "javax.servlet:javax.servlet-api:$jetty9_servlet_api_version" 12 | compile "org.eclipse.jetty:jetty-server:$jetty9_version" 13 | compile "org.eclipse.jetty:jetty-servlet:$jetty9_version" 14 | compile "org.eclipse.jetty:jetty-webapp:$jetty9_version" 15 | compile "org.eclipse.jetty:jetty-security:$jetty9_version" 16 | compile "org.eclipse.jetty:jetty-jsp:$jetty9_version" 17 | compile "org.eclipse.jetty:jetty-annotations:$jetty9_version" 18 | compile "org.eclipse.jetty:jetty-plus:$jetty9_version" 19 | compile "org.eclipse.jetty.websocket:javax-websocket-server-impl:$jetty9_version" 20 | compile "org.ow2.asm:asm:$asm_version" 21 | compile "org.ow2.asm:asm-commons:$asm_version" 22 | } 23 | -------------------------------------------------------------------------------- /libs/gretty-runner-jetty93/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: rootProject.file('common.gradle') 2 | 3 | configurations { 4 | compile { 5 | exclude group: 'org.eclipse.jetty.orbit', module: 'javax.servlet' 6 | } 7 | } 8 | 9 | dependencies { 10 | compile project(':libs:gretty-runner-jetty') 11 | compile "javax.servlet:javax.servlet-api:$jetty9_servlet_api_version" 12 | compile "org.eclipse.jetty:jetty-server:$jetty93_version" 13 | compile "org.eclipse.jetty:jetty-servlet:$jetty93_version" 14 | compile "org.eclipse.jetty:jetty-webapp:$jetty93_version" 15 | compile "org.eclipse.jetty:jetty-security:$jetty93_version" 16 | compile "org.eclipse.jetty:apache-jsp:$jetty93_version" 17 | compile "org.eclipse.jetty:jetty-annotations:$jetty93_version" 18 | compile "org.eclipse.jetty:jetty-plus:$jetty93_version" 19 | compile "org.eclipse.jetty.websocket:javax-websocket-server-impl:$jetty93_version" 20 | compile "org.ow2.asm:asm:$asm_version" 21 | compile "org.ow2.asm:asm-commons:$asm_version" 22 | } 23 | -------------------------------------------------------------------------------- /libs/gretty-runner-jetty94/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: rootProject.file('common.gradle') 2 | 3 | configurations { 4 | compile { 5 | exclude group: 'org.eclipse.jetty.orbit', module: 'javax.servlet' 6 | } 7 | } 8 | 9 | dependencies { 10 | compile project(':libs:gretty-runner-jetty') 11 | compile "javax.servlet:javax.servlet-api:$jetty9_servlet_api_version" 12 | compile "org.eclipse.jetty:jetty-server:$jetty94_version" 13 | compile "org.eclipse.jetty:jetty-servlet:$jetty94_version" 14 | compile "org.eclipse.jetty:jetty-webapp:$jetty94_version" 15 | compile "org.eclipse.jetty:jetty-security:$jetty94_version" 16 | compile "org.eclipse.jetty:apache-jsp:$jetty94_version" 17 | compile "org.eclipse.jetty:jetty-annotations:$jetty94_version" 18 | compile "org.eclipse.jetty:jetty-plus:$jetty94_version" 19 | compile "org.eclipse.jetty.websocket:javax-websocket-server-impl:$jetty94_version" 20 | compile "org.ow2.asm:asm:$asm_version" 21 | compile "org.ow2.asm:asm-commons:$asm_version" 22 | } 23 | -------------------------------------------------------------------------------- /integrationTests/springBootWebSocket/src/main/java/org/akhikhl/examples/gretty/springbootwebsocket/Application.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootwebsocket; 10 | 11 | import org.springframework.boot.SpringApplication; 12 | import org.springframework.boot.autoconfigure.SpringBootApplication; 13 | //import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 14 | //import org.springframework.context.annotation.ComponentScan; 15 | //import org.springframework.context.annotation.Configuration; 16 | 17 | @SpringBootApplication 18 | //@Configuration 19 | //@EnableAutoConfiguration 20 | //@ComponentScan 21 | public class Application { 22 | 23 | public static void main(String[] args) { 24 | SpringApplication.run(Application.class, args); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /integrationTests/farm/MyWebService/src/integrationTest/groovy/org/akhikhl/examples/gretty/mywebservice/WebServiceSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.mywebservice 10 | 11 | import org.akhikhl.gretty.GrettyAjaxSpec 12 | import static groovyx.net.http.ContentType.* 13 | import static groovyx.net.http.Method.* 14 | 15 | class WebServiceSpec extends GrettyAjaxSpec { 16 | 17 | def 'should handle requests'() { 18 | when: 19 | def result = conn.request(POST, JSON) { 20 | uri.path = "${contextPath}/getdate" 21 | response.success = { resp, json -> 22 | json.date 23 | } 24 | response.failure = { resp -> 25 | resp.statusLine.statusCode 26 | } 27 | } 28 | then: 29 | result == new Date().format('EEE, d MMM yyyy') 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /libs/gretty-runner-jetty7/src/main/groovy/org/akhikhl/gretty/LifeCycleListenerAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty; 10 | 11 | import org.eclipse.jetty.util.component.LifeCycle; 12 | 13 | /** 14 | * 15 | * @author akhikhl 16 | */ 17 | public class LifeCycleListenerAdapter implements LifeCycle.Listener { 18 | 19 | @Override 20 | public void lifeCycleStarting(LifeCycle event) { 21 | 22 | } 23 | 24 | @Override 25 | public void lifeCycleStarted(LifeCycle event) { 26 | 27 | } 28 | 29 | @Override 30 | public void lifeCycleFailure(LifeCycle event, Throwable cause) { 31 | 32 | } 33 | 34 | @Override 35 | public void lifeCycleStopping(LifeCycle event) { 36 | 37 | } 38 | 39 | @Override 40 | public void lifeCycleStopped(LifeCycle event) { 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /libs/gretty-runner-jetty8/src/main/groovy/org/akhikhl/gretty/LifeCycleListenerAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty; 10 | 11 | import org.eclipse.jetty.util.component.LifeCycle; 12 | 13 | /** 14 | * 15 | * @author akhikhl 16 | */ 17 | public class LifeCycleListenerAdapter implements LifeCycle.Listener { 18 | 19 | @Override 20 | public void lifeCycleStarting(LifeCycle event) { 21 | 22 | } 23 | 24 | @Override 25 | public void lifeCycleStarted(LifeCycle event) { 26 | 27 | } 28 | 29 | @Override 30 | public void lifeCycleFailure(LifeCycle event, Throwable cause) { 31 | 32 | } 33 | 34 | @Override 35 | public void lifeCycleStopping(LifeCycle event) { 36 | 37 | } 38 | 39 | @Override 40 | public void lifeCycleStopped(LifeCycle event) { 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /libs/gretty-runner-jetty9/src/main/groovy/org/akhikhl/gretty/LifeCycleListenerAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty; 10 | 11 | import org.eclipse.jetty.util.component.LifeCycle; 12 | 13 | /** 14 | * 15 | * @author akhikhl 16 | */ 17 | public class LifeCycleListenerAdapter implements LifeCycle.Listener { 18 | 19 | @Override 20 | public void lifeCycleStarting(LifeCycle event) { 21 | 22 | } 23 | 24 | @Override 25 | public void lifeCycleStarted(LifeCycle event) { 26 | 27 | } 28 | 29 | @Override 30 | public void lifeCycleFailure(LifeCycle event, Throwable cause) { 31 | 32 | } 33 | 34 | @Override 35 | public void lifeCycleStopping(LifeCycle event) { 36 | 37 | } 38 | 39 | @Override 40 | public void lifeCycleStopped(LifeCycle event) { 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /libs/gretty-runner-jetty93/src/main/groovy/org/akhikhl/gretty/LifeCycleListenerAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty; 10 | 11 | import org.eclipse.jetty.util.component.LifeCycle; 12 | 13 | /** 14 | * 15 | * @author akhikhl 16 | */ 17 | public class LifeCycleListenerAdapter implements LifeCycle.Listener { 18 | 19 | @Override 20 | public void lifeCycleStarting(LifeCycle event) { 21 | 22 | } 23 | 24 | @Override 25 | public void lifeCycleStarted(LifeCycle event) { 26 | 27 | } 28 | 29 | @Override 30 | public void lifeCycleFailure(LifeCycle event, Throwable cause) { 31 | 32 | } 33 | 34 | @Override 35 | public void lifeCycleStopping(LifeCycle event) { 36 | 37 | } 38 | 39 | @Override 40 | public void lifeCycleStopped(LifeCycle event) { 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /libs/gretty-runner-jetty94/src/main/groovy/org/akhikhl/gretty/LifeCycleListenerAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty; 10 | 11 | import org.eclipse.jetty.util.component.LifeCycle; 12 | 13 | /** 14 | * 15 | * @author akhikhl 16 | */ 17 | public class LifeCycleListenerAdapter implements LifeCycle.Listener { 18 | 19 | @Override 20 | public void lifeCycleStarting(LifeCycle event) { 21 | 22 | } 23 | 24 | @Override 25 | public void lifeCycleStarted(LifeCycle event) { 26 | 27 | } 28 | 29 | @Override 30 | public void lifeCycleFailure(LifeCycle event, Throwable cause) { 31 | 32 | } 33 | 34 | @Override 35 | public void lifeCycleStopping(LifeCycle event) { 36 | 37 | } 38 | 39 | @Override 40 | public void lifeCycleStopped(LifeCycle event) { 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /integrationTests/farmJacoco/MyWebService/src/integrationTest/groovy/org/akhikhl/examples/gretty/mywebservice/WebServiceSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.mywebservice 10 | 11 | import org.akhikhl.gretty.GrettyAjaxSpec 12 | import static groovyx.net.http.ContentType.* 13 | import static groovyx.net.http.Method.* 14 | 15 | class WebServiceSpec extends GrettyAjaxSpec { 16 | 17 | def 'should handle requests'() { 18 | when: 19 | def result = conn.request(POST, JSON) { 20 | uri.path = "${contextPath}/getdate" 21 | response.success = { resp, json -> 22 | json.date 23 | } 24 | response.failure = { resp -> 25 | resp.statusLine.statusCode 26 | } 27 | } 28 | then: 29 | result == new Date().format('EEE, d MMM yyyy') 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebService/src/integrationTest/groovy/org/akhikhl/examples/gretty/mywebservice/WebServiceSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.mywebservice 10 | 11 | import org.akhikhl.gretty.GrettyAjaxSpec 12 | import static groovyx.net.http.ContentType.* 13 | import static groovyx.net.http.Method.* 14 | 15 | class WebServiceSpec extends GrettyAjaxSpec { 16 | 17 | def 'should handle requests'() { 18 | when: 19 | def result = conn.request(POST, JSON) { 20 | uri.path = "${contextPath}/getdate" 21 | response.success = { resp, json -> 22 | json.date 23 | } 24 | response.failure = { resp -> 25 | resp.statusLine.statusCode 26 | } 27 | } 28 | then: 29 | result == new Date().format('EEE, d MMM yyyy') 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebService2/src/integrationTest/groovy/org/akhikhl/examples/gretty/mywebservice/WebServiceSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.mywebservice 10 | 11 | import org.akhikhl.gretty.GrettyAjaxSpec 12 | import static groovyx.net.http.ContentType.* 13 | import static groovyx.net.http.Method.* 14 | 15 | class WebServiceSpec extends GrettyAjaxSpec { 16 | 17 | def 'should handle requests'() { 18 | when: 19 | def result = conn.request(POST, JSON) { 20 | uri.path = "${contextPath}/getdate" 21 | response.success = { resp, json -> 22 | json.date 23 | } 24 | response.failure = { resp -> 25 | resp.statusLine.statusCode 26 | } 27 | } 28 | then: 29 | result == new Date().format('EEE, d MMM yyyy') 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /libs/gretty-core/src/main/groovy/org/akhikhl/gretty/Externalized.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | import org.apache.commons.configuration.PropertiesConfiguration 12 | 13 | /** 14 | * 15 | * @author akhikhl 16 | */ 17 | class Externalized { 18 | 19 | private static PropertiesConfiguration config 20 | 21 | static String getString(String key) { 22 | if(config == null) { 23 | config = new PropertiesConfiguration() 24 | URLConnection resConn = Externalized.getResource('Externalized.properties').openConnection() 25 | // this fixes exceptions when reloading classes in running application 26 | resConn.setUseCaches(false) 27 | resConn.getInputStream().withStream { 28 | config.load(it) 29 | } 30 | } 31 | config.getString(key) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /integrationTests/testWar/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.akhikhl.gretty' 2 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 3 | 4 | task integrationTest(type: Test) { 5 | outputs.upToDateWhen { false } 6 | include '**/*IT.*' 7 | // we explain to integrationTest that contextPath under test is "helloGretty", not "testWar" 8 | ext.contextPath = 'helloGretty' 9 | // specific to concrete test harness 10 | doFirst { 11 | systemProperty 'geb.build.reportsDir', reporting.file('geb') 12 | } 13 | } 14 | 15 | farm { 16 | webapp '../helloGretty/build/libs/helloGretty.war' 17 | integrationTestProject project 18 | } 19 | 20 | afterEvaluate { 21 | // this is needed because integrationTest task does not belong to webapps listed in farms 22 | project.tasks.farmIntegrationTest.dependsOn project.tasks.integrationTest 23 | // this is needed only if WAR-file is generated in the same project tree 24 | project.tasks.farmBeforeIntegrationTest.dependsOn ':helloGretty:build' 25 | } 26 | 27 | tasks.testAll.dependsOn { tasks.farmIntegrationTest } 28 | -------------------------------------------------------------------------------- /integrationTests/websocket/src/main/resources/logback.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | scan '30 seconds' 10 | 11 | String encoderPattern = '%-12date{HH:mm:ss} %-5level %logger{35} - %msg%n' 12 | String logDir = "${System.getProperty('user.home')}/logs" 13 | String logFileName = 'websocket' 14 | 15 | appender('CONSOLE', ConsoleAppender) { 16 | encoder(PatternLayoutEncoder) { 17 | pattern = encoderPattern 18 | } 19 | } 20 | 21 | appender('FILE', RollingFileAppender) { 22 | file = "${logDir}/${logFileName}.log" 23 | append = true 24 | rollingPolicy(TimeBasedRollingPolicy) { 25 | fileNamePattern = "${logDir}/${logFileName}-%d{yyyy-MM-dd_HH}.log" 26 | maxHistory = 7 27 | } 28 | encoder(PatternLayoutEncoder) { 29 | pattern = encoderPattern 30 | } 31 | } 32 | 33 | root WARN, ['CONSOLE', 'FILE'] 34 | 35 | logger 'org.akhikhl.gretty', INFO 36 | 37 | -------------------------------------------------------------------------------- /libs/gretty/src/main/groovy/org/akhikhl/gretty/GrettyExtension.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.gretty 10 | 11 | /** 12 | * 13 | * @author akhikhl 14 | */ 15 | class GrettyExtension extends GrettyConfig { 16 | 17 | int debugPort = 5005 18 | boolean debugSuspend = true 19 | boolean jacocoEnabled = true; 20 | 21 | protected List overlays = [] 22 | 23 | String integrationTestTask = 'integrationTest' 24 | 25 | protected afterEvaluate = [] 26 | 27 | Closure webappCopy = {} 28 | 29 | boolean autoConfigureRepositories = false 30 | 31 | void afterEvaluate(Closure closure) { 32 | afterEvaluate.add(closure) 33 | } 34 | 35 | void overlay(def newValue) { 36 | if(!(newValue instanceof String)) 37 | throw new Exception("Overlay ${newValue?.toString()} should be a string") 38 | overlays.add newValue 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | rootProjectName = gretty-root 2 | projectId=gretty 3 | description=Advanced gradle plugin for running web-apps on jetty and tomcat 4 | projectLabels=gretty,jetty,gradle,plugin,spring,spring-boot 5 | developerId=akhikhl 6 | developerName=Andrey Hihlovskiy 7 | license=The MIT License 8 | group=org.akhikhl.gretty 9 | version=2.0.1-SNAPSHOT 10 | jetty7_version=7.6.16.v20140903 11 | jetty7_servlet_api_version=2.5 12 | # Cannot upgrade to Jetty 8.1.15 or newer until issue #159 is resolved. 13 | jetty8_version=8.1.8.v20121106 14 | jetty8_servlet_api_version=3.0.1 15 | jetty9_version=9.2.22.v20170606 16 | jetty93_version=9.3.20.v20170531 17 | jetty94_version=9.4.6.v20170531 18 | jetty9_servlet_api_version=3.1.0 19 | tomcat7_version=7.0.78 20 | tomcat7_servlet_api_version=3.0.1 21 | tomcat8_version=8.0.44 22 | tomcat8_servlet_api_version=3.1.0 23 | asm_version=5.0.3 24 | groovy_version=2.4.11 25 | spock_version=1.1-groovy-2.4 26 | logback_version=1.1.3 27 | slf4j_version=1.7.12 28 | springBootVersion=1.5.4.RELEASE 29 | springLoadedVersion=1.2.5.RELEASE 30 | springVersion=4.3.9.RELEASE 31 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/jee-webservice/src/integrationTest/groovy/org/akhikhl/examples/gretty/org/akhikhl/examples/gretty/mywebservice/RequestResponseIT.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.mywebservice 10 | 11 | import org.akhikhl.gretty.GrettyAjaxSpec 12 | import static groovyx.net.http.ContentType.* 13 | import static groovyx.net.http.Method.* 14 | 15 | class RequestResponseIT extends GrettyAjaxSpec { 16 | 17 | def 'should handle requests'() { 18 | when: 19 | def result = conn.request(POST, JSON) { 20 | uri.path = "${contextPath}/myservlet/getdate" 21 | response.success = { resp, json -> 22 | json.date 23 | } 24 | response.failure = { resp -> 25 | resp.statusLine.statusCode 26 | } 27 | } 28 | then: 29 | result == new Date().format('EEE, d MMM yyyy') 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/spring-boot-webservice1/src/integrationTest/groovy/org/akhikhl/examples/gretty/springbootwebservice1/RequestResponseIT.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootwebservice1 10 | 11 | import org.akhikhl.gretty.GrettyAjaxSpec 12 | import static groovyx.net.http.ContentType.* 13 | import static groovyx.net.http.Method.* 14 | 15 | class RequestResponseIT extends GrettyAjaxSpec { 16 | 17 | def 'should handle requests'() { 18 | when: 19 | def result = conn.request(POST, JSON) { 20 | uri.path = "${contextPath}/mycontroller/getdate" 21 | response.success = { resp, json -> 22 | json.date 23 | } 24 | response.failure = { resp -> 25 | resp.statusLine.statusCode 26 | } 27 | } 28 | then: 29 | result == new Date().format('EEE, d MMM yyyy') 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/spring-boot-webservice2/src/integrationTest/groovy/org/akhikhl/examples/gretty/springbootwebservice2/RequestResponseIT.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.springbootwebservice2 10 | 11 | import org.akhikhl.gretty.GrettyAjaxSpec 12 | import static groovyx.net.http.ContentType.* 13 | import static groovyx.net.http.Method.* 14 | 15 | class RequestResponseIT extends GrettyAjaxSpec { 16 | 17 | def 'should handle requests'() { 18 | when: 19 | def result = conn.request(POST, JSON) { 20 | uri.path = "${contextPath}/mycontroller/getdate" 21 | response.success = { resp, json -> 22 | json.date 23 | } 24 | response.failure = { resp -> 25 | resp.statusLine.statusCode 26 | } 27 | } 28 | then: 29 | result == new Date().format('EEE, d MMM yyyy') 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-simple/src/main/resources/logback.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | scan '30 seconds' 10 | 11 | String encoderPattern = '%-12date{HH:mm:ss} %-5level %logger{35} - %msg%n' 12 | String logDir = "${System.getProperty('user.home')}/logs" 13 | String logFileName = 'spring-boot-simple' 14 | 15 | appender('CONSOLE', ConsoleAppender) { 16 | encoder(PatternLayoutEncoder) { 17 | pattern = encoderPattern 18 | } 19 | } 20 | 21 | appender('FILE', RollingFileAppender) { 22 | file = "${logDir}/${logFileName}.log" 23 | append = true 24 | rollingPolicy(TimeBasedRollingPolicy) { 25 | fileNamePattern = "${logDir}/${logFileName}-%d{yyyy-MM-dd_HH}.log" 26 | maxHistory = 7 27 | } 28 | encoder(PatternLayoutEncoder) { 29 | pattern = encoderPattern 30 | } 31 | } 32 | 33 | root WARN, ['CONSOLE', 'FILE'] 34 | 35 | logger 'org.akhikhl.gretty', INFO 36 | 37 | -------------------------------------------------------------------------------- /integrationTests/springBootWebSocket/src/main/resources/logback.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | scan '30 seconds' 10 | 11 | String encoderPattern = '%-12date{HH:mm:ss} %-5level %logger{35} - %msg%n' 12 | String logDir = "${System.getProperty('user.home')}/logs" 13 | String logFileName = 'springBootWebSocket' 14 | 15 | appender('CONSOLE', ConsoleAppender) { 16 | encoder(PatternLayoutEncoder) { 17 | pattern = encoderPattern 18 | } 19 | } 20 | 21 | appender('FILE', RollingFileAppender) { 22 | file = "${logDir}/${logFileName}.log" 23 | append = true 24 | rollingPolicy(TimeBasedRollingPolicy) { 25 | fileNamePattern = "${logDir}/${logFileName}-%d{yyyy-MM-dd_HH}.log" 26 | maxHistory = 7 27 | } 28 | encoder(PatternLayoutEncoder) { 29 | pattern = encoderPattern 30 | } 31 | } 32 | 33 | root WARN, ['CONSOLE', 'FILE'] 34 | 35 | logger 'org.akhikhl.gretty', INFO 36 | 37 | -------------------------------------------------------------------------------- /integrationTests/grettyLogging_logback/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | logs/mylog.log 4 | 5 | logs/mylog.%i.log.zip 6 | 1 7 | 3 8 | 9 | 10 | 11 | 5MB 12 | 13 | 14 | %date{YYYY-MM-dd HH:mm:ss} %level [%thread] %logger{10} [%file:%line] %msg%n 15 | 16 | 17 | 18 | 19 | 20 | %msg%n 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /integrationTests/helloGretty/src/integrationTest/groovy/org/akhikhl/examples/gretty/hellogretty/PageSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.hellogretty 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class PageSpec extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | } 20 | 21 | def 'should get expected static page'() { 22 | when: 23 | go "${baseURI}/index.html" 24 | then: 25 | $('h1').text() == 'Hello, world!' 26 | $('p', 0).text() == /This is static HTML page./ 27 | } 28 | 29 | def 'should get expected response from servlet'() { 30 | when: 31 | go "${baseURI}/dynamic" 32 | then: 33 | $('h1').text() == 'Hello, world!' 34 | $('p', 0).text() == /This is dynamic HTML page generated by servlet./ 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /integrationTests/filterWebapp/src/integrationTest/groovy/org/akhikhl/examples/gretty/hellogretty/PageSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.hellogretty 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class PageSpec extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | } 20 | 21 | def 'should get expected static page'() { 22 | when: 23 | go "${baseURI}/index.html" 24 | then: 25 | $('h1').text() == 'Hello, world!' 26 | $('p', 0).text() == /This is static HTML page./ 27 | } 28 | 29 | def 'should get expected response from servlet'() { 30 | when: 31 | go "${baseURI}/dynamic" 32 | then: 33 | $('h1').text() == 'Hello, world!' 34 | $('p', 0).text() == /This is dynamic HTML page generated by servlet./ 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /integrationTests/jacocoExample/src/integrationTest/groovy/org/akhikhl/examples/gretty/hellogretty/PageSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.hellogretty 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class PageSpec extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | } 20 | 21 | def 'should get expected static page'() { 22 | when: 23 | go "${baseURI}/index.html" 24 | then: 25 | $('h1').text() == 'Hello, world!' 26 | $('p', 0).text() == /This is static HTML page./ 27 | } 28 | 29 | def 'should get expected response from servlet'() { 30 | when: 31 | go "${baseURI}/dynamic" 32 | then: 33 | $('h1').text() == 'Hello, world!' 34 | $('p', 0).text() == /This is dynamic HTML page generated by servlet./ 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/spring-boot-app/src/main/resources/logback.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | scan '30 seconds' 10 | 11 | String encoderPattern = '%-12date{HH:mm:ss} %-5level %logger{35} - %msg%n' 12 | String logDir = "${System.getProperty('user.home')}/logs" 13 | String logFileName = 'spring-boot-app' 14 | 15 | appender('CONSOLE', ConsoleAppender) { 16 | encoder(PatternLayoutEncoder) { 17 | pattern = encoderPattern 18 | } 19 | } 20 | 21 | appender('FILE', RollingFileAppender) { 22 | file = "${logDir}/${logFileName}.log" 23 | append = true 24 | rollingPolicy(TimeBasedRollingPolicy) { 25 | fileNamePattern = "${logDir}/${logFileName}-%d{yyyy-MM-dd_HH}.log" 26 | maxHistory = 7 27 | } 28 | encoder(PatternLayoutEncoder) { 29 | pattern = encoderPattern 30 | } 31 | } 32 | 33 | root WARN, ['CONSOLE', 'FILE'] 34 | 35 | logger 'org.akhikhl.gretty', INFO 36 | 37 | -------------------------------------------------------------------------------- /integrationTests/buildSrc/gretty-integrationTest/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'groovy' 2 | 3 | import org.apache.tools.ant.filters.* 4 | 5 | dependencies { 6 | compile gradleApi() 7 | compile "commons-configuration:commons-configuration:$commons_configuration_version" 8 | compile "de.undercouch:gradle-download-task:$gradle_download_task_version" 9 | compile "org.akhikhl.gretty:gretty:$version" 10 | } 11 | 12 | def projectProps = [ 13 | projectGroup: project.group, 14 | projectName: project.name, 15 | projectVersion: project.version, 16 | buildDate: new Date().format('yyyy-MM-dd'), 17 | buildUser: System.getProperty('user.name'), 18 | buildOrigin: ('hostname'.execute().text.trim()), 19 | gebVersion: project.gebVersion, 20 | geckoDriverVersion: project.geckoDriverVersion, 21 | groovy_version: project.groovy_version, 22 | seleniumVersion: project.seleniumVersion, 23 | spock_version: project.spock_version 24 | ] 25 | 26 | processResources { 27 | inputs.properties projectProps 28 | filesMatching('**/project.properties') { 29 | filter ReplaceTokens, tokens: projectProps 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm-secure/spring-boot-app/src/main/resources/logback.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | scan '30 seconds' 10 | 11 | String encoderPattern = '%-12date{HH:mm:ss} %-5level %logger{35} - %msg%n' 12 | String logDir = "${System.getProperty('user.home')}/logs" 13 | String logFileName = 'spring-boot-app' 14 | 15 | appender('CONSOLE', ConsoleAppender) { 16 | encoder(PatternLayoutEncoder) { 17 | pattern = encoderPattern 18 | } 19 | } 20 | 21 | appender('FILE', RollingFileAppender) { 22 | file = "${logDir}/${logFileName}.log" 23 | append = true 24 | rollingPolicy(TimeBasedRollingPolicy) { 25 | fileNamePattern = "${logDir}/${logFileName}-%d{yyyy-MM-dd_HH}.log" 26 | maxHistory = 7 27 | } 28 | encoder(PatternLayoutEncoder) { 29 | pattern = encoderPattern 30 | } 31 | } 32 | 33 | root WARN, ['CONSOLE', 'FILE'] 34 | 35 | logger 'org.akhikhl.gretty', INFO 36 | 37 | -------------------------------------------------------------------------------- /integrationTests/jacocoInstantiateTasks/src/integrationTest/groovy/org/akhikhl/examples/gretty/hellogretty/PageSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.hellogretty 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class PageSpec extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | } 20 | 21 | def 'should get expected static page'() { 22 | when: 23 | go "${baseURI}/index.html" 24 | then: 25 | $('h1').text() == 'Hello, world!' 26 | $('p', 0).text() == /This is static HTML page./ 27 | } 28 | 29 | def 'should get expected response from servlet'() { 30 | when: 31 | go "${baseURI}/dynamic" 32 | then: 33 | $('h1').text() == 'Hello, world!' 34 | $('p', 0).text() == /This is dynamic HTML page generated by servlet./ 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm/spring-boot-app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.akhikhl.gretty' 2 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.FarmIntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile "org.codehaus.groovy:groovy-all:$groovy_version" 7 | compile 'org.webjars:bootstrap:3.2.0' 8 | compile 'org.webjars:jquery:2.1.1' 9 | } 10 | 11 | gretty { 12 | springBoot = true 13 | } 14 | 15 | farm { 16 | managedClassReload = true 17 | servletContainer = 'jetty8' 18 | httpPort = 8081 19 | webapp project 20 | webapp ':spring-boot-farm:spring-boot-webservice1' 21 | webapp ':spring-boot-farm:spring-boot-webservice2' 22 | webapp ':spring-boot-farm:jee-webservice' 23 | } 24 | 25 | defineIntegrationTest() 26 | 27 | testAll.dependsOn defineFarmIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat7', 'tomcat8'], { 28 | webapp project 29 | webapp ':spring-boot-farm:spring-boot-webservice1' 30 | webapp ':spring-boot-farm:spring-boot-webservice2' 31 | webapp ':spring-boot-farm:jee-webservice' 32 | }) 33 | -------------------------------------------------------------------------------- /integrationTests/farmJacoco/MyWebService/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | apply plugin: 'jacoco' 5 | 6 | jacoco { 7 | toolVersion = '+' 8 | } 9 | 10 | defineIntegrationTest() 11 | 12 | // client-side exec-file, not related to gretty 13 | tasks.integrationTest.jacoco { 14 | append = false 15 | destinationFile = new File(project.buildDir, 'jacoco/integrationTest_client.exec') 16 | } 17 | 18 | // client-side report, not related to gretty 19 | task('integrationTestClientReport', type: JacocoReport) { 20 | 21 | tasks.integrationTest.finalizedBy it 22 | 23 | executionData tasks.integrationTest 24 | 25 | sourceDirectories = project.files(project.sourceSets.test.allSource.srcDirs) 26 | classDirectories = project.sourceSets.test.output 27 | 28 | def reportDir = project.reporting.file("jacoco/integrationTest_client/html") 29 | reports { 30 | html.destination = reportDir 31 | } 32 | doLast { 33 | println "Jacoco report for client created: file://${reportDir.toURI().path}" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm-secure/spring-boot-app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.akhikhl.gretty' 2 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.FarmIntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile "org.codehaus.groovy:groovy-all:$groovy_version" 7 | compile 'org.webjars:bootstrap:3.2.0' 8 | compile 'org.webjars:jquery:2.1.1' 9 | } 10 | 11 | gretty { 12 | springBoot = true 13 | httpEnabled = false 14 | httpsEnabled = true 15 | servletContainer = 'jetty9' 16 | realm = 'auth' 17 | realmConfigFile = '../security' 18 | singleSignOn = true 19 | } 20 | 21 | farm { 22 | webapp project 23 | webapp ':spring-boot-farm-secure:spring-boot-webservice' 24 | webapp ':spring-boot-farm-secure:jee-webservice' 25 | } 26 | 27 | defineIntegrationTest() 28 | 29 | testAll.dependsOn defineFarmIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat7', 'tomcat8'], { 30 | webapp project 31 | webapp ':spring-boot-farm-secure:spring-boot-webservice' 32 | webapp ':spring-boot-farm-secure:jee-webservice' 33 | }) 34 | -------------------------------------------------------------------------------- /integrationTests/testTomcatContextConfig/src/integrationTest/groovy/org/akhikhl/examples/gretty/hellogretty/RequestResponseIT.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.hellogretty 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class RequestResponseIT extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | } 20 | 21 | def 'should get expected static page'() { 22 | when: 23 | go "${baseURI}/index.html" 24 | then: 25 | $('h1').text() == 'Hello, world!' 26 | $('p', 0).text() == /This is static HTML page./ 27 | } 28 | 29 | def 'should get expected response from servlet'() { 30 | when: 31 | go "${baseURI}/dynamic" 32 | then: 33 | $('h1').text() == 'Hello, world!' 34 | $('p', 0).text() == /This is dynamic HTML page generated by servlet./ 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /integrationTests/testTomcatServerConfig/src/integrationTest/groovy/org/akhikhl/examples/gretty/hellogretty/RequestResponseIT.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.hellogretty 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class RequestResponseIT extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | } 20 | 21 | def 'should get expected static page'() { 22 | when: 23 | go "${baseURI}/index.html" 24 | then: 25 | $('h1').text() == 'Hello, world!' 26 | $('p', 0).text() == /This is static HTML page./ 27 | } 28 | 29 | def 'should get expected response from servlet'() { 30 | when: 31 | go "${baseURI}/dynamic" 32 | then: 33 | $('h1').text() == 'Hello, world!' 34 | $('p', 0).text() == /This is dynamic HTML page generated by servlet./ 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /integrationTests/helloGretty/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello-world page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

Hello, world!

18 |

This is static HTML page.

19 |

Click here to see dynamic page generated by servlet.

20 |
21 |
22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /integrationTests/filterWebapp/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello-world page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

Hello, world!

18 |

This is static HTML page.

19 |

Click here to see dynamic page generated by servlet.

20 |
21 |
22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /integrationTests/jacocoExample/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello-world page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

Hello, world!

18 |

This is static HTML page.

19 |

Click here to see dynamic page generated by servlet.

20 |
21 |
22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /integrationTests/farmJacoco/MyWebApp/src/integrationTest/groovy/org/akhikhl/examples/gretty/mywebapp/WebAppSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.mywebapp 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class WebAppSpec extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | } 20 | 21 | def 'should get expected static page'() { 22 | when: 23 | go baseURI 24 | then: 25 | $('h1').text() == 'Hello, world!' 26 | $('p', 0).text() == /This is static HTML page./ 27 | } 28 | 29 | def 'should get response from MyWebService'() { 30 | if(!System.getProperty('gretty.farm')) 31 | return 32 | when: 33 | go baseURI 34 | $('#sendRequest').click() 35 | then: 36 | $('#result').text() == 'Got from server: ' + new Date().format('EEE, d MMM yyyy') 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebApp/src/integrationTest/groovy/org/akhikhl/examples/gretty/mywebapp/WebAppSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.mywebapp 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class WebAppSpec extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | } 20 | 21 | def 'should get expected static page'() { 22 | when: 23 | go baseURI 24 | then: 25 | $('h1').text() == 'Hello, world!' 26 | $('p', 0).text() == /This is static HTML page./ 27 | } 28 | 29 | def 'should get response from MyWebService'() { 30 | if(!System.getProperty('gretty.farm')) 31 | return 32 | when: 33 | go baseURI 34 | $('#sendRequest').click() 35 | then: 36 | $('#result').text() == 'Got from server: ' + new Date().format('EEE, d MMM yyyy') 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /integrationTests/multifarm/MyWebApp2/src/integrationTest/groovy/org/akhikhl/examples/gretty/mywebapp/WebAppSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.mywebapp 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class WebAppSpec extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | } 20 | 21 | def 'should get expected static page'() { 22 | when: 23 | go baseURI 24 | then: 25 | $('h1').text() == 'Hello, world!' 26 | $('p', 0).text() == /This is static HTML page./ 27 | } 28 | 29 | def 'should get response from MyWebService'() { 30 | if(!System.getProperty('gretty.farm')) 31 | return 32 | when: 33 | go baseURI 34 | $('#sendRequest').click() 35 | then: 36 | $('#result').text() == 'Got from server: ' + new Date().format('EEE, d MMM yyyy') 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /integrationTests/testInitParameter/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello-world page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

Hello, world!

18 |

This is static HTML page.

19 |

Click here to see dynamic page generated by servlet.

20 |
21 |
22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /integrationTests/farm/MyWebApp/src/integrationTest/groovy/org/akhikhl/examples/gretty/mywebapp/WebAppSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.mywebapp 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class WebAppSpec extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | } 20 | 21 | def 'should get expected static page'() { 22 | when: 23 | go baseURI 24 | then: 25 | $('h1').text() == 'Hello, world!' 26 | $('p', 0).text() == /This is static HTML page./ 27 | } 28 | 29 | def 'should get response from MyWebService'() { 30 | if(!System.getProperty('gretty.farm')) 31 | return 32 | when: 33 | go baseURI 34 | $('#sendRequest').click() 35 | then: 36 | waitFor { $('#result').text() == 'Got from server: ' + new Date().format('EEE, d MMM yyyy') } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /integrationTests/helloGretty/src/main/resources/org/akhikhl/examples/gretty/hellogretty/templates/servletpage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello-world page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

Hello, world!

18 |

This is dynamic HTML page generated by servlet.

19 |

Today is $today.

20 |

Click here to see static page.

21 |
22 |
23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /integrationTests/helloGrettySecure/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | apply plugin: 'org.akhikhl.gretty' 3 | apply plugin: 'org.akhikhl.gretty.internal.integrationTests.IntegrationTestPlugin' 4 | 5 | dependencies { 6 | compile 'org.webjars:bootstrap:3.2.0' 7 | compile 'org.webjars:jquery:2.1.1' 8 | // We use Velocity for example of template processing within the webapp. 9 | compile 'org.apache.velocity:velocity:1.7' 10 | } 11 | 12 | gretty { 13 | httpEnabled = false 14 | httpsEnabled = true 15 | // Possible servletContainer values are 'jetty7', 'jetty8', 'jetty9', 'tomcat7', 'tomcat8'. Default is 'jetty9'. 16 | servletContainer = 'jetty9' 17 | realm 'auth' 18 | // realmConfigFile is optional. When omitted, 'jetty-realm.properties' or 'tomcat-users.xml' is assumed. 19 | // If path is relative, the file will be searched in projectDir, build/resources/main and src/main/webapp/WEB-INF. 20 | // realmConfigFile 'jetty-realm.properties' 21 | onStart { 22 | println 'Enter user name "test" and password "test123" for logon.' 23 | } 24 | } 25 | 26 | defineIntegrationTest() 27 | testAll.dependsOn defineIntegrationTestAllContainers() 28 | -------------------------------------------------------------------------------- /integrationTests/helloGrettySecure/src/main/webapp/content/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello-world page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

Hello, world!

18 |

This is static HTML page.

19 |

Click here to see dynamic page generated by servlet.

20 |
21 |
22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /integrationTests/jacocoExample/src/main/resources/org/akhikhl/examples/gretty/hellogretty/templates/servletpage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello-world page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

Hello, world!

18 |

This is dynamic HTML page generated by servlet.

19 |

Today is $today.

20 |

Click here to see static page.

21 |
22 |
23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /integrationTests/jacocoInstantiateTasks/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello-world page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

Hello, world!

18 |

This is static HTML page.

19 |

Click here to see dynamic page generated by servlet.

20 |
21 |
22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /integrationTests/spring-boot-farm-secure/spring-boot-app/src/main/webapp/js/functions.js: -------------------------------------------------------------------------------- 1 | jQuery.noConflict(); 2 | 3 | jQuery(function($) { 4 | $('#sendRequest1').click(function() { 5 | $('#result1').addClass('hide'); 6 | $.ajax({ type: 'POST', url: '/spring-boot-webservice/mycontroller/getdate', dataType: 'json' }).done(function(data) { 7 | $('#result1').removeClass('hide bg-danger').addClass('bg-success').text('Got from server: ' + data.date); 8 | }).fail(function(jqXHR, textStatus, errorThrown) { 9 | $('#result1').removeClass('hide bg-success').addClass('bg-danger').text('error: ' + errorThrown); 10 | }); 11 | }); 12 | $('#sendRequest2').click(function() { 13 | $('#result2').addClass('hide'); 14 | $.ajax({ type: 'POST', url: '/jee-webservice/myservlet/getdate', dataType: 'json' }).done(function(data) { 15 | $('#result2').removeClass('hide bg-danger').addClass('bg-success').text('Got from server: ' + data.date); 16 | }).fail(function(jqXHR, textStatus, errorThrown) { 17 | $('#result2').removeClass('hide bg-success').addClass('bg-danger').text('error: ' + errorThrown); 18 | }); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /integrationTests/testDependency/src/integrationTest/groovy/org/akhikhl/examples/gretty/hellogretty/PageSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Gretty 3 | * 4 | * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. 5 | * 6 | * See the file "LICENSE" for copying and usage permission. 7 | * See the file "CONTRIBUTORS" for complete list of contributors. 8 | */ 9 | package org.akhikhl.examples.gretty.hellogretty 10 | 11 | import geb.spock.GebReportingSpec 12 | 13 | class PageSpec extends GebReportingSpec { 14 | 15 | private static String baseURI 16 | 17 | void setupSpec() { 18 | baseURI = System.getProperty('gretty.baseURI') 19 | System.err.println "baseURI=$baseURI" 20 | } 21 | 22 | def 'should get expected static page'() { 23 | when: 24 | go "${baseURI}/index.html" 25 | then: 26 | $('h1').text() == 'Hello, world!' 27 | $('p', 0).text() == /This is static HTML page./ 28 | } 29 | 30 | def 'should get expected response from servlet'() { 31 | when: 32 | go "${baseURI}/dynamic" 33 | then: 34 | $('h1').text() == 'Hello, world!' 35 | $('p', 0).text() == /This is dynamic HTML page generated by servlet./ 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /integrationTests/testTomcatContextConfig/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello-world page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

Hello, world!

18 |

This is static HTML page.

19 |

Click here to see dynamic page generated by servlet.

20 |
21 |
22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /integrationTests/testTomcatServerConfig/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello-world page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

Hello, world!

18 |

This is static HTML page.

19 |

Click here to see dynamic page generated by servlet.

20 |
21 |
22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2016 Timur Shakurov, Andrey Hihlovskiy and contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /integrationTests/filterWebapp/README.md: -------------------------------------------------------------------------------- 1 | # filterWebapp 2 | 3 | Example programs showing how to implement webapp filtering with gretty. 4 | 5 | The main ideas behind webapp filtering are the following: 6 | 7 | 1. Webapp filtering gives possibility to filter files in "src/main/webapp" 8 | in a similar way to processResources filtering. 9 | 10 | 2. Webapp filtering happens "naturally", each time the program is run 11 | or each time a WAR-file (or a product) is built. 12 | 13 | 3. Webapp filtering is configured via property "gretty.webappCopy": 14 | 15 | ```groovy 16 | gretty { 17 | webappCopy = { CopySpec copySpec -> 18 | // ... 19 | } 20 | } 21 | ``` 22 | 23 | webappCopy is a closure, accepting org.gradle.api.file.CopySpec as a parameter. 24 | 25 | See details in "build.gradle" and "src/main/webapp/WEB-INF/web.xml". 26 | 27 | ## How to run 28 | 29 | ```bash 30 | cd examples/filterWebapp 31 | gradle appRun 32 | ``` 33 | 34 | ## How to test 35 | 36 | ```bash 37 | cd examples/filterWebapp 38 | gradle integrationTest 39 | ``` 40 | 41 | ## How to build a product 42 | 43 | 44 | ```bash 45 | cd examples/filterWebapp 46 | gradle buildProduct 47 | ``` 48 | 49 | -------------------------------------------------------------------------------- /integrationTests/helloGrettySecure/src/main/resources/org/akhikhl/examples/gretty/hellogretty/templates/servletpage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello-world page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

Hello, dynamic world!

18 |

This is dynamic HTML page generated by servlet.

19 |

Today is $today.

20 |

Click here to see static page.

21 |
22 |
23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /integrationTests/jacocoInstantiateTasks/src/main/resources/org/akhikhl/examples/gretty/hellogretty/templates/servletpage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello-world page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

Hello, world!

18 |

This is dynamic HTML page generated by servlet.

19 |

Today is $today.

20 |

Click here to see static page.

21 |
22 |
23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /integrationTests/testAnnotations/src/main/resources/org/akhikhl/examples/gretty/hellogretty/templates/servletpage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello-world page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

Hello, world!

18 |

This is dynamic HTML page generated by servlet.

19 |

The servlet is configured via JEE annotations.

20 |

Today is $today.

21 |
22 |
23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /integrationTests/testTomcatServerConfig/src/main/resources/org/akhikhl/examples/gretty/hellogretty/templates/servletpage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello-world page 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

Hello, world!

18 |

This is dynamic HTML page generated by servlet.

19 |

Today is $today.

20 |

Click here to see static page.

21 |
22 |
23 |
24 | 25 | 26 | --------------------------------------------------------------------------------