01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2005-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.data.postgis;
17:
18: import java.io.IOException;
19:
20: import org.geotools.data.DataSourceException;
21: import org.geotools.data.Transaction;
22: import org.geotools.filter.Filter;
23:
24: /**
25: *
26: * @author Justin
27: */
28: public class PostgisPermissionOnlineTest extends PostgisOnlineTestCase {
29:
30: protected String getFixtureId() {
31: return "postgis.restricted";
32: }
33:
34: public void testGetFeatureSource() throws IOException {
35:
36: try {
37: dataStore.getFeatureSource("restricted");
38: fail("user should not have been able to create featureSource to restricted table");
39: } catch (DataSourceException e) {
40: }
41: }
42:
43: public void testGetFeatureWriter() throws IOException {
44: try {
45: dataStore.getFeatureWriter("restricted", Filter.EXCLUDE,
46: Transaction.AUTO_COMMIT);
47: fail("user should not have been able to create featureWriter to restricted table");
48: } catch (DataSourceException e) {
49: }
50:
51: try {
52: dataStore.getFeatureWriter("restricted",
53: Transaction.AUTO_COMMIT);
54: fail("user should not have been able to create featureWriter to restricted table");
55: } catch (DataSourceException e) {
56: }
57:
58: try {
59: dataStore.getFeatureWriterAppend("restricted",
60: Transaction.AUTO_COMMIT);
61: fail("user should not have been able to create featureWriter to restricted table");
62: } catch (DataSourceException e) {
63: }
64: }
65:
66: public void testGetSchema() throws IOException {
67: try {
68: dataStore.getSchema("restricted");
69: fail("user should not have been able to create featureWriter to restricted table");
70: } catch (DataSourceException e) {
71: }
72: }
73:
74: }
|