Skip to content

Commit

Permalink
#286 Rename package csv to file and sql to database.
Browse files Browse the repository at this point in the history
  • Loading branch information
tabergma committed Feb 27, 2015
1 parent a0aa9c2 commit 0ee3fd4
Show file tree
Hide file tree
Showing 36 changed files with 65 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package de.metanome.algorithm_integration.input;

/**
* Generates new copies of a sql table based {@link de.metanome.algorithm_integration.input.RelationalInput}.
* Generates new copies of a database table based {@link de.metanome.algorithm_integration.input.RelationalInput}.
*
* @author Jakob Zwiener
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
import de.metanome.algorithm_integration.configuration.ConfigurationSettingDatabaseConnection;
import de.metanome.algorithm_integration.configuration.ConfigurationValue;
import de.metanome.algorithm_integration.input.DatabaseConnectionGenerator;
import de.metanome.backend.input.sql.DefaultDatabaseConnectionGenerator;
import de.metanome.backend.input.database.DefaultDatabaseConnectionGenerator;

import java.util.Set;

/**
* Represents sql input configuration values for {@link Algorithm}s.
* Represents database input configuration values for {@link Algorithm}s.
*
* @author Jakob Zwiener
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import de.metanome.algorithm_integration.configuration.ConfigurationSettingFileInput;
import de.metanome.algorithm_integration.configuration.ConfigurationValue;
import de.metanome.algorithm_integration.input.FileInputGenerator;
import de.metanome.backend.input.csv.DefaultFileInputGenerator;
import de.metanome.backend.input.file.DefaultFileInputGenerator;

import java.util.Set;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import de.metanome.algorithm_integration.configuration.ConfigurationSettingTableInput;
import de.metanome.algorithm_integration.configuration.ConfigurationValue;
import de.metanome.algorithm_integration.input.TableInputGenerator;
import de.metanome.backend.input.sql.DefaultTableInputGenerator;
import de.metanome.backend.input.database.DefaultTableInputGenerator;

import java.util.Set;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import de.metanome.algorithm_integration.input.RelationalInputGenerator;
import de.metanome.algorithm_integration.input.RelationalInputGeneratorInitializer;
import de.metanome.backend.configuration.ConfigurationValueRelationalInputGenerator;
import de.metanome.backend.input.csv.DefaultFileInputGenerator;
import de.metanome.backend.input.sql.DefaultTableInputGenerator;
import de.metanome.backend.input.file.DefaultFileInputGenerator;
import de.metanome.backend.input.database.DefaultTableInputGenerator;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.metanome.backend.input.sql;
package de.metanome.backend.input.database;

import de.metanome.algorithm_integration.AlgorithmConfigurationException;
import de.metanome.algorithm_integration.configuration.ConfigurationSettingDatabaseConnection;
Expand Down Expand Up @@ -85,7 +85,7 @@ public RelationalInput generateRelationalInputFromSql(String queryString)
resultSetIterator = new ResultSetIterator(resultSet);
} catch (SQLException e) {
throw new InputGenerationException(
ExceptionParser.parse(e, "Could not construct sql input"), e);
ExceptionParser.parse(e, "Could not construct database input"), e);
}

return resultSetIterator;
Expand All @@ -105,14 +105,14 @@ protected ResultSet executeQuery(String queryString) throws InputGenerationExcep
statements.add(sqlStatement);
} catch (SQLException e) {
throw new InputGenerationException(
ExceptionParser.parse(e, "Could not create sql statement on connection"), e);
ExceptionParser.parse(e, "Could not create database statement on connection"), e);
}
ResultSet resultSet;
try {
resultSet = sqlStatement.executeQuery(queryString);
} catch (SQLException e) {
throw new InputGenerationException(
ExceptionParser.parse(e, "Could not execute sql statement"), e);
ExceptionParser.parse(e, "Could not execute database statement"), e);
}

return resultSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.metanome.backend.input.sql;
package de.metanome.backend.input.database;

import de.metanome.algorithm_integration.AlgorithmConfigurationException;
import de.metanome.algorithm_integration.configuration.ConfigurationSettingTableInput;
Expand Down Expand Up @@ -63,7 +63,7 @@ public DefaultTableInputGenerator(ConfigurationSettingTableInput setting)
* Generates a new {@link de.metanome.algorithm_integration.input.RelationalInput} to iterate over the data in the table.
*
* @return the {@link de.metanome.algorithm_integration.input.RelationalInput}
* @throws InputGenerationException if the sql statement could not be executed
* @throws InputGenerationException if the database statement could not be executed
*/
@Override
public RelationalInput generateNewCopy() throws InputGenerationException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.metanome.backend.input.sql;
package de.metanome.backend.input.database;

