// Path: src/test/java/org/agilos/zendesk_jira_plugin/testframework/JIRARoles.java
// public abstract class JIRARoles {
// 	public static final String Administrators = "Administrators";
// 	public static final String Developers = "Developers";
// 	public static final String Users = "Users";
// 
// 	public enum Roles { jiraadministrators, jiradevelopers, jirausers }//Define default groups
// 
// 	private static Logger log = Logger.getLogger(JIRARoles.class.getName());
// 
// 	private static final Map<String, RemoteProjectRole> roleMap = new HashMap<String, RemoteProjectRole>();
// 	private static JIRAClient jiraClient = JIRAClient.instance();
// 
// 	public static RemoteProjectRole getRole(String name) {
// 		if (roleMap.isEmpty()) retrieveRoles();
// 		return roleMap.get(name);
// 	}
// 
// 	public static void addUserToProjectRoleInProject(String userName, String projectRole, RemoteProject project) throws RemoteException, java.rmi.RemoteException {
// 		jiraClient.getService().addActorsToProjectRole(jiraClient.getToken(), new String[] { userName }, getRole(projectRole), project, "atlassian-user-role-actor");
// 	}
// 
// 	public static void removeUserFromProjectRoleInProject(String username, String projectRole, RemoteProject project) throws RemoteException, java.rmi.RemoteException {
// 		jiraClient.getService().removeActorsFromProjectRole(jiraClient.getToken(), new String[] { username }, getRole(projectRole), project, "atlassian-user-role-actor");
// 	}
// 
// 	/**
// 	 * Always use this to add new roles, else the local roles cache will become obsolete
// 	 */
// 	public static void addRole() {
// 		throw new NotImplementedException();
// 	}
// 
// 	public static void retrieveRoles() {
// 		try {
// 			RemoteProjectRole[] roles = jiraClient.getService().getProjectRoles(jiraClient.getToken());
// 			for (int i=0;i<roles.length;i++) {
// 				roleMap.put(roles[i].getName(), roles[i]);
// 			}
// 		} catch (Exception e) {
// 			log.error("Unable to retieve project roles");
// 		} 
// 	}
// }
// 
// Path: src/test/java/org/agilos/zendesk_jira_plugin/testframework/ZendeskWSClient.java
// public class ZendeskWSClient {
// 	private static AgilosSoapService agilosSoapService;
// 	private static String agilosSoapToken;
// 
// 	public static AgilosSoapService getSoapService() {
// 		return agilosSoapService;
// 	}
// 
// 	public static String getSoapToken() {
// 		return agilosSoapToken;
// 	}
// 
// 	private Logger log = Logger.getLogger(ZendeskWSClient.class.getName());
// 
// 	public ZendeskWSClient() throws ServiceException, RemoteException, MalformedURLException {	
// 		AgilosSoapServiceService agilosSoapServiceGetter = new AgilosSoapServiceServiceLocator();
// 		URL agilosSOAPServiceUrl = new URL(JIRA.URL+"/rpc/soap/agilossoapservice-v1");
// 		log.debug("Retriving jira soap service from "+agilosSOAPServiceUrl);
// 		agilosSoapService = agilosSoapServiceGetter.getAgilossoapserviceV1(agilosSOAPServiceUrl);
// 		log.debug("Logging in with user: " + JIRA.LOGIN_NAME+" and password: " + JIRA.LOGIN_PASSWORD);
// 		agilosSoapToken = agilosSoapService.login(JIRA.LOGIN_NAME, JIRA.LOGIN_PASSWORD);
// 	}
// 	
// 	public RemoteUser[] assignableUsers(String projectKey) throws Exception {
// 		return agilosSoapService.getAssignableUsers(agilosSoapToken, projectKey);
// 	}
// }


import org.agilos.jira.soapclient.RemoteUser;
import org.agilos.zendesk_jira_plugin.testframework.JIRARoles;
import org.agilos.zendesk_jira_plugin.testframework.ZendeskWSClient;
import org.apache.log4j.Logger;
package org.agilos.zendesk_jira_plugin.integrationtest.fixtures;



