Java Code Examples for org.springframework.integration.test.util.TestUtils

The following examples show how to use org.springframework.integration.test.util.TestUtils. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Test
@Override
public void test() throws Exception {
	for (int i = 1; i <= 2; i++) {
		Message<?> received = this.messageCollector.forChannel(this.channels.output())
				.poll(10, TimeUnit.SECONDS);
		assertNotNull(received);
		assertThat(received, hasPayload(new File(this.config.getLocalDir(), i + ".test")));
	}

	assertEquals(2, this.config.getLocalDir().list().length);

	AWSCredentialsProvider awsCredentialsProvider =
			TestUtils.getPropertyValue(this.amazonS3, "awsCredentialsProvider", AWSCredentialsProvider.class);

	AWSCredentials credentials = awsCredentialsProvider.getCredentials();
	assertEquals(AWS_ACCESS_KEY, credentials.getAWSAccessKeyId());
	assertEquals(AWS_SECRET_KEY, credentials.getAWSSecretKey());

	assertEquals(Region.US_GovCloud, this.amazonS3.getRegion());
	assertEquals(new URI("https://s3-us-gov-west-1.amazonaws.com"),
			TestUtils.getPropertyValue(this.amazonS3, "endpoint"));
}
 
Example 2
@Test
public void test() {
	assertNotNull(this.sink.input());
	assertEquals(LoggingHandler.Level.WARN, this.logSinkHandler.getLevel());
	Log logger = TestUtils.getPropertyValue(this.logSinkHandler, "messageLogger",
			Log.class);
	assertEquals("foo", TestUtils.getPropertyValue(logger, "name"));
	logger = spy(logger);
	new DirectFieldAccessor(this.logSinkHandler).setPropertyValue("messageLogger",
			logger);
	GenericMessage<String> message = new GenericMessage<>("foo");
	this.sink.input().send(message);
	ArgumentCaptor<Object> captor = ArgumentCaptor.forClass(Object.class);
	verify(logger).warn(captor.capture());
	assertEquals("FOO", captor.getValue());
	this.logSinkHandler.setExpression("#this");
	this.sink.input().send(message);
	verify(logger, times(2)).warn(captor.capture());
	assertSame(message, captor.getValue());
}
 
Example 3
@Test
public void test() throws Exception {
	assertThat(this.splitter, instanceOf(FileSplitter.class));
	assertSame(this.splitter, TestUtils.getPropertyValue(this.consumer, "handler"));
	File file = new File(System.getProperty("java.io.tmpdir") + File.separator + "splitter.proc.test");
	FileOutputStream fos = new FileOutputStream(file);
	fos.write("hello\nworld\n".getBytes());
	fos.close();
	this.channels.input().send(new GenericMessage<>(file));
	Message<?> m = this.collector.forChannel(this.channels.output()).poll(10, TimeUnit.SECONDS);
	assertNotNull(m);
	assertNull((m.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER)));
	assertThat(m, hasPayload("hello"));
	assertThat(this.collector.forChannel(this.channels.output()), receivesPayloadThat(is("world")));
	file.delete();
}
 
Example 4
@Test
public void test() throws Exception {
	assertThat(this.splitter, instanceOf(FileSplitter.class));
	assertSame(this.splitter, TestUtils.getPropertyValue(this.consumer, "handler"));
	File file = new File(System.getProperty("java.io.tmpdir") + File.separator + "splitter.proc.test");
	FileOutputStream fos = new FileOutputStream(file);
	fos.write("hello\nworld\n".getBytes());
	fos.close();
	this.channels.input().send(new GenericMessage<>(file));
	Message<?> m = this.collector.forChannel(this.channels.output()).poll(10, TimeUnit.SECONDS);
	assertNotNull(m);
	assertThat(m.getPayload(), instanceOf(FileMarker.class));
	assertThat((FileMarker) m.getPayload(), hasMark(Mark.START));
	assertThat(m, allOf(hasSequenceNumber(1), hasSequenceSize(0)));
	assertThat(this.collector.forChannel(this.channels.output()), receivesPayloadThat(is("hello")));
	assertThat(this.collector.forChannel(this.channels.output()), receivesPayloadThat(is("world")));
	assertThat(this.collector.forChannel(this.channels.output()),
			receivesPayloadThat(allOf(
					instanceOf(FileMarker.class),
		 			hasMark(Mark.END))));
	file.delete();
}
 
