use of org.knime.testing.data.blob.LargeBlobCell in project knime-core by knime.
the class BlobsInSetCellWorkflowTest method createBDT.
/**
* {@inheritDoc}
*/
@Override
protected BufferedDataTable createBDT(final ExecutionContext exec) {
DataType t = ListCell.getCollectionType(DataType.getType(DataCell.class));
BufferedDataContainer c = exec.createDataContainer(new DataTableSpec(new DataColumnSpecCreator("Sequence", t).createSpec()));
for (int i = 0; i < ROW_COUNT; i++) {
String s = "someName_" + i;
// every other a ordinary string cell
Collection<DataCell> cells = new ArrayList<DataCell>();
for (int j = 0; j < LIST_SIZE * 2; j++) {
String val = "Row_" + i + "; Cell index " + j;
if (j % 2 == 0) {
cells.add(new LargeBlobCell(val, LargeBlobCell.SIZE_OF_CELL));
} else {
cells.add(new StringCell(val));
}
}
ListCell cell = CollectionCellFactory.createListCell(cells);
c.addRowToTable(new DefaultRow(s, cell));
}
c.close();
return c.getTable();
}
use of org.knime.testing.data.blob.LargeBlobCell in project knime-core by knime.
the class BlobReferenceInWorkflowTest method createBDT.
/**
* {@inheritDoc}
*/
@Override
public BufferedDataTable createBDT(final ExecutionContext exec) {
BufferedDataContainer c = exec.createDataContainer(new DataTableSpec(new DataColumnSpecCreator("Blobs", LargeBlobCell.TYPE).createSpec()));
for (int i = 0; i < BLOB_COUNT; i++) {
String s = "someName_" + i;
c.addRowToTable(new DefaultRow(s, new LargeBlobCell(s, LargeBlobCell.SIZE_OF_CELL)));
}
c.close();
return c.getTable();
}
use of org.knime.testing.data.blob.LargeBlobCell in project knime-core by knime.
the class BlobsInSetCellPartiallySingletonsWorkflowTest method createBDT.
/**
* {@inheritDoc}
*/
@Override
protected BufferedDataTable createBDT(final ExecutionContext exec) {
DataType t = ListCell.getCollectionType(DataType.getType(DataCell.class));
BufferedDataContainer c = exec.createDataContainer(new DataTableSpec(new DataColumnSpecCreator("Sequence", t).createSpec()));
LargeBlobCell singleton = new LargeBlobCell("singleton", LargeBlobCell.SIZE_OF_CELL);
for (int i = 0; i < ROW_COUNT; i++) {
String s = "someName_" + i;
// every other a ordinary string cell
Collection<DataCell> cells = new ArrayList<DataCell>();
for (int j = 0; j < 4; j++) {
String val = "Row_" + i + "; Cell index " + j;
switch(j) {
case 0:
cells.add(singleton);
break;
case 1:
case 3:
cells.add(new StringCell(val));
break;
case 2:
cells.add(new LargeBlobCell(val, LargeBlobCell.SIZE_OF_CELL));
break;
default:
fail("invalid index");
}
}
ListCell cell = CollectionCellFactory.createListCell(cells);
c.addRowToTable(new DefaultRow(s, cell));
}
c.close();
return c.getTable();
}
use of org.knime.testing.data.blob.LargeBlobCell in project knime-core by knime.
the class OneBlobManyTimesInTableWorkflowTest method createBDT.
/**
* {@inheritDoc}
*/
@Override
public BufferedDataTable createBDT(final ExecutionContext exec) {
BufferedDataContainer c = exec.createDataContainer(new DataTableSpec(new DataColumnSpecCreator("Blobs", LargeBlobCell.TYPE).createSpec()));
LargeBlobCell cell = new LargeBlobCell("This is a big cell", LargeBlobCell.SIZE_OF_CELL);
for (int i = 0; i < ROW_COUNT; i++) {
String s = "someName_" + i;
c.addRowToTable(new DefaultRow(s, cell));
}
c.close();
return c.getTable();
}
Aggregations