use of org.pentaho.di.core.row.value.ValueMetaBinary in project pentaho-kettle by pentaho.
the class VerticaDatabaseMetaIT method testGetOneByteBinaryFieldDefinition.
@Test
public void testGetOneByteBinaryFieldDefinition() {
ValueMetaInterface vm = new ValueMetaBinary("TestFieldBinary", 1, 1);
String expDefaultBinaryField = "VARBINARY(1)";
DatabaseInterface databaseInterface = new VerticaDatabaseMeta();
String defaultBinaryField = databaseInterface.getFieldDefinition(vm, TECHNICAL_KEY_NAME, PRIMARY_KEY_NAME, false, false, false);
String assertMessage = defaultBinaryField + " should be equal to expected " + expDefaultBinaryField;
assertTrue(assertMessage, expDefaultBinaryField.equals(defaultBinaryField));
}
use of org.pentaho.di.core.row.value.ValueMetaBinary in project pentaho-kettle by pentaho.
the class VerticaDatabaseMetaIT method testGetMaximumByteBinaryFieldDefinition.
@Test
public void testGetMaximumByteBinaryFieldDefinition() {
ValueMetaInterface vm = new ValueMetaBinary("TestFieldBinary", 65000, 1);
String expDefaultBinaryField = "VARBINARY(65000)";
DatabaseInterface databaseInterface = new VerticaDatabaseMeta();
String defaultBinaryField = databaseInterface.getFieldDefinition(vm, TECHNICAL_KEY_NAME, PRIMARY_KEY_NAME, false, false, false);
String assertMessage = defaultBinaryField + " should be equal to expected " + expDefaultBinaryField;
assertTrue(assertMessage, expDefaultBinaryField.equals(defaultBinaryField));
}
use of org.pentaho.di.core.row.value.ValueMetaBinary in project pentaho-kettle by pentaho.
the class VerticaDatabaseMetaIT method testGetDefaultBinaryFieldDefinition.
@Test
public void testGetDefaultBinaryFieldDefinition() {
ValueMetaInterface vm = new ValueMetaBinary("TestFieldBinary", -1, 1);
String expDefaultBinaryField = "VARBINARY";
DatabaseInterface databaseInterface = new VerticaDatabaseMeta();
String defaultBinaryField = databaseInterface.getFieldDefinition(vm, TECHNICAL_KEY_NAME, PRIMARY_KEY_NAME, false, false, false);
String assertMessage = defaultBinaryField + " should be equal to expected " + expDefaultBinaryField;
assertTrue(assertMessage, expDefaultBinaryField.equals(defaultBinaryField));
}
use of org.pentaho.di.core.row.value.ValueMetaBinary in project pentaho-kettle by pentaho.
the class JaninoStepIT method createRowMetaInterface.
public RowMetaInterface createRowMetaInterface() {
RowMetaInterface rm = new RowMeta();
ValueMetaInterface[] valuesMeta = { new ValueMetaString("string"), new ValueMetaInteger("integer"), new ValueMetaNumber("number"), new ValueMetaBigNumber("bigdecimal"), new ValueMetaDate("date"), new ValueMetaBinary("binary"), new ValueMetaBoolean("bool"), new ValueMetaTimestamp("timestamp"), new ValueMetaInternetAddress("inetaddress") };
for (int i = 0; i < valuesMeta.length; i++) {
rm.addValueMeta(valuesMeta[i]);
}
return rm;
}
use of org.pentaho.di.core.row.value.ValueMetaBinary in project pentaho-kettle by pentaho.
the class CheckSumTest method testHexOutput_sha1_compatibilityMode.
@Test
public void testHexOutput_sha1_compatibilityMode() throws Exception {
MockRowListener results = executeHexTest(3, true, "xyz", new ValueMetaString("test"), false);
assertEquals(1, results.getWritten().size());
assertEquals("66FD7417FD7E024C46526C2F6D35FD754FFD52FD", results.getWritten().get(0)[1]);
results = executeHexTest(3, true, 10.8, new ValueMetaNumber("test"), false);
assertEquals(1, results.getWritten().size());
assertEquals("78FDFD3DFDFDE80656FD0AFD5AFDFD10FDFD68", results.getWritten().get(0)[1]);
results = executeHexTest(3, true, 10.82, new ValueMetaNumber("test"), false);
assertEquals(1, results.getWritten().size());
assertEquals("74FD3D4C2DFD7CFD31FD563A72FD5DFD461F04FD", results.getWritten().get(0)[1]);
byte[] input = IOUtils.toByteArray(getFile("/org/pentaho/di/trans/steps/loadfileinput/files/pentaho_splash.png").getContent().getInputStream());
results = executeHexTest(3, true, input, new ValueMetaBinary("test"), false);
assertEquals(1, results.getWritten().size());
assertEquals("FD7D0B5B60663BFD5E0DFDFD3B44FD673738315A", results.getWritten().get(0)[1]);
}
Aggregations