Package de.bamberg.ha.messaging.parser

Examples of de.bamberg.ha.messaging.parser.SimplePropertiesStringParser


public class SimplePropertiesStringParserTest {

  @Test
  public void testContent() {
    String inputMessage="session=0,action=1";
    MessageParser<String,Properties> parser=new SimplePropertiesStringParser();
    Message<Properties> message=parser.parse(inputMessage);
    assertNotNull(message);
    assertNotNull(message.getContent());
    assertEquals("0",message.getContent().getProperty("session"));
    assertEquals("1",message.getContent().getProperty("action"));
    assertEquals("2",message.getContent().getProperty("unknownTestDefault","2"));
View Full Code Here


  }

  @Test
  public void testContentWithWhiteSpaces() {
    String inputMessage="session=0 ,action\t = 1 ";
    MessageParser<String,Properties> parser=new SimplePropertiesStringParser();
    Message<Properties> message=parser.parse(inputMessage);
    assertNotNull(message);
    assertNotNull(message.getContent());
    assertEquals("0",message.getContent().getProperty("session"));
    assertEquals("1",message.getContent().getProperty("action"));
    assertEquals("2",message.getContent().getProperty("unknownTestDefault","2"));
View Full Code Here

 
  @Test
  public void testHeaderAttribute() {
    String inputMessage="sessionid=0,action=1";
    MessageParser<String,Properties> parser=new SimplePropertiesStringParser();
    Message<Properties> message=parser.parse(inputMessage);
    assertNotNull(message);
    assertNotNull(message.getContent());
    assertEquals("0",message.getHeaderAttribute( MessageHeader.SESSIONID.name() ));
   
  }
View Full Code Here

  }
 
  @Test
  public void testHeaderAttributes() {
    String inputMessage="sessionid=0,endpoint=1";
    MessageParser<String,Properties> parser=new SimplePropertiesStringParser();
    Message<Properties> message=parser.parse(inputMessage);
    assertNotNull(message);
    assertNotNull(message.getContent());
    assertEquals("0",message.getHeaderAttribute( MessageHeader.SESSIONID.name() ));
    assertEquals("1",message.getHeaderAttribute( MessageHeader.ENDPOINT.name() ));
   
View Full Code Here

TOP

Related Classes of de.bamberg.ha.messaging.parser.SimplePropertiesStringParser

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.