import com.google.common.collect.ImmutableList;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.metanome.backend.input.csv;
package de.metanome.backend.input.file;

import de.metanome.algorithm_integration.AlgorithmConfigurationException;
import de.metanome.algorithm_integration.configuration.ConfigurationSettingFileInput;
Expand All @@ -29,7 +29,7 @@
import java.io.FileReader;

/**
* Generator for {@link de.metanome.algorithm_integration.input.RelationalInput}s based on csv
* Generator for {@link de.metanome.algorithm_integration.input.RelationalInput}s based on file
* files.
* The setting holds all parameters to construct new {@link de.metanome.algorithm_integration.input.RelationalInput}s.
* To adapt the parameters you have to adapt the setting.
Expand All @@ -44,7 +44,7 @@ public class DefaultFileInputGenerator implements FileInputGenerator {
/**
* Creates a DefaultFileInputGenerator with default settings.
* The default setting is used to construct a new {@link de.metanome.algorithm_integration.input.RelationalInput}.
* @param inputFile the csv input file
* @param inputFile the file input file
* @throws java.io.FileNotFoundException if the input file is not found
*/
public DefaultFileInputGenerator(File inputFile) throws FileNotFoundException {
Expand Down Expand Up @@ -75,7 +75,7 @@ public RelationalInput generateNewCopy() throws InputGenerationException {
throw new InputGenerationException(ExceptionParser.parse(e), e);
} catch (InputIterationException e) {
throw new InputGenerationException(
ExceptionParser.parse(e, "Could not iterate over the first line of the csv file"), e);
ExceptionParser.parse(e, "Could not iterate over the first line of the file file"), e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.metanome.backend.input.csv;
package de.metanome.backend.input.file;

import au.com.bytecode.opencsv.CSVReader;

Expand All @@ -30,7 +30,7 @@
import java.util.List;

/**
* {@link FileIterator}s are Iterators over lines in a csv file.
* {@link FileIterator}s are Iterators over lines in a file file.
*
* @author Jakob Zwiener
*/
Expand Down Expand Up @@ -149,7 +149,7 @@ protected List<String> readNextLine() throws InputIterationException {
currentLineNumber++;
} catch (IOException e) {
throw new InputIterationException(
ExceptionParser.parse(e, "Could not read next line in csv file"), e);
ExceptionParser.parse(e, "Could not read next line in file file"), e);
}
if (lineArray == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import au.com.bytecode.opencsv.CSVParser;
import au.com.bytecode.opencsv.CSVReader;

import de.metanome.backend.input.csv.FileIterator;
import de.metanome.backend.input.file.FileIterator;

import java.io.Serializable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import de.metanome.backend.configuration.ConfigurationValueListBox;
import de.metanome.backend.configuration.ConfigurationValueRelationalInputGenerator;
import de.metanome.backend.configuration.ConfigurationValueString;
import de.metanome.backend.input.csv.FileFixture;
import de.metanome.backend.input.file.FileFixture;
import de.metanome.backend.resources.AlgorithmResource;
import de.metanome.backend.resources.ExecutionResource;
import de.metanome.backend.resources.FileInputResource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import de.metanome.algorithm_integration.configuration.ConfigurationSettingString;
import de.metanome.algorithm_integration.input.InputGenerationException;
import de.metanome.algorithm_integration.input.InputIterationException;
import de.metanome.backend.input.csv.FileFixture;
import de.metanome.backend.input.file.FileFixture;

import org.junit.Before;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import de.metanome.algorithm_integration.input.InputIterationException;
import de.metanome.algorithm_integration.input.RelationalInputGenerator;
import de.metanome.backend.configuration.ConfigurationValueRelationalInputGenerator;
import de.metanome.backend.input.csv.FileFixture;
import de.metanome.backend.input.file.FileFixture;

import org.junit.Test;
import org.mockito.ArgumentCaptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.metanome.backend.input.sql;
package de.metanome.backend.input.database;

import de.metanome.algorithm_integration.input.InputGenerationException;

Expand Down Expand Up @@ -170,7 +170,7 @@ public void testGetSetResultSetConcurrency() {

/**
* Test method for {@link DefaultDatabaseConnectionGenerator#close()} <p/> The database connection
* generator should be closeable. After closing the sql iterator generator the underlying db
* generator should be closeable. After closing the database iterator generator the underlying db
* connection should be closed.
*/
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.metanome.backend.input.sql;
package de.metanome.backend.input.database;

import de.metanome.algorithm_integration.input.InputGenerationException;

Expand All @@ -24,7 +24,7 @@
import static org.mockito.Mockito.verify;

/**
* Tests for {@link de.metanome.backend.input.sql.DefaultTableInputGenerator}
* Tests for {@link de.metanome.backend.input.database.DefaultTableInputGenerator}
*
* @author Jakob Zwiener
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.metanome.backend.input.sql;
package de.metanome.backend.input.database;

import com.mysql.jdbc.ResultSetMetaData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.metanome.backend.input.sql;
package de.metanome.backend.input.database;

import com.google.common.collect.ImmutableList;

Expand Down Expand Up @@ -176,7 +176,7 @@ public void testColumnNames() throws SQLException {
}

/**
* Test method for {@link ResultSetIterator#close()} <p/> The sql iterator should be closeable.
* Test method for {@link ResultSetIterator#close()} <p/> The database iterator should be closeable.
* After closing the iterator, the underlying result set and statement should be closed.
*/
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.metanome.backend.input.sql;
package de.metanome.backend.input.database;

import com.google.common.collect.ImmutableList;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.metanome.backend.input.csv;
package de.metanome.backend.input.file;

import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.metanome.backend.input.csv;
package de.metanome.backend.input.file;

import com.google.common.base.Joiner;

Expand All @@ -28,7 +28,7 @@
import java.util.List;

/**
* A fixture generating a csv file with 4 rows. Rows 2 and 4 have differing lengths (2 (short) and 4
* A fixture generating a file file with 4 rows. Rows 2 and 4 have differing lengths (2 (short) and 4
* (long)).
*
* @author Tanja Bergmann
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.metanome.backend.input.csv;
package de.metanome.backend.input.file;

import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.metanome.backend.input.csv;
package de.metanome.backend.input.file;

import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
Expand All @@ -26,7 +26,7 @@
import java.io.StringReader;

/**
* A fixture generating a csv file with 4 rows. Rows 2 and 4 have differing lengths (2 (short) and 4
* A fixture generating a file file with 4 rows. Rows 2 and 4 have differing lengths (2 (short) and 4
* (long)).
*
* @author Jakob Zwiener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
* limitations under the License.
*/

package de.metanome.backend.input.csv;
package de.metanome.backend.input.file;

import de.metanome.algorithm_integration.configuration.ConfigurationSettingFileInput;
import de.metanome.algorithm_integration.input.InputIterationException;

import java.io.StringReader;

/**
* A fixture generating a csv file with a header and a short line.
* A fixture generating a file file with a header and a short line.
*
* @author Jakob Zwiener
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.metanome.backend.input.csv;
package de.metanome.backend.input.file;

import de.metanome.algorithm_integration.AlgorithmConfigurationException;
import de.metanome.algorithm_integration.configuration.ConfigurationSettingFileInput;
Expand Down Expand Up @@ -54,7 +54,7 @@ public class DefaultFileInputGeneratorTest {
@Before
public void setUp() throws Exception {
this.csvFileFixture = new CsvFileFixture();
this.expectedFile = csvFileFixture.getTestDataPath("test.csv");
this.expectedFile = csvFileFixture.getTestDataPath("test.file");

this.expectedSeparator = CsvFileFixture.SEPARATOR;
this.expectedQuotechar = CsvFileFixture.QUOTE_CHAR;
Expand Down Expand Up @@ -90,7 +90,7 @@ public void testConstructor() {
}

/**
* Test method for {@link de.metanome.backend.input.csv.DefaultFileInputGenerator#DefaultFileInputGenerator(de.metanome.algorithm_integration.configuration.ConfigurationSettingFileInput)}
* Test method for {@link de.metanome.backend.input.file.DefaultFileInputGenerator#DefaultFileInputGenerator(de.metanome.algorithm_integration.configuration.ConfigurationSettingFileInput)}
*
* The generator should store the file path correctly.
* The generator should use a default setting.
Expand All @@ -114,7 +114,7 @@ public void testConstructorSetting() throws AlgorithmConfigurationException,
/**
* Test method for {@link DefaultFileInputGenerator#generateNewCopy()}
*
* The generator should generate fresh csv files iterable from the start.
* The generator should generate fresh file files iterable from the start.
*/
@Test
public void testGenerateNewCsvFile() throws InputGenerationException, InputIterationException {
Expand Down
Loading

0 comments on commit 0ee3fd4

Please sign in to comment.