@Test
public void testWriteCommand() throws URISyntaxException, IOException {

	URL resource = this.getClass().getResource("/de/prob/testmachines/b/scheduler.mch");
	assertNotNull(resource);
	File f =  new File(resource.toURI());
	StructuredPrologOutput prologTermOutput = new StructuredPrologOutput();
	ClassicalBFactory factory = new ClassicalBFactory(null);
	BParser bparser = new BParser();
	Start ast = factory.parseFile(f, bparser);
	RecursiveMachineLoader rml = factory.parseAllMachines(ast,
			f.getParent(), f, bparser.getContentProvider(), bparser);
	LoadBProjectCommand command = new LoadBProjectCommand(rml, f);
	command.writeCommand(prologTermOutput);
	prologTermOutput.fullstop().flush();
	Collection<PrologTerm> sentences = prologTermOutput.getSentences();
	PrologTerm next = sentences.iterator().next();
	assertNotNull(next);
	assertTrue(next instanceof CompoundPrologTerm);
	CompoundPrologTerm t = (CompoundPrologTerm) next;
	assertEquals("load_classical_b_from_list_of_facts", t.getFunctor());
	assertEquals(2, t.getArity());
	PrologTerm argument = t.getArgument(2);
	assertTrue(argument.isList());
}