예제 #1
0
 @Test
 public void writeAndReadConfiguration() {
   Plumber plumber = Plumber.createWithDefaultPath();
   Pipeline origin = PipelineTest.getJDBCPipeline();
   plumber.intoConfiguration(origin);
   Pipeline deserialized = plumber.fromConfiguration(origin.getName());
   assertNotSame(deserialized, origin);
   assertThat(deserialized, is(origin));
 }
예제 #2
0
  @Test
  public void readConfigurationFromInputStream() throws FileNotFoundException {
    Plumber output = Plumber.createWithDefaultPath();
    Pipeline origin = PipelineTest.getJDBCPipeline();
    output.intoConfiguration(origin);

    Plumber input = Plumber.createWithoutPath();
    Reader reader = new FileReader("./config/" + origin.getName() + ".xml");
    Pipeline deserialized = input.fromInputStream(reader);
    assertNotSame(deserialized, origin);
    assertThat(deserialized, is(origin));
  }