LoadParser extends SingleParser<T> { @Override protected void parse(T type) { var load = environment.resolver.any(type, Load.class); var mapping = environment.mappings; mapping.put("load", load.during().toString()); check(type, load.before()); mapping.put("loadbefore", load.before()); check(type, load.optionallyAfter()); mapping.put("softdepend", load.optionallyAfter()); check(type, load.after()); mapping.put("depend", load.after()); } LoadParser(Environment<T> environment);   }
@Test void parse() { parser.parse(LoadParserTest.class); var mappings = environment.mappings; assertEquals(4, mappings.size()); assertEquals("STARTUP", mappings.get("load")); assertArrayEquals(new String[] {"a"}, (String[]) mappings.get("loadbefore")); assertArrayEquals(new String[] {"b"}, (String[]) mappings.get("softdepend")); assertArrayEquals(new String[] {"c"}, (String[]) mappings.get("depend")); }
@Test void parse_empty() { parser.parse(Empty.class); var mappings = environment.mappings; assertEquals(4, mappings.size()); assertEquals("POSTWORLD", mappings.get("load")); assertArrayEquals(EMPTY, (String[]) mappings.get("loadbefore")); assertArrayEquals(EMPTY, (String[]) mappings.get("softdepend")); assertArrayEquals(EMPTY, (String[]) mappings.get("depend")); }