root / trunk / libraries / libUIComponent / src-test-ui / org / gvsig / gui / beans / panelGroup / TestPanelGroupLoaderFromList.java @ 15734
History | View | Annotate | Download (2.39 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*/
|
19 |
|
20 |
package org.gvsig.gui.beans.panelGroup; |
21 |
|
22 |
import org.gvsig.gui.beans.panelGroup.loaders.PanelGroupLoaderFromList; |
23 |
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel; |
24 |
import org.gvsig.gui.beans.panelGroup.samples.Samples_Data; |
25 |
|
26 |
import junit.framework.TestCase; |
27 |
|
28 |
/**
|
29 |
* <p>Tests {@link PanelGroupLoaderUtilities PanelGroupLoaderUtilities} and {@link PanelGroupLoaderFromList PanelGroupLoaderFromList}.</p>
|
30 |
*
|
31 |
* @version 16/10/2007
|
32 |
* @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es)
|
33 |
*/
|
34 |
public class TestPanelGroupLoaderFromList extends TestCase { |
35 |
|
36 |
/*
|
37 |
* (non-Javadoc)
|
38 |
* @see junit.framework.TestCase#setUp()
|
39 |
*/
|
40 |
protected void setUp() throws Exception { |
41 |
super.setUp();
|
42 |
} |
43 |
|
44 |
/*
|
45 |
* (non-Javadoc)
|
46 |
* @see junit.framework.TestCase#tearDown()
|
47 |
*/
|
48 |
protected void tearDown() throws Exception { |
49 |
super.tearDown();
|
50 |
} |
51 |
|
52 |
/**
|
53 |
* <p>Test, results must be valid.</p>
|
54 |
*/
|
55 |
public void test() { |
56 |
System.out.println("==> BEGINNING TEST CLASS: \'\'PanelGroupLoaderFromList\'\' <=="); |
57 |
|
58 |
try {
|
59 |
PanelGroupLoaderFromList loader = new PanelGroupLoaderFromList(Samples_Data.TEST2_CLASSES);
|
60 |
AbstractPanel[] panels = loader.loadPanels();
|
61 |
|
62 |
// Check that has loaded all panels
|
63 |
assertEquals(Samples_Data.TEST2_CLASSES.length, panels.length); |
64 |
|
65 |
int i = 0; |
66 |
|
67 |
for (AbstractPanel panel: panels) {
|
68 |
// Check order and class types
|
69 |
assertTrue(panel.getClass() == (Samples_Data.TEST2_CLASSES[i++])); |
70 |
} |
71 |
} catch (Exception e) { |
72 |
e.printStackTrace(); |
73 |
fail(); |
74 |
} |
75 |
|
76 |
System.out.println("==> ENDING TEST CLASS: \'\'PanelGroupLoaderFromList\'\' <=="); |
77 |
} |
78 |
} |