use of org.talend.components.azurestorage.table.tazurestorageoutputtable.TAzureStorageOutputTableProperties in project components by Talend.
the class AzureStorageTableComponentsTest method getAllSchemaPropertiesConnectors.
@Test
public void getAllSchemaPropertiesConnectors() {
TAzureStorageOutputTableProperties p = new TAzureStorageOutputTableProperties("test");
assertTrue(p.getAllSchemaPropertiesConnectors(true).isEmpty());
HashSet<PropertyPathConnector> connectors = new HashSet<>();
connectors.add(p.MAIN_CONNECTOR);
assertEquals(connectors, p.getAllSchemaPropertiesConnectors(false));
}
use of org.talend.components.azurestorage.table.tazurestorageoutputtable.TAzureStorageOutputTableProperties in project components by Talend.
the class AzureStorageTableWriterTest method setUp.
@Before
public void setUp() throws Exception {
container = new RuntimeContainerMock();
sink = new AzureStorageTableSink();
properties = new TAzureStorageOutputTableProperties(PROP_ + "InputTable");
properties.setupProperties();
// valid fake connection
properties.connection = new TAzureStorageConnectionProperties(PROP_ + "Connection");
properties.connection.protocol.setValue(Protocol.HTTP);
properties.connection.accountName.setValue("fakeAccountName");
properties.connection.accountKey.setValue("fakeAccountKey=ANBHFYRJJFHRIKKJFU");
properties.dieOnError.setValue(false);
properties.tableName.setValue(TableHelper.generateRandomTableName());
properties.actionOnTable.setValue(ActionOnTable.Create_table_if_does_not_exist);
properties.actionOnData.setValue(ActionOnData.Insert);
properties.schema.schema.setValue(TableHelper.getWriteSchema());
properties.schemaReject.schema.setValue(TableHelper.getRejectSchema());
properties.partitionKey.setStoredValue("PartitionKey");
properties.rowKey.setStoredValue("RowKey");
}
use of org.talend.components.azurestorage.table.tazurestorageoutputtable.TAzureStorageOutputTableProperties in project components by Talend.
the class TAzureStorageInputTableTestIT method createSampleDataset.
public void createSampleDataset(String table) throws Throwable {
tableClient.getTableReference(table).createIfNotExists();
TAzureStorageOutputTableProperties props = new TAzureStorageOutputTableProperties("tests");
props = (TAzureStorageOutputTableProperties) setupConnectionProperties(props);
props.setupProperties();
props.schema.schema.setValue(getDynamicSchema());
props.actionOnTable.setValue(ActionOnTable.Default);
props.actionOnData.setValue(ActionOnData.Insert);
props.schemaListener.afterSchema();
props.tableName.setValue(table);
Writer<?> writer = createWriter(props);
writer.open("test-uid");
for (String p : partitions) {
for (String r : rows) {
IndexedRecord entity = new GenericData.Record(getWriteSchema());
entity.put(0, p);
entity.put(1, r);
entity.put(2, RandomStringUtils.random(50));
entity.put(3, RandomStringUtils.randomNumeric(10));
writer.write(entity);
}
}
writer.close();
}
use of org.talend.components.azurestorage.table.tazurestorageoutputtable.TAzureStorageOutputTableProperties in project components by Talend.
the class AzureStorageTableSinkTest method setUp.
@Before
public void setUp() throws Exception {
sink = new AzureStorageTableSink();
p = new TAzureStorageOutputTableProperties("test");
p.connection.setupProperties();
p.setupProperties();
sink.initialize(null, p);
}
use of org.talend.components.azurestorage.table.tazurestorageoutputtable.TAzureStorageOutputTableProperties in project components by Talend.
the class AzureStorageTableWriteOperationTest method setUp.
@Before
public void setUp() throws Exception {
container = new RuntimeContainerMock();
sink = new AzureStorageTableSink();
properties = new TAzureStorageOutputTableProperties(PROP_ + "InputTable");
properties.setupProperties();
// valid fake connection
properties.connection = new TAzureStorageConnectionProperties(PROP_ + "Connection");
properties.connection.protocol.setValue(Protocol.HTTP);
properties.connection.accountName.setValue("fakeAccountName");
properties.connection.accountKey.setValue("fakeAccountKey=ANBHFYRJJFHRIKKJFU");
properties.dieOnError.setValue(false);
properties.tableName.setValue("testtable");
properties.actionOnTable.setValue(ActionOnTable.Create_table_if_does_not_exist);
properties.actionOnData.setValue(ActionOnData.Insert);
properties.schema.schema.setValue(TableHelper.getWriteSchema());
properties.schemaReject.schema.setValue(TableHelper.getRejectSchema());
properties.partitionKey.setStoredValue("PartitionKey");
properties.rowKey.setStoredValue("RowKey");
}
Aggregations