Revision 30754 branches/v2_0_0_prep/libraries/libRaster/src-test/org/gvsig/raster/dataset/io/rmf/TestRmfRead.java

View differences:

TestRmfRead.java
46 46
/**
47 47
 * Test de lectura para ficheros rmf. Obtiene distintos tipos de bloques y
48 48
 * comprueba que el objeto que han de generar es correcto.
49
 * 
49
 *
50 50
 * @author Nacho Brodin (nachobrodin@gmail.com)
51 51
 */
52 52
public class TestRmfRead extends BaseTestCase {
......
60 60
		RasterLibrary.wakeUp();
61 61
	}
62 62

  
63
	public void start() {
63
	public void start() throws Exception {
64 64
		this.setUp();
65 65
		this.testStack();
66 66
	}
67 67

  
68
	public void setUp() {
68
	protected void doSetUp() throws Exception {
69
		super.doSetUp();
69 70
		System.err.println("TestRmfRead running...");
70 71
		try {
71 72
			deleteRMF(path1);
......
130 131

  
131 132
	public void testColorInterpretation(DatasetColorInterpretation ci) {
132 133
		for (int j = 0; j < ci.length(); j++) {
133
			String value = (String) ci.get(j);
134
			String value = ci.get(j);
134 135
//			System.out.println(value);
135 136
			if (j == 0)
136 137
				assertEquals(value, "Blue");
......
140 141
				assertEquals(value, "Red");
141 142
		}
142 143
	}
143
	
144

  
144 145
	public void testHistogram(Histogram h) {
145 146
		Histogram h2 = Histogram.convertHistogramToRGB(h);
146
		
147

  
147 148
		HistogramClass[][] classes = h2.getHistogram();
148
		for (int iBand = 0; iBand < classes.length; iBand++) {
149
		for (int iBand = 0; iBand < classes.length; iBand++)
149 150
			for (int iValue = 0; iValue < classes[iBand].length; iValue++) {
150 151
				assertEquals((int) classes[iBand][iValue].getMin(), iValue);
151 152
				assertEquals((int) classes[iBand][iValue].getMax(), iValue + 1);
152 153
			}
153
		}
154 154

  
155 155
		assertEquals((int) h.getHistogramValue(0, 0), 16);
156 156
		assertEquals((int) h.getHistogramValue(0, 1), 4);
......
210 210

  
211 211
	public void testNoData(NoData noData) {
212 212
		assertEquals((int) noData.getValue(), 5450);
213
		assertEquals((int) noData.getType(), 2);
213
		assertEquals(noData.getType(), 2);
214 214
	}
215 215

  
216 216
	public void testStatistics(DatasetStatistics ds) {
......
223 223
		double[] variance = ds.getVariance();
224 224

  
225 225
		assertEquals(bandCount, 3);
226
		for (int i = 0; i < bandCount; i++) {
226
		for (int i = 0; i < bandCount; i++)
227 227
			switch (i) {
228 228
				case 0:
229 229
					assertEquals((int) max[i], 250);
......
250 250
					assertEquals((int) variance[i], 4154);
251 251
					break;
252 252
			}
253
		}
254 253

  
255 254
//		System.out.println(ct.getName());
256 255
//		System.out.println(ct.getType());

Also available in: Unified diff