Search in sources :

Example 1 with RefineServletStub

use of com.google.refine.RefineServletStub in project OpenRefine by OpenRefine.

the class KeyValueColumnizeTests method SetUp.

@BeforeMethod
public void SetUp() throws IOException, ModelException {
    servlet = new RefineServletStub();
    File dir = TestUtils.createTempDirectory("openrefine-test-workspace-dir");
    FileProjectManager.initialize(dir);
    project = new Project();
    pm = new ProjectMetadata();
    pm.setName("KeyValueColumnize test");
    ProjectManager.singleton.registerProject(project, pm);
    options = mock(ObjectNode.class);
    OperationRegistry.registerOperation(getCoreModule(), "key-value-columnize", KeyValueColumnizeOperation.class);
    ImportingManager.initialize(servlet);
    job = ImportingManager.createJob();
    importer = new SeparatorBasedImporter();
}
Also used : Project(com.google.refine.model.Project) RefineServletStub(com.google.refine.RefineServletStub) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ProjectMetadata(com.google.refine.ProjectMetadata) SeparatorBasedImporter(com.google.refine.importers.SeparatorBasedImporter) File(java.io.File) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with RefineServletStub

use of com.google.refine.RefineServletStub in project OpenRefine by OpenRefine.

the class WikidataRefineTest method initServlet.

@BeforeMethod(alwaysRun = true)
public void initServlet() {
    servlet = new RefineServletStub();
    ProjectManager.singleton = new ProjectManagerStub();
    ImportingManager.initialize(servlet);
}
Also used : ProjectManagerStub(com.google.refine.ProjectManagerStub) RefineServletStub(com.google.refine.RefineServletStub) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 3 with RefineServletStub

use of com.google.refine.RefineServletStub 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();
    ImportingJob spiedJob = ImportingManager.createJob();
    job = Mockito.spy(spiedJob);
    when(job.getRetrievalRecord()).thenReturn(ParsingUtilities.mapper.createObjectNode());
    options = Mockito.mock(ObjectNode.class);
}
Also used : Project(com.google.refine.model.Project) RefineServletStub(com.google.refine.RefineServletStub) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ProjectMetadata(com.google.refine.ProjectMetadata) ImportingJob(com.google.refine.importing.ImportingJob)

Aggregations

RefineServletStub (com.google.refine.RefineServletStub)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2 ProjectMetadata (com.google.refine.ProjectMetadata)2 Project (com.google.refine.model.Project)2 BeforeMethod (org.testng.annotations.BeforeMethod)2 ProjectManagerStub (com.google.refine.ProjectManagerStub)1 SeparatorBasedImporter (com.google.refine.importers.SeparatorBasedImporter)1 ImportingJob (com.google.refine.importing.ImportingJob)1 File (java.io.File)1