mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#815 - ENH: When loading ebean-autotune.xml also look in resources (if not found as file)
This commit is contained in:
+31
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user