use of won.protocol.message.WonMessage in project webofneeds by researchstudio-sat.
the class WonMessageSlipComputerTests method testSendMessageFromNodeGroupFacet.
@Test
public void testSendMessageFromNodeGroupFacet() throws Exception {
Exchange exchange = new DefaultExchange(new DefaultCamelContext());
exchange.getIn().setHeader(WonCamelConstants.MESSAGE_HEADER, new WonMessage(DatasetFactory.createGeneral()));
exchange.getIn().setHeader(WonCamelConstants.MESSAGE_TYPE_HEADER, URI.create(WONMSG.TYPE_CONNECTION_MESSAGE_STRING));
exchange.getIn().setHeader(WonCamelConstants.DIRECTION_HEADER, URI.create(WonMessageDirection.FROM_EXTERNAL.getResource().getURI().toString()));
exchange.getIn().setHeader(WonCamelConstants.FACET_TYPE_HEADER, URI.create(WON.GROUP_FACET_STRING));
String slip = wonMessageSlipComputer.evaluate(exchange, String.class);
Assert.assertEquals("sendMessageFromNodeProcessor,sendMessageFromNodeGroupFacetImpl", slip);
}
use of won.protocol.message.WonMessage in project webofneeds by researchstudio-sat.
the class WonMessageSlipComputerTests method testActivateNeedMessage.
@Test
public void testActivateNeedMessage() throws Exception {
Exchange exchange = new DefaultExchange(new DefaultCamelContext());
exchange.getIn().setHeader(WonCamelConstants.MESSAGE_HEADER, new WonMessage(DatasetFactory.createGeneral()));
exchange.getIn().setHeader(WonCamelConstants.MESSAGE_TYPE_HEADER, URI.create(WONMSG.TYPE_ACTIVATE_STRING));
exchange.getIn().setHeader(WonCamelConstants.DIRECTION_HEADER, URI.create(WONMSG.TYPE_FROM_OWNER.getURI().toString()));
exchange.getIn().setHeader(WonCamelConstants.FACET_TYPE_HEADER, URI.create(WON.OWNER_FACET_STRING));
String slip = wonMessageSlipComputer.evaluate(exchange, String.class);
Assert.assertEquals("activateNeedMessageProcessor", slip);
}
use of won.protocol.message.WonMessage in project webofneeds by researchstudio-sat.
the class WonMessageSlipComputerTests method testConnectMessageFromOwner.
@Test
public void testConnectMessageFromOwner() throws Exception {
Exchange exchange = new DefaultExchange(new DefaultCamelContext());
exchange.getIn().setHeader(WonCamelConstants.MESSAGE_HEADER, new WonMessage(DatasetFactory.createGeneral()));
exchange.getIn().setHeader(WonCamelConstants.MESSAGE_TYPE_HEADER, URI.create(WONMSG.TYPE_CONNECT_STRING));
exchange.getIn().setHeader(WonCamelConstants.DIRECTION_HEADER, URI.create(WonMessageDirection.FROM_OWNER.getResource().getURI().toString()));
exchange.getIn().setHeader(WonCamelConstants.FACET_TYPE_HEADER, URI.create(WON.OWNER_FACET_STRING));
String slip = wonMessageSlipComputer.evaluate(exchange, String.class);
Assert.assertEquals("connectMessageFromOwnerProcessor,connectFromOwnerOwnerFacetImpl", slip);
}
use of won.protocol.message.WonMessage in project webofneeds by researchstudio-sat.
the class WonMessageSlipComputerTests method testOpenMessageFromOwner.
@Test
public void testOpenMessageFromOwner() throws Exception {
Exchange exchange = new DefaultExchange(new DefaultCamelContext());
exchange.getIn().setHeader(WonCamelConstants.MESSAGE_HEADER, new WonMessage(DatasetFactory.createGeneral()));
exchange.getIn().setHeader(WonCamelConstants.MESSAGE_TYPE_HEADER, URI.create(WONMSG.TYPE_OPEN_STRING));
exchange.getIn().setHeader(WonCamelConstants.DIRECTION_HEADER, URI.create(WonMessageDirection.FROM_OWNER.getResource().getURI().toString()));
exchange.getIn().setHeader(WonCamelConstants.FACET_TYPE_HEADER, URI.create(WON.OWNER_FACET_STRING));
String slip = wonMessageSlipComputer.evaluate(exchange, String.class);
Assert.assertEquals("openMessageFromOwnerProcessor,openFromOwnerOwnerFacetImpl", slip);
}
Aggregations