Package org.springframework.beans.factory.parsing

Examples of org.springframework.beans.factory.parsing.ParseState.peek()


  public void testSimple() throws Exception {
    MockEntry entry = new MockEntry();

    ParseState parseState = new ParseState();
    parseState.push(entry);
    assertEquals("Incorrect peek value.", entry, parseState.peek());
    parseState.pop();
    assertNull("Should get null on peek()", parseState.peek());
  }

  public void testNesting() throws Exception {
View Full Code Here


    ParseState parseState = new ParseState();
    parseState.push(entry);
    assertEquals("Incorrect peek value.", entry, parseState.peek());
    parseState.pop();
    assertNull("Should get null on peek()", parseState.peek());
  }

  public void testNesting() throws Exception {
    MockEntry one = new MockEntry();
    MockEntry two = new MockEntry();
View Full Code Here

    MockEntry two = new MockEntry();
    MockEntry three = new MockEntry();

    ParseState parseState = new ParseState();
    parseState.push(one);
    assertEquals(one, parseState.peek());
    parseState.push(two);
    assertEquals(two, parseState.peek());
    parseState.push(three);
    assertEquals(three, parseState.peek());
View Full Code Here

    ParseState parseState = new ParseState();
    parseState.push(one);
    assertEquals(one, parseState.peek());
    parseState.push(two);
    assertEquals(two, parseState.peek());
    parseState.push(three);
    assertEquals(three, parseState.peek());

    parseState.pop();
    assertEquals(two, parseState.peek());
View Full Code Here

    parseState.push(one);
    assertEquals(one, parseState.peek());
    parseState.push(two);
    assertEquals(two, parseState.peek());
    parseState.push(three);
    assertEquals(three, parseState.peek());

    parseState.pop();
    assertEquals(two, parseState.peek());
    parseState.pop();
    assertEquals(one, parseState.peek());
View Full Code Here

    assertEquals(two, parseState.peek());
    parseState.push(three);
    assertEquals(three, parseState.peek());

    parseState.pop();
    assertEquals(two, parseState.peek());
    parseState.pop();
    assertEquals(one, parseState.peek());
  }

  public void testSnapshot() throws Exception {
View Full Code Here

    assertEquals(three, parseState.peek());

    parseState.pop();
    assertEquals(two, parseState.peek());
    parseState.pop();
    assertEquals(one, parseState.peek());
  }

  public void testSnapshot() throws Exception {
    MockEntry entry = new MockEntry();
View Full Code Here

    ParseState original = new ParseState();
    original.push(entry);

    ParseState snapshot = original.snapshot();
    original.push(new MockEntry());
    assertEquals("Snapshot should not have been modified.", entry, snapshot.peek());
  }


  private static class MockEntry implements ParseState.Entry {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.