Search in sources :

Example 11 with MarkLogicConnectionProperties

use of org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionProperties in project components by Talend.

the class MarkLogicInputPropertiesTest method testGetConnectionProperties.

@Test
public void testGetConnectionProperties() {
    MarkLogicConnectionProperties connectionProperties = new MarkLogicConnectionProperties("connectionProperties");
    connectionProperties.init();
    testInputProperties.init();
    testInputProperties.connection.referencedComponent.setReference(connectionProperties);
    assertEquals(connectionProperties, testInputProperties.getConnectionProperties());
}
Also used : MarkLogicConnectionProperties(org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionProperties) Test(org.junit.Test) MarkLogicConnectionPropertiesTest(org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionPropertiesTest)

Example 12 with MarkLogicConnectionProperties

use of org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionProperties in project components by Talend.

the class MarkLogicOutputPropertiesTest method testGetConnectionProperties.

@Test
public void testGetConnectionProperties() {
    MarkLogicConnectionProperties connectionProperties = new MarkLogicConnectionProperties("connectionProperties");
    connectionProperties.init();
    testOutputProperties.init();
    testOutputProperties.connection.referencedComponent.setReference(connectionProperties);
    assertEquals(connectionProperties, testOutputProperties.getConnectionProperties());
}
Also used : MarkLogicConnectionProperties(org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionProperties) Test(org.junit.Test) MarkLogicConnectionPropertiesTest(org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionPropertiesTest)

Example 13 with MarkLogicConnectionProperties

use of org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionProperties in project components by Talend.

the class MarkLogicOutputPropertiesTest method testUseExistedConnectionHideConnectionWidget.

@Test
public void testUseExistedConnectionHideConnectionWidget() {
    MarkLogicConnectionProperties someConnection = new MarkLogicConnectionProperties("connection");
    testOutputProperties.init();
    someConnection.init();
    testOutputProperties.connection.referencedComponent.setReference(someConnection);
    testOutputProperties.connection.referencedComponent.componentInstanceId.setValue(MarkLogicConnectionDefinition.COMPONENT_NAME + "_1");
    testOutputProperties.refreshLayout(testOutputProperties.getForm(Form.MAIN));
    boolean isConnectionHostPropertyHidden = testOutputProperties.connection.getForm(Form.MAIN).getWidget(testOutputProperties.connection.host).isHidden();
    boolean isConnectionPortPropertyHidden = testOutputProperties.connection.getForm(Form.MAIN).getWidget(testOutputProperties.connection.port).isHidden();
    boolean isUserNameHidden = testOutputProperties.connection.getForm(Form.MAIN).getWidget(testOutputProperties.connection.username).isHidden();
    boolean isPasswordHidden = testOutputProperties.connection.getForm(Form.MAIN).getWidget(testOutputProperties.connection.password).isHidden();
    boolean isConnectionDatabasePropertyHidden = testOutputProperties.connection.getForm(Form.MAIN).getWidget(testOutputProperties.connection.database).isHidden();
    assertTrue(isConnectionHostPropertyHidden);
    assertTrue(isConnectionPortPropertyHidden);
    assertTrue(isUserNameHidden);
    assertTrue(isPasswordHidden);
    assertTrue(isConnectionDatabasePropertyHidden);
}
Also used : MarkLogicConnectionProperties(org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionProperties) Test(org.junit.Test) MarkLogicConnectionPropertiesTest(org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionPropertiesTest)

Example 14 with MarkLogicConnectionProperties

use of org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionProperties in project components by Talend.

the class MarkLogicDataSourceTest method setup.

@Before
public void setup() {
    datasource = new MarkLogicDataSource();
    datastore = new MarkLogicConnectionProperties("datastore");
    datastore.init();
    MarkLogicDatasetProperties dataset = new MarkLogicDatasetProperties("dataset");
    dataset.setDatastoreProperties(datastore);
    dataset.init();
    datasource.initialize(null, dataset);
}
Also used : MarkLogicConnectionProperties(org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionProperties) Before(org.junit.Before)

Example 15 with MarkLogicConnectionProperties

use of org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionProperties in project components by Talend.

the class MarkLogicDatastoreRuntimeTest method setup.

@Before
public void setup() {
    datastoreRuntime = new MarkLogicDatastoreRuntime();
    MarkLogicConnectionProperties datastore = new MarkLogicConnectionProperties("datastore");
    datastore.referencedComponent.componentInstanceId.setValue("reference");
    datastoreRuntime.initialize(null, datastore);
}
Also used : MarkLogicConnectionProperties(org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionProperties) Before(org.junit.Before)

Aggregations

MarkLogicConnectionProperties (org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionProperties)17 Test (org.junit.Test)8 Before (org.junit.Before)7 DatabaseClient (com.marklogic.client.DatabaseClient)4 MarkLogicConnectionPropertiesTest (org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionPropertiesTest)4 RuntimeContainer (org.talend.components.api.container.RuntimeContainer)3 MarkLogicBulkLoadProperties (org.talend.components.marklogic.tmarklogicbulkload.MarkLogicBulkLoadProperties)3 SecurityContext (com.marklogic.client.DatabaseClientFactory.SecurityContext)2 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)2 MarkLogicInputProperties (org.talend.components.marklogic.tmarklogicinput.MarkLogicInputProperties)2 DatabaseClientFactory (com.marklogic.client.DatabaseClientFactory)1 GenericDocumentManager (com.marklogic.client.document.GenericDocumentManager)1 SearchHandle (com.marklogic.client.io.SearchHandle)1 MatchDocumentSummary (com.marklogic.client.query.MatchDocumentSummary)1 QueryManager (com.marklogic.client.query.QueryManager)1 StringQueryDefinition (com.marklogic.client.query.StringQueryDefinition)1 IndexedRecord (org.apache.avro.generic.IndexedRecord)1 MarkLogicErrorCode (org.talend.components.marklogic.exceptions.MarkLogicErrorCode)1 MarkLogicException (org.talend.components.marklogic.exceptions.MarkLogicException)1 ValidationResult (org.talend.daikon.properties.ValidationResult)1