01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.util;
05:
06: import junit.framework.TestCase;
07:
08: public class SequenceGeneratorTest extends TestCase {
09:
10: public void tests() throws Exception {
11: long seq = 0;
12: SequenceGenerator sg = new SequenceGenerator();
13: assertEquals(seq, sg.getNextSequence());
14: assertEquals(seq, sg.getCurrentSequence());
15:
16: assertEquals(++seq, sg.getNextSequence());
17: assertEquals(seq, sg.getCurrentSequence());
18:
19: seq = 1001;
20: sg = new SequenceGenerator(seq);
21: assertEquals(seq, sg.getNextSequence());
22: assertEquals(seq, sg.getCurrentSequence());
23: assertEquals(++seq, sg.getNextSequence());
24: assertEquals(seq, sg.getCurrentSequence());
25:
26: }
27:
28: }
|