Permalink
Browse files

obsessive import tidying

  • Loading branch information...
1 parent ff06e90 commit d673f5cb792fb542b589b895a6d2f2b8ba6413a8 Rob Fletcher committed Oct 23, 2012
Showing with 92 additions and 240 deletions.
  1. +2 −5 src/main/groovy/co/freeside/betamax/Betamax.groovy
  2. +1 −2 src/main/groovy/co/freeside/betamax/Recorder.groovy
  3. +1 −2 src/main/groovy/co/freeside/betamax/encoding/DeflateEncoder.groovy
  4. +1 −2 src/main/groovy/co/freeside/betamax/encoding/GzipEncoder.groovy
  5. +1 −2 src/main/groovy/co/freeside/betamax/handler/ChainedHttpHandler.groovy
  6. +2 −4 src/main/groovy/co/freeside/betamax/handler/HeaderFilter.groovy
  7. +1 −2 src/main/groovy/co/freeside/betamax/handler/HttpHandler.groovy
  8. +0 −1 src/main/groovy/co/freeside/betamax/handler/TapeWriter.groovy
  9. +2 −6 src/main/groovy/co/freeside/betamax/message/AbstractMessage.groovy
  10. +0 −1 src/main/groovy/co/freeside/betamax/message/filtering/HeaderFilteringMessage.groovy
  11. +1 −2 src/main/groovy/co/freeside/betamax/message/filtering/HeaderFilteringRequest.groovy
  12. +1 −2 src/main/groovy/co/freeside/betamax/message/filtering/HeaderFilteringResponse.groovy
  13. +2 −6 src/main/groovy/co/freeside/betamax/message/tape/RecordedMessage.groovy
  14. +1 −4 src/main/groovy/co/freeside/betamax/proxy/jetty/BetamaxProxy.groovy
  15. +2 −3 src/main/groovy/co/freeside/betamax/proxy/jetty/CustomConnectHandler.groovy
  16. +3 −5 src/main/groovy/co/freeside/betamax/proxy/jetty/SimpleServer.groovy
  17. +1 −3 src/main/groovy/co/freeside/betamax/tape/RequestMatcher.groovy
  18. +1 −2 src/main/groovy/co/freeside/betamax/tape/Tape.groovy
  19. +5 −12 src/main/groovy/co/freeside/betamax/tape/yaml/TapeRepresenter.groovy
  20. +3 −9 src/main/groovy/co/freeside/betamax/tape/yaml/YamlTape.groovy
  21. +1 −3 src/main/groovy/co/freeside/betamax/tape/yaml/YamlTapeLoader.groovy
  22. +3 −8 src/test/groovy/co/freeside/betamax/compatibility/HttpBuilderSpec.groovy
  23. +3 −8 src/test/groovy/co/freeside/betamax/compatibility/HttpClient3Spec.groovy
  24. +5 −13 src/test/groovy/co/freeside/betamax/compatibility/HttpClientSpec.groovy
  25. +3 −9 src/test/groovy/co/freeside/betamax/compatibility/HttpURLConnectionSpec.groovy
  26. +3 −8 src/test/groovy/co/freeside/betamax/compatibility/WsLiteSpec.groovy
  27. +1 −2 src/test/groovy/co/freeside/betamax/encoding/EncoderSpec.groovy
  28. +1 −2 src/test/groovy/co/freeside/betamax/handler/ChainedHttpHandlerSpec.groovy
  29. +0 −1 src/test/groovy/co/freeside/betamax/handler/TapeReaderSpec.groovy
  30. +0 −1 src/test/groovy/co/freeside/betamax/handler/TapeWriterSpec.groovy
  31. +0 −1 src/test/groovy/co/freeside/betamax/handler/TargetConnectorSpec.groovy
  32. +2 −5 src/test/groovy/co/freeside/betamax/message/filtering/HeaderFilteringSpec.groovy
  33. +3 −8 src/test/groovy/co/freeside/betamax/message/httpclient/HttpResponseAdapterSpec.groovy
  34. +3 −7 src/test/groovy/co/freeside/betamax/message/servlet/ServletRequestAdapterSpec.groovy
  35. +2 −5 src/test/groovy/co/freeside/betamax/proxy/HttpsSpec.groovy
  36. +0 −1 src/test/groovy/co/freeside/betamax/proxy/ProxyTimeoutSpec.groovy
  37. +0 −5 src/test/groovy/co/freeside/betamax/proxy/RequestMethodsSpec.groovy
  38. +1 −3 src/test/groovy/co/freeside/betamax/proxy/jetty/BetamaxProxySpec.groovy
  39. +2 −6 src/test/groovy/co/freeside/betamax/recorder/RecorderConfigurationSpec.groovy
  40. +0 −1 src/test/groovy/co/freeside/betamax/recorder/RequestMatchingSpec.groovy
  41. +1 −1 src/test/groovy/co/freeside/betamax/recorder/SequentialTapeSpec.groovy
  42. +1 −3 src/test/groovy/co/freeside/betamax/tape/BodyContentTypeSpec.groovy
  43. +4 −10 src/test/groovy/co/freeside/betamax/tape/ContentCharsetSpec.groovy
  44. +3 −8 src/test/groovy/co/freeside/betamax/tape/ContentEncodingSpec.groovy
  45. +1 −3 src/test/groovy/co/freeside/betamax/tape/PostBodySpec.groovy
  46. +2 −5 src/test/groovy/co/freeside/betamax/tape/ReadTapeFromYamlSpec.groovy
  47. +2 −5 src/test/groovy/co/freeside/betamax/tape/RequestMatcherSpec.groovy
  48. +3 −8 src/test/groovy/co/freeside/betamax/tape/TapeSpec.groovy
  49. +4 −9 src/test/groovy/co/freeside/betamax/tape/WriteTapeToYamlSpec.groovy
  50. +1 −2 src/test/groovy/co/freeside/betamax/util/ProxyOverriderSpec.groovy
  51. +1 −2 src/test/groovy/co/freeside/betamax/util/server/SimpleSecureServer.groovy
  52. +3 −7 src/test/groovy/co/freeside/betamax/util/server/SlowHandler.groovy
  53. +2 −5 src/test/groovy/co/freeside/betamax/util/servlet/MockHttpServletResponse.groovy
