use of com.google.api.generator.engine.ast.BlockComment in project gapic-generator-java by googleapis.
the class JavaWriterVisitorTest method writeBlockComment_shortLines.
@Test
public void writeBlockComment_shortLines() {
String content = "Apache License \nThis is a test file header";
BlockComment blockComment = BlockComment.builder().setComment(content).build();
String expected = LineFormatter.lines("/*\n", "* Apache License\n", "* This is a test file header\n", "*/\n");
blockComment.accept(writerVisitor);
assertEquals(expected, writerVisitor.write());
}
use of com.google.api.generator.engine.ast.BlockComment in project gapic-generator-java by googleapis.
the class JavaWriterVisitorTest method writeBlockCommentStatement_basic.
/**
* =============================== COMMENT ===============================
*/
@Test
public void writeBlockCommentStatement_basic() {
String content = "this is a test comment";
BlockComment blockComment = BlockComment.builder().setComment(content).build();
CommentStatement commentStatement = CommentStatement.withComment(blockComment);
String expected = LineFormatter.lines("/*\n", "* this is a test comment\n", "*/\n");
commentStatement.accept(writerVisitor);
assertEquals(expected, writerVisitor.write());
}
use of com.google.api.generator.engine.ast.BlockComment in project gapic-generator-java by googleapis.
the class JavaWriterVisitorTest method writeBlockComment_newLineInBetween.
@Test
public void writeBlockComment_newLineInBetween() {
String content = "Apache License \n" + "Licensed under the Apache License, Version 2.0 (the \"License\");\n\n" + "you may not use this file except in compliance with the License.";
BlockComment blockComment = BlockComment.builder().setComment(content).build();
String expected = LineFormatter.lines("/*\n", "* Apache License\n", "* Licensed under the Apache License, Version 2.0 (the \"License\");\n", "*\n", "* you may not use this file except in compliance with the License.\n", "*/\n");
blockComment.accept(writerVisitor);
assertEquals(expected, writerVisitor.write());
}
Aggregations