Package org.springframework.context

Examples of org.springframework.context.ApplicationContext


  @Test
  public void doesNotRegisterHateoasSpecificComponentsIfHateoasNotPresent() throws Exception {

    hide(HATEOAS);

    ApplicationContext context = WebTestUtils.createApplicationContext(SampleConfig.class);
    List<String> names = Arrays.asList(context.getBeanDefinitionNames());

    assertThat(names, hasItems("pageableResolver", "sortResolver"));
    assertThat(names, not(hasItems("pagedResourcesAssembler", "pagedResourcesAssemblerArgumentResolver")));
  }
View Full Code Here


   * @see DATACMNS-475
   */
  @Test
  public void registersJacksonSpecificBeanDefinitions() throws Exception {

    ApplicationContext context = WebTestUtils.createApplicationContext(SampleConfig.class);
    List<String> names = Arrays.asList(context.getBeanDefinitionNames());

    assertThat(names, hasItem("jacksonGeoModule"));
  }
View Full Code Here

  @Test
  public void doesNotRegisterJacksonSpecificComponentsIfJacksonNotPresent() throws Exception {

    hide(JACKSON);

    ApplicationContext context = WebTestUtils.createApplicationContext(SampleConfig.class);
    List<String> names = Arrays.asList(context.getBeanDefinitionNames());

    assertThat(names, not(hasItem("jacksonGeoModule")));
  }
View Full Code Here

*/
public class BinaryFileCopyTest {

  @Test
  public void testBinaryCopy() throws Exception{
    ApplicationContext context = new ClassPathXmlApplicationContext("/META-INF/spring/integration/fileCopyDemo-binary.xml", BinaryFileCopyTest.class);
    FileCopyDemoCommon.displayDirectories(context);
    Thread.sleep(5000);
  }
View Full Code Here

public class GmailInboundImapIdleAdapterTestApp {
  private static Logger logger = Logger.getLogger(GmailInboundImapIdleAdapterTestApp.class);


  public static void main (String[] args) throws Exception {
    ApplicationContext ac = new ClassPathXmlApplicationContext("/META-INF/spring/integration/gmail-imap-idle-config.xml");
    DirectChannel inputChannel = ac.getBean("receiveChannel", DirectChannel.class);
    inputChannel.subscribe(new MessageHandler() {
      public void handleMessage(Message<?> message) throws MessagingException {
        logger.info("Message: " + message);
      }
    });
View Full Code Here

public class GmailInboundPop3AdapterTestApp {

  private static Logger logger = Logger.getLogger(GmailInboundPop3AdapterTestApp.class);

  public static void main (String[] args) throws Exception {
    ApplicationContext ac = new ClassPathXmlApplicationContext("/META-INF/spring/integration/gmail-pop3-config.xml");
    DirectChannel inputChannel = ac.getBean("receiveChannel", DirectChannel.class);
    inputChannel.subscribe(new MessageHandler() {
      public void handleMessage(Message<?> message) throws MessagingException {
        logger.info("Message: " + message);
      }
    });
View Full Code Here

*/
public class TwitterSendUpdatesSample {

  @Test
  public void runDemo() throws Exception{
    ApplicationContext context =
      new ClassPathXmlApplicationContext("META-INF/spring/integration/TwitterSendUpdates-context.xml");
   
    MessageChannel twitterOutChannel = context.getBean("twitterOut", MessageChannel.class);
    Message<String> twitterUpdate = new GenericMessage<String>("Testing new Twitter samples for #springintegration");
    twitterOutChannel.send(twitterUpdate);
  }
View Full Code Here

  private static final Logger LOGGER = Logger.getLogger(OutboundGatewayTest.class);

  @Test
  public void insertPersonRecord() {

    final ApplicationContext context = new ClassPathXmlApplicationContext(
      "classpath:/META-INF/spring/integration/spring-integration-context.xml");

    final PersonService service = context.getBean(PersonService.class);

    LOGGER.info("Creating person Instance");

    final Person person = new Person();
    Calendar createdDateTime = Calendar.getInstance();
View Full Code Here

*/
public class SendInstantMessageSample {

  @Test
  public void runDemo() throws Exception{
    ApplicationContext context = new ClassPathXmlApplicationContext("META-INF/spring/integration/SendInstantMessageSample-context.xml");
   
    MessageChannel toUserChannel = context.getBean("toUserChannel", MessageChannel.class);
    Message<String> message = new GenericMessage<String>("Hello from Spring Integration XMPP");
    toUserChannel.send(message);
  }
View Full Code Here

*/
public class FileBasedFileCopyTest {

  @Test
  public void testFileBasedCopy() throws Exception{
    ApplicationContext context = new ClassPathXmlApplicationContext("/META-INF/spring/integration/fileCopyDemo-file.xml", FileBasedFileCopyTest.class);
    FileCopyDemoCommon.displayDirectories(context);
    Thread.sleep(5000);
  }
View Full Code Here

TOP

Related Classes of org.springframework.context.ApplicationContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.