From 05b5c1d0c2a44f0f4c6bb87c178b917d1311f5c7 Mon Sep 17 00:00:00 2001 From: Ryan Morgan Date: Wed, 24 Jun 2009 11:57:39 -0700 Subject: [PATCH] Rename WADL test base class. --- .../hyperic/hq/hqapi1/test/WADLTestBase.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/org/hyperic/hq/hqapi1/test/WADLTestBase.java diff --git a/src/org/hyperic/hq/hqapi1/test/WADLTestBase.java b/src/org/hyperic/hq/hqapi1/test/WADLTestBase.java new file mode 100644 index 00000000..0aa4be94 --- /dev/null +++ b/src/org/hyperic/hq/hqapi1/test/WADLTestBase.java @@ -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()); + } +}