Commit cc30db8a authored by Luna Riegel's avatar Luna Riegel
Browse files

Refactor: Remove obsolete function

parent cee896c7
......@@ -224,19 +224,6 @@ public class EmbeddedDatabaseHandler {
return ids;
}
public List<CityObject> getAllCityObjects() {
List<CityObject> cos = new ArrayList<>();
try (Connection con = dataSource.getConnection()) {
try (PreparedStatement ps = con.prepareStatement("SELECT gmlid, bbox, data FROM features")) {
ResultSet rs = ps.executeQuery();
cos.addAll(retrieveCityObjects(rs));
}
} catch (SQLException e) {
logger.error(Localization.getText("DatabaseHandler.getAllCityObjectsFailure"));
logger.debug(e.getMessage());
}
return cos;
}
public List<GmlId> getBufferIntersectingObjects(CityObject co, double bufferSize) {
......
......@@ -16,13 +16,10 @@ import de.hft.stuttgart.citydoctor2.parser.CityGmlParser;
import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import org.citygml4j.core.model.building.AbstractBuilding;
import org.h2gis.functions.factory.H2GISDBFactory;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import static de.hft.stuttgart.citydoctor2.database.SerializationTest.assertCityObjectEquality;
......@@ -45,27 +42,6 @@ public class DataBaseHandlerTest {
}
@Test
public void testGetAllFeatures() {
Building b = new Building();
b.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.SOLID, Lod.LOD0));
Building b2 = new Building();
b2.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.SOLID, Lod.LOD2));
Building b3 = new Building();
b3.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.SOLID, Lod.LOD3));
handler.marshallCityObject(b);
handler.marshallCityObject(b2);
handler.marshallCityObject(b3);
assertEquals(3, handler.getFeatureCount());
List<CityObject> objects = handler.getAllCityObjects();
assertEquals(3, objects.size());
assertEquals(3, handler.getFeatureCount());
}
@Test
public void testGetBboxIntersectingObjects() {
Building b = new Building();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment