Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 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());
Add Comment
Please, Sign In to add comment