Skip to content

Instantly share code, notes, and snippets.

@tdharris
Created June 15, 2015 21:38
Show Gist options
  • Save tdharris/e237ecfe2c4b7619fe10 to your computer and use it in GitHub Desktop.
Save tdharris/e237ecfe2c4b7619fe10 to your computer and use it in GitHub Desktop.
package sf.test.telephony.us.transfers.warm;
import java.util.Collection;
import lmp.actions.CallPath;
import obj.CallPathData;
import obj.comms.nodes.NodeForward;
import obj.comms.nodes.NodeRepQueue;
import obj.comms.nodes.NodeStart;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import sf.test.TestBase;
import sf.actions.ClickToCall;
import util.SFUtils;
import util.SipPhone;
@RunWith(Parameterized.class)
public class WarmTransferToCallPathC2C extends TestBase
{
private ClickToCall c2c;
private static SipPhone agent;
private static SipPhone forward;
private static SipPhone client;
private CallPath callPath;
private CallPathData data;
public WarmTransferToCallPathC2C(String _data)
{
try
{
System.out.println("Fetching JSON Object...");
JSONObject json = new JSONObject(_data);
testCase = json.getJSONArray("testCase");
// agent = new SipPhone();
// forward = new SipPhone();
// client = new SipPhone();
callPath = new CallPath(sm);
data = callPath.getData();
} catch (JSONException e)
{
e.printStackTrace();
}
}
@Parameters
public static Collection<String[]> data()
{
return TestBase.data("ui_" + WarmTransferToCallPathC2C.class.getSimpleName() + ".json", "ui_" + WarmTransferToCallPathC2C.class.getSimpleName(), "/");
}
@Before
public void setup()
{
// Create a Call Path to Transfer to
NodeStart startNode = new NodeStart();
NodeForward forwardNode = new NodeForward();
NodeRepQueue repQueueNode = new NodeRepQueue();
// set up the forward node properties
forwardNode.setCallerIdDisplay("Caller's Number");
forwardNode.setForwardNumber("8019601392");
// set up the rep queue properties
repQueueNode.setName("Ad Rep Queue");
repQueueNode.setFailoverTime(10);
repQueueNode.setPopScreenType("Lead");
repQueueNode.setAnswerTime(5);
repQueueNode.setLoopWaitMessage(true);
repQueueNode.setRouteType("Most Ready");
//repQueueNode.setWaitMessage("Good Morning");
repQueueNode.setPopScreenLayout("New Layout");
//ArrayList<String> attendees = new ArrayList<>();
//attendees.add("Main Admin");
repQueueNode.addAllAttendees();
//repQueueNode.setAttendees(attendees);
repQueueNode.setAlwaysCreateNewRecord(false);
repQueueNode.setWhisperMessage(null);
repQueueNode.setImmediateFailover(false);
repQueueNode.setReassignOwnerAfterRouting(false);
repQueueNode.setDefaultRecordOwner(SFUtils.getCurrentEmployee(sm));
repQueueNode.setEmployeeAreaCodeRestrictions(false);
startNode.addChildNode(repQueueNode);
repQueueNode.addChildNode(forwardNode);
data.addNode(startNode);
data.addNode(repQueueNode);
data.addNode(forwardNode);
// set the data for the call path
callPath.setData(data);
// create the new call path
callPath.add();
}
@After
public void tearDown()
{
// agent.release();
// forward.release();
// client.release();
// agent.quit();
// clean up Call Path
callPath.delete();
}
@Test
public void testWarmTransferToCallPathUS()
{
System.out.println("C2C Stuff...");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment