LoginAndInfoTest.java (769B)
1 package de.openrat.client.test; 2 3 import de.openrat.client.CMSClient; 4 import org.junit.Test; 5 6 import static de.openrat.client.test.TestConfiguration.*; 7 8 public class LoginAndInfoTest { 9 10 /** 11 * simple example for using the client. 12 */ 13 @Test 14 public void testUserInfo() throws Exception { 15 16 final CMSClient client = new CMSClient(TestConfiguration.HOST, PATH, PORT); 17 client.setLogWriter(WRITER); 18 client.setProxy(PROXY_HOST, PROXY_PORT); 19 client.setLocale(LOCALE); 20 client.setKeepAlive(false); 21 client.setTimeout(15000); 22 23 ExampleCMSTestAPI api = new ExampleCMSTestAPI(client); 24 25 // let's login 26 api.login( DB,USER, PASS); 27 28 // print user info 29 System.out.println(api.info()); 30 31 client.close(); 32 } 33 34 }