/*
 *    jETeL/Clover - Java based ETL application framework.
 *    Copyright (C) 2002-05  David Pavlis <david_pavlis@hotmail.com> and others.
 *    
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation; either
 *    version 2.1 of the License, or (at your option) any later version.
 *    
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    
 *    Lesser General Public License for more details.
 *    
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Created on 31.5.2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package test.org.jetel.data.sequence;

import org.jetel.data.sequence.SimpleIntSequence;

import junit.framework.TestCase;

/**
 * @author david
 * @since  31.5.2005
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class SimpleIntSequenceTest extends TestCase {
    
    SimpleIntSequence sequence;
    
    /* (non-Javadoc)
     * @see junit.framework.TestCase#setUp()
     */
    protected void setUp() throws Exception {
        // TODO Auto-generated method stub
        super.setUp();
        sequence=new SimpleIntSequence("Test","c:\\tmp\\sequence2.dat",0,1,20);
        sequence.init();
    }

    public void test_1(){
        assertEquals("different",sequence.currentValueInt(),0);
        assertEquals("different",sequence.nextValueInt(),1);
        sequence.close();
    }
    
    public void test_2(){
        sequence.init();
        assertEquals("different",sequence.currentValueInt(),1);
        sequence.close();
    }
    
    protected void tearDown(){
        sequence.close();
    }
    
}

@@ -1152,27 +1152,24 @@
 uence.Simple
-Int
 Sequence;%0A%0Ai
@@ -1158,32 +1158,32 @@
 SimpleSequence;%0A
+
 %0Aimport junit.fr
@@ -1247,141 +1247,8 @@
 005%0A
- *%0A * TODO To change the template for this generated type comment go to%0A * Window - Preferences - Java - Code Style - Code Templates%0A
  */%0A
@@ -1312,27 +1312,24 @@
  %0A    Simple
-Int
 Sequence seq
@@ -1522,24 +1522,26 @@
 er.setUp();%0A
+//
         sequ
@@ -1551,27 +1551,24 @@
 e=new Simple
-Int
 Sequence(%22Te
@@ -1601,24 +1601,97 @@
 t%22,0,1,20);%0A
+        sequence=new SimpleSequence(%22Test%22,%22/tmp/sequence2.dat%22,0,1,20);%0A
         sequ
@@ -1926,34 +1926,27 @@
 _2()
-%7B%0A        sequence.init();
+ throws Exception %7B
 %0A   

test now uses (correctly) class SimpleSequence