| | |
| | | package de.hsadmin.remote; |
| | | |
| | | import static org.junit.Assert.fail; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.BufferedWriter; |
| | | import java.io.IOException; |
| | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URL; |
| | | import java.net.URLEncoder; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | import javax.net.ssl.HttpsURLConnection; |
| | | |
| | | import org.apache.xmlrpc.XmlRpcException; |
| | | import org.apache.xmlrpc.client.XmlRpcClient; |
| | | |
| | | import de.hsadmin.core.util.Config; |
| | | |
| | |
| | | return result; |
| | | } |
| | | |
| | | public void setPassword(XmlRpcClient client, String user) { |
| | | try { |
| | | String admin = "ad"; |
| | | String grantingTicketURL = getGrantingTicketURL(admin); |
| | | Map<String, String> whereParams = new HashMap<String, String>(); |
| | | Map<String, String> setParams = new HashMap<String, String>(); |
| | | whereParams.put("name", user); |
| | | setParams.put("password", "test123"); |
| | | Object[] params = new Object[] { user, |
| | | getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), |
| | | setParams, whereParams }; |
| | | client.execute("user.update", params); |
| | | } catch (XmlRpcException e) { |
| | | fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |