Search in sources :

Example 6 with Project

use of com.google.refine.model.Project in project OpenRefine by OpenRefine.

the class CsvExporterTests method SetUp.

@BeforeMethod
public void SetUp() {
    SUT = new CsvExporter();
    writer = new StringWriter();
    project = new Project();
    engine = new Engine(project);
    options = mock(Properties.class);
}
Also used : Project(com.google.refine.model.Project) StringWriter(java.io.StringWriter) CsvExporter(com.google.refine.exporters.CsvExporter) Properties(java.util.Properties) Engine(com.google.refine.browsing.Engine) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 7 with Project

use of com.google.refine.model.Project in project OpenRefine by OpenRefine.

the class HtmlExporterTests method SetUp.

@BeforeMethod
public void SetUp() {
    SUT = new HtmlTableExporter();
    writer = new StringWriter();
    ProjectManager.singleton = new ProjectManagerStub();
    projectMetadata = new ProjectMetadata();
    project = new Project();
    projectMetadata.setName(TEST_PROJECT_NAME);
    ProjectManager.singleton.registerProject(project, projectMetadata);
    engine = new Engine(project);
    options = mock(Properties.class);
}
Also used : Project(com.google.refine.model.Project) ProjectManagerStub(com.google.refine.tests.ProjectManagerStub) StringWriter(java.io.StringWriter) ProjectMetadata(com.google.refine.ProjectMetadata) HtmlTableExporter(com.google.refine.exporters.HtmlTableExporter) Properties(java.util.Properties) Engine(com.google.refine.browsing.Engine) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 8 with Project

use of com.google.refine.model.Project in project OpenRefine by OpenRefine.

the class TemplatingExporterTests method SetUp.

@BeforeMethod
public void SetUp() {
    SUT = new TemplatingExporter();
    writer = new StringWriter();
    ProjectManager.singleton = new ProjectManagerStub();
    projectMetadata = new ProjectMetadata();
    project = new Project();
    projectMetadata.setName(TEST_PROJECT_NAME);
    ProjectManager.singleton.registerProject(project, projectMetadata);
    engine = new Engine(project);
    options = mock(Properties.class);
}
Also used : Project(com.google.refine.model.Project) ProjectManagerStub(com.google.refine.tests.ProjectManagerStub) StringWriter(java.io.StringWriter) ProjectMetadata(com.google.refine.ProjectMetadata) TemplatingExporter(com.google.refine.exporters.TemplatingExporter) Properties(java.util.Properties) Engine(com.google.refine.browsing.Engine) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 9 with Project

use of com.google.refine.model.Project in project OpenRefine by OpenRefine.

the class TsvExporterTests method SetUp.

@BeforeMethod
public void SetUp() {
    //new TsvExporter();
    SUT = new CsvExporter('\t');
    writer = new StringWriter();
    project = new Project();
    engine = new Engine(project);
    options = mock(Properties.class);
}
Also used : Project(com.google.refine.model.Project) StringWriter(java.io.StringWriter) CsvExporter(com.google.refine.exporters.CsvExporter) Properties(java.util.Properties) Engine(com.google.refine.browsing.Engine) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 10 with Project

use of com.google.refine.model.Project in project OpenRefine by OpenRefine.

the class CacheTests 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("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);
    engine = new Engine(project);
    engine_config = new JSONObject(ENGINE_JSON_DUPLICATES);
    //        engine_config.getJSONArray("facets").getJSONObject(0).getJSONArray("selection").put(new JSONArray());
    engine.initializeFromJSON(engine_config);
    engine.setMode(Engine.Mode.RowBased);
    bindings = new Properties();
    bindings.put("project", project);
}
Also used : Project(com.google.refine.model.Project) JSONObject(org.json.JSONObject) Column(com.google.refine.model.Column) ProjectMetadata(com.google.refine.ProjectMetadata) Properties(java.util.Properties) File(java.io.File) Engine(com.google.refine.browsing.Engine) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

Project (com.google.refine.model.Project)146 Properties (java.util.Properties)46 IOException (java.io.IOException)40 Engine (com.google.refine.browsing.Engine)37 Test (org.testng.annotations.Test)37 ServletException (javax.servlet.ServletException)35 ProjectMetadata (com.google.refine.ProjectMetadata)33 BeforeMethod (org.testng.annotations.BeforeMethod)31 Cell (com.google.refine.model.Cell)29 Row (com.google.refine.model.Row)29 RefineTest (com.google.refine.RefineTest)25 Column (com.google.refine.model.Column)25 BeforeTest (org.testng.annotations.BeforeTest)18 Process (com.google.refine.process.Process)17 AbstractOperation (com.google.refine.model.AbstractOperation)14 StringWriter (java.io.StringWriter)13 RowVisitor (com.google.refine.browsing.RowVisitor)11 ArrayList (java.util.ArrayList)11 File (java.io.File)10 WrappedCell (com.google.refine.expr.WrappedCell)9