01: /******************************************************************************
02: * Copyright (C) Lars Ivar Almli. All rights reserved. *
03: * ---------------------------------------------------------------------------*
04: * This file is part of MActor. *
05: * *
06: * MActor is free software; you can redistribute it and/or modify *
07: * it under the terms of the GNU General Public License as published by *
08: * the Free Software Foundation; either version 2 of the License, or *
09: * (at your option) any later version. *
10: * *
11: * MActor is distributed in the hope that it will be useful, *
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14: * GNU General Public License for more details. *
15: * *
16: * You should have received a copy of the GNU General Public License *
17: * along with MActor; if not, write to the Free Software *
18: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
19: ******************************************************************************/package org.mactor.tests;
20:
21: import java.util.LinkedList;
22: import java.util.List;
23: import org.junit.Assert;
24: import org.junit.Test;
25: import org.mactor.framework.commandexecutors.java.SequenceValueCommandExecutor;
26:
27: public class SequenceValueCommandExecutorTest {
28: @Test
29: public void test() throws Exception {
30: List<String> p = new LinkedList<String>();
31: p.add("200");
32: SequenceValueCommandExecutor seq = new SequenceValueCommandExecutor(
33: "s1", p);
34: SequenceValueCommandExecutor seq2 = new SequenceValueCommandExecutor(
35: "s2", new LinkedList<String>());
36: SequenceValueCommandExecutor seq3 = new SequenceValueCommandExecutor(
37: "s1", new LinkedList<String>());
38: Assert.assertEquals("201", seq.extractValue(null));
39: Assert.assertEquals("202", seq.extractValue(null));
40: Assert.assertTrue(seq2.extractValue(null).length() > 7);
41: Assert.assertEquals("203", seq3.extractValue(null));
42: Assert.assertEquals("204", seq3.extractValue(null));
43: }
44: }
|