@Test void continuationLineWithoutBeginningQuotes() { CobolLine startContinuationLine = new CobolLine(); startContinuationLine.setType(NORMAL); startContinuationLine.setIndicatorArea(WS); startContinuationLine.setContentAreaB(" \"RANDOM TEXT "); CobolLine quoteContinuationLine = new CobolLine(); quoteContinuationLine.setType(CONTINUATION); quoteContinuationLine.setIndicatorArea("-"); quoteContinuationLine.setContentAreaA(" "); quoteContinuationLine.setContentAreaB(" \"RANDOM TEXT SINGLE CONTINUATION LINE\""); CobolLine lastContinuationLine = new CobolLine(); lastContinuationLine.setType(CONTINUATION); lastContinuationLine.setIndicatorArea("-"); lastContinuationLine.setContentAreaA(" "); lastContinuationLine.setContentAreaB(" RANDOM TEXT SINGLE CONTINUATION LINE\""); startContinuationLine.setSuccessor(quoteContinuationLine); quoteContinuationLine.setSuccessor(lastContinuationLine); CobolLineIndicatorProcessorImpl processor = new CobolLineIndicatorProcessorImpl(); CobolLine outcome = processor.processLine(lastContinuationLine); assertEquals( WS + "RANDOM TEXT SINGLE CONTINUATION LINE\"", outcome.getIndicatorArea() + outcome.getContentArea()); }
@Override public CobolLine processLine(final CobolLine line) { final String conditionalRightTrimmedContentArea = conditionalRightTrimContentArea(line); final CobolLine result; switch (line.getType()) { case CONTINUATION: result = processContinuationLine(line, conditionalRightTrimmedContentArea); break; case COMMENT: result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( COMMENT_TAG + WS, conditionalRightTrimmedContentArea, line); break; case COMPILER_DIRECTIVE: result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea(WS, EMPTY_STRING, line); break; case NORMAL: case DEBUG: default: result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( WS, conditionalRightTrimmedContentArea, line); break; } return result; }
CobolLineIndicatorProcessorImpl implements CobolLineIndicatorProcessor { @Override public CobolLine processLine(final CobolLine line) { final String conditionalRightTrimmedContentArea = conditionalRightTrimContentArea(line); final CobolLine result; switch (line.getType()) { case CONTINUATION: result = processContinuationLine(line, conditionalRightTrimmedContentArea); break; case COMMENT: result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( COMMENT_TAG + WS, conditionalRightTrimmedContentArea, line); break; case COMPILER_DIRECTIVE: result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea(WS, EMPTY_STRING, line); break; case NORMAL: case DEBUG: default: result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( WS, conditionalRightTrimmedContentArea, line); break; } return result; } }
CobolLineIndicatorProcessorImpl implements CobolLineIndicatorProcessor { @Override public CobolLine processLine(final CobolLine line) { final String conditionalRightTrimmedContentArea = conditionalRightTrimContentArea(line); final CobolLine result; switch (line.getType()) { case CONTINUATION: result = processContinuationLine(line, conditionalRightTrimmedContentArea); break; case COMMENT: result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( COMMENT_TAG + WS, conditionalRightTrimmedContentArea, line); break; case COMPILER_DIRECTIVE: result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea(WS, EMPTY_STRING, line); break; case NORMAL: case DEBUG: default: result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( WS, conditionalRightTrimmedContentArea, line); break; } return result; }  }
CobolLineIndicatorProcessorImpl implements CobolLineIndicatorProcessor { @Override public CobolLine processLine(final CobolLine line) { final String conditionalRightTrimmedContentArea = conditionalRightTrimContentArea(line); final CobolLine result; switch (line.getType()) { case CONTINUATION: result = processContinuationLine(line, conditionalRightTrimmedContentArea); break; case COMMENT: result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( COMMENT_TAG + WS, conditionalRightTrimmedContentArea, line); break; case COMPILER_DIRECTIVE: result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea(WS, EMPTY_STRING, line); break; case NORMAL: case DEBUG: default: result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( WS, conditionalRightTrimmedContentArea, line); break; } return result; }  @Override List<CobolLine> processLines(final List<CobolLine> lines); @Override CobolLine processLine(final CobolLine line); }
CobolLineIndicatorProcessorImpl implements CobolLineIndicatorProcessor { @Override public CobolLine processLine(final CobolLine line) { final String conditionalRightTrimmedContentArea = conditionalRightTrimContentArea(line); final CobolLine result; switch (line.getType()) { case CONTINUATION: result = processContinuationLine(line, conditionalRightTrimmedContentArea); break; case COMMENT: result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( COMMENT_TAG + WS, conditionalRightTrimmedContentArea, line); break; case COMPILER_DIRECTIVE: result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea(WS, EMPTY_STRING, line); break; case NORMAL: case DEBUG: default: result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( WS, conditionalRightTrimmedContentArea, line); break; } return result; }  @Override List<CobolLine> processLines(final List<CobolLine> lines); @Override CobolLine processLine(final CobolLine line);  }