This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.twitter.service.flock.edges.check | |
| import scala.collection.immutable.HashMap | |
| import org.scalacheck._ | |
| import net.lag.configgy.{Config, Configgy} | |
| import org.specs.{ScalaCheck, Specification} | |
| object EdgesSpec extends Specification with ScalaCheck with Waiter { | |
| Configgy.configure(System.getProperty("basedir") + "/config/test.conf") | |
| val username = System.getProperty("db.test.user") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class RequestWrapper(request: HttpServletRequest) extends javax.servlet.http.HttpServletRequestWrapper(request) { | |
| override def getHeaders(name: String): java.util.Enumeration[_] = { | |
| if (!ForwardRequest.hopByHopHeaders.contains(name)) | |
| super.getHeaders(name) | |
| else | |
| java.util.Collections.enumeration(new ArrayList) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Cash | |
| class Lock | |
| def self.synchronize(*args, &block) | |
| $lock.synchronize(*args, &block) | |
| end | |
| end | |
| module Accessor | |
| module ClassMethods | |
| alias_method :expire_cache, :expire |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.twitter.service.cachet.test.unit | |
| import com.twitter.service.cachet._ | |
| import org.joda.time.DateTime | |
| import javax.servlet.http._ | |
| import org.specs._ | |
| import org.specs.mock._ | |
| import org.specs.mock.JMocker._ | |
| import com.twitter.service.cachet.test.mock._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ActsAsCached | |
| class LocalCache | |
| delegate :respond_to?, :to => :@remote_cache | |
| def initialize(remote_cache) | |
| @remote_cache = remote_cache | |
| end | |
| def cache_locally | |
| @remote_cache = LocalCacheBuffer.new(original_cache = @remote_cache) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace :britt do | |
| desc 'Removes trailing whitespace' | |
| task :space do | |
| sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;} | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test "Stale objects are expired, but served from cache for a grace period" | |
| shell "/Users/pivotal/workspace/freshyfresh/target/memset version:test 2" | |
| server s { | |
| rxreq | |
| expect req.url == "/" | |
| txresp -status 200 -hdr "ETag: 1" -hdr "X-Generation-Key: version:test" | |
| } -start | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test "Stale objects are expired, but served from cache for a grace period" | |
| shell "/Users/pivotal/workspace/freshyfresh/target/memset version:test 2" | |
| server s { | |
| rxreq | |
| expect req.url == "/" | |
| txresp -status 200 -hdr "ETag: 1" -hdr "X-Generation-Key: version:test" | |
| } -start | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test "Stale objects are expired, but served from cache for a grace period" | |
| shell "/Users/pivotal/workspace/freshyfresh/target/memset version:test 2" | |
| server s { | |
| rxreq | |
| expect req.url == "/" | |
| txresp -status 200 -hdr "ETag: 1" -hdr "X-Generation-Key: version:test" | |
| } -start | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test "Stale objects are expired, but served from cache for a grace period" | |
| shell "/Users/pivotal/workspace/freshyfresh/bin/memset version:test 2" | |
| server s { | |
| rxreq | |
| expect req.url == "/" | |
| txresp -status 200 -hdr "ETag: 1" -hdr "X-Generation-Key: version:test" | |
| } -start | |