use of org.jdiameter.server.impl.app.sh.ShServerSessionImpl in project jain-slee.diameter by RestComm.
the class ShServerActivityAnswerCreationTest method testShServerActivityAnswerCreation.
@Test
public void testShServerActivityAnswerCreation() throws Exception {
ServerShSession session = new ShServerSessionImpl(new ShServerSessionDataLocalImpl(), new IShMessageFactoryImpl(), (ISessionFactory) stack.getSessionFactory(), new ServerShSessionListenerImpl());
DiameterMessageFactoryImpl msgFactory = new DiameterMessageFactoryImpl(session.getSessions().get(0), stack, null, null);
ShClientMessageFactoryImpl factory = new ShClientMessageFactoryImpl(session.getSessions().get(0), stack);
UserDataRequest udr = factory.createUserDataRequest();
net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest pur = factory.createProfileUpdateRequest();
net.java.slee.resource.diameter.sh.events.SubscribeNotificationsRequest snr = factory.createSubscribeNotificationsRequest();
ArrayList<DiameterMessage> list = new ArrayList<DiameterMessage>();
list.add(udr);
list.add(pur);
list.add(snr);
ShServerActivityImpl activity = new ShServerActivityImpl(new ShServerMessageFactoryImpl(msgFactory, session.getSessions().get(0), stack, diameterShAvpFactory), diameterShAvpFactory, session, null, null);
DiameterActivityAnswerCreationHelper.testAnswerCreation(activity, "stateMessages", list);
}
use of org.jdiameter.server.impl.app.sh.ShServerSessionImpl in project jain-slee.diameter by RestComm.
the class ShServerSessionFactory method getNewSession.
/*
* (non-Javadoc)
* @see org.jdiameter.common.api.app.IAppSessionFactory#getNewSession(java.lang.String, java.lang.Class, org.jdiameter.api.ApplicationId, java.lang.Object[])
*/
public AppSession getNewSession(String sessionId, Class<? extends AppSession> aClass, ApplicationId applicationId, Object[] args) {
if (aClass == ServerShSession.class) {
ShServerSessionImpl serverSession = null;
serverSession = (ShServerSessionImpl) super.getNewSession(sessionId, aClass, applicationId, args);
return serverSession;
} else {
throw new IllegalArgumentException("Wrong session class. Class[" + aClass + "]. Supported[" + ServerShSession.class + "]");
}
}
use of org.jdiameter.server.impl.app.sh.ShServerSessionImpl in project jain-slee.diameter by RestComm.
the class ShServerActivityAnswerCreationTest method testShServerSubscriptionActivityAnswerCreation.
@Test
public void testShServerSubscriptionActivityAnswerCreation() throws Exception {
ServerShSession session = new ShServerSessionImpl(new ShServerSessionDataLocalImpl(), new IShMessageFactoryImpl(), (ISessionFactory) stack.getSessionFactory(), new ServerShSessionListenerImpl());
DiameterMessageFactoryImpl msgFactory = new DiameterMessageFactoryImpl(session.getSessions().get(0), stack, null, null);
ShClientMessageFactoryImpl factory = new ShClientMessageFactoryImpl(session.getSessions().get(0), stack);
UserDataRequest udr = factory.createUserDataRequest();
net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest pur = factory.createProfileUpdateRequest();
net.java.slee.resource.diameter.sh.events.SubscribeNotificationsRequest snr = factory.createSubscribeNotificationsRequest();
ArrayList<DiameterMessage> list = new ArrayList<DiameterMessage>();
list.add(udr);
list.add(pur);
list.add(snr);
ShServerSubscriptionActivityImpl activity = new ShServerSubscriptionActivityImpl(new ShServerMessageFactoryImpl(msgFactory, session.getSessions().get(0), stack, diameterShAvpFactory), diameterShAvpFactory, session, null, null);
DiameterActivityAnswerCreationHelper.testAnswerCreation(activity, "stateMessages", list);
}
Aggregations