001: /*
002: * @(#) $Header: /cvs/jai-operators/src/tests/ca/forklabs/media/jai/operator/IDFT3DDescriptorTest.java,v 1.2 2007/06/13 18:57:21 forklabs Exp $
003: *
004: * Copyright (C) 2007 Forklabs Daniel Léonard
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License
008: * as published by the Free Software Foundation; either version 2
009: * of the License, or (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
019: */
020:
021: package ca.forklabs.media.jai.operator;
022:
023: import java.util.Locale;
024: import junit.framework.TestCase;
025: import ca.forklabs.media.jai.operator.IDFT3DDescriptor;
026:
027: /**
028: * Class {@code IDFT3DDescriptorTest} tests class {@link IDFT3DDescriptor}.
029: *
030: * @author <a href="mailto:forklabs at dev.java.net?subject=ca.forklabs.media.jai.operator.IDFT3DDescriptorTest">Daniel Léonard</a>
031: * @version $Revision: 1.2 $
032: */
033: @SuppressWarnings("nls")
034: public class IDFT3DDescriptorTest extends TestCase {
035:
036: //---------------------------
037: // Constructors
038: //---------------------------
039:
040: /**
041: * Constructor.
042: * @param name the name of this test.
043: */
044: public IDFT3DDescriptorTest(String name) {
045: super (name);
046: }
047:
048: //---------------------------
049: // Test methods
050: //---------------------------
051:
052: /**
053: * Tests the English messages.
054: */
055: public void testEnglishMessages() {
056: Locale locale = Locale.getDefault();
057: Locale.setDefault(Locale.ENGLISH);
058:
059: try {
060: String[] expected = new String[] {
061: "3D inverse Fourier transform",
062: "The data scaling type", "The data nature", };
063:
064: String[] got = new String[] {
065: IDFT3DDescriptor.getDescription(),
066: IDFT3DDescriptor.getArg0Description(),
067: IDFT3DDescriptor.getArg1Description(), };
068:
069: assertEquals(expected.length, got.length);
070:
071: for (int i = 0; i < expected.length; i++) {
072: assertEquals("[" + i + "]", expected[i], got[i]);
073: }
074: } finally {
075: Locale.setDefault(locale);
076: }
077: }
078:
079: /**
080: * Tests the French messages.
081: */
082: public void testFrenchMessages() {
083: Locale locale = Locale.getDefault();
084: Locale.setDefault(Locale.FRENCH);
085:
086: try {
087: String[] expected = new String[] {
088: "Transformée de Fourier inverse 3D",
089: "Le facteur de normalisation",
090: "La nature des données", };
091:
092: String[] got = new String[] {
093: IDFT3DDescriptor.getDescription(),
094: IDFT3DDescriptor.getArg0Description(),
095: IDFT3DDescriptor.getArg1Description(), };
096:
097: assertEquals(expected.length, got.length);
098:
099: for (int i = 0; i < expected.length; i++) {
100: assertEquals("[" + i + "]", expected[i], got[i]);
101: }
102: } finally {
103: Locale.setDefault(locale);
104: }
105: }
106:
107: //---------------------------
108: // Class methods
109: //---------------------------
110:
111: /**
112: * Runs only this test.
113: * @param args ignored.
114: */
115: public static void main(String... args) {
116: junit.swingui.TestRunner.run(IDFT3DDescriptorTest.class);
117: }
118:
119: }
120:
121: /*
122: * $Log: IDFT3DDescriptorTest.java,v $
123: * Revision 1.2 2007/06/13 18:57:21 forklabs
124: * Changed parent to use CollectionDescriptor.
125: *
126: * Revision 1.1 2007/06/05 02:27:51 forklabs
127: * Operators dft3d and idft3d
128: *
129: */
|