From fad66c5cd2836ea3b23c06a84b224bda40e8f6ca Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Mon, 22 Feb 2016 22:12:47 -0600 Subject: [PATCH] Spaces to Tabs --- docs/build.gradle | 12 +- .../groovy/sample/MultiBrowserGebSpec.groovy | 132 +++++++++--------- .../build.gradle | 2 +- .../src/main/java/sample/ServerConfig.java | 4 +- .../groovy/sample/RestTests.groovy | 94 ++++++------- spring-session-data-gemfire/build.gradle | 20 +-- .../HazelcastHttpSessionConfiguration.java | 100 ++++++------- 7 files changed, 182 insertions(+), 182 deletions(-) diff --git a/docs/build.gradle b/docs/build.gradle index 05389639..06804e9c 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -1,11 +1,11 @@ buildscript { - repositories { - jcenter() - } + repositories { + jcenter() + } - dependencies { - classpath 'org.kordamp.gradle:livereload-gradle-plugin:0.2.1' - } + dependencies { + classpath 'org.kordamp.gradle:livereload-gradle-plugin:0.2.1' + } } apply plugin: 'org.kordamp.gradle.livereload' diff --git a/samples/findbyusername/src/integration-test/groovy/sample/MultiBrowserGebSpec.groovy b/samples/findbyusername/src/integration-test/groovy/sample/MultiBrowserGebSpec.groovy index e7eafe1b..5c2f73a0 100644 --- a/samples/findbyusername/src/integration-test/groovy/sample/MultiBrowserGebSpec.groovy +++ b/samples/findbyusername/src/integration-test/groovy/sample/MultiBrowserGebSpec.groovy @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -21,80 +21,80 @@ import spock.lang.* * https://github.com/kensiprell/geb-multibrowser */ abstract class MultiBrowserGebSpec extends Specification { - String gebConfEnv = null - String gebConfScript = null + String gebConfEnv = null + String gebConfScript = null - // Map of geb browsers which can be referenced by name in the spec - // THese currently share the same config. This is not a problem for - // my uses, but I can see potential for wanting to configure different - // browsers separately - @Shared _browsers = createBrowserMap() - def currentBrowser + // Map of geb browsers which can be referenced by name in the spec + // THese currently share the same config. This is not a problem for + // my uses, but I can see potential for wanting to configure different + // browsers separately + @Shared _browsers = createBrowserMap() + def currentBrowser - def createBrowserMap() { - [:].withDefault { new Browser(createConf()) } - } + def createBrowserMap() { + [:].withDefault { new Browser(createConf()) } + } - Configuration createConf() { - // Use the standard configured geb driver, but turn off cacheing so - // we can run multiple - def conf = new ConfigurationLoader(gebConfEnv).getConf(gebConfScript) - conf.cacheDriver = false - return conf - } + Configuration createConf() { + // Use the standard configured geb driver, but turn off cacheing so + // we can run multiple + def conf = new ConfigurationLoader(gebConfEnv).getConf(gebConfScript) + conf.cacheDriver = false + return conf + } - def withBrowserSession(browser, Closure c) { - currentBrowser = browser - def returnedValue = c.call() - currentBrowser = null - returnedValue - } + def withBrowserSession(browser, Closure c) { + currentBrowser = browser + def returnedValue = c.call() + currentBrowser = null + returnedValue + } - void resetBrowsers() { - _browsers.each { k, browser -> - if (browser.config?.autoClearCookies) { - browser.clearCookiesQuietly() - } - browser.quit() - } - _browsers = createBrowserMap() - } + void resetBrowsers() { + _browsers.each { k, browser -> + if (browser.config?.autoClearCookies) { + browser.clearCookiesQuietly() + } + browser.quit() + } + _browsers = createBrowserMap() + } - def propertyMissing(String name) { - if(currentBrowser) { - return currentBrowser."$name" - } else { - return _browsers[name] - } - } + def propertyMissing(String name) { + if(currentBrowser) { + return currentBrowser."$name" + } else { + return _browsers[name] + } + } - def methodMissing(String name, args) { - if(currentBrowser) { - return currentBrowser."$name"(*args) - } else { - def browser = _browsers[name] - if(args) { - return browser."${args[0]}"(*(args[1..-1])) - } else { - return browser - } - } - } + def methodMissing(String name, args) { + if(currentBrowser) { + return currentBrowser."$name"(*args) + } else { + def browser = _browsers[name] + if(args) { + return browser."${args[0]}"(*(args[1..-1])) + } else { + return browser + } + } + } - def propertyMissing(String name, value) { - if(!currentBrowser) throw new IllegalArgumentException("No context for setting property $name") - currentBrowser."$name" = value - } + def propertyMissing(String name, value) { + if(!currentBrowser) throw new IllegalArgumentException("No context for setting property $name") + currentBrowser."$name" = value + } - private isSpecStepwise() { - this.class.getAnnotation(Stepwise) != null - } + private isSpecStepwise() { + this.class.getAnnotation(Stepwise) != null + } - def cleanup() { - if (!isSpecStepwise()) resetBrowsers() - } + def cleanup() { + if (!isSpecStepwise()) resetBrowsers() + } - def cleanupSpec() { - if (isSpecStepwise()) resetBrowsers() - } + def cleanupSpec() { + if (isSpecStepwise()) resetBrowsers() + } } \ No newline at end of file diff --git a/samples/httpsession-gemfire-clientserver/build.gradle b/samples/httpsession-gemfire-clientserver/build.gradle index 7d968c7b..14952fdb 100644 --- a/samples/httpsession-gemfire-clientserver/build.gradle +++ b/samples/httpsession-gemfire-clientserver/build.gradle @@ -40,7 +40,7 @@ task runGemFireServer(dependsOn: availablePort) << { String classpath = sourceSets.main.runtimeClasspath.collect { it }.join(File.pathSeparator) String[] commandLine = ['java', '-server', '-ea', - "-Dspring.session.data.gemfire.port=$port", + "-Dspring.session.data.gemfire.port=$port", "-Dsample.httpsession.gemfire.log-level=" + System.getProperty('sample.httpsession.gemfire.log-level', 'warning'), '-classpath', classpath, 'sample.ServerConfig'] diff --git a/samples/httpsession-gemfire-clientserver/src/main/java/sample/ServerConfig.java b/samples/httpsession-gemfire-clientserver/src/main/java/sample/ServerConfig.java index a27b8457..832f4a46 100644 --- a/samples/httpsession-gemfire-clientserver/src/main/java/sample/ServerConfig.java +++ b/samples/httpsession-gemfire-clientserver/src/main/java/sample/ServerConfig.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -68,7 +68,7 @@ public class ServerConfig { @Bean CacheServerFactoryBean gemfireCacheServer(Cache gemfireCache, // <4> - @Value("${spring.session.data.gemfire.port:"+SERVER_PORT+"}") int port) { + @Value("${spring.session.data.gemfire.port:"+SERVER_PORT+"}") int port) { CacheServerFactoryBean cacheServerFactory = new CacheServerFactoryBean(); diff --git a/samples/rest/src/integration-test/groovy/sample/RestTests.groovy b/samples/rest/src/integration-test/groovy/sample/RestTests.groovy index 0510c0d6..39016b6c 100644 --- a/samples/rest/src/integration-test/groovy/sample/RestTests.groovy +++ b/samples/rest/src/integration-test/groovy/sample/RestTests.groovy @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -31,55 +31,55 @@ import javax.servlet.http.HttpServletResponse @Stepwise class RestTests extends Specification { - @Shared - RESTClient client = new RESTClient(System.properties.'geb.build.baseUrl') + @Shared + RESTClient client = new RESTClient(System.properties.'geb.build.baseUrl') - @Shared - String session + @Shared + String session - def 'Unauthenticated user sent to log in page'() { - when: 'unauthenticated user request protected page' - def resp = client.get path: '/', headers: ['Accept':'application/json'] - then: 'sent to the log in page' - def e = thrown(HttpResponseException) - e.response.status == HttpServletResponse.SC_UNAUTHORIZED - } + def 'Unauthenticated user sent to log in page'() { + when: 'unauthenticated user request protected page' + def resp = client.get path: '/', headers: ['Accept':'application/json'] + then: 'sent to the log in page' + def e = thrown(HttpResponseException) + e.response.status == HttpServletResponse.SC_UNAUTHORIZED + } - def 'Authenticate with Basic Works'() { - when: 'Authenticate with Basic' - def username, response - client.get(path: '/', headers: ['Authorization': 'Basic ' + 'user:password'.bytes.encodeBase64() ]) { resp, json -> - response = resp - username = json.username - session = resp.headers.'x-auth-token' - } - then: 'Access the User information and obtain session via x-auth-token header' - response.status == HttpServletResponse.SC_OK - username == 'user' - session - } + def 'Authenticate with Basic Works'() { + when: 'Authenticate with Basic' + def username, response + client.get(path: '/', headers: ['Authorization': 'Basic ' + 'user:password'.bytes.encodeBase64() ]) { resp, json -> + response = resp + username = json.username + session = resp.headers.'x-auth-token' + } + then: 'Access the User information and obtain session via x-auth-token header' + response.status == HttpServletResponse.SC_OK + username == 'user' + session + } - def 'Authenticate with x-auth-token works'() { - when: 'Authenticate with x-auth-token' - def username, response - client.get(path: '/', headers: ['x-auth-token': session ]) { resp, json -> - response = resp - username = json.username - } - then: 'Access the User information' - response.status == HttpServletResponse.SC_OK - username == 'user' - } + def 'Authenticate with x-auth-token works'() { + when: 'Authenticate with x-auth-token' + def username, response + client.get(path: '/', headers: ['x-auth-token': session ]) { resp, json -> + response = resp + username = json.username + } + then: 'Access the User information' + response.status == HttpServletResponse.SC_OK + username == 'user' + } - def 'Logout'() { - when: 'invalide session' - def response - client.get(path: '/logout', headers: ['x-auth-token': session ]) { resp, json -> - response = resp - session = resp.headers.'x-auth-token' - } - then: 'The session is deleted and an empty x-auth-token is returned' - response.status == HttpServletResponse.SC_NO_CONTENT - session == '' - } + def 'Logout'() { + when: 'invalide session' + def response + client.get(path: '/logout', headers: ['x-auth-token': session ]) { resp, json -> + response = resp + session = resp.headers.'x-auth-token' + } + then: 'The session is deleted and an empty x-auth-token is returned' + response.status == HttpServletResponse.SC_NO_CONTENT + session == '' + } } \ No newline at end of file diff --git a/spring-session-data-gemfire/build.gradle b/spring-session-data-gemfire/build.gradle index 2fd5d9bf..8e1036ea 100644 --- a/spring-session-data-gemfire/build.gradle +++ b/spring-session-data-gemfire/build.gradle @@ -5,17 +5,17 @@ apply plugin: 'spring-io' description = "Aggregator for Spring Session and Spring Data GemFire" dependencies { - compile project(':spring-session') - compile("org.springframework.data:spring-data-gemfire:$springDataGemFireVersion") { - exclude group: "org.slf4j", module: 'slf4j-api' - exclude group: "org.slf4j", module: 'jcl-over-slf4j' - } + compile project(':spring-session') + compile("org.springframework.data:spring-data-gemfire:$springDataGemFireVersion") { + exclude group: "org.slf4j", module: 'slf4j-api' + exclude group: "org.slf4j", module: 'jcl-over-slf4j' + } } dependencyManagement { - springIoTestRuntime { - imports { - mavenBom "io.spring.platform:platform-bom:${springIoVersion}" - } - } + springIoTestRuntime { + imports { + mavenBom "io.spring.platform:platform-bom:${springIoVersion}" + } + } } diff --git a/spring-session/src/main/java/org/springframework/session/hazelcast/config/annotation/web/http/HazelcastHttpSessionConfiguration.java b/spring-session/src/main/java/org/springframework/session/hazelcast/config/annotation/web/http/HazelcastHttpSessionConfiguration.java index a09e37c4..a0e1df7e 100644 --- a/spring-session/src/main/java/org/springframework/session/hazelcast/config/annotation/web/http/HazelcastHttpSessionConfiguration.java +++ b/spring-session/src/main/java/org/springframework/session/hazelcast/config/annotation/web/http/HazelcastHttpSessionConfiguration.java @@ -98,70 +98,70 @@ public class HazelcastHttpSessionConfiguration extends SpringHttpSessionConfigur public void setSessionMapName(String sessionMapName) { this.sessionMapName = sessionMapName; } - + static class ExpiringSessionMap implements Map { - private IMap delegate; + private IMap delegate; - ExpiringSessionMap(IMap delegate) { - this.delegate = delegate; - } - public ExpiringSession put(String key, ExpiringSession value) { - if(value == null) { - return delegate.put(key, value); - } - return delegate.put(key, value, value.getMaxInactiveIntervalInSeconds(), TimeUnit.SECONDS); - } + ExpiringSessionMap(IMap delegate) { + this.delegate = delegate; + } + public ExpiringSession put(String key, ExpiringSession value) { + if(value == null) { + return delegate.put(key, value); + } + return delegate.put(key, value, value.getMaxInactiveIntervalInSeconds(), TimeUnit.SECONDS); + } - public int size() { - return delegate.size(); - } + public int size() { + return delegate.size(); + } - public boolean isEmpty() { - return delegate.isEmpty(); - } + public boolean isEmpty() { + return delegate.isEmpty(); + } - public boolean containsKey(Object key) { - return delegate.containsKey(key); - } + public boolean containsKey(Object key) { + return delegate.containsKey(key); + } - public boolean containsValue(Object value) { - return delegate.containsValue(value); - } + public boolean containsValue(Object value) { + return delegate.containsValue(value); + } - public ExpiringSession get(Object key) { - return delegate.get(key); - } + public ExpiringSession get(Object key) { + return delegate.get(key); + } - public ExpiringSession remove(Object key) { - return delegate.remove(key); - } + public ExpiringSession remove(Object key) { + return delegate.remove(key); + } - public void putAll(Map m) { - delegate.putAll(m); - } + public void putAll(Map m) { + delegate.putAll(m); + } - public void clear() { - delegate.clear(); - } + public void clear() { + delegate.clear(); + } - public Set keySet() { - return delegate.keySet(); - } + public Set keySet() { + return delegate.keySet(); + } - public Collection values() { - return delegate.values(); - } + public Collection values() { + return delegate.values(); + } - public Set> entrySet() { - return delegate.entrySet(); - } + public Set> entrySet() { + return delegate.entrySet(); + } - public boolean equals(Object o) { - return delegate.equals(o); - } + public boolean equals(Object o) { + return delegate.equals(o); + } - public int hashCode() { - return delegate.hashCode(); - } + public int hashCode() { + return delegate.hashCode(); + } } }