01: /*
02: * Copyright (C) 2004 Joe Walnes.
03: * Copyright (C) 2006, 2007 XStream Committers.
04: * All rights reserved.
05: *
06: * The software in this package is published under the terms of the BSD
07: * style license a copy of which has been included with this distribution in
08: * the LICENSE.txt file.
09: *
10: * Created on 02. September 2004 by Joe Walnes
11: */
12: package com.thoughtworks.xstream.core.util;
13:
14: import junit.framework.TestCase;
15:
16: public class FastStackTest extends TestCase {
17:
18: public void test() {
19: FastStack stack = new FastStack(2);
20:
21: stack.push("a");
22: stack.push("b");
23: stack.push("c");
24: stack.push("d");
25:
26: assertEquals("d", stack.peek());
27: assertEquals("d", stack.peek());
28: assertEquals("d", stack.pop());
29: assertEquals("c", stack.pop());
30: stack.popSilently();
31: assertEquals("a", stack.peek());
32: assertEquals("a", stack.pop());
33: }
34: }
|