r115 - in trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/content: catches operation operation/catches operation/catches/species operation/catches/species/frequency
Author: tchemit Date: 2012-12-28 09:35:21 +0100 (Fri, 28 Dec 2012) New Revision: 115 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/115 Log: move test Added: trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/ trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/ trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyRowModelTest.java Removed: trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/content/catches/species/ trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/content/operation/species/ Copied: trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyRowModelTest.java (from rev 114, trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesFrequencyRowModelTest.java) =================================================================== --- trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyRowModelTest.java (rev 0) +++ trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyRowModelTest.java 2012-12-28 08:35:21 UTC (rev 115) @@ -0,0 +1,66 @@ +package fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency; + +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 Ifremer + * %% + * 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.junit.Assert; +import org.junit.Test; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class SpeciesFrequencyRowModelTest { + + @Test + public void compareTo() throws Exception { + + SpeciesFrequencyRowModel s0 = new SpeciesFrequencyRowModel(); + SpeciesFrequencyRowModel s1 = new SpeciesFrequencyRowModel(); + + // s0=null, s1=null + Assert.assertTrue(s0.compareTo(s1) == 0); + + // s0=1, s1=null + s0.setLengthStep(1f); + Assert.assertTrue(s0.compareTo(s1) > 0); + + // s0=null, s1=1 + s0.setLengthStep(null); + s1.setLengthStep(1f); + Assert.assertTrue(s0.compareTo(s1) < 0); + + // s0=2, s1=1 + s0.setLengthStep(2f); + Assert.assertTrue(s0.compareTo(s1) > 0); + + // s0=2, s1=2 + s1.setLengthStep(2f); + Assert.assertTrue(s0.compareTo(s1) == 0); + + // s0=2, s1=3 + s1.setLengthStep(3f); + Assert.assertTrue(s0.compareTo(s1) < 0); + } +} Property changes on: trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyRowModelTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native
participants (1)
-
tchemit@users.forge.codelutin.com