Search in sources :

Example 21 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 22 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)22 Project (com.google.refine.model.Project)16 Properties (java.util.Properties)10 BeforeMethod (org.testng.annotations.BeforeMethod)9 File (java.io.File)7 JSONObject (org.json.JSONObject)6 Engine (com.google.refine.browsing.Engine)5 Column (com.google.refine.model.Column)4 ProjectManagerStub (com.google.refine.tests.ProjectManagerStub)4 IOException (java.io.IOException)4 ServletException (javax.servlet.ServletException)3 JSONException (org.json.JSONException)3 Cell (com.google.refine.model.Cell)2 Row (com.google.refine.model.Row)2 RefineServletStub (com.google.refine.tests.RefineServletStub)2 StringWriter (java.io.StringWriter)2 JSONWriter (org.json.JSONWriter)2 BeforeTest (org.testng.annotations.BeforeTest)2 Test (org.testng.annotations.Test)2 AuthenticationException (com.google.gdata.util.AuthenticationException)1