Revision 10627 trunk/libraries/libGDBMS/src/test/java/com/hardcode/gdbms/engine/data/Tests.java

View differences:

Tests.java
1 1
package com.hardcode.gdbms.engine.data;
2 2

  
3
import com.hardcode.driverManager.DriverLoadException;
3
import java.io.ByteArrayInputStream;
4
import java.io.ByteArrayOutputStream;
5
import java.io.PrintWriter;
4 6

  
7
import org.xml.sax.InputSource;
8
import org.xml.sax.XMLReader;
9
import org.xml.sax.helpers.XMLReaderFactory;
10

  
11
import com.hardcode.driverManager.DriverLoadException;
5 12
import com.hardcode.gdbms.DataSourceTestCase;
13
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
14
import com.hardcode.gdbms.driver.exceptions.WriteDriverException;
6 15
import com.hardcode.gdbms.engine.data.driver.DriverException;
7 16
import com.hardcode.gdbms.engine.data.persistence.Handler;
8 17
import com.hardcode.gdbms.engine.data.persistence.Memento;
9 18
import com.hardcode.gdbms.engine.data.persistence.MementoContentHandler;
10 19
import com.hardcode.gdbms.engine.instruction.EvaluationException;
11 20
import com.hardcode.gdbms.engine.instruction.SemanticException;
12
import com.hardcode.gdbms.engine.instruction.TableNotFoundException;
13 21
import com.hardcode.gdbms.engine.values.BooleanValue;
14 22
import com.hardcode.gdbms.engine.values.ValueFactory;
15 23
import com.hardcode.gdbms.parser.ParseException;
16 24

  
17
import org.xml.sax.InputSource;
18
import org.xml.sax.XMLReader;
19
import org.xml.sax.helpers.XMLReaderFactory;
20 25

  
21
import java.io.ByteArrayInputStream;
22
import java.io.ByteArrayOutputStream;
23
import java.io.IOException;
24
import java.io.PrintWriter;
25

  
26

  
27 26
/**
28 27
 * DOCUMENT ME!
29 28
 *
......
82 81
            throw new RuntimeException(e);
83 82
        } catch (ParseException e) {
84 83
            throw new RuntimeException(e);
85
        } catch (DriverException e) {
84
        } catch (ReadDriverException e) {
86 85
            throw new RuntimeException(e);
87 86
        } catch (SemanticException e) {
88 87
            throw new RuntimeException(e);
89
        } catch (IOException e) {
90
            throw new RuntimeException(e);
91 88
        } finally {
92 89
            ds.clearViews();
93 90
        }
......
99 96
     * @throws DriverException
100 97
     * @throws RuntimeException DOCUMENT ME!
101 98
     */
102
    public void testViewRemoving() throws DriverException {
99
    public void testViewRemoving() throws ReadDriverException {
103 100
        ds.setDelegating(true);
104 101

  
105 102
        DataSource d1;
......
114 111
            throw new RuntimeException(e1);
115 112
        } catch (ParseException e1) {
116 113
            throw new RuntimeException(e1);
117
        } catch (DriverException e1) {
118
            throw new RuntimeException(e1);
119 114
        } catch (SemanticException e1) {
120 115
            throw new RuntimeException(e1);
121
        } catch (IOException e1) {
122
            throw new RuntimeException(e1);
123 116
        } catch (NoSuchTableException e) {
124 117
            throw new RuntimeException(e);
125 118
        } catch (EvaluationException e) {
......
132 125
            d1.start();
133 126
            d1.stop();
134 127
            assertTrue("Views not deleted", false);
135
        } catch (DriverException e) {
128
        } catch (ReadDriverException e) {
136 129
        }
137 130
    }
138 131

  
......
142 135
     * @throws DriverException
143 136
     * @throws RuntimeException DOCUMENT ME!
144 137
     */
145
    public void testQueryDataSources() throws DriverException {
138
    public void testQueryDataSources() throws ReadDriverException {
146 139
        DataSource d1;
147 140

  
148 141
        try {
......
162 155
            throw new RuntimeException(e);
163 156
        } catch (NoSuchTableException e) {
164 157
            throw new RuntimeException(e);
165
        } catch (DriverException e) {
158
        } catch (ReadDriverException e) {
166 159
            throw new RuntimeException(e);
167 160
        } catch (ParseException e) {
168 161
            throw new RuntimeException(e);
169 162
        } catch (SemanticException e) {
170 163
            throw new RuntimeException(e);
171
        } catch (IOException e) {
172
            throw new RuntimeException(e);
173 164
        } catch (EvaluationException e) {
174 165
            throw new RuntimeException(e);
175 166
        } finally {
......
193 184
            throw new RuntimeException(e);
194 185
        } catch (NoSuchTableException e) {
195 186
            throw new RuntimeException(e);
196
        } catch (DriverException e) {
187
        } catch (ReadDriverException e) {
197 188
            throw new RuntimeException(e);
198
        }
189
        } catch (WriteDriverException e) {
190
        	throw new RuntimeException(e);
191
		}
199 192

  
200 193
        try {
201 194
            d = ds.createRandomDataSource("persona",
......
205 198
            throw new RuntimeException(e1);
206 199
        } catch (NoSuchTableException e1) {
207 200
            assertTrue(true);
208
        } catch (DriverException e) {
201
        } catch (ReadDriverException e) {
209 202
            throw new RuntimeException(e);
210 203
        }
211 204
    }
......
303 296

  
304 297
        ds.clearViews();
305 298
    }
306
    
299

  
307 300
    public void testChangeDataSourceName() throws Throwable {
308 301
        ds.changeDataSourceName("persona", "nuevonombre");
309
        
302

  
310 303
        try{
311 304
            ds.createRandomDataSource("persona");
312 305
            assertTrue(false);

Also available in: Unified diff