diff --git a/core/src/main/groovyx/gaelyk/GaelykServletContextListener.groovy b/core/src/main/groovyx/gaelyk/GaelykServletContextListener.groovy index e176371a..df4d27c4 100644 --- a/core/src/main/groovyx/gaelyk/GaelykServletContextListener.groovy +++ b/core/src/main/groovyx/gaelyk/GaelykServletContextListener.groovy @@ -43,7 +43,7 @@ class GaelykServletContextListener implements ServletContextListener { void contextDestroyed(ServletContextEvent servletContextEvent) { // nothing special to be done } - + /** * Verifies if proper version of Gaelyk is used. * Currently Groovy 2.x.x versions are supported but this may change @@ -54,9 +54,9 @@ class GaelykServletContextListener implements ServletContextListener { throw new IllegalStateException("You must use Groovy 2.x to run Gaelyk ${GaelykBindingEnhancer.app['gaelyk']['version']} application.") } } - + private static boolean verifyGroovyVersionInternal(String version){ - version.startsWith('2.') + version.startsWith('2.') || version.startsWith('3.') } - + } diff --git a/core/src/test/groovyx/gaelyk/GaelykServletContextListenerTest.groovy b/core/src/test/groovyx/gaelyk/GaelykServletContextListenerTest.groovy index a885eb9c..594024d8 100644 --- a/core/src/test/groovyx/gaelyk/GaelykServletContextListenerTest.groovy +++ b/core/src/test/groovyx/gaelyk/GaelykServletContextListenerTest.groovy @@ -69,16 +69,17 @@ class GaelykServletContextListenerTest extends GroovyTestCase { assert called } - + void testVerifyVersion(){ - assert !GaelykServletContextListener.verifyGroovyVersionInternal('3.0.0') + assert !GaelykServletContextListener.verifyGroovyVersionInternal('4.0.0') assert GaelykServletContextListener.verifyGroovyVersionInternal('2.1') + assert GaelykServletContextListener.verifyGroovyVersionInternal('3.0.0-alpha-4') assert GaelykServletContextListener.verifyGroovyVersionInternal('2.1.0') assert GaelykServletContextListener.verifyGroovyVersionInternal('2.0.0') - assert GaelykServletContextListener.verifyGroovyVersionInternal('2.0.5') + assert GaelykServletContextListener.verifyGroovyVersionInternal('2.5.6') assert !GaelykServletContextListener.verifyGroovyVersionInternal('1.8.7') assert !GaelykServletContextListener.verifyGroovyVersionInternal('1.7') - + // verify that we are building using good version GaelykServletContextListener.verifyGroovyVersion() }