Search in sources :

Example 1 with I18nMessages

use of org.talend.daikon.i18n.I18nMessages in project components by Talend.

the class SnowflakeConstantsTest method testI18NConstants.

@Test
public void testI18NConstants() {
    I18nMessages i18nMessages = GlobalI18N.getI18nMessageProvider().getI18nMessages(SnowflakeConstants.class);
    String incorrectSnowflakeAccoutMessage = i18nMessages.getMessage("error.incorrectAccount");
    String connectionSuccessfullMessage = i18nMessages.getMessage("messages.success");
    assertFalse(incorrectSnowflakeAccoutMessage.equals("error.incorrectAccount"));
    assertFalse(connectionSuccessfullMessage.equals("messages.success"));
}
Also used : I18nMessages(org.talend.daikon.i18n.I18nMessages) Test(org.junit.Test)

Example 2 with I18nMessages

use of org.talend.daikon.i18n.I18nMessages in project components by Talend.

the class SnowflakeSourceOrSinkTest method testI18NMessages.

@Test
public void testI18NMessages() {
    I18nMessages i18nMessages = GlobalI18N.getI18nMessageProvider().getI18nMessages(SnowflakeSourceOrSink.class);
    String errorDuringSearchingTable = i18nMessages.getMessage("error.searchingTable");
    String tableNotFoundMessage = i18nMessages.getMessage("error.tableNotFound");
    String requiredPropertyIsEmptyMessage = i18nMessages.getMessage("error.requiredPropertyIsEmpty");
    assertFalse(errorDuringSearchingTable.equals("error.searchingTable"));
    assertFalse(tableNotFoundMessage.equals("error.tableNotFound"));
    assertFalse(requiredPropertyIsEmptyMessage.equals("error.requiredPropertyIsEmpty"));
}
Also used : I18nMessages(org.talend.daikon.i18n.I18nMessages) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 3 with I18nMessages

use of org.talend.daikon.i18n.I18nMessages in project components by Talend.

the class SnowflakeConnectionPropertiesTest method testI18NMessage.

@Test
public void testI18NMessage() {
    I18nMessages i18nMessages = GlobalI18N.getI18nMessageProvider().getI18nMessages(SnowflakeConnectionProperties.class);
    String connectionSuccessMessage = i18nMessages.getMessage("messages.connectionSuccessful");
    Assert.assertFalse(connectionSuccessMessage.equals("messages.connectionSuccessful"));
}
Also used : I18nMessages(org.talend.daikon.i18n.I18nMessages) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 4 with I18nMessages

use of org.talend.daikon.i18n.I18nMessages in project components by Talend.

the class ComponentServiceTest method testGetSchema.

@Test
public void testGetSchema() {
    TestComponentProperties componentProperties = (TestComponentProperties) getComponentService().getComponentProperties(TestComponentDefinition.COMPONENT_NAME);
    Schema aSchema = SchemaBuilder.builder().booleanType();
    componentProperties.mainOutput.setValue(aSchema);
    Schema schema = getComponentService().getSchema(componentProperties, componentProperties.getAllConnectors().iterator().next(), true);
    assertEquals(aSchema, schema);
    schema = getComponentService().getSchema(componentProperties, new Connector() {

        @Override
        public String getDisplayName() {
            return null;
        }

        @Override
        public String getTitle() {
            return null;
        }

        @Override
        public void setI18nMessageFormatter(I18nMessages i18nMessages) {
        }

        @Override
        public String getI18nMessage(String key, Object... arguments) {
            return null;
        }

        @Override
        public String getName() {
            return "foo";
        }
    }, true);
    assertNull(schema);
}
Also used : Connector(org.talend.components.api.component.Connector) TestComponentProperties(org.talend.components.api.service.common.testcomponent.TestComponentProperties) Schema(org.apache.avro.Schema) I18nMessages(org.talend.daikon.i18n.I18nMessages) Test(org.junit.Test) AbstractComponentTest(org.talend.components.api.test.AbstractComponentTest)

Example 5 with I18nMessages

use of org.talend.daikon.i18n.I18nMessages in project components by Talend.

the class MarkLogicBulkLoadTest method testI18N.

@Test
public void testI18N() {
    I18nMessages i18nMessages = GlobalI18N.getI18nMessageProvider().getI18nMessages(MarkLogicBulkLoad.class);
    assertFalse(i18nMessages.getMessage("messages.debug.command").equals("messages.debug.command"));
    assertFalse(i18nMessages.getMessage("messages.info.startBulkLoad").equals("messages.info.startBulkLoad"));
    assertFalse(i18nMessages.getMessage("messages.info.finishBulkLoad").equals("messages.info.finishBulkLoad"));
}
Also used : I18nMessages(org.talend.daikon.i18n.I18nMessages) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

Test (org.junit.Test)7 I18nMessages (org.talend.daikon.i18n.I18nMessages)7 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)4 Schema (org.apache.avro.Schema)1 Connector (org.talend.components.api.component.Connector)1 TestComponentProperties (org.talend.components.api.service.common.testcomponent.TestComponentProperties)1 AbstractComponentTest (org.talend.components.api.test.AbstractComponentTest)1