English 中文(简体)
应用测试中的错误异常例外
原标题:MalformedURLException in application tests

I m working on application tests and have found an issue. My app. has an authenticate(email, password) action inside the Security controller and when invoked, from the login page, with a valid e-mail and invalid password it sends me back to the login page with an error message, located in the flash scope.

App. 测试代码如下:

Response response = 
    GET("/security/authenticate?email=validUser&password=invalid", true);
String pattern = "invalid password";
assertContentMatch(pattern, response);

当运行此代码时, 下一个例外 :

A java.lang.RuntimeException has been caught,
java.net.MalformedURLException: no protocol: /login

有些研究发现:

  • the exception is thrown when a new URL object creation is attempted, to be able for redirection, using an invalid URL. In this case no protocol is present
  • looking at app. test in samples apps. GET is used without redirection, meaning that after GET only the http code is verified but no attempt to follow the redirection

Has anyone had this same issue also ? Any open bug to look for info or add my 2 cents ?

最佳回答
问题回答

暂无回答




相关问题
Selenium not working with Firefox 3.x on linux

I am using selenium-server , selenium rc for UI testing in my application . My dev box is Windows with FireFox 3.5 and every thing is running fine and cool. But when i try to run selenium tests on my ...

Best browser for testing under Safari Mobile on Linux?

I have an iPhone web app I m producing on a Linux machine. What s the best browser I can use to most closely mimic the feature-limited version of Safari present on the iPhone? (It s a "slimmed down" ...

Code Coverage Tools & Visual Studio 2008 Pro

Just wondering what people are using for code coverage tools when using MS Visual Studio 2008 Pro. We are using the built-in MS test project and unit testing tool (the one that come pre-installed ...

Is there any error checking web app cralwers out there?

Wondering if there was some sort of crawler we could use to test and re-test everything when changes are made to the web app so we know some new change didn t error out any existing pages. Or maybe a ...

热门标签