use of com.google.refine.model.Project in project OpenRefine by OpenRefine.
the class FunctionTests method SetUp.
@BeforeMethod
public void SetUp() throws IOException, ModelException {
bindings = new Properties();
File dir = TestUtils.createTempDirectory("openrefine-test-workspace-dir");
FileProjectManager.initialize(dir);
project = new Project();
ProjectMetadata pm = new ProjectMetadata();
pm.setName("TNG Test Project");
ProjectManager.singleton.registerProject(project, pm);
int index = project.columnModel.allocateNewCellIndex();
Column column = new Column(index, "Column A");
project.columnModel.addColumn(index, column, true);
options = mock(Properties.class);
bindings.put("project", project);
// Five rows of a's and five of 1s
for (int i = 0; i < 10; i++) {
Row row = new Row(1);
row.setCell(0, new Cell(i < 5 ? "a" : new Integer(1), null));
project.rows.add(row);
}
}
use of com.google.refine.model.Project in project OpenRefine by OpenRefine.
the class HistoryTests method SetUp.
@BeforeMethod
public void SetUp() {
projectManager = mock(ProjectManager.class);
ProjectManager.singleton = projectManager;
proj = new Project();
SUT = new History(proj);
}
use of com.google.refine.model.Project in project OpenRefine by OpenRefine.
the class ImporterTest method setUp.
public void setUp() {
//FIXME - should we try and use mock(Project.class); - seems unnecessary complexity
servlet = new RefineServletStub();
ImportingManager.initialize(servlet);
project = new Project();
metadata = new ProjectMetadata();
job = ImportingManager.createJob();
options = Mockito.mock(JSONObject.class);
}
use of com.google.refine.model.Project in project OpenRefine by OpenRefine.
the class ImporterUtilitiesTests method setupColumns.
@Test
public void setupColumns() {
Project project = new Project();
List<String> columnNames = new ArrayList<String>();
columnNames.add("col1");
columnNames.add("col2");
columnNames.add("");
ImporterUtilities.setupColumns(project, columnNames);
Assert.assertEquals(project.columnModel.columns.get(0).getName(), "col1");
Assert.assertEquals(project.columnModel.columns.get(1).getName(), "col2");
Assert.assertEquals(project.columnModel.columns.get(2).getName(), "Column");
}
use of com.google.refine.model.Project in project OpenRefine by OpenRefine.
the class UrlFetchingTests method SetUp.
@BeforeMethod
public void SetUp() throws JSONException, IOException, ModelException {
File dir = TestUtils.createTempDirectory("openrefine-test-workspace-dir");
FileProjectManager.initialize(dir);
project = new Project();
ProjectMetadata pm = new ProjectMetadata();
pm.setName("URL Fetching Test Project");
ProjectManager.singleton.registerProject(project, pm);
int index = project.columnModel.allocateNewCellIndex();
Column column = new Column(index, "fruits");
project.columnModel.addColumn(index, column, true);
options = mock(Properties.class);
engine = new Engine(project);
engine_config = new JSONObject(ENGINE_JSON_URLS);
engine.initializeFromJSON(engine_config);
engine.setMode(Engine.Mode.RowBased);
bindings = new Properties();
bindings.put("project", project);
}
Aggregations