Skip to content

Commit

Permalink
Some minor enhancements. Issues #37 and #38, PR #111
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Mendioroz committed Aug 9, 2017
1 parent 142dc02 commit 033596d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void init(InputStream configStream, String clientID) throws Exception {
sessionFactory.registerAppFacory(ServerSLgSession.class, sLgSessionFactory);
sessionFactory.registerAppFacory(ClientSLgSession.class, sLgSessionFactory);

sLgSessionFactory .setClientSessionListener(this);
sLgSessionFactory.setClientSessionListener(this);

this.clientSLgSession = ((ISessionFactory) this.sessionFactory).getNewAppSession(this.sessionFactory.getSessionId("xx-SLg-TESTxx"), getApplicationId(),
ClientSLgSession.class, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public abstract class AbstractSLgServer extends TBase implements ServerSLgSessio
// know we support it... ech.

protected ServerSLgSession serverSLgSession;
protected ClientSLgSession clientSLgSession;

public void init(InputStream configStream, String clientID) throws Exception {
try {
Expand Down Expand Up @@ -95,6 +94,8 @@ public void stop(int disconnectCause) {
stack.stop(disconnectCause);
}

// ------- def methods, to fail :)

public void doOtherEvent(AppSession session, AppRequestEvent request, AppAnswerEvent answer) throws InternalException, IllegalDiameterStateException,
RouteException,
OverloadException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ public Answer processRequest(Request request) {
fail("Received Request with code not used by SLg!. Code[" + request.getCommandCode() + "]", null);
return null;
}
if (super.serverSLgSession != null) {
if (super.clientSLgSession != null) {
// do fail?
fail("Received Request in base listener, not in app specific!" + code, null);
} else {
try {

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

} catch (Exception e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* @author <a href="mailto:[email protected]"> Bartosz Baranowski </a>
*/
@RunWith(Parameterized.class)
public class SLgSessionBasicSLgFlowTest {
public class SLgSessionBasicFlowTest {
// TODO: add test on replicated nodes ?
private ClientSLg clientNode;
private ServerSLg serverNode1;
Expand All @@ -64,7 +64,7 @@ public class SLgSessionBasicSLgFlowTest {
* // @param node2
* // @param serverCount
*/
public SLgSessionBasicSLgFlowTest(String clientConfigUrl, String serverNode1ConfigURL) throws Exception {
public SLgSessionBasicFlowTest(String clientConfigUrl, String serverNode1ConfigURL) throws Exception {
super();
this.clientConfigURI = new URI(clientConfigUrl);
this.serverNode1ConfigURI = new URI(serverNode1ConfigURL);
Expand Down Expand Up @@ -201,7 +201,7 @@ public static Collection<Object[]> data() {
//String replicatedClient = "configurations/functional-slh/replicated-config-client.xml";
//String replicatedServer1 = "configurations/functional-slh/replicated-config-server-node1.xml";

Class<SLgSessionBasicSLgFlowTest> t = SLgSessionBasicSLgFlowTest.class;
Class<SLgSessionBasicFlowTest> t = SLgSessionBasicFlowTest.class;
client = t.getClassLoader().getResource(client).toString();
server1 = t.getClassLoader().getResource(server1).toString();
//replicatedClient = t.getClassLoader().getResource(replicatedClient).toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void doLocationReportAnswerEvent(ServerSLgSession session, LocationReport
Utils.printMessage(log, super.stack.getDictionary(), answer.getMessage(), false);

if (this.receivedLRA) {
fail("Received PLA more than once", null);
fail("Received LRA more than once", null);
return;
}
this.receivedLRA = true;
Expand Down

0 comments on commit 033596d

Please sign in to comment.