#815 - ENH: When loading ebean-autotune.xml also look in resources (if not found as file)

This commit is contained in:
Robin Bygrave
2016-08-24 22:19:46 +12:00
parent 2b7c204072
commit 157dfcfeb6
5 changed files with 87 additions and 13 deletions
@@ -0,0 +1,31 @@
package com.avaje.ebeaninternal.server.autotune.service;
import com.avaje.ebeaninternal.server.autotune.model.Autotune;
import org.junit.Test;
import java.io.File;
import java.io.InputStream;
import static org.assertj.core.api.Assertions.assertThat;
public class AutoTuneXmlReaderTest {
@Test
public void read_file() throws Exception {
File testFile = new File("src/test/resources/autotune/test-autotune.xml");
Autotune tuneInfo = AutoTuneXmlReader.read(testFile);
assertThat(tuneInfo.getOrigin()).isNotEmpty();
}
@Test
public void read_inputStream() throws Exception {
InputStream is = getClass().getResourceAsStream("/autotune/test-autotune.xml");
Autotune tuneInfo = AutoTuneXmlReader.read(is);
assertThat(tuneInfo.getOrigin()).isNotEmpty();
}
}