Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ryan Morgan
committed
Jun 24, 2009
1 parent
c693558
commit 05b5c1d
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.hyperic.hq.hqapi1.test; | ||
|
||
import junit.framework.TestCase; | ||
|
||
import org.hyperic.hq.hqapi1.wadl.*; | ||
|
||
import java.net.Authenticator; | ||
import java.net.PasswordAuthentication; | ||
|
||
public class WADLTestBase extends TestCase { | ||
|
||
public void setUp() throws Exception { | ||
final String username ="hqadmin"; | ||
final String password ="hqadmin"; | ||
|
||
Authenticator.setDefault(new Authenticator() { | ||
protected PasswordAuthentication getPasswordAuthentication() { | ||
return new PasswordAuthentication (username, password.toCharArray()); | ||
} | ||
}); | ||
} | ||
|
||
// Assert SUCCESS | ||
|
||
void hqAssertSuccess(Response response) { | ||
String error = (response.getError() != null) ? | ||
response.getError().getReasonText() : ""; | ||
assertEquals(error, ResponseStatus.SUCCESS, response.getStatus()); | ||
} | ||
} |