public class WebserviceFixture extends JIRAFixture {
	protected ZendeskWSClient zendeskWSClient;
	
// Path: src/test/java/org/agilos/zendesk_jira_plugin/testframework/JIRARoles.java
// public abstract class JIRARoles {
// 	public static final String Administrators = "Administrators";
// 	public static final String Developers = "Developers";
// 	public static final String Users = "Users";
// 
// 	public enum Roles { jiraadministrators, jiradevelopers, jirausers }//Define default groups
// 
// 	private static Logger log = Logger.getLogger(JIRARoles.class.getName());
// 
// 	private static final Map<String, RemoteProjectRole> roleMap = new HashMap<String, RemoteProjectRole>();
// 	private static JIRAClient jiraClient = JIRAClient.instance();
// 
// 	public static RemoteProjectRole getRole(String name) {
// 		if (roleMap.isEmpty()) retrieveRoles();
// 		return roleMap.get(name);
// 	}
// 
// 	public static void addUserToProjectRoleInProject(String userName, String projectRole, RemoteProject project) throws RemoteException, java.rmi.RemoteException {
// 		jiraClient.getService().addActorsToProjectRole(jiraClient.getToken(), new String[] { userName }, getRole(projectRole), project, "atlassian-user-role-actor");
// 	}
// 
// 	public static void removeUserFromProjectRoleInProject(String username, String projectRole, RemoteProject project) throws RemoteException, java.rmi.RemoteException {
// 		jiraClient.getService().removeActorsFromProjectRole(jiraClient.getToken(), new String[] { username }, getRole(projectRole), project, "atlassian-user-role-actor");
// 	}
// 
// 	/**
// 	 * Always use this to add new roles, else the local roles cache will become obsolete
// 	 */
// 	public static void addRole() {
// 		throw new NotImplementedException();
// 	}
// 
// 	public static void retrieveRoles() {
// 		try {
// 			RemoteProjectRole[] roles = jiraClient.getService().getProjectRoles(jiraClient.getToken());
// 			for (int i=0;i<roles.length;i++) {
// 				roleMap.put(roles[i].getName(), roles[i]);
// 			}
// 		} catch (Exception e) {
// 			log.error("Unable to retieve project roles");
// 		} 
// 	}
// }
// 
// Path: src/test/java/org/agilos/zendesk_jira_plugin/testframework/ZendeskWSClient.java
// public class ZendeskWSClient {
// 	private static AgilosSoapService agilosSoapService;
// 	private static String agilosSoapToken;
// 
// 	public static AgilosSoapService getSoapService() {
// 		return agilosSoapService;
// 	}
// 
// 	public static String getSoapToken() {
// 		return agilosSoapToken;
// 	}
// 
// 	private Logger log = Logger.getLogger(ZendeskWSClient.class.getName());
// 
// 	public ZendeskWSClient() throws ServiceException, RemoteException, MalformedURLException {	
// 		AgilosSoapServiceService agilosSoapServiceGetter = new AgilosSoapServiceServiceLocator();
// 		URL agilosSOAPServiceUrl = new URL(JIRA.URL+"/rpc/soap/agilossoapservice-v1");
// 		log.debug("Retriving jira soap service from "+agilosSOAPServiceUrl);
// 		agilosSoapService = agilosSoapServiceGetter.getAgilossoapserviceV1(agilosSOAPServiceUrl);
// 		log.debug("Logging in with user: " + JIRA.LOGIN_NAME+" and password: " + JIRA.LOGIN_PASSWORD);
// 		agilosSoapToken = agilosSoapService.login(JIRA.LOGIN_NAME, JIRA.LOGIN_PASSWORD);
// 	}
// 	
// 	public RemoteUser[] assignableUsers(String projectKey) throws Exception {
// 		return agilosSoapService.getAssignableUsers(agilosSoapToken, projectKey);
// 	}
// }


// Path: src/test/java/org/agilos/zendesk_jira_plugin/integrationtest/fixtures/WebserviceFixture.java
import org.agilos.jira.soapclient.RemoteUser;
import org.agilos.zendesk_jira_plugin.testframework.JIRARoles;
import org.agilos.zendesk_jira_plugin.testframework.ZendeskWSClient;
import org.apache.log4j.Logger;

package org.agilos.zendesk_jira_plugin.integrationtest.fixtures;



public class WebserviceFixture extends JIRAFixture {
	protected ZendeskWSClient zendeskWSClient;
	
	private Logger log = Logger.getLogger(WebserviceFixture.class.getName());