Search in sources :

Example 11 with MemoryMetadataProvider

use of org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider in project hop by apache.

the class TableOutputMetaTest method setUp.

@SuppressWarnings("unchecked")
@Before
public void setUp() {
    variables = mock(IVariables.class);
    databases = mock(List.class);
    metadataProvider = new MemoryMetadataProvider();
}
Also used : MemoryMetadataProvider(org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider) IVariables(org.apache.hop.core.variables.IVariables) Before(org.junit.Before)

Example 12 with MemoryMetadataProvider

use of org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider in project hop by apache.

the class MetadataTestBase method setUp.

@Override
protected void setUp() throws Exception {
    HopClientEnvironment.init();
    PluginRegistry registry = PluginRegistry.getInstance();
    registry.registerPluginType(MetadataPluginType.class);
    registry.registerPluginClass(MetadataType1.class.getName(), MetadataPluginType.class, HopMetadata.class);
    assertNotNull(registry.findPluginWithId(MetadataPluginType.class, "type-1"));
    registry.registerPluginClass(MetadataType2.class.getName(), MetadataPluginType.class, HopMetadata.class);
    assertNotNull(registry.findPluginWithId(MetadataPluginType.class, "type-2"));
    IVariables variables = Variables.getADefaultVariableSpace();
    ITwoWayPasswordEncoder twoWayPasswordEncoder = new HopTwoWayPasswordEncoder();
    provider1 = new MemoryMetadataProvider(twoWayPasswordEncoder, variables);
    provider1.setDescription("Provider1");
    provider2 = new MemoryMetadataProvider(twoWayPasswordEncoder, variables);
    provider2.setDescription("Provider2");
    provider3 = new MemoryMetadataProvider(twoWayPasswordEncoder, variables);
    provider3.setDescription("Provider3");
    List<IHopMetadataProvider> providers = new ArrayList<>(Arrays.asList(provider1, provider2, provider3));
    multiMetadataProvider = new MultiMetadataProvider(twoWayPasswordEncoder, providers, variables);
}
Also used : HopTwoWayPasswordEncoder(org.apache.hop.core.encryption.HopTwoWayPasswordEncoder) ITwoWayPasswordEncoder(org.apache.hop.core.encryption.ITwoWayPasswordEncoder) MemoryMetadataProvider(org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider) IVariables(org.apache.hop.core.variables.IVariables) PluginRegistry(org.apache.hop.core.plugins.PluginRegistry) ArrayList(java.util.ArrayList) IHopMetadataProvider(org.apache.hop.metadata.api.IHopMetadataProvider) MetadataPluginType(org.apache.hop.metadata.plugin.MetadataPluginType)

Example 13 with MemoryMetadataProvider

use of org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider in project hop by apache.

the class AesTwoWayPasswordEncoderTest method testEncodingInMetadata.

@Test
public void testEncodingInMetadata() throws HopException {
    MemoryMetadataProvider metadataProvider = new MemoryMetadataProvider();
    ITwoWayPasswordEncoder twoWayPasswordEncoder = metadataProvider.getTwoWayPasswordEncoder();
    assertNotNull(twoWayPasswordEncoder);
    assertEquals(AesTwoWayPasswordEncoder.class, twoWayPasswordEncoder.getClass());
    // Store something in there...
    // 
    DatabaseMeta databaseMeta = new DatabaseMeta();
    databaseMeta.setName("test");
    databaseMeta.setDatabaseType("None");
    databaseMeta.setUsername("user");
    databaseMeta.setPassword("password");
    IHopMetadataSerializer<DatabaseMeta> serializer = metadataProvider.getSerializer(DatabaseMeta.class);
    serializer.save(databaseMeta);
    String json = new SerializableMetadataProvider(metadataProvider).toJson();
    assertTrue(json.contains("\"password\":\"AES 86lpAqp+Xpa\\/zp6m3SYcFQ==\""));
    databaseMeta.setPassword("${DB_PASSWORD}");
    serializer.save(databaseMeta);
    json = new SerializableMetadataProvider(metadataProvider).toJson();
    assertTrue(json.contains("\"password\":\"${DB_PASSWORD}\""));
}
Also used : MemoryMetadataProvider(org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider) ITwoWayPasswordEncoder(org.apache.hop.core.encryption.ITwoWayPasswordEncoder) SerializableMetadataProvider(org.apache.hop.core.metadata.SerializableMetadataProvider) DatabaseMeta(org.apache.hop.core.database.DatabaseMeta) Test(org.junit.Test)

Example 14 with MemoryMetadataProvider

use of org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider in project hop by apache.

the class HopDiffTest method setUp.

@Before
public void setUp() throws HopException {
    HopClientEnvironment.getInstance().setClient(HopClientEnvironment.ClientType.OTHER);
    HopEnvironment.init();
    metadataProvider = new MemoryMetadataProvider();
}
Also used : MemoryMetadataProvider(org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider) Before(org.junit.Before)

Example 15 with MemoryMetadataProvider

use of org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider in project hop by apache.

the class PipelineMetaTest method setUp.

@Before
public void setUp() throws Exception {
    pipelineMeta = new PipelineMeta();
    variables = new Variables();
    metadataProvider = new MemoryMetadataProvider();
}
Also used : IVariables(org.apache.hop.core.variables.IVariables) Variables(org.apache.hop.core.variables.Variables) MemoryMetadataProvider(org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider) Before(org.junit.Before)

Aggregations

MemoryMetadataProvider (org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider)17 Before (org.junit.Before)6 Test (org.junit.Test)6 BeanInjectionInfo (org.apache.hop.core.injection.bean.BeanInjectionInfo)5 BeanInjector (org.apache.hop.core.injection.bean.BeanInjector)5 RowMetaAndData (org.apache.hop.core.RowMetaAndData)4 IRowMeta (org.apache.hop.core.row.IRowMeta)4 RowMetaBuilder (org.apache.hop.core.row.RowMetaBuilder)4 DatabaseMeta (org.apache.hop.core.database.DatabaseMeta)3 IVariables (org.apache.hop.core.variables.IVariables)3 HopTwoWayPasswordEncoder (org.apache.hop.core.encryption.HopTwoWayPasswordEncoder)2 ITwoWayPasswordEncoder (org.apache.hop.core.encryption.ITwoWayPasswordEncoder)2 IHopMetadataProvider (org.apache.hop.metadata.api.IHopMetadataProvider)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 BeamDirectPipelineEngine (org.apache.hop.beam.engines.direct.BeamDirectPipelineEngine)1 BeamFlinkPipelineEngine (org.apache.hop.beam.engines.flink.BeamFlinkPipelineEngine)1 BeamSparkPipelineEngine (org.apache.hop.beam.engines.spark.BeamSparkPipelineEngine)1 FileDefinition (org.apache.hop.beam.metadata.FileDefinition)1 BeamBQInputMeta (org.apache.hop.beam.transforms.bq.BeamBQInputMeta)1