Statistics
| Revision:

root / trunk / extensions / extSymbology / src-test / org / gvsig / remoteClient / sld / symbolizerTests / TestParsePointSymbolizer.java @ 20768

History | View | Annotate | Download (1.28 KB)

1
package org.gvsig.remoteClient.sld.symbolizerTests;
2
import java.io.File;
3
import java.io.IOException;
4

    
5
import junit.framework.TestCase;
6

    
7
import org.gvsig.remoteClient.sld.SLDProtocolHandler;
8
import org.gvsig.remoteClient.sld.SLDProtocolHandlerFactory;
9
import org.gvsig.remoteClient.sld.UnsupportedSLDVersionException;
10
import org.xmlpull.v1.XmlPullParserException;
11

    
12
import com.iver.cit.gvsig.fmap.drivers.legend.LegendDriverException;
13

    
14

    
15
public class TestParsePointSymbolizer extends TestCase {
16
        SLDProtocolHandler my_sld = null;
17
        File f;
18
        
19
        public void setUp() {
20
                f = new File("src-test/points/test-data/pointSymbolizer.sld" );
21
        }
22

    
23
        public void testParsing() {
24
                long t1 = System.currentTimeMillis();
25
                try {
26
                        my_sld = SLDProtocolHandlerFactory.createVersionedProtocolHandler(f);                
27
                        ((SLDProtocolHandler) my_sld).parse(f);
28
                        
29
                } catch (LegendDriverException e) {
30
                        e.printStackTrace();
31
                        fail();
32
                } catch (IOException e) {
33
                        e.printStackTrace();
34
                        fail();
35
                } catch (XmlPullParserException e) {
36
                        e.printStackTrace();
37
                        fail();
38
                } catch (UnsupportedSLDVersionException e) {
39
                        e.printStackTrace();
40
                        fail();
41
                }
42
                long t2 = System.nanoTime();
43
                System.out.println("Test parsing done with apparently no errors in "+ (t2-(float)t1)+" nano-seconds");
44
        }
45

    
46
}