Example 5
@Test
public void test() throws Exception {
	AbstractMessageListenerContainer container = TestUtils.getPropertyValue(this.endpoint, "listenerContainer",
			AbstractMessageListenerContainer.class);
	assertThat(container, instanceOf(DefaultMessageListenerContainer.class));
	assertEquals(Session.AUTO_ACKNOWLEDGE, TestUtils.getPropertyValue(container, "sessionAcknowledgeMode"));
	assertTrue(TestUtils.getPropertyValue(container, "sessionTransacted", Boolean.class));
	assertEquals("client", TestUtils.getPropertyValue(container, "clientId"));
	assertEquals("topic", TestUtils.getPropertyValue(container, "destination"));
	assertTrue(TestUtils.getPropertyValue(container, "subscriptionDurable", Boolean.class));
	assertEquals("subName", TestUtils.getPropertyValue(container, "subscriptionName"));
	assertFalse(TestUtils.getPropertyValue(container, "subscriptionShared", Boolean.class));
	assertEquals(3, TestUtils.getPropertyValue(container, "concurrentConsumers"));
	assertEquals(4, TestUtils.getPropertyValue(container, "maxConcurrentConsumers"));
	assertTrue(TestUtils.getPropertyValue(container, "pubSubDomain", Boolean.class));
}
 
Example 6
@Test
public void test() throws Exception {
	AbstractMessageListenerContainer container = TestUtils.getPropertyValue(this.endpoint, "listenerContainer",
			AbstractMessageListenerContainer.class);
	assertThat(container, instanceOf(DefaultMessageListenerContainer.class));
	assertEquals(Session.AUTO_ACKNOWLEDGE, TestUtils.getPropertyValue(container, "sessionAcknowledgeMode"));
	assertTrue(TestUtils.getPropertyValue(container, "sessionTransacted", Boolean.class));
	assertEquals("jmssource.test.queue", TestUtils.getPropertyValue(container, "destination"));
	assertEquals("JMSCorrelationId=foo", TestUtils.getPropertyValue(container, "messageSelector"));
	assertFalse(TestUtils.getPropertyValue(container, "subscriptionDurable", Boolean.class));
	assertFalse(TestUtils.getPropertyValue(container, "subscriptionShared", Boolean.class));
	assertEquals(3, TestUtils.getPropertyValue(container, "concurrentConsumers"));
	assertEquals(4, TestUtils.getPropertyValue(container, "maxConcurrentConsumers"));
	assertFalse(TestUtils.getPropertyValue(container, "pubSubDomain", Boolean.class));

	template.convertAndSend("jmssource.test.queue", "Hello, world!");
	Message<?> received = messageCollector.forChannel(channels.output()).poll(10, TimeUnit.SECONDS);
	assertNotNull(received);
	assertEquals("Hello, world!", received.getPayload());
}
 
Example 7
@Test
public void testSink() throws Exception {
	assertNotNull(this.sink.input());
	this.sink.input().send(new GenericMessage<>("foo"));
	Log logger = spy(TestUtils.getPropertyValue(this.configuration, "logger", Log.class));
	new DirectFieldAccessor(this.configuration).setPropertyValue("logger", logger);
	final CountDownLatch latch = new CountDownLatch(1);
	doAnswer(new Answer<Void>() {

		@Override
		public Void answer(InvocationOnMock invocation) throws Throwable {
			invocation.callRealMethod();
			latch.countDown();
			return null;
		}

	}).when(logger).info(anyString());
	assertTrue(latch.await(10, TimeUnit.SECONDS));
}
 
Example 8
@Test
@SuppressWarnings("unchecked")
public void converterCorrectlyInstalled() {
	Expression expression = this.pojo.getExpression();
	assertThat(expression.getValue("{\"a\": {\"b\": 5}}").toString()).isEqualTo("5");

	List<PropertyAccessor> propertyAccessors = TestUtils.getPropertyValue(
			this.evaluationContext, "propertyAccessors", List.class);

	assertThat(propertyAccessors)
			.hasAtLeastOneElementOfType(JsonPropertyAccessor.class);

	propertyAccessors = TestUtils.getPropertyValue(this.config.evaluationContext,
			"propertyAccessors", List.class);

	assertThat(propertyAccessors)
			.hasAtLeastOneElementOfType(JsonPropertyAccessor.class);
}
 
