test_class.file: alien4cloud-tosca/src/test/java/alien4cloud/tosca/parser/impl/base/ReferencedParserTest.java
test_class.identifier: ReferencedParserTest
test_case.body: @Test
      public void referenceToMissingTypeShouldFail() {
          ReferencedParser referencedParser = new ReferencedParser("missingParser");
          ParsingContextExecution contextExecution = new ParsingContextExecution();
          try {
              contextExecution.init();
              contextExecution.setRegistry(Maps.newHashMap());
              Node node = Mockito.mock(Node.class);
              Mockito.when(node.getStartMark()).thenReturn(new Mark("name", 0, 10, 10, "", 0));
              Mockito.when(node.getEndMark()).thenReturn(new Mark("name", 0, 10, 10, "", 0));
              referencedParser.parse(node, contextExecution);
              assertEquals(ParsingErrorLevel.ERROR, contextExecution.getParsingErrors().get(0).getErrorLevel());
              assertEquals(ErrorCode.ALIEN_MAPPING_ERROR, contextExecution.getParsingErrors().get(0).getErrorCode());
          } finally {
              ParsingContextExecution.destroy();
          }
      }
test_case.class_method_signature: ReferencedParserTest.referenceToMissingTypeShouldFail()
test_case.full_signature: @Test public void referenceToMissingTypeShouldFail()
test_case.identifier: referenceToMissingTypeShouldFail
test_case.invocations: init setRegistry newHashMap mock thenReturn when getStartMark thenReturn when getEndMark parse assertEquals getErrorLevel get getParsingErrors assertEquals getErrorCode get getParsingErrors destroy
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void referenceToMissingTypeShouldFail()
focal_class.declarator: typeName
focal_class.modifier: private
focal_class.original_string: private String typeName;
focal_class.type: String
focal_class.var_name: typeName
focal_class.file: alien4cloud-tosca/src/main/java/alien4cloud/tosca/parser/impl/base/ReferencedParser.java
focal_class.identifier: ReferencedParser
focal_class.interfaces: implements INodeParser<T>
focal_class.class_method_signature: ReferencedParser.ReferencedParser(String typeName)
focal_class.full_signature: public  ReferencedParser(String typeName)
focal_class.identifier: ReferencedParser
focal_class.modifiers: public
focal_class.parameters: (String typeName)
focal_class.signature:  ReferencedParser(String typeName)
focal_class.class_method_signature: ReferencedParser.parse(Node node, ParsingContextExecution context)
focal_class.full_signature: @Override public T parse(Node node, ParsingContextExecution context)
focal_class.identifier: parse
focal_class.modifiers: @Override public
focal_class.parameters: (Node node, ParsingContextExecution context)
focal_class.return: T
focal_class.signature: T parse(Node node, ParsingContextExecution context)
focal_method.body: @Override
      public T parse(Node node, ParsingContextExecution context) {
          INodeParser<?> delegate = context.getRegistry().get(typeName);
          if (delegate == null) {
              log.error("No parser found for yaml type {}", typeName);
              context.getParsingErrors().add(
                      new ParsingError(ErrorCode.ALIEN_MAPPING_ERROR, "No parser found for yaml type", node.getStartMark(), "", node.getEndMark(), typeName));
              return null;
          }
          return (T) delegate.parse(node, context);
      }
focal_method.class_method_signature: ReferencedParser.parse(Node node, ParsingContextExecution context)
focal_method.full_signature: @Override public T parse(Node node, ParsingContextExecution context)
focal_method.identifier: parse
focal_method.invocations: get getRegistry error add getParsingErrors getStartMark getEndMark parse
focal_method.modifiers: @Override public
focal_method.parameters: (Node node, ParsingContextExecution context)
focal_method.return: T
focal_method.signature: T parse(Node node, ParsingContextExecution context)