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();
}
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);
}
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}\""));
}
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();
}
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();
}
Aggregations