Search in sources :

Example 46 with ProjectMetadata

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);
}
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)

Example 47 with ProjectMetadata

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);
}
Also used : Project(com.google.refine.model.Project) ProjectMetadata(com.google.refine.ProjectMetadata) File(java.io.File) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

ProjectMetadata (com.google.refine.ProjectMetadata)47 Project (com.google.refine.model.Project)33 BeforeMethod (org.testng.annotations.BeforeMethod)20 Properties (java.util.Properties)14 File (java.io.File)12 Engine (com.google.refine.browsing.Engine)10 IOException (java.io.IOException)9 ServletException (javax.servlet.ServletException)7 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)6 Test (org.testng.annotations.Test)6 ProjectManagerStub (com.google.refine.ProjectManagerStub)5 StringWriter (java.io.StringWriter)5 JSONObject (org.json.JSONObject)5 ImportingJob (com.google.refine.importing.ImportingJob)4 Column (com.google.refine.model.Column)4 ProjectManagerStub (com.google.refine.tests.ProjectManagerStub)4 SeparatorBasedImporter (com.google.refine.importers.SeparatorBasedImporter)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 BeforeTest (org.testng.annotations.BeforeTest)3 ProjectManager (com.google.refine.ProjectManager)2