Skip to content

Commit

Permalink
allow groovy 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
kdabir committed Feb 4, 2019
1 parent a0fe772 commit 207dec1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Expand Up @@ -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
Expand All @@ -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.')
}

}
Expand Up @@ -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()
}
Expand Down

0 comments on commit 207dec1

Please sign in to comment.