package test.com.ninjametrics.kapi;
import static org.junit.Assert.assertTrue;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import com.ninjametrics.kapi.KApi;
public class KapiTest {
private boolean retrnval1;
private KApi kapiobj;
@BeforeClass
public static void setUpClass() {
}
@Before
public void setUp() {
retrnval1 = false;
kapiobj = new KApi(YOUR_CLIENT_ID, YOUR_APP_ID, YOUR_APP_TOKEN);
}
@Test
public void testlogLoginDep() throws InterruptedException {
retrnval1 = kapiobj.logLogin(new Date(), "cool_guy@example.deprecated.com", "", 0, "", 0);
assertTrue("test for Login Deprecated ", retrnval1);
}
@Test
public void testlogLogin() throws InterruptedException {
retrnval1 = kapiobj.logLogin(new Date(), "cool_guy@example.com", "", 0, "", 0, "");
assertTrue("test for Login ", retrnval1);
}
@Test
public void testlogLogoutDep() {
retrnval1 = kapiobj.logLogout(new Date(), "cool_guy@example.com", "", 0, "", 0);
assertTrue("test for Logout Deprecated ", retrnval1);
}
@Test
public void testlogLogout() {
retrnval1 = kapiobj.logLogout(new Date(), "cool_guy@example.com", "");
assertTrue("test for Logout ", retrnval1);
}
@Test
public void testputSubChangeDep() {
Date expireTsdate = null;
try {
DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
expireTsdate = formatter.parse("01/13/2014");
} catch (ParseException pe) {
pe.printStackTrace();
}
retrnval1 = kapiobj.putSubChange(new Date(), "cool_guy@example.deprecated.com", "", "", expireTsdate);
assertTrue("test for Subscription Change Decprecated", retrnval1);
}
@Test
public void testputSubChange() {
Date expireTsdate = null;
try {
DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
expireTsdate = formatter.parse("01/13/2014");
} catch (ParseException pe) {
pe.printStackTrace();
}
retrnval1 = kapiobj.putSubChange(new Date(), "cool_guy@example.com", "", "", 10, expireTsdate);
assertTrue("test for Subscription Change ", retrnval1);
}
@Test
public void testlogEnterGroup() {
retrnval1 = kapiobj.logEnterGroup(new Date(), "cool_guy@example.com", "", 0, 4223, 32);
assertTrue("test for Group Enter ", retrnval1);
}
@Test
public void logExitGroup() {
retrnval1 = kapiobj.logExitGroup(new Date(), "cool_guy@example.com", "", 0, 4223, 32);
assertTrue("test for Group Exit ", retrnval1);
}
@Test
public void logSocialEvent() {
retrnval1 = kapiobj.logSocialEvent(new Date(), "admin@sharemagnet.com", "", 0, "admin@sharemagnet.com", "", 0, 0, "rebate_share", "");
assertTrue("test for Social ", retrnval1);
}
@Test
public void logOgiRecv() {
retrnval1 = kapiobj.logOgiRecv(new Date(), "cool_guy@example.com", "", "small_cat@example.com", "", 42, "https://www.facebook.com/wall/42", "wall post", "responded");
assertTrue("test for OFF_GAME_INTERACTION_RECEIVE ", retrnval1);
}
@Test
public void logOgiSend() {
retrnval1 = kapiobj.logOgiSend(new Date(), "cool_guy@example.com", "", "small_cat@example.com", "", 42, "https://www.facebook.com/wall/42", "wall post");
assertTrue("test for OFF_GAME_INTERACTION_SEND ", retrnval1);
}
@Test
public void loadAccountCreateDep() {
Date paramdate = null;
try {
DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
paramdate = formatter.parse("01/29/2012");
} catch (ParseException pe) {
pe.printStackTrace();
}
retrnval1 = kapiobj.loadAccountCreate(new Date(), "cool_guy@example.deprecated.com", "Free", "", "", "", paramdate, 0, "");
assertTrue("test for Deprecated Account Create ", retrnval1);
}
@Test
public void loadAccountCreate() {
Date paramdate = null;
try {
DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
paramdate = formatter.parse("01/29/2012");
} catch (ParseException pe) {
pe.printStackTrace();
}
retrnval1 = kapiobj.loadAccountCreate(new Date(), "cool_guy@example.com", "Free", "", "", "", paramdate, 0, "", "Old_account@example.com");
assertTrue("test for Account Create ", retrnval1);
}
@Test
public void loadAccountDeleteDep() {
retrnval1 = kapiobj.loadAccountDelete(new Date(), "cool_guy@example.deprecated.com", "", true, true);
assertTrue("test for Account Delete Deprecated", retrnval1);
}
@Test
public void loadAccountDelete() {
retrnval1 = kapiobj.loadAccountDelete(new Date(), "cool_guy@example.com", "");
assertTrue("test for Account Delete ", retrnval1);
}
@Test
public void loadCharacterCreate() {
retrnval1 = kapiobj.loadCharacterCreate(new Date(), "cool_guy@example.com", "", "", "", "", "", "", 0);
assertTrue("test for Character Create ", retrnval1);
}
@Test
public void loadCharacterDelete() {
retrnval1 = kapiobj.loadCharacterDelete(new Date(), "cool_guy@example.com", "Wizard");
assertTrue("test for Character Delete ", retrnval1);
}
@Test
public void loadShardCreate() {
retrnval1 = kapiobj.loadShardCreate(new Date(), 42, "");
assertTrue("test for Shard Create ", retrnval1);
}
@Test
public void loadVirtualCurrency() {
retrnval1 = kapiobj.loadVirtualCurrency(new Date(), "MUCHA");
assertTrue("test for Virtual Currency Set ", retrnval1);
}
@Test
public void loadItem() {
retrnval1 = kapiobj.loadItem(new Date(), 66, "", "", "UGC", "cool_guy@example.com", "");
assertTrue("test for Initialize Item ", retrnval1);
}
@Test
public void logItem() {
retrnval1 = kapiobj.logItem(new Date(), "cool_guy@example.com", "", 0, 0, 0, "The Blaster Gun", 1, 0, "", 0, 0, 0);
assertTrue("test for Item Used ", retrnval1);
}
@Test
public void logItemTransaction() {
retrnval1 = kapiobj.logItemTransaction(new Date(), "cool_guy@example.com", "", 0, 66, "", 3, 0, 0, "", 3, 0);
assertTrue("test for Item Transaction ", retrnval1);
}
@Test
public void logCurrencyTransaction() {
retrnval1 = kapiobj.logCurrencyTransaction(new Date(), "cool_guy@example.com", "", 0, 0, 0, "mucha", 3, "", 0);
assertTrue("test for Currency Transaction ", retrnval1);
}
@Test
public void loadUgcRating() {
retrnval1 = kapiobj.loadUgcRating(new Date(), "cool_guy@example.com", "", 0, 0, "", 1);
assertTrue("test for UGC Rating ", retrnval1);
}
@Test
public void logMessage() {
retrnval1 = kapiobj.logMessage(new Date(), "cool_guy@example.com", "", "small_cat@example.com", "", 0, "", "pulled from twitter", 1);
assertTrue("test for Message ", retrnval1);
}
@Test
public void combatStart() {
retrnval1 = kapiobj.combatStart(new Date(), "cool_guy@example.com", "", 42, 23456, 0, 0, 0, 0, "");
assertTrue("test for Start Combat ", retrnval1);
}
@Test
public void combatEnd() {
retrnval1 = kapiobj.combatEnd(new Date(), "cool_guy@example.com", "", 0, 23456, 0, 0, 0, 0, "");
assertTrue("test for End Combat ", retrnval1);
}
@Test
public void logKillNpc() {
retrnval1 = kapiobj.logKillNpc(new Date(), "cool_guy@example.com", "", 0, 0, 23456);
assertTrue("test for Kill ", retrnval1);
}
@Test
public void playerPoints() {
retrnval1 = kapiobj.playerPoints(new Date(), "cool_guy@example.com", "", 0, 0, 34, false, "");
assertTrue("test for Player Points ", retrnval1);
}
@Test
public void logPvpDuel() {
retrnval1 = kapiobj.logPvpDuel(new Date(), "cool_guy@example.com", "", 0, true);
assertTrue("test for PVP Duel ", retrnval1);
}
@Test
public void logPlayerDeath() {
retrnval1 = kapiobj.logPlayerDeath(new Date(), "cool_guy@example.com", "", 0, 23456, "", 0, 0, 0, 0, "");
assertTrue("test for Player Death ", retrnval1);
}
@Test
public void levelBegin() {
retrnval1 = kapiobj.levelBegin(new Date(), "cool_guy@example.com", "", 0, 0, 0, 0, 0, 0, "");
assertTrue("test for Level Begin ", retrnval1);
}
@Test
public void levelEnd() {
retrnval1 = kapiobj.levelEnd(new Date(), "cool_guy@example.com", "", 0, 0, 0, 0, 0, 0, "");
assertTrue("test for Level End ", retrnval1);
}
@Test
public void areaEnter() {
retrnval1 = kapiobj.areaEnter(new Date(), "cool_guy@example.com", "", 52, 0, 0, 0, 0, 0, "");
assertTrue("test for Enter Area ", retrnval1);
}
@Test
public void areaExit() {
retrnval1 = kapiobj.areaExit(new Date(), "cool_guy@example.com", "", 52, 0, 0, 0, 0, 0, "");
assertTrue("test for Exit Area ", retrnval1);
}
@Test
public void logNpcInteraction() {
retrnval1 = kapiobj.logNpcInteraction(new Date(), "cool_guy@example.com", "", 0, "npcEventName", "npcEventType", 0, "npcName", "", 0, 0, 0, "theToughnessEnum");
assertTrue("test for NPC Interaction ", retrnval1);
}
@Test
public void logChallenge() {
retrnval1 = kapiobj.logChallenge(new Date(), "cool_guy@example.com", "", 0, "challengeId", "", "");
assertTrue("test for Challenge ", retrnval1);
}
@Test
public void recruitmentSend() {
retrnval1 = kapiobj.recruitmentSend(new Date(), "cool_guy@example.com", "", "small_cat@example.com", "", "");
assertTrue("test for Recruitment Send ", retrnval1);
}
@Test
public void recruitmentReceive() {
retrnval1 = kapiobj.recruitmentReceive(new Date(), "cool_guy@example.com", "", "small_cat@example.com", "", "", "");
assertTrue("test for Recruitment Receive ", retrnval1);
}
@Test
public void storeCreate() {
retrnval1 = kapiobj.storeCreate(new Date(), 8729, "", "", "", "", "", "");
assertTrue("test for Create Store ", retrnval1);
}
@Test
public void storeDelete() {
retrnval1 = kapiobj.storeDelete(new Date(), 8729);
assertTrue("test for Delete Store ", retrnval1);
}
@Test
public void storeBuyItem() {
retrnval1 = kapiobj.storeBuyItem(new Date(), "cool_guy@example.com", "", "small_cat@example.com", "", 0, 123456, 0, "", 3, 1, "MCH", 4, 0);
assertTrue("test for Buy Store Item ", retrnval1);
}
@Test
public void storeLogin() {
retrnval1 = kapiobj.storeLogin(new Date(), "cool_guy@example.com", "", 0, 123456);
assertTrue("test for Store Login ", retrnval1);
}
@Test
public void storeLogout() {
retrnval1 = kapiobj.storeLogout(new Date(), "cool_guy@example.com", "", 0, 123456);
assertTrue("test for Store Logout ", retrnval1);
}
@Test
public void storeAddToCart() {
retrnval1 = kapiobj.storeAddToCart(new Date(), "cool_guy@example.com", "", 123456, 0, "Sword", "");
assertTrue("test for Store Add Cart ", retrnval1);
}
@Test
public void logEnterGuild() {
retrnval1 = kapiobj.logEnterGuild(new Date(), "cool_guy@example.com", "", 0, 1, 42);
assertTrue("test for Enter Guild ", retrnval1);
}
@Test
public void logExitGuild() {
retrnval1 = kapiobj.logExitGuild(new Date(), "cool_guy@example.com", "", 0, 1, 42, "");
assertTrue("test for Exit Guild ", retrnval1);
}
@Test
public void logFriendAdd() {
retrnval1 = kapiobj.logFriendAdd(new Date(), "cool_guy@example.com", "", "small_cat@example.com", "");
assertTrue("test for Add Friend ", retrnval1);
}
@Test
public void logFriendDelete() {
retrnval1 = kapiobj.logFriendDelete(new Date(), "cool_guy@example.com", "", "small_cat@example.com", "");
assertTrue("test for Delete Friend ", retrnval1);
}
@Test
public void putGuildLeader() {
retrnval1 = kapiobj.putGuildLeader(new Date(), "cool_guy@example.com", "", 777);
assertTrue("test for Guild Leader ", retrnval1);
}
@Test
public void trackUgcCopy() {
retrnval1 = kapiobj.trackUgcCopy(new Date(), "cool_guy@example.com", "", 0, 8729, "");
assertTrue("test for Track UGC Copy ", retrnval1);
}
@Test
public void logFarmer() {
retrnval1 = kapiobj.logFarmer(new Date(), "cool_guy@example.com", "", 0, "");
assertTrue("test for Farmer ", retrnval1);
}
@Test
public void logIntegrity() {
retrnval1 = kapiobj.logIntegrity(new Date(), "cool_guy@example.com", 0, "");
assertTrue("test for Integrity ", retrnval1);
}
@Test
public void logReward() {
retrnval1 = kapiobj.logReward(new Date(), "cool_guy@example.com", "", 0, 1, "1", "", 50);
assertTrue("test for Reward ", retrnval1);
}
@Test
public void logAreaDim() {
retrnval1 = kapiobj.logAreaDim(new Date(), "", 2, 0, "", 0, 0, 0, 0, 0, 0);
assertTrue("test for Area ", retrnval1);
}
@Test
public void logMob() {
retrnval1 = kapiobj.logMob(new Date(), "cool_guy@example.com", "", 0, "");
assertTrue("test for MOB ", retrnval1);
}
@Test
public void logCrmAction() {
Date crmFulfilledTsdate = null;
try {
DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
crmFulfilledTsdate = formatter.parse("03/13/2014");
} catch (ParseException pe) {
pe.printStackTrace();
}
retrnval1 = kapiobj.logCrmAction(new Date(), "cool_guy@example.com", "", 0, "", "", "", crmFulfilledTsdate);
assertTrue("test for CRM Action ", retrnval1);
}
@Test
public void logCustomerServiceAction() {
retrnval1 = kapiobj.logCustomerServiceAction(new Date(), "cool_guy@example.com", "", 0, "cs action", "");
assertTrue("test for Customer Service Action ", retrnval1);
}
@Test
public void logCustomSlot() {
retrnval1 = kapiobj.logCustomSlot(new Date(), "cool_guy@example.com", "", "custom action", "custom action type", "");
assertTrue("test for Custom Slot ", retrnval1);
}
@Test
public void logProductivity() {
retrnval1 = kapiobj.logProductivity(new Date(), "cool_guy@example.com", "", 0, "");
assertTrue("test for Productivity ", retrnval1);
}
@Test
public void logResource() {
retrnval1 = kapiobj.logResource(new Date(), "cool_guy@example.com", "", 0, "", "1", 3);
assertTrue("test for Resource ", retrnval1);
}
@Test
public void logAdClick() {
Date AdActionTsdate = null;
try {
DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
AdActionTsdate = formatter.parse("01/23/2014");
} catch (ParseException pe) {
pe.printStackTrace();
}
retrnval1 = kapiobj.logAdClick(new Date(), "cool_guy@example.com", "", AdActionTsdate);
assertTrue("test for Ad Click ", retrnval1);
}
@Test
public void logEconomic() {
retrnval1 = kapiobj.logEconomic(new Date(), "cool_guy@example.com", "", "small_cat@example.com", "", 0, 124606, "", "", 52, 0, "USD", 52);
assertTrue("test for Economic ", retrnval1);
}
@Test
public void logTrafficSource() throws InterruptedException {
retrnval1 = kapiobj.logTrafficSource(new Date(), "cool_guy@example.com", "", 0, "");
assertTrue("test for Traffic Source ", retrnval1);
}
@AfterClass
public static void afterClass() throws InterruptedException {
Thread.sleep(5000);
}
}