use of org.talend.components.marklogic.tmarklogicinput.MarkLogicInputProperties in project components by Talend.
the class MarkLogicSourceOrSinkTest method testIntegerAvroTypeNotSupported.
@Test(expected = MarkLogicException.class)
public void testIntegerAvroTypeNotSupported() {
MarkLogicInputProperties testInputProperties = new MarkLogicInputProperties("inputProperties");
testInputProperties.init();
Schema bytesSchema = prepareSchema(AvroUtils._int(), null);
testInputProperties.datasetProperties.main.schema.setValue(bytesSchema);
sourceOrSink.checkDocContentTypeSupported(testInputProperties.datasetProperties.main);
}
use of org.talend.components.marklogic.tmarklogicinput.MarkLogicInputProperties in project components by Talend.
the class MarkLogicSourceOrSinkTest method testGetMarkLogicConnectionProperties.
@Test
public void testGetMarkLogicConnectionProperties() {
MarkLogicInputProperties expectedInputProperties = new MarkLogicInputProperties("inputProperties");
expectedInputProperties.init();
sourceOrSink.initialize(null, expectedInputProperties);
MarkLogicConnectionProperties actualConnectionProperties = sourceOrSink.getMarkLogicConnectionProperties();
assertEquals(expectedInputProperties.connection, actualConnectionProperties);
}
use of org.talend.components.marklogic.tmarklogicinput.MarkLogicInputProperties in project components by Talend.
the class MarkLogicSourceOrSinkTest method testDocContentStringTypeSupported.
@Test
public void testDocContentStringTypeSupported() {
MarkLogicInputProperties testInputProperties = new MarkLogicInputProperties("inputProperties");
testInputProperties.init();
Schema stringSchema = prepareSchema(AvroUtils._string(), null);
testInputProperties.inputSchema.schema.setValue(stringSchema);
sourceOrSink.checkDocContentTypeSupported(testInputProperties.datasetProperties.main);
}
use of org.talend.components.marklogic.tmarklogicinput.MarkLogicInputProperties in project components by Talend.
the class MarkLogicSourceOrSinkTest method testIntegerTalendTypeNotSupported.
@Test(expected = MarkLogicException.class)
public void testIntegerTalendTypeNotSupported() {
MarkLogicInputProperties testInputProperties = new MarkLogicInputProperties("inputProperties");
testInputProperties.init();
Schema bytesSchema = prepareSchema(AvroUtils._short(), "id_Integer");
testInputProperties.datasetProperties.main.schema.setValue(bytesSchema);
sourceOrSink.checkDocContentTypeSupported(testInputProperties.datasetProperties.main);
}
use of org.talend.components.marklogic.tmarklogicinput.MarkLogicInputProperties in project components by Talend.
the class MarkLogicSourceOrSinkTest method testValidateCannotConnect.
@Test
public void testValidateCannotConnect() {
DatabaseClient mockedClient = mock(DatabaseClient.class);
when(mockedClient.openTransaction()).thenThrow(new ForbiddenUserException("User not allowed"));
PowerMockito.mockStatic(DatabaseClientFactory.class);
when(DatabaseClientFactory.newClient(anyString(), anyInt(), anyString(), (DatabaseClientFactory.SecurityContext) anyObject())).thenReturn(mockedClient);
MarkLogicInputProperties inputProperties = new MarkLogicInputProperties("inputProperties");
sourceOrSink.initialize(null, inputProperties);
assertEquals(Result.ERROR, sourceOrSink.validate(null).getStatus());
}
Aggregations