Now with file-based level grammar.

This commit is contained in:
Woody Folsom
2012-03-18 10:56:25 -04:00
parent b431d5efeb
commit d6516388ad
8 changed files with 234 additions and 9 deletions

View File

@@ -0,0 +1,25 @@
package dk.itu.mario.level.grammar;
import static org.junit.Assert.assertNotNull;
import java.io.File;
import org.junit.Test;
public class LevelGrammarFactoryTest {
@Test
public void testCreateGrammar() {
LevelGrammar levelGrammar = LevelGrammarFactory.createGrammar();
assertNotNull(levelGrammar);
System.out.println(levelGrammar.toString());
}
@Test
public void testReadFile() throws Exception {
File grammarFile = new File("grammars/overland.grm");
LevelGrammar levelGrammar = LevelGrammarFactory.createGrammar(grammarFile);
assertNotNull(levelGrammar);
System.out.println("Read Grammar from file:");
System.out.println(levelGrammar.toString());
}
}