Example 9
Source Project: spring-integration-aws   Source File: SqsPermissionsParserTests.java    License: MIT License 6 votes vote down vote up
@Test
public void outboundPermissions() {
	EventDrivenConsumer consumer = context.getBean("sqs-outbound",
			EventDrivenConsumer.class);
	assertThat(consumer, is(notNullValue()));

	final SqsExecutor executor = TestUtils.getPropertyValue(consumer,
			"handler.sqsExecutor", SqsExecutor.class);
	assertThat(executor, is(notNullValue()));

	@SuppressWarnings("unchecked")
	Set<Permission> permissions = (Set<Permission>) TestUtils
			.getPropertyValue(executor, "permissions");
	assertThat("permissions is not null", permissions, is(notNullValue()));
	assertThat("all permissions loaded", permissions.size(), is(equalTo(1)));
}
 
Example 10
Source Project: spring-integration-aws   Source File: SqsPermissionsParserTests.java    License: MIT License 6 votes vote down vote up
@Test
public void outboundGatewayPermissions() {
	EventDrivenConsumer consumer = context.getBean("sqs-gateway",
			EventDrivenConsumer.class);
	assertThat(consumer, is(notNullValue()));

	final SqsExecutor executor = TestUtils.getPropertyValue(consumer,
			"handler.sqsExecutor", SqsExecutor.class);
	assertThat(executor, is(notNullValue()));

	@SuppressWarnings("unchecked")
	Set<Permission> permissions = (Set<Permission>) TestUtils
			.getPropertyValue(executor, "permissions");
	assertThat("permissions is not null", permissions, is(notNullValue()));
	assertThat("all permissions loaded", permissions.size(), is(equalTo(1)));
}
 
Example 11
Source Project: spring-integration-aws   Source File: SqsPermissionsParserTests.java    License: MIT License 6 votes vote down vote up
@Test
public void channelPermissions() {
	SubscribableChannel channel = context.getBean("sqs-channel",
			SubscribableChannel.class);
	assertThat(channel, is(notNullValue()));

	final SqsExecutor executor = TestUtils.getPropertyValue(channel,
			"sqsExecutor", SqsExecutor.class);
	assertThat(executor, is(notNullValue()));

	@SuppressWarnings("unchecked")
	Set<Permission> permissions = (Set<Permission>) TestUtils
			.getPropertyValue(executor, "permissions");
	assertThat("permissions is not null", permissions, is(notNullValue()));
	assertThat("all permissions loaded", permissions.size(), is(equalTo(1)));
}
 
Example 12
Source Project: spring-integration-aws   Source File: SqsChannelParserTests.java    License: MIT License 6 votes vote down vote up
@Test
public void testSqsInboundChannelAdapterParser() throws Exception {

	setUp("SqsChannelParserTests.xml", getClass(), "sqsChannel");

	final SqsExecutor sqsExecutor = TestUtils.getPropertyValue(
			this.channel, "sqsExecutor", SqsExecutor.class);

	assertNotNull(sqsExecutor);

	final String queueNameProperty = TestUtils.getPropertyValue(
			sqsExecutor, "queueName", String.class);

	assertEquals("testQueue", queueNameProperty);

	Object sqsExecutorProxy = context.getBean("sqsExecutorProxy");
	assertNotNull(sqsExecutorProxy);
	assertEquals(SqsExecutorProxy.class, sqsExecutorProxy.getClass());
	SqsExecutor proxiedExecutor = TestUtils.getPropertyValue(
			sqsExecutorProxy, "sqsExecutor", SqsExecutor.class);
	assertNotNull(proxiedExecutor);
	SqsExecutor innerBean = context.getBean(SqsExecutor.class);
	assertSame(innerBean, proxiedExecutor);
}
 
Example 13
Source Project: spring-integration-aws   Source File: SnsPermissionsParserTests.java    License: MIT License 6 votes vote down vote up
@Test
public void outboundPermissions() {
	EventDrivenConsumer consumer = context.getBean("sns-outbound",
			EventDrivenConsumer.class);
	assertThat(consumer, is(notNullValue()));

	final SnsExecutor executor = TestUtils.getPropertyValue(consumer,
			"handler.snsExecutor", SnsExecutor.class);
	assertThat("snsExecutor is not null", executor, is(notNullValue()));

	@SuppressWarnings("unchecked")
	Set<Permission> permissions = (Set<Permission>) TestUtils
			.getPropertyValue(executor, "permissions");
	assertThat("permissions is not null", permissions, is(notNullValue()));
	assertThat("all permissions loaded", permissions.size(), is(equalTo(1)));
}
 
