FileDefinitionParser { int recognizeComponent( String line, BufferedReader br ) throws IOException { int result = P_CODE_NO; String alteredLine = line.trim().toLowerCase(); if( ! alteredLine.isEmpty() && ! alteredLine.startsWith( String.valueOf( ParsingConstants.COMMENT_DELIMITER )) && ! startsWith( alteredLine, ParsingConstants.KEYWORD_FACET ) && ! startsWith( alteredLine, ParsingConstants.KEYWORD_INSTANCE_OF ) && ! startsWith( alteredLine, ParsingConstants.KEYWORD_IMPORT )) result = recognizePropertiesHolder( line, br, new BlockComponent( this.definitionFile )); return result; } FileDefinitionParser( File relationsFile, boolean ignoreComments ); FileDefinition read();  }
@Test public void testRecognizeComponent() throws Exception { Map<String,ParsingError> resourceNameToErrorCode = new LinkedHashMap<> (); resourceNameToErrorCode.put( "component-invalid-property.graph", new ParsingError( ErrorCode.P_INVALID_PROPERTY, null, 2 )); resourceNameToErrorCode.put( "component-invalid-end.graph", new ParsingError( ErrorCode.P_C_C_BRACKET_EXTRA_CHARACTERS, null, 3 )); resourceNameToErrorCode.put( "component-missing-closing-cb.graph", new ParsingError( ErrorCode.P_C_C_BRACKET_MISSING, null, 3 )); resourceNameToErrorCode.put( "component-missing-opening-cb.graph", new ParsingError( ErrorCode.P_O_C_BRACKET_MISSING, null, 1 )); resourceNameToErrorCode.put( "component-extra-char.graph", new ParsingError( ErrorCode.P_O_C_BRACKET_EXTRA_CHARACTERS, null, 1 )); resourceNameToErrorCode.put( "component-line-number.graph", new ParsingError( ErrorCode.P_C_C_BRACKET_MISSING, null, 6 )); testRecognizePropertiesHolder( resourceNameToErrorCode, AbstractBlock.COMPONENT ); }