FileDefinition { public void setFileType( int fileType ) { if( fileType != GRAPH && fileType != INSTANCE && fileType != AGGREGATOR && fileType != EMPTY ) throw new IllegalArgumentException( "The file type was expected to be GRAPH, INSTANCE, AGGREGATOR or EMPTY." ); this.fileType = fileType; } 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 testSetFileType_1() { FileDefinition def = new FileDefinition( new File( "toto.txt" )); def.setFileType( FileDefinition.INSTANCE ); }
@Test public void testSetFileType_2() { FileDefinition def = new FileDefinition( new File( "toto.txt" )); def.setFileType( FileDefinition.GRAPH ); }
@Test public void testSetFileType_3() { FileDefinition def = new FileDefinition( new File( "toto.txt" )); def.setFileType( FileDefinition.AGGREGATOR ); }
@Test( expected = IllegalArgumentException.class ) public void testSetFileType_4() { FileDefinition def = new FileDefinition( new File( "toto.txt" )); def.setFileType( FileDefinition.UNDETERMINED ); }
@Test( expected = IllegalArgumentException.class ) public void testSetFileType_5() { FileDefinition def = new FileDefinition( new File( "toto.txt" )); def.setFileType( 87 ); }