Example 14
Source Project: spring-integration-aws   Source File: SnsPermissionsParserTests.java    License: MIT License 6 votes vote down vote up
@Test
public void outboundGatewayPermissions() {
	EventDrivenConsumer consumer = context.getBean("sns-gateway",
			EventDrivenConsumer.class);
	assertThat(consumer, is(notNullValue()));

	final SnsExecutor executor = TestUtils.getPropertyValue(consumer,
			"handler.snsExecutor", SnsExecutor.class);
	assertThat("snsExecutor is not null", executor, is(notNullValue()));

	@SuppressWarnings("unchecked")
	Set<Permission> permissions = (Set<Permission>) TestUtils
			.getPropertyValue(executor, "permissions");
	assertThat("permissions is not null", permissions, is(notNullValue()));
	assertThat("all permissions loaded", permissions.size(), is(equalTo(1)));
}
 
Example 15
Source Project: spring-integration-aws   Source File: SnsPermissionsParserTests.java    License: MIT License 6 votes vote down vote up
@Test
public void channelPermissions() {
	SubscribableChannel channel = context.getBean("sns-channel",
			SubscribableChannel.class);
	assertThat(channel, is(notNullValue()));

	final SnsExecutor executor = TestUtils.getPropertyValue(channel,
			"snsExecutor", SnsExecutor.class);
	assertThat("snsExecutor is not null", executor, is(notNullValue()));

	@SuppressWarnings("unchecked")
	Set<Permission> permissions = (Set<Permission>) TestUtils
			.getPropertyValue(executor, "permissions");
	assertThat("permissions is not null", permissions, is(notNullValue()));
	assertThat("all permissions loaded", permissions.size(), is(equalTo(1)));
}
 
Example 16
@Test
public void testKstreamBinderWithPojoInputAndStringOuput() throws Exception {
	SpringApplication app = new SpringApplication(ProductCountApplication.class);
	app.setWebApplicationType(WebApplicationType.NONE);
	ConfigurableApplicationContext context = app.run("--server.port=0",
			"--spring.jmx.enabled=false",
			"--spring.cloud.stream.bindings.input.destination=foos",
			"--spring.cloud.stream.bindings.output.destination=counts-id",
			"--spring.cloud.stream.kafka.streams.binder.configuration.commit.interval.ms=1000",
			"--spring.cloud.stream.kafka.streams.binder.configuration.default.key.serde"
					+ "=org.apache.kafka.common.serialization.Serdes$StringSerde",
			"--spring.cloud.stream.kafka.streams.binder.configuration.default.value.serde"
					+ "=org.apache.kafka.common.serialization.Serdes$StringSerde",
			"--spring.cloud.stream.kafka.streams.bindings.input.consumer.applicationId=ProductCountApplication-xyz",
			"--spring.cloud.stream.kafka.streams.binder.brokers="
					+ embeddedKafka.getBrokersAsString());
	try {
		receiveAndValidateFoo();
		// Assertions on StreamBuilderFactoryBean
		StreamsBuilderFactoryBean streamsBuilderFactoryBean = context
				.getBean("&stream-builder-ProductCountApplication-process", StreamsBuilderFactoryBean.class);
		CleanupConfig cleanup = TestUtils.getPropertyValue(streamsBuilderFactoryBean,
				"cleanupConfig", CleanupConfig.class);
		assertThat(cleanup.cleanupOnStart()).isFalse();
		assertThat(cleanup.cleanupOnStop()).isTrue();
	}
	finally {
		context.close();
	}
}
 
Example 17
@Test
public void sourceFilesAsRef() throws InterruptedException {
	assertEquals("*", TestUtils.getPropertyValue(TestUtils.getPropertyValue(sourcePollingChannelAdapter,
								"source.synchronizer.filter.fileFilters", Set.class).iterator().next(), "path"));
	for (int i = 1; i <= 2; i++) {
		@SuppressWarnings("unchecked")
		Message<File> received = (Message<File>) messageCollector.forChannel(ftpSource.output()).poll(10,
				TimeUnit.SECONDS);
		assertNotNull(received);
		assertThat(received.getPayload(), equalTo(new File(config.getLocalDir() + "/ftpSource" + i + ".txt")));
	}
	assertThat(this.sessionFactory, instanceOf(CachingSessionFactory.class));
}
 
