Package marauroa.common.game

Examples of marauroa.common.game.Attributes


  /**
   * @throws ParseException
   */
  @Test(expected=ParseException.class)
  public void testParseFail() throws ParseException {
    Attributes attributes = new Attributes(RPClass.getBaseRPObjectDefault());
    AttributesParser parser = new AttributesParser(": [a=b][c=d", attributes);
    parser.parse();
  }
View Full Code Here


  /**
   * @throws ParseException
   */
  @Test
  public void testFindEndPosOfAttribute() throws ParseException {
    Attributes attributes = new Attributes(RPClass.getBaseRPObjectDefault());
    AttributesParser parser = new AttributesParser(": [a=b][c=d]", attributes);
    assertThat(Integer.valueOf(parser.findEndPosOfAttribute(0)), equalTo(Integer.valueOf(6)));

    parser = new AttributesParser(": [a=b\\]e][c=d]", attributes);
    assertThat(Integer.valueOf(parser.findEndPosOfAttribute(0)), equalTo(Integer.valueOf(9)));
View Full Code Here

  /**
   * @throws ParseException
   */
  @Test(expected=ParseException.class)
  public void testFindEndPosOfAttributeFailNoClose() throws ParseException {
    Attributes attributes = new Attributes(RPClass.getBaseRPObjectDefault());
    AttributesParser parser = new AttributesParser(": [a=b\\][c=d", attributes);
    parser.findEndPosOfAttribute(0);
  }
View Full Code Here

  /**
   * @throws ParseException
   */
  @Test
  public void testCheckSplitterPosition() throws ParseException {
    Attributes attributes = new Attributes(RPClass.getBaseRPObjectDefault());
    AttributesParser parser = new AttributesParser("", attributes);
    parser.checkSplitterPosition(0, 1, 2);
  }
View Full Code Here

  /**
   * @throws ParseException
   */
  @Test(expected=ParseException.class)
  public void testCheckSplitterPositionFailNo() throws ParseException {
    Attributes attributes = new Attributes(RPClass.getBaseRPObjectDefault());
    AttributesParser parser = new AttributesParser("", attributes);
    parser.checkSplitterPosition(0, -1, 2);
  }
View Full Code Here

  /**
   * @throws ParseException
   */
  @Test(expected=ParseException.class)
  public void testCheckSplitterPositionFailOutside() throws ParseException {
    Attributes attributes = new Attributes(RPClass.getBaseRPObjectDefault());
    AttributesParser parser = new AttributesParser("", attributes);
    parser.checkSplitterPosition(0, 3, 2);
  }
View Full Code Here

  /**
   * @throws ParseException
   */
  @Test
  public void testParseAttribute() throws ParseException {
    Attributes attributes = new Attributes(RPClass.getBaseRPObjectDefault());
    AttributesParser parser = new AttributesParser(": [a=b][c=d]", attributes);
    parser.parseAttribute(2, 6);
    assertThat(attributes.get("a"), equalTo("b"));
  }
View Full Code Here

  /**
   * @throws ParseException
   */
  @Test
  public void testParse() throws ParseException {
    Attributes attributes = new Attributes(RPClass.getBaseRPObjectDefault());
    AttributesParser parser = new AttributesParser(": [a=b][c=d][e=\\\\f][g=h\\]abcd][i=\\]]", attributes);
    parser.parse();
    assertThat(attributes.get("a"), equalTo("b"));
    assertThat(attributes.get("c"), equalTo("d"));
    assertThat(attributes.get("e"), equalTo("\\f"));
    assertThat(attributes.get("g"), equalTo("h]abcd"));
    assertThat(attributes.get("i"), equalTo("]"));
  }
View Full Code Here

TOP

Related Classes of marauroa.common.game.Attributes

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.