use of com.google.refine.ProjectMetadata in project OpenRefine by OpenRefine.
the class XlsExporterTests method SetUp.
@BeforeMethod
public void SetUp() {
SUT = new XlsExporter(false);
stream = new ByteArrayOutputStream();
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);
}
use of com.google.refine.ProjectMetadata in project OpenRefine by OpenRefine.
the class BooleanTests 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 HistoryTests method canAddEntry.
@Test
public void canAddEntry() {
//local dependencies
HistoryEntry entry = mock(HistoryEntry.class);
Project project = mock(Project.class);
ProjectMetadata projectMetadata = mock(ProjectMetadata.class);
when(projectManager.getProject(Mockito.anyLong())).thenReturn(project);
when(projectManager.getProjectMetadata(Mockito.anyLong())).thenReturn(projectMetadata);
SUT.addEntry(entry);
verify(projectManager, times(1)).getProject(Mockito.anyLong());
verify(entry, times(1)).apply(project);
verify(projectMetadata, times(1)).updateModified();
Assert.assertEquals(SUT.getLastPastEntries(1).get(0), entry);
}
use of com.google.refine.ProjectMetadata 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);
}
use of com.google.refine.ProjectMetadata 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);
}
Aggregations