use of net.morimekta.providence.reflect.util.ProgramTypeRegistry in project providence by morimekta.
the class TypeLoaderTest method testLoadServices.
@Test
public void testLoadServices() throws IOException {
copyResourceTo("/parser/tests/service2.thrift", temp.getRoot());
File service = copyResourceTo("/parser/tests/service.thrift", temp.getRoot());
TypeLoader loader = new TypeLoader(ImmutableList.of());
ProgramTypeRegistry reg = loader.load(service);
assertThat(loader.loadedPrograms(), hasSize(2));
assertThat(reg.getLocalProgramContext(), is("service"));
ProgramTypeRegistry rep = loader.load(service);
assertThat(loader.loadedPrograms(), hasSize(2));
assertThat(rep, sameInstance(reg));
}
Aggregations