Spring Framework DirectFieldAccessor - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework DirectFieldAccessor class.

This code example shows how to use the following methods:getPropertyValue
This code example shows how to use the following methods:getPropertyValue
        MessageTransformingHandler handler = (MessageTransformingHandler)
                endpointAccessor.getPropertyValue("handler");
        DirectFieldAccessor handlerAccessor = new DirectFieldAccessor(handler);
        FileToStringTransformer transformer = (FileToStringTransformer)
                handlerAccessor.getPropertyValue("transformer");
        DirectFieldAccessor transformerAccessor = new DirectFieldAccessor(transformer);
        assertEquals(Boolean.TRUE, transformerAccessor.getPropertyValue("deleteFiles"));
        assertSame(this.messageBuilderFactory, transformerAccessor.getPropertyValue("messageBuilderFactory"));
    } 
 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPropertyValue
	TcpReceivingChannelAdapter tcpNetIn;
 
	@Test
	public void testNetIn() throws Exception {
		assertFalse(cfS1.isAutoStartup());
		DirectFieldAccessor dfa = new DirectFieldAccessor(cfS1);
		assertNull(dfa.getPropertyValue("serverSocket"));
		startAndStop(); 
		assertNull(dfa.getPropertyValue("serverSocket"));
		startAndStop(); 
		assertNull(dfa.getPropertyValue("serverSocket"));
	} 
 
	/** 
	 * @throws InterruptedException 
	 */ 
	private void startAndStop() throws InterruptedException {
		tcpNetIn.start();
		TestingUtilities.waitListening(cfS1, null);
		tcpNetIn.stop();
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPropertyValue
	public void testReceivesMessageFromChannelWithSource() { 
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
				"directChannelParserTests.xml", DirectChannelParserTests.class); 
		Object channel = context.getBean("channel");
		assertEquals(DirectChannel.class, channel.getClass());
		DirectFieldAccessor dcAccessor = new DirectFieldAccessor(((DirectChannel)channel).getDispatcher());
		assertTrue(dcAccessor.getPropertyValue("loadBalancingStrategy") instanceof RoundRobinLoadBalancingStrategy);
	} 
 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPropertyValue
		TestXmlApplicationContext ctx = TestXmlApplicationContextHelper
				.getTestAppContext("<bean id='docBuilderFactory' class='org.springframework.integration.xml.config.StubDocumentBuilderFactory' />" 
						+ channelDefinitions
						+ "<si-xml:xpath-splitter id='splitter' input-channel='test-input' output-channel='test-output' doc-builder-factory='docBuilderFactory'><si-xml:xpath-expression expression='//name'/></si-xml:xpath-splitter>"); 
		EventDrivenConsumer consumer = (EventDrivenConsumer) ctx.getBean("splitter");
		DirectFieldAccessor fieldAccessor = new DirectFieldAccessor(consumer);
		Object handler = fieldAccessor.getPropertyValue("handler");
		fieldAccessor = new DirectFieldAccessor(handler);
		Object documnetBuilderFactory = fieldAccessor.getPropertyValue("documentBuilderFactory");
		assertTrue("DocumnetBuilderFactory was not expected stub ", documnetBuilderFactory instanceof DocumentBuilderFactory);
	} 
	 
	@Test
	public void testXPathExpressionRef() throws Exception {
		TestXmlApplicationContext ctx = TestXmlApplicationContextHelper
				.getTestAppContext( 
						 channelDefinitions +
						 "<si-xml:xpath-expression id='xpathOne' expression='//name'/>" + 
						"<si-xml:xpath-splitter id='splitter' xpath-expression-ref='xpathOne' input-channel='test-input' output-channel='test-output' />"); 
		EventDrivenConsumer consumer = (EventDrivenConsumer) ctx.getBean("splitter");
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPropertyValue
	} 
 
 
	@Test
	public void configured() throws Exception {
		DirectFieldAccessor accessor = new DirectFieldAccessor(pollableFileSource);
		assertEquals(inputDir, accessor.getPropertyValue("directory"));
	} 
 
	@Test
	public void getFiles() throws Exception {
		Message<File> received1 = pollableFileSource.receive();
		System.out.println("receive files round 1");
		assertNotNull("This should return the first message", received1); 
		pollableFileSource.onSend(received1);
		Message<File> received2 = pollableFileSource.receive();
		assertNotNull(received2); 
		pollableFileSource.onSend(received2);
		Message<File> received3 = pollableFileSource.receive();
		assertNotNull(received3); 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPropertyValue
 
		GroovyMarkupView view = new GroovyMarkupView(); 
		view.setTemplateEngine(new TestTemplateEngine()); 
		view.setApplicationContext(this.webAppContext); 
 
		DirectFieldAccessor accessor = new DirectFieldAccessor(view); 
		TemplateEngine engine = (TemplateEngine) accessor.getPropertyValue("engine"); 
		assertNotNull(engine); 
		assertEquals(TestTemplateEngine.class, engine.getClass()); 
	} 
 
	@Test 
	public void detectTemplateEngine() throws Exception { 
 
		GroovyMarkupView view = new GroovyMarkupView(); 
 
		view.setTemplateEngine(new TestTemplateEngine()); 
		view.setApplicationContext(this.webAppContext); 
 
		DirectFieldAccessor accessor = new DirectFieldAccessor(view); 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPropertyValue
	} 
 
 
	@SuppressWarnings("unchecked") 
	private List<MessageSelector> getSelectors(MessageSelectorChain chain) {
		DirectFieldAccessor accessor = new DirectFieldAccessor(chain);
		return (List<MessageSelector>) accessor.getPropertyValue("selectors");
	} 
 
	private VotingStrategy getStrategy(MessageSelectorChain chain) {
		return (VotingStrategy) new DirectFieldAccessor(chain).getPropertyValue("votingStrategy");
	} 
	 
	public static class StubMessageSelector implements MessageSelector { 
		public boolean accept(Message<?> message) {
			return true; 
		} 
	} 
	 
	public static class StubPojoSelector { 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPropertyValue
	private EventDrivenConsumer gateway;
 
 
	@Test
	public void outboundChannelAdapter() throws Exception {
		DirectFieldAccessor accessor = new DirectFieldAccessor(
				new DirectFieldAccessor(adapter).getPropertyValue("handler"));
		File expected = new ClassPathResource("").getFile();
 
		Expression destinationDirectoryExpression = (Expression) accessor.getPropertyValue("destinationDirectoryExpression");
		File actual = new File(destinationDirectoryExpression.getExpressionString());
 
		assertEquals("'destinationDirectory' should be set", expected, actual);
	} 
 
	@Test
	public void outboundGateway() throws Exception {
		DirectFieldAccessor accessor = new DirectFieldAccessor(
				new DirectFieldAccessor(gateway).getPropertyValue("handler"));
		File expected = new ClassPathResource("").getFile();
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPropertyValue
See Code Examples for Spring Framework DirectFieldAccessor Methods: