@Test public void testTransactionExceptionReport() throws IOException { wfs.setFailOnTransaction(true); ContentFeatureSource source = (ContentFeatureSource) dataStore.getFeatureSource(simpleTypeName1); assertNotNull(source); assertTrue(source instanceof WFSFeatureStore); WFSFeatureStore store = (WFSFeatureStore) source; MemoryFeatureCollection collection = new MemoryFeatureCollection(featureType1); SimpleFeature feat = new SimpleFeatureImpl( Arrays.asList(new Object[] {null, "mypoint", "pics/x.jpg", "pics/y.jpg"}), featureType1, new FeatureIdImpl("myid")); collection.add(feat); Transaction transaction = new DefaultTransaction(); store.setTransaction(transaction); List<FeatureId> fids = store.addFeatures((SimpleFeatureCollection) collection); assertEquals(1, fids.size()); try { transaction.commit(); } catch (WFSException e) { StringWriter writer = new StringWriter(); PrintWriter printer = new PrintWriter(writer); e.printStackTrace(printer); printer.close(); assertTrue(writer.toString().contains("MyErrorMessage")); return; } Assert.fail("Expected WFSException."); }
@Override public void setTransaction(Transaction transaction) { super.setTransaction(transaction); if (delegate.getTransaction() != transaction) { delegate.setTransaction(transaction); } }
WFSFeatureStore extends ContentFeatureStore { @Override public void setTransaction(Transaction transaction) { super.setTransaction(transaction); if (delegate.getTransaction() != transaction) { delegate.setTransaction(transaction); } } }
WFSFeatureStore extends ContentFeatureStore { @Override public void setTransaction(Transaction transaction) { super.setTransaction(transaction); if (delegate.getTransaction() != transaction) { delegate.setTransaction(transaction); } } WFSFeatureStore(WFSFeatureSource source); }
WFSFeatureStore extends ContentFeatureStore { @Override public void setTransaction(Transaction transaction) { super.setTransaction(transaction); if (delegate.getTransaction() != transaction) { delegate.setTransaction(transaction); } } WFSFeatureStore(WFSFeatureSource source); @Override boolean canReproject(); @Override boolean canLock(); @Override WFSDataStore getDataStore(); @Override ContentEntry getEntry(); @Override ResourceInfo getInfo(); @Override Name getName(); @Override QueryCapabilities getQueryCapabilities(); @Override WFSContentState getState(); @Override Transaction getTransaction(); @Override void setTransaction(Transaction transaction); @Override void modifyFeatures(Name[] properties, Object[] values, Filter filter); }
WFSFeatureStore extends ContentFeatureStore { @Override public void setTransaction(Transaction transaction) { super.setTransaction(transaction); if (delegate.getTransaction() != transaction) { delegate.setTransaction(transaction); } } WFSFeatureStore(WFSFeatureSource source); @Override boolean canReproject(); @Override boolean canLock(); @Override WFSDataStore getDataStore(); @Override ContentEntry getEntry(); @Override ResourceInfo getInfo(); @Override Name getName(); @Override QueryCapabilities getQueryCapabilities(); @Override WFSContentState getState(); @Override Transaction getTransaction(); @Override void setTransaction(Transaction transaction); @Override void modifyFeatures(Name[] properties, Object[] values, Filter filter);  }