mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
Mage.Stats WS module for getting server stats in json format
This commit is contained in:
parent
78c0d76088
commit
71614becc2
43 changed files with 1587 additions and 0 deletions
|
|
@ -0,0 +1,33 @@
|
|||
package com.anygo.ws.rest;
|
||||
|
||||
import com.xmage.ws.model.DomainErrors;
|
||||
import com.xmage.ws.rest.services.XMageStatsService;
|
||||
import com.xmage.ws.util.json.JSONParser;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
/**
|
||||
* Testings XMage stats service without need to deploy.
|
||||
*
|
||||
* @author noxx
|
||||
*/
|
||||
public class XMageStatsServiceTest {
|
||||
|
||||
@Test
|
||||
public void testAddNewAndGet() throws Exception {
|
||||
|
||||
XMageStatsService xMageStatsService = new XMageStatsService();
|
||||
|
||||
Response response = xMageStatsService.getAllStats();
|
||||
|
||||
JSONParser parser = new JSONParser();
|
||||
parser.parseJSON((String) response.getEntity());
|
||||
|
||||
Assert.assertEquals(DomainErrors.Errors.STATUS_OK.getCode(), parser.getInt("code"));
|
||||
System.out.println("response = " + response.getEntity().toString());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue