Created
July 23, 2008 18:10
-
-
Save defunkt/1837 to your computer and use it in GitHub Desktop.
This file contains 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
# watch me turn java into ruby | |
def try; end | |
def catch(*args) end | |
def RuntimeException(*args) end | |
def re; end | |
class Anything; def method_missing(*args) Anything.new end end | |
def getDialog; Anything.new end | |
def WebResponse(*args) end | |
def atUrl; '' end | |
def assertEquals(*args) end | |
# now for the fun part | |
try { | |
beginAt(atUrl); | |
} | |
catch (RuntimeException re) { | |
log.warn("Can't assert 503 response, using crude websphere workaround"); | |
assertTrue(re.getMessage().contains("IOException")); | |
assertTrue(re.getMessage().contains("503")); | |
return; | |
} | |
WebResponse webResponse = getDialog().getResponse(); | |
assertEquals("expected service unavailable response for url: '" + atUrl + "'", 503, webResponse.getResponseCode()); | |
assertEquals("should be no content for this url: '" + atUrl + "'", 0, webResponse.getText().length()); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment