Package org.springframework.integration.voldemort.test.domain

Examples of org.springframework.integration.voldemort.test.domain.Person


    final ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "VoldemortOutboundAdapterTest-context.xml", getClass() );
    final StoreClient storeClient = context.getBean( "storeClient", StoreClient.class );
    final MessageChannel voldemortOutboundPutChannel = context.getBean( "voldemortOutboundPutChannel", MessageChannel.class );

    // given
    final Person lukasz = new Person( "1", "Lukasz", "Antoniak" );

    // when
    final Message<Person> message = MessageBuilder.withPayload( lukasz ).setHeader( VoldemortHeaders.KEY, lukasz.getId() ).build();
    voldemortOutboundPutChannel.send( message );

    // then
    final Versioned found = storeClient.get( lukasz.getId() );
    Assert.assertEquals( lukasz, found.getValue() );

    context.close();
  }
View Full Code Here


    final ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "VoldemortOutboundAdapterTest-context.xml", getClass() );
    final StoreClient storeClient = context.getBean( "storeClient", StoreClient.class );
    final MessageChannel voldemortOutboundChannel = context.getBean( "voldemortOutboundPutConstantKeyChannel", MessageChannel.class );

    // given
    final Person lukasz = new Person( "1", "Lukasz", "Antoniak" );

    // when
    final Message<Person> firstMessage = MessageBuilder.withPayload( lukasz ).build();
    voldemortOutboundChannel.send( firstMessage );

    // then
    Assert.assertEquals( lukasz, storeClient.get( "constant-key" ).getValue() );

    // given
    final Person tomasz = new Person( "2", "Tomasz", "Antoniak" );

    // when
    final Message<Person> secondMessage = MessageBuilder.withPayload( tomasz ).build();
    voldemortOutboundChannel.send( secondMessage );
View Full Code Here

    final ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "VoldemortOutboundAdapterTest-context.xml", getClass() );
    final StoreClient storeClient = context.getBean( "storeClient", StoreClient.class );
    final MessageChannel voldemortOutboundDeleteChannel = context.getBean( "voldemortOutboundDeleteChannel", MessageChannel.class );

    // given
    final Person lukasz = new Person( "1", "Lukasz", "Antoniak" );
    storeClient.put( lukasz.getId(), lukasz );

    // when
    final Message<Person> message = MessageBuilder.withPayload( lukasz ).build();
    voldemortOutboundDeleteChannel.send( message );

    // then
    final Versioned found = storeClient.get( lukasz.getId() );
    Assert.assertNull( found );

    context.close();
  }
View Full Code Here

    final ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "VoldemortOutboundAdapterTest-context.xml", getClass() );
    final StoreClient storeClient = context.getBean( "storeClient", StoreClient.class );
    final MessageChannel voldemortOutboundDeleteChannel = context.getBean( "voldemortOutboundDeleteChannel", MessageChannel.class );

    // given
    final Person lukasz = new Person( "1", "Lukasz", "Antoniak" );

    // when
    // Overriding output adapter's persist mode.
    final Message<Person> message = MessageBuilder.withPayload( lukasz )
        .setHeader( VoldemortHeaders.PERSIST_MODE, PersistMode.PUT ).build();
    voldemortOutboundDeleteChannel.send( message );

    // then
    final Versioned found = storeClient.get( lukasz.getId() );
    Assert.assertEquals( lukasz, found.getValue() );

    context.close();
  }
View Full Code Here

  public void testStoppedAdapter() {
    final ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "VoldemortOutboundAdapterTest-context.xml", getClass() );
    final MessageChannel voldemortStoppedChannel = context.getBean( "voldemortStoppedChannel", MessageChannel.class );

    // given
    final Person lukasz = new Person( "1", "Lukasz", "Antoniak" );

    // when
    final Message<Person> message = MessageBuilder.withPayload( lukasz ).build();
    try {
      voldemortStoppedChannel.send( message );
View Full Code Here

    final StoreClient storeClient = context.getBean( "storeClient", StoreClient.class );
    final MessageUpdatingServiceActivator messageUpdater = context.getBean( "messageUpdater", MessageUpdatingServiceActivator.class );
    final MessageChannel voldemortOrderChannel = context.getBean( "voldemortOrderChannel", MessageChannel.class );

    // given
    final Person lukasz = new Person( "lukasz", "Lukasz", "Antoniak" );
    final Person copy = new Person( "lukasz", "Lukasz", "Antoniak" );

    // when
    final Message<Person> message = MessageBuilder.withPayload( lukasz ).build();
    voldemortOrderChannel.send( message );
View Full Code Here

    final ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "VoldemortInboundAdapterTest-context.xml", getClass() );
    final StoreClient storeClient = context.getBean( "storeClient", StoreClient.class );
    final PollableChannel inboundChannel = context.getBean( "voldemortInboundChannel", PollableChannel.class );

    // given
    final Person lukasz = new Person( "lukasz", "Lukasz", "Antoniak" );
    storeClient.put( lukasz.getId(), lukasz );

    // when
    final Message<Person> received = (Message<Person>) inboundChannel.receive();

    // then
View Full Code Here

    final ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "VoldemortInboundAdapterTest-context.xml", getClass() );
    final StoreClient storeClient = context.getBean( "storeClient", StoreClient.class );
    final PollableChannel inboundChannel = context.getBean( "voldemortInboundChannel", PollableChannel.class );

    // given
    final Person kinga = new Person( "kinga", "Kinga", "Mroz" );
    storeClient.put( kinga.getId(), kinga );

    // when
    final Message<Versioned<Person>> received = (Message<Versioned<Person>>) inboundChannel.receive();

    // then
    final Versioned found = storeClient.get( kinga.getId() );
    Assert.assertEquals( found, received.getPayload() );

    context.close();
  }
View Full Code Here

    final ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "VoldemortInboundAdapterTest-context.xml", getClass() );
    final StoreClient storeClient = context.getBean( "storeClient", StoreClient.class );
    final PollableChannel inboundChannel = context.getBean( "voldemortInboundChannel", PollableChannel.class );

    // given
    final Person robert = new Person( "robert", "Robert", "Antoniak" );
    storeClient.put( robert.getId(), robert );

    // when
    final Message<Person> received = (Message<Person>) inboundChannel.receive();

    // then
    Assert.assertEquals( robert, received.getPayload() );
    final Versioned found = storeClient.get( robert.getId() );
    Assert.assertNull( found );

    context.close();
  }
View Full Code Here

TOP

Related Classes of org.springframework.integration.voldemort.test.domain.Person

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.