Example 18
@Test
public void sourceFilesAsRef() throws InterruptedException {
	assertEquals(".*", TestUtils.getPropertyValue(TestUtils.getPropertyValue(sourcePollingChannelAdapter,
			"source.synchronizer.filter.fileFilters", Set.class).iterator().next(), "pattern").toString());
	for (int i = 1; i <= 2; i++) {
		@SuppressWarnings("unchecked")
		Message<File> received = (Message<File>) messageCollector.forChannel(sftpSource.output()).poll(10,
				TimeUnit.SECONDS);
		assertNotNull(received);
		assertThat(received.getPayload(), equalTo(new File(config.getLocalDir() + "/sftpSource" + i + ".txt")));
	}
}
 
Example 19
@Test
@Override
public void test() throws Exception {
	AmazonS3 amazonS3Client = TestUtils.getPropertyValue(this.s3MessageHandler, "transferManager.s3",
			AmazonS3.class);

	InputStream payload = new StringInputStream("a");
	Message<?> message = MessageBuilder.withPayload(payload)
			.setHeader("key", "myInputStream")
			.build();

	this.channels.input().send(message);

	ArgumentCaptor<PutObjectRequest> putObjectRequestArgumentCaptor =
			ArgumentCaptor.forClass(PutObjectRequest.class);
	verify(amazonS3Client, atLeastOnce()).putObject(putObjectRequestArgumentCaptor.capture());

	PutObjectRequest putObjectRequest = putObjectRequestArgumentCaptor.getValue();
	assertThat(putObjectRequest.getBucketName(), equalTo(S3_BUCKET));
	assertThat(putObjectRequest.getKey(), equalTo("myInputStream"));
	assertNull(putObjectRequest.getFile());
	assertNotNull(putObjectRequest.getInputStream());

	ObjectMetadata metadata = putObjectRequest.getMetadata();
	assertThat(metadata.getContentMD5(), equalTo(Md5Utils.md5AsBase64(payload)));
	assertThat(metadata.getContentLength(), equalTo(1L));
	assertThat(metadata.getContentType(), equalTo(MediaType.APPLICATION_JSON_VALUE));
	assertThat(metadata.getContentDisposition(), equalTo("test.json"));
}
 
Example 20
@Test
public void testSimpleTest() throws Exception {

	Message<?> received = this.messageCollector.forChannel(source.output()).poll(10, TimeUnit.SECONDS);
	assertNotNull(received);
	assertThat(received.getPayload(), Matchers.instanceOf(String.class));
	assertTrue(!received.getPayload().equals("Test Mail"));

	MailToStringTransformer mailToStringTransformer = this.beanFactory.getBean(MailToStringTransformer.class);
	assertEquals("cp1251", TestUtils.getPropertyValue(mailToStringTransformer, "charset"));
}
 
Example 21
@Test
public void test() {
	assertThat(this.splitter, instanceOf(DefaultMessageSplitter.class));
	assertSame(this.splitter, TestUtils.getPropertyValue(this.consumer, "handler"));
	this.channels.input().send(new GenericMessage<>(Arrays.asList("hello", "world")));
	assertThat(this.collector.forChannel(this.channels.output()), receivesPayloadThat(is("hello")));
	assertThat(this.collector.forChannel(this.channels.output()), receivesPayloadThat(is("world")));
}
 
Example 22
@Test
public void test() {
	assertThat(this.splitter, instanceOf(DefaultMessageSplitter.class));
	assertSame(this.splitter, TestUtils.getPropertyValue(this.consumer, "handler"));
	this.channels.input().send(new GenericMessage<>("hello,world"));
	assertThat(this.collector.forChannel(this.channels.output()), receivesPayloadThat(is("hello")));
	assertThat(this.collector.forChannel(this.channels.output()), receivesPayloadThat(is("world")));
}
 
Example 23
@Test
public void test() throws Exception {
	assertThat(this.connectionFactory, Matchers.instanceOf(TcpNioClientConnectionFactory.class));
	assertEquals("foo", this.connectionFactory.getHost());
	assertTrue(TestUtils.getPropertyValue(this.connectionFactory, "lookupHost", Boolean.class));
	assertTrue(TestUtils.getPropertyValue(this.connectionFactory, "usingDirectBuffers", Boolean.class));
	assertEquals(123, TestUtils.getPropertyValue(this.connectionFactory, "soTimeout"));
	assertTrue(this.connectionFactory.isSingleUse());
	assertEquals("bar", TestUtils.getPropertyValue(this.connectionFactory, "mapper.charset"));
}
 
