|
2 | 2 |
|
3 | 3 | import com.bc.fiduceo.IOTestRunner; |
4 | 4 | import com.bc.fiduceo.TestUtil; |
| 5 | +import com.bc.fiduceo.core.Dimension; |
5 | 6 | import com.bc.fiduceo.core.NodeType; |
6 | 7 | import com.bc.fiduceo.geometry.*; |
7 | 8 | import com.bc.fiduceo.reader.AcquisitionInfo; |
|
18 | 19 |
|
19 | 20 | import static org.junit.Assert.*; |
20 | 21 |
|
| 22 | +@SuppressWarnings("NewClassNamingConvention") |
21 | 23 | @RunWith(IOTestRunner.class) |
22 | 24 | public class SmosL1CDailyGriddedReader_IO_Test { |
23 | 25 |
|
24 | 26 | private SmosL1CDailyGriddedReader reader; |
25 | | - private ReaderContext readerContext; |
26 | 27 |
|
27 | 28 | @Before |
28 | 29 | public void setUp() throws IOException { |
29 | | - readerContext = new ReaderContext(); |
| 30 | + final ReaderContext readerContext = new ReaderContext(); |
30 | 31 | readerContext.setGeometryFactory(new GeometryFactory(GeometryFactory.Type.S2)); |
31 | 32 |
|
32 | 33 | final File testDir = TestUtil.getTestDir(); |
@@ -88,8 +89,28 @@ public void testReadAcquisitionInfo_CDF3TA() throws IOException { |
88 | 89 | } |
89 | 90 | } |
90 | 91 |
|
| 92 | + @Test |
| 93 | + public void testGetProductSize_CDF3TD() throws IOException { |
| 94 | + final File file = getCDF3TDFile(); |
| 95 | + try { |
| 96 | + reader.open(file); |
| 97 | + |
| 98 | + final Dimension productSize = reader.getProductSize(); |
| 99 | + assertNotNull(productSize); |
| 100 | + assertEquals(1388, productSize.getNx()); |
| 101 | + assertEquals(584, productSize.getNy()); |
| 102 | + } finally { |
| 103 | + reader.close(); |
| 104 | + } |
| 105 | + } |
| 106 | + |
91 | 107 | private File getCDF3TAFile() throws IOException { |
92 | 108 | final String testFilePath = TestUtil.assembleFileSystemPath(new String[]{"miras-smos-CDF3TA", "re07", "2016", "162", "SM_RE07_MIR_CDF3TA_20160610T000000_20160610T235959_330_001_7.tgz"}, false); |
93 | 109 | return TestUtil.getTestDataFileAsserted(testFilePath); |
94 | 110 | } |
| 111 | + |
| 112 | + private File getCDF3TDFile() throws IOException { |
| 113 | + final String testFilePath = TestUtil.assembleFileSystemPath(new String[]{"miras-smos-CDF3TD", "re07", "2017", "324", "SM_RE07_MIR_CDF3TD_20171120T000000_20171120T235959_330_001_7.tgz"}, false); |
| 114 | + return TestUtil.getTestDataFileAsserted(testFilePath); |
| 115 | + } |
95 | 116 | } |
0 commit comments