use of org.apache.qpid.server.protocol.v1_0.type.messaging.Source in project qpid-broker-j by apache.
the class Session_1_0Test method createAttach.
private Attach createAttach(final boolean durable, final String linkName, final String address, final Symbol destinationTypeCapability, final boolean isGlobal, final boolean isShared) {
Attach attach = new Attach();
Source source = new Source();
List<Symbol> capabilities = new ArrayList<>();
if (isGlobal) {
capabilities.add(Symbol.getSymbol("global"));
}
if (isShared) {
capabilities.add(Symbol.getSymbol("shared"));
}
capabilities.add(destinationTypeCapability);
source.setCapabilities(capabilities.toArray(new Symbol[capabilities.size()]));
if (durable) {
source.setDurable(TerminusDurability.CONFIGURATION);
source.setExpiryPolicy(TerminusExpiryPolicy.NEVER);
} else {
source.setDurable(TerminusDurability.NONE);
source.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH);
}
attach.setSource(source);
Target target = new Target();
attach.setTarget(target);
attach.setHandle(new UnsignedInteger(_handle++));
attach.setIncompleteUnsettled(false);
attach.setName(linkName);
attach.setRole(Role.RECEIVER);
source.setAddress(address);
return attach;
}
use of org.apache.qpid.server.protocol.v1_0.type.messaging.Source in project qpid-broker-j by apache.
the class LinkStoreTestCase method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
_linkStore = createLinkStore();
_source = new Source();
_target = new Target();
_source.setAddress(ADDRESS);
_source.setCapabilities(new Symbol[] { Symbol.getSymbol(CAPABILITY) });
_source.setDefaultOutcome(new Rejected());
_source.setDistributionMode(StdDistMode.COPY);
_source.setDurable(TerminusDurability.UNSETTLED_STATE);
_source.setDynamic(Boolean.TRUE);
_source.setExpiryPolicy(TerminusExpiryPolicy.CONNECTION_CLOSE);
_source.setFilter(Collections.singletonMap(Symbol.valueOf("foo"), NoLocalFilter.INSTANCE));
_source.setOutcomes(new Accepted().getSymbol());
_source.setDynamicNodeProperties(Collections.singletonMap(Symbol.valueOf("dynamicProperty"), "dynamicPropertyValue"));
_source.setTimeout(new UnsignedInteger(1));
_target.setTimeout(new UnsignedInteger(2));
_target.setDynamicNodeProperties(Collections.singletonMap(Symbol.valueOf("targetDynamicProperty"), "targetDynamicPropertyValue"));
_target.setDynamic(Boolean.TRUE);
_target.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH);
_target.setAddress("bar");
_target.setCapabilities(new Symbol[] { Symbol.getSymbol(CAPABILITY) });
_target.setDurable(TerminusDurability.CONFIGURATION);
}
use of org.apache.qpid.server.protocol.v1_0.type.messaging.Source in project qpid-broker-j by apache.
the class MessageConverter_1_0_to_v0_10Test method testAmqpValueWithListContainingUnsupportedType.
public void testAmqpValueWithListContainingUnsupportedType() throws Exception {
final List<Object> originalList = Collections.singletonList(new Source());
final AmqpValue amqpValue = new AmqpValue(originalList);
Message_1_0 sourceMessage = createTestMessage(amqpValue.createEncodingRetainingSection());
try {
_converter.convert(sourceMessage, mock(NamedAddressSpace.class));
fail("expected exception not thrown.");
} catch (MessageConversionException e) {
// pass
}
}
use of org.apache.qpid.server.protocol.v1_0.type.messaging.Source in project qpid-broker-j by apache.
the class MessageConverter_1_0_to_v0_8Test method testAmqpSequenceWithUnsupportedType.
public void testAmqpSequenceWithUnsupportedType() throws Exception {
final List<Object> originalList = Collections.singletonList(new Source());
final AmqpSequence amqpSequence = new AmqpSequence(originalList);
Message_1_0 sourceMessage = createTestMessage(amqpSequence.createEncodingRetainingSection());
try {
_converter.convert(sourceMessage, mock(NamedAddressSpace.class));
fail("expected exception not thrown.");
} catch (MessageConversionException e) {
// pass
}
}
use of org.apache.qpid.server.protocol.v1_0.type.messaging.Source in project qpid-broker-j by apache.
the class MessageConverter_1_0_to_v0_8Test method testAmqpValueWithListContainingUnsupportedType.
public void testAmqpValueWithListContainingUnsupportedType() throws Exception {
final List<Object> originalList = Collections.singletonList(new Source());
final AmqpValue amqpValue = new AmqpValue(originalList);
Message_1_0 sourceMessage = createTestMessage(amqpValue.createEncodingRetainingSection());
try {
_converter.convert(sourceMessage, mock(NamedAddressSpace.class));
fail("expected exception not thrown.");
} catch (MessageConversionException e) {
// pass
}
}
Aggregations