use of com.google.refine.ProjectMetadata 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.ProjectMetadata 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.ProjectMetadata 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);
}
use of com.google.refine.ProjectMetadata in project OpenRefine by OpenRefine.
the class MassChangeTests method SetUp.
@BeforeMethod
public void SetUp() throws IOException, ModelException {
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);
}
use of com.google.refine.ProjectMetadata in project OpenRefine by OpenRefine.
the class ImportingJob method prepareNewProject.
public void prepareNewProject() {
if (project != null) {
project.dispose();
}
// Make sure all projects have been saved in case we run out of memory
// or have some other catastrophe on import
ProjectManager.singleton.save(true);
project = new Project();
metadata = new ProjectMetadata();
}
Aggregations