Author: tchemit Date: 2008-02-02 15:48:30 +0000 (Sat, 02 Feb 2008) New Revision: 582 Added: trunk/simexplorer-is-storage/src/test/fr/cemagref/simexplorer/is/storage/VersionGeneratorTest.java Log: tests unitaires du g?\195?\169n?\195?\169rateur de versions Added: trunk/simexplorer-is-storage/src/test/fr/cemagref/simexplorer/is/storage/VersionGeneratorTest.java =================================================================== --- trunk/simexplorer-is-storage/src/test/fr/cemagref/simexplorer/is/storage/VersionGeneratorTest.java (rev 0) +++ trunk/simexplorer-is-storage/src/test/fr/cemagref/simexplorer/is/storage/VersionGeneratorTest.java 2008-02-02 15:48:30 UTC (rev 582) @@ -0,0 +1,60 @@ +/* +* ##% Copyright (C) 2008 Code Lutin, Gabriel Landais, Tony Chemit +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* ##% */ +package fr.cemagref.simexplorer.is.storage; + +import fr.cemagref.simexplorer.is.entities.metadata.Version; +import junit.framework.TestCase; + +/** + * VersionGenerator Tester. + * + * @author chemit + * @version 1.0 + * @since <pre>02/02/2008</pre> + */ +public class VersionGeneratorTest extends TestCase { + + VersionGenerator generator; + + public VersionGeneratorTest(String name) { + super(name); + } + + @Override + public void setUp() throws Exception { + super.setUp(); + generator = VersionGenerator.getInstance(); + } + + @Override + public void tearDown() throws Exception { + super.tearDown(); + generator = null; + } + + public void testGenerateVersion() throws Exception { + Version version = generator.generateVersion(); + assertTrue(version.getLength() < VersionGenerator.MAX_SIZE); + } + + public void testGenerateVersions() throws Exception { + Version[] version = generator.generateVersions(); + assertTrue(version.length < VersionGenerator.MAX_NB_VERSIONS); + } + +}