FileDefinition { public static String fileTypeAsString( int fileType ) { String result; switch( fileType ) { case AGGREGATOR: result = "aggregator"; break; case GRAPH: result = "graph"; break; case INSTANCE: result = "intsnace"; break; case UNDETERMINED: result = "undetermined"; break; default: result = "unknown"; break; } return result; } FileDefinition( File editedFile ); void setEditedFile( File editedFile ); File getEditedFile(); List<ParsingError> getParsingErrors(); List<AbstractBlock> getBlocks(); int getFileType(); void setFileType( int fileType ); @Override String toString(); static String fileTypeAsString( int fileType ); static final int UNDETERMINED; static final int GRAPH; static final int INSTANCE; static final int AGGREGATOR; static final int EMPTY; }
@Test public void testFileTypeAsString() { Assert.assertNotSame( "unknown", FileDefinition.fileTypeAsString( FileDefinition.AGGREGATOR )); Assert.assertNotSame( "unknown", FileDefinition.fileTypeAsString( FileDefinition.GRAPH )); Assert.assertNotSame( "unknown", FileDefinition.fileTypeAsString( FileDefinition.INSTANCE )); Assert.assertNotSame( "unknown", FileDefinition.fileTypeAsString( FileDefinition.UNDETERMINED )); Assert.assertEquals( "unknown", FileDefinition.fileTypeAsString( 54 )); }