Skip to content

Commit

Permalink
Some corrections in SLg testsuite after debugging with traces. Issues #…
Browse files Browse the repository at this point in the history
…37 and #38, PR #111
  • Loading branch information
Fernando Mendioroz committed Aug 12, 2017
1 parent 033596d commit fdee453
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 22 deletions.
Expand Up @@ -112,15 +112,13 @@ public Answer processRequest(Request request) {
fail("Received Request with code not used by SLg!. Code[" + request.getCommandCode() + "]", null);
return null;
}
if (super.clientSLgSession != null) {
if (super.clientSLgSession.getSessionId().equals(request.getSessionId())) {
// do fail?
fail("Received Request in base listener, not in app specific!" + code, null);
} else {
try {

super.clientSLgSession = this.sessionFactory.getNewAppSession(request.getSessionId(), getApplicationId(), ClientSLgSession.class, (Object) null);
((NetworkReqListener) this.clientSLgSession).processRequest(request);

} catch (Exception e) {
e.printStackTrace();
fail(null, e);
Expand Down
Expand Up @@ -131,7 +131,7 @@ public void tearDown() {
}

@Test
public void testLocationReportRequestBasicFlow() throws Exception {
public void testSLgImmediateAndDeferredBasicFlow() throws Exception {
try {
// pain of parameter tests :) ?
clientNode.sendProvideLocationRequest();
Expand Down Expand Up @@ -198,16 +198,16 @@ public static Collection<Object[]> data() {
String client = "configurations/functional-slg/config-client.xml";
String server1 = "configurations/functional-slg/config-server-node1.xml";

//String replicatedClient = "configurations/functional-slh/replicated-config-client.xml";
//String replicatedServer1 = "configurations/functional-slh/replicated-config-server-node1.xml";
String replicatedClient = "configurations/functional-slg/replicated-config-client.xml";
String replicatedServer1 = "configurations/functional-slg/replicated-config-server-node1.xml";

Class<SLgSessionBasicFlowTest> t = SLgSessionBasicFlowTest.class;
client = t.getClassLoader().getResource(client).toString();
server1 = t.getClassLoader().getResource(server1).toString();
//replicatedClient = t.getClassLoader().getResource(replicatedClient).toString();
//replicatedServer1 = t.getClassLoader().getResource(replicatedServer1).toString();
replicatedClient = t.getClassLoader().getResource(replicatedClient).toString();
replicatedServer1 = t.getClassLoader().getResource(replicatedServer1).toString();

return Arrays.asList(new Object[][] { { client, server1 }/*, { replicatedClient, replicatedServer1 } */});
return Arrays.asList(new Object[][] { { client, server1 }, { replicatedClient, replicatedServer1 }});
}

private void waitForMessage() {
Expand Down
Expand Up @@ -180,8 +180,8 @@ public static Collection<Object[]> data() {
String client = "configurations/functional-slg/config-client.xml";
String server1 = "configurations/functional-slg/config-server-node1.xml";

//String replicatedClient = "configurations/functional-slh/replicated-config-client.xml";
//String replicatedServer1 = "configurations/functional-slh/replicated-config-server-node1.xml";
//String replicatedClient = "configurations/functional-slg/replicated-config-client.xml";
//String replicatedServer1 = "configurations/functional-slg/replicated-config-server-node1.xml";

Class<SLgSessionBasicLRRFlowTest> t = SLgSessionBasicLRRFlowTest.class;
client = t.getClassLoader().getResource(client).toString();
Expand Down
Expand Up @@ -180,8 +180,8 @@ public static Collection<Object[]> data() {
String client = "configurations/functional-slg/config-client.xml";
String server1 = "configurations/functional-slg/config-server-node1.xml";

//String replicatedClient = "configurations/functional-slh/replicated-config-client.xml";
//String replicatedServer1 = "configurations/functional-slh/replicated-config-server-node1.xml";
//String replicatedClient = "configurations/functional-slg/replicated-config-client.xml";
//String replicatedServer1 = "configurations/functional-slg/replicated-config-server-node1.xml";

Class<SLgSessionBasicPLRFlowTest> t = SLgSessionBasicPLRFlowTest.class;
client = t.getClassLoader().getResource(client).toString();
Expand Down
Expand Up @@ -67,18 +67,11 @@ public void sendProvideLocationAnswer() throws Exception {
}

public void sendLocationReportRequest() throws Exception {
try {

super.serverSLgSession = this.sessionFactory.getNewAppSession("xx-SLg-TESTxx", getApplicationId(), ServerSLgSession.class, (Object) null);

} catch (Exception e) {
e.printStackTrace();
fail(null, e);
}
super.serverSLgSession = this.sessionFactory.getNewAppSession(this.sessionFactory.getSessionId("xx-SLg-TESTxx"), getApplicationId(), ServerSLgSession.class, (Object) null);
LocationReportRequest lrr = super.createLRR(super.serverSLgSession);
this.serverSLgSession.sendLocationReportRequest(lrr);
Utils.printMessage(log, super.stack.getDictionary(), lrr.getMessage(), true);
this.sentLRR = true;
Utils.printMessage(log, super.stack.getDictionary(), lrr.getMessage(), true);
}

/* (non-Javadoc)
Expand Down

0 comments on commit fdee453

Please sign in to comment.