@@ -16,11 +16,8 @@
package co.freeside.betamax
-import java.lang.annotation.Retention
-import java.lang.annotation.Target
-
-import static co.freeside.betamax.MatchRule.method
-import static co.freeside.betamax.MatchRule.uri
+import java.lang.annotation.*
+import static co.freeside.betamax.MatchRule.*
import static co.freeside.betamax.TapeMode.DEFAULT
import static java.lang.annotation.ElementType.METHOD
import static java.lang.annotation.RetentionPolicy.RUNTIME
@@ -20,10 +20,9 @@ import java.util.logging.Logger
import co.freeside.betamax.proxy.jetty.ProxyServer
import co.freeside.betamax.tape.*
import co.freeside.betamax.tape.yaml.YamlTapeLoader
-import co.freeside.betamax.util.*
+import co.freeside.betamax.util.PropertiesCategory
import org.junit.rules.MethodRule
import org.junit.runners.model.*
-import org.yaml.snakeyaml.introspector.PropertyUtils
import static TapeMode.READ_WRITE
import static co.freeside.betamax.MatchRule.*
import static java.util.Collections.EMPTY_MAP
@@ -16,8 +16,7 @@
package co.freeside.betamax.encoding
-import java.util.zip.DeflaterOutputStream
-import java.util.zip.InflaterInputStream
+import java.util.zip.*
class DeflateEncoder extends AbstractEncoder {
@@ -16,8 +16,7 @@
package co.freeside.betamax.encoding
-import java.util.zip.GZIPInputStream
-import java.util.zip.GZIPOutputStream
+import java.util.zip.*
class GzipEncoder extends AbstractEncoder {
@@ -1,7 +1,6 @@
package co.freeside.betamax.handler
-import co.freeside.betamax.message.Request
-import co.freeside.betamax.message.Response
+import co.freeside.betamax.message.*
abstract class ChainedHttpHandler implements HttpHandler {
@@ -1,9 +1,7 @@
package co.freeside.betamax.handler
-import co.freeside.betamax.message.Request
-import co.freeside.betamax.message.Response
-import co.freeside.betamax.message.filtering.HeaderFilteringRequest
-import co.freeside.betamax.message.filtering.HeaderFilteringResponse
+import co.freeside.betamax.message.*
+import co.freeside.betamax.message.filtering.*
class HeaderFilter extends ChainedHttpHandler {
@@ -1,7 +1,6 @@
package co.freeside.betamax.handler
-import co.freeside.betamax.message.Request
-import co.freeside.betamax.message.Response
+import co.freeside.betamax.message.*
interface HttpHandler {
@@ -2,7 +2,6 @@ package co.freeside.betamax.handler
import java.util.logging.Logger
import co.freeside.betamax.Recorder
-import co.freeside.betamax.handler.*
import co.freeside.betamax.message.*
import static co.freeside.betamax.proxy.jetty.BetamaxProxy.X_BETAMAX
import static java.util.logging.Level.INFO
@@ -16,13 +16,9 @@
package co.freeside.betamax.message
+import java.util.zip.*
import org.apache.commons.lang.StringUtils
-
-import java.util.zip.GZIPInputStream
-import java.util.zip.InflaterInputStream
-
-import static org.apache.http.HttpHeaders.CONTENT_ENCODING
-import static org.apache.http.HttpHeaders.CONTENT_TYPE
+import static org.apache.http.HttpHeaders.*
abstract class AbstractMessage implements Message {
@@ -1,7 +1,6 @@
package co.freeside.betamax.message.filtering
import co.freeside.betamax.message.Message
-
import static org.apache.http.HttpHeaders.*
abstract class HeaderFilteringMessage implements Message {
@@ -1,7 +1,6 @@
package co.freeside.betamax.message.filtering
-import co.freeside.betamax.message.Message
-import co.freeside.betamax.message.Request
+import co.freeside.betamax.message.*
class HeaderFilteringRequest extends HeaderFilteringMessage implements Request {
@@ -1,7 +1,6 @@
package co.freeside.betamax.message.filtering
-import co.freeside.betamax.message.Message
-import co.freeside.betamax.message.Response
+import co.freeside.betamax.message.*
class HeaderFilteringResponse extends HeaderFilteringMessage implements Response {
@@ -1,11 +1,7 @@
package co.freeside.betamax.message.tape
-import co.freeside.betamax.encoding.AbstractEncoder
-import co.freeside.betamax.encoding.DeflateEncoder
-import co.freeside.betamax.encoding.GzipEncoder
-import co.freeside.betamax.encoding.NoOpEncoder
-import co.freeside.betamax.message.AbstractMessage
-import co.freeside.betamax.message.Message
+import co.freeside.betamax.encoding.*
+import co.freeside.betamax.message.*
import org.apache.http.HttpHeaders
abstract class RecordedMessage extends AbstractMessage implements Message {
@@ -2,12 +2,9 @@ package co.freeside.betamax.proxy.jetty
import java.util.logging.Logger
import javax.servlet.http.*
-import co.freeside.betamax.handler.HandlerException
+import co.freeside.betamax.handler.*
import co.freeside.betamax.message.Response
import co.freeside.betamax.message.servlet.ServletRequestAdapter
-import co.freeside.betamax.proxy.handler.HttpHandler
-import co.freeside.betamax.handler.HttpHandler
-import co.freeside.betamax.handler.HandlerException
import org.eclipse.jetty.server.Request
import org.eclipse.jetty.server.handler.AbstractHandler
import static java.util.logging.Level.SEVERE
@@ -1,11 +1,10 @@
package co.freeside.betamax.proxy.jetty
+import java.nio.channels.SocketChannel
+import javax.servlet.http.HttpServletRequest
import org.eclipse.jetty.server.Handler
import org.eclipse.jetty.server.handler.ConnectHandler
-import javax.servlet.http.HttpServletRequest
-import java.nio.channels.SocketChannel
-
class CustomConnectHandler extends ConnectHandler {
int sslPort
@@ -16,13 +16,11 @@
package co.freeside.betamax.proxy.jetty
-import org.eclipse.jetty.server.Handler
-import org.eclipse.jetty.server.Server
-import org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
-import org.eclipse.jetty.util.component.LifeCycle
-
import java.util.concurrent.CountDownLatch
import java.util.logging.Logger
+import org.eclipse.jetty.server.*
+import org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
+import org.eclipse.jetty.util.component.LifeCycle
class SimpleServer extends AbstractLifeCycleListener {
@@ -18,9 +18,7 @@ package co.freeside.betamax.tape
import co.freeside.betamax.message.Request
import co.freeside.betamax.message.tape.RecordedRequest
-
-import static co.freeside.betamax.MatchRule.method
-import static co.freeside.betamax.MatchRule.uri
+import static co.freeside.betamax.MatchRule.*
class RequestMatcher {
@@ -18,8 +18,7 @@ package co.freeside.betamax.tape
import co.freeside.betamax.TapeMode
import co.freeside.betamax.handler.HandlerException
-import co.freeside.betamax.message.Request
-import co.freeside.betamax.message.Response
+import co.freeside.betamax.message.*
/**
* Represents a set of recorded HTTP interactions that can be played back or appended to.
*/
@@ -16,20 +16,13 @@
package co.freeside.betamax.tape.yaml
-import co.freeside.betamax.message.tape.RecordedRequest
-import co.freeside.betamax.message.tape.RecordedResponse
-import co.freeside.betamax.tape.RecordedInteraction
-import co.freeside.betamax.tape.Tape
-import org.yaml.snakeyaml.introspector.BeanAccess
-import org.yaml.snakeyaml.introspector.Property
-import org.yaml.snakeyaml.introspector.PropertyUtils
+import co.freeside.betamax.message.tape.*
+import co.freeside.betamax.tape.*
+import org.yaml.snakeyaml.introspector.*
import org.yaml.snakeyaml.nodes.*
import org.yaml.snakeyaml.representer.Represent
-
-import static org.yaml.snakeyaml.DumperOptions.ScalarStyle.LITERAL
-import static org.yaml.snakeyaml.DumperOptions.ScalarStyle.PLAIN
-import static org.yaml.snakeyaml.nodes.Tag.NULL
-import static org.yaml.snakeyaml.nodes.Tag.STR
+import static org.yaml.snakeyaml.DumperOptions.ScalarStyle.*
+import static org.yaml.snakeyaml.nodes.Tag.*
/**
* Applies a fixed ordering to properties and excludes `null` valued properties, empty collections and empty maps.
*/
@@ -16,18 +16,12 @@
package co.freeside.betamax.tape.yaml
-import co.freeside.betamax.message.Request
-import co.freeside.betamax.message.Response
-import co.freeside.betamax.tape.MemoryTape
-import co.freeside.betamax.tape.StorableTape
-import co.freeside.betamax.tape.TapeLoadException
-import org.yaml.snakeyaml.DumperOptions
-import org.yaml.snakeyaml.TypeDescription
-import org.yaml.snakeyaml.Yaml
+import co.freeside.betamax.message.*
+import co.freeside.betamax.tape.*
+import org.yaml.snakeyaml.*
import org.yaml.snakeyaml.constructor.Constructor
import org.yaml.snakeyaml.error.YAMLException
import org.yaml.snakeyaml.nodes.Tag
-
import static org.yaml.snakeyaml.DumperOptions.FlowStyle.BLOCK
class YamlTape extends MemoryTape implements StorableTape {
@@ -16,11 +16,9 @@
package co.freeside.betamax.tape.yaml
-import co.freeside.betamax.tape.StorableTape
-import co.freeside.betamax.tape.TapeLoader
-
import java.text.Normalizer
import java.util.logging.Logger
+import co.freeside.betamax.tape.*
class YamlTapeLoader implements TapeLoader<YamlTape> {
@@ -1,19 +1,14 @@
package co.freeside.betamax.compatibility
-import co.freeside.betamax.Betamax
-import co.freeside.betamax.Recorder
+import co.freeside.betamax.*
import co.freeside.betamax.httpclient.BetamaxRoutePlanner
import co.freeside.betamax.proxy.jetty.SimpleServer
import co.freeside.betamax.util.httpbuilder.BetamaxRESTClient
import co.freeside.betamax.util.server.EchoHandler
-import groovyx.net.http.HttpURLClient
-import groovyx.net.http.RESTClient
+import groovyx.net.http.*
import org.apache.http.HttpHost
import org.junit.Rule
-import spock.lang.AutoCleanup
-import spock.lang.Shared
-import spock.lang.Specification
-import spock.lang.Timeout
+import spock.lang.*
import static co.freeside.betamax.util.FileUtils.newTempDir
import static java.net.HttpURLConnection.HTTP_OK
import static org.apache.http.HttpHeaders.VIA
@@ -1,17 +1,12 @@
package co.freeside.betamax.compatibility
-import co.freeside.betamax.Betamax
-import co.freeside.betamax.Recorder
+import co.freeside.betamax.*
import co.freeside.betamax.proxy.jetty.SimpleServer
import co.freeside.betamax.util.server.EchoHandler
-import org.apache.commons.httpclient.HttpClient
-import org.apache.commons.httpclient.ProxyHost
+import org.apache.commons.httpclient.*
import org.apache.commons.httpclient.methods.GetMethod
import org.junit.Rule
-import spock.lang.AutoCleanup
-import spock.lang.Shared
-import spock.lang.Specification
-import spock.lang.Timeout
+import spock.lang.*
import static co.freeside.betamax.util.FileUtils.newTempDir
import static java.net.HttpURLConnection.HTTP_OK
import static org.apache.http.HttpHeaders.VIA
@@ -1,22 +1,14 @@
package co.freeside.betamax.compatibility
-import co.freeside.betamax.Betamax
-import co.freeside.betamax.Recorder
-import co.freeside.betamax.httpclient.BetamaxHttpsSupport
-import co.freeside.betamax.httpclient.BetamaxRoutePlanner
+import co.freeside.betamax.*
+import co.freeside.betamax.httpclient.*
import co.freeside.betamax.proxy.jetty.SimpleServer
-import co.freeside.betamax.util.server.EchoHandler
-import co.freeside.betamax.util.server.HelloHandler
-import co.freeside.betamax.util.server.SimpleSecureServer
+import co.freeside.betamax.util.server.*
import org.apache.http.HttpHost
import org.apache.http.client.methods.HttpGet
-import org.apache.http.impl.client.DefaultHttpClient
-import org.apache.http.impl.client.SystemDefaultHttpClient
+import org.apache.http.impl.client.*
import org.junit.Rule
-import spock.lang.AutoCleanup
-import spock.lang.Shared
-import spock.lang.Specification
-import spock.lang.Timeout
+import spock.lang.*
import static co.freeside.betamax.TapeMode.WRITE_ONLY
import static co.freeside.betamax.util.FileUtils.newTempDir
import static java.net.HttpURLConnection.HTTP_OK
@@ -1,16 +1,10 @@
package co.freeside.betamax.compatibility
-import co.freeside.betamax.Betamax
-import co.freeside.betamax.Recorder
+import co.freeside.betamax.*
import co.freeside.betamax.proxy.jetty.SimpleServer
-import co.freeside.betamax.util.server.EchoHandler
-import co.freeside.betamax.util.server.HelloHandler
-import co.freeside.betamax.util.server.SimpleSecureServer
+import co.freeside.betamax.util.server.*
import org.junit.Rule
-import spock.lang.AutoCleanup
-import spock.lang.Shared
-import spock.lang.Specification
-import spock.lang.Timeout
+import spock.lang.*
import static co.freeside.betamax.TapeMode.WRITE_ONLY
import static co.freeside.betamax.util.FileUtils.newTempDir
import static java.net.HttpURLConnection.HTTP_OK
@@ -1,15 +1,10 @@
package co.freeside.betamax.compatibility
-import co.freeside.betamax.Betamax
-import co.freeside.betamax.Recorder
+import co.freeside.betamax.*
import co.freeside.betamax.proxy.jetty.SimpleServer
-import co.freeside.betamax.util.server.EchoHandler
-import co.freeside.betamax.util.server.HelloHandler
-import co.freeside.betamax.util.server.SimpleSecureServer
+import co.freeside.betamax.util.server.*
import org.junit.Rule
-import spock.lang.AutoCleanup
-import spock.lang.Shared
-import spock.lang.Specification
+import spock.lang.*
import wslite.rest.RESTClient
import static co.freeside.betamax.TapeMode.WRITE_ONLY
import static co.freeside.betamax.proxy.jetty.BetamaxProxy.X_BETAMAX
@@ -1,7 +1,6 @@
package co.freeside.betamax.encoding
-import spock.lang.Specification
-import spock.lang.Unroll
+import spock.lang.*
@Unroll
class EncoderSpec extends Specification {
@@ -1,7 +1,6 @@
package co.freeside.betamax.handler
-import co.freeside.betamax.message.Request
-import co.freeside.betamax.message.Response
+import co.freeside.betamax.message.*
import spock.lang.Specification
class ChainedHttpHandlerSpec extends Specification {
Oops, something went wrong.

0 comments on commit d673f5c

Please sign in to comment.