Example 24
@Test
public void test() throws Exception {
	assertThat(this.connectionFactory, Matchers.instanceOf(TcpNetClientConnectionFactory.class));
	assertEquals("foo", this.connectionFactory.getHost());
	assertFalse(TestUtils.getPropertyValue(this.connectionFactory, "lookupHost", Boolean.class));
	assertEquals(120000, TestUtils.getPropertyValue(this.connectionFactory, "soTimeout"));
}
 
Example 25
@Test
public void test() throws Exception {
	assertThat(this.connectionFactory, Matchers.instanceOf(TcpNioClientConnectionFactory.class));
	assertEquals("foo", this.connectionFactory.getHost());
	assertTrue(this.connectionFactory.getDeserializer() instanceof ByteArrayLfSerializer);
	assertEquals(1234, ((ByteArrayLfSerializer) this.connectionFactory.getDeserializer()).getMaxMessageSize());
	assertTrue(this.connectionFactory.getSerializer() instanceof ByteArraySingleTerminatorSerializer);
	assertTrue(TestUtils.getPropertyValue(this.connectionFactory, "lookupHost", Boolean.class));
	assertTrue(TestUtils.getPropertyValue(this.connectionFactory, "usingDirectBuffers", Boolean.class));
	assertEquals(123, TestUtils.getPropertyValue(this.connectionFactory, "soTimeout"));
	assertFalse(this.connectionFactory.isSingleUse());
	assertEquals("bar", TestUtils.getPropertyValue(this.connectionFactory, "mapper.charset"));
}
 
Example 26
@Test
public void test() throws Exception {
	assertThat(this.connectionFactory, Matchers.instanceOf(TcpNioServerConnectionFactory.class));
	assertTrue(TestUtils.getPropertyValue(this.connectionFactory, "lookupHost", Boolean.class));
	assertTrue(TestUtils.getPropertyValue(this.connectionFactory, "usingDirectBuffers", Boolean.class));
	assertEquals(123, TestUtils.getPropertyValue(this.connectionFactory, "soTimeout"));
	assertEquals(5, TestUtils.getPropertyValue(this.connectionFactory, "deserializer.maxMessageSize"));
}
 
Example 27
@Test
public void test() throws Exception {
	assertThat(this.connectionFactory, Matchers.instanceOf(TcpNetServerConnectionFactory.class));
	assertFalse(TestUtils.getPropertyValue(this.connectionFactory, "lookupHost", Boolean.class));
	assertEquals(120000, TestUtils.getPropertyValue(this.connectionFactory, "soTimeout"));
	assertEquals(2048, TestUtils.getPropertyValue(this.connectionFactory, "deserializer.maxMessageSize"));
}
 
Example 28
@Test
public void test() throws Exception {
	assertThat(this.connectionFactory, Matchers.instanceOf(TcpNioClientConnectionFactory.class));
	assertEquals("foo", this.connectionFactory.getHost());
	assertTrue(this.connectionFactory.getDeserializer() instanceof ByteArrayLfSerializer);
	assertEquals(1234, ((ByteArrayLfSerializer) this.connectionFactory.getDeserializer()).getMaxMessageSize());
	assertTrue(TestUtils.getPropertyValue(this.connectionFactory, "lookupHost", Boolean.class));
	assertTrue(TestUtils.getPropertyValue(this.connectionFactory, "usingDirectBuffers", Boolean.class));
	assertEquals(123, TestUtils.getPropertyValue(this.connectionFactory, "soTimeout"));
	assertFalse(this.connectionFactory.isSingleUse());
	assertEquals("bar", TestUtils.getPropertyValue(this.connectionFactory, "mapper.charset"));
}
 
Example 29
@Test
public void test() throws Exception {
	assertThat(this.connectionFactory, Matchers.instanceOf(TcpNioServerConnectionFactory.class));
	assertTrue(TestUtils.getPropertyValue(this.connectionFactory, "lookupHost", Boolean.class));
	assertEquals(123, TestUtils.getPropertyValue(this.connectionFactory, "soTimeout"));
	assertEquals(5, TestUtils.getPropertyValue(this.connectionFactory, "deserializer.maxMessageSize"));
}
 
Example 30
@Test
public void test() throws Exception {
	assertThat(this.connectionFactory, Matchers.instanceOf(TcpNetServerConnectionFactory.class));
	assertFalse(TestUtils.getPropertyValue(this.connectionFactory, "lookupHost", Boolean.class));
	assertEquals(0, TestUtils.getPropertyValue(this.connectionFactory, "soTimeout"));
	assertEquals(2048, TestUtils.getPropertyValue(this.connectionFactory, "deserializer.maxMessageSize"));
}