use of org.jbehave.core.annotations.When in project javaparser by javaparser.
the class CommentParsingSteps method whenTheClassIsParsedByTheJavaParser.
@When("the class is parsed by the Java parser")
public void whenTheClassIsParsedByTheJavaParser() {
ParseResult<CompilationUnit> result = new JavaParser(configuration).parse(COMPILATION_UNIT, provider(sourceUnderTest));
compilationUnit = result.getResult().get();
}
use of org.jbehave.core.annotations.When in project javaparser by javaparser.
the class CommentParsingSteps method whenTheClassIsParsedByTheCommentParser.
@When("the class is parsed by the comment parser")
public void whenTheClassIsParsedByTheCommentParser() throws IOException {
ParseResult<CompilationUnit> parseResult = new JavaParser(new ParserConfiguration()).parse(COMPILATION_UNIT, provider(sourceUnderTest));
commentsCollection = parseResult.getCommentsCollection().orElse(new CommentsCollection());
}
use of org.jbehave.core.annotations.When in project javaparser by javaparser.
the class ManipulationSteps method whenThePackageDeclarationIsSetTo.
@When("the package declaration is set to \"$packageName\"")
public void whenThePackageDeclarationIsSetTo(String packageName) {
CompilationUnit compilationUnit = (CompilationUnit) state.get("cu1");
compilationUnit.setPackageDeclaration(new PackageDeclaration(parseName(packageName)));
state.put("cu1", compilationUnit);
}
use of org.jbehave.core.annotations.When in project javaparser by javaparser.
the class ManipulationSteps method whenTheCompilationUnitIsCloned.
@When("the compilation unit is cloned")
public void whenTheCompilationUnitIsCloned() throws CloneNotSupportedException {
CompilationUnit compilationUnit = (CompilationUnit) state.get("cu1");
state.put("cu1", compilationUnit.clone());
}
use of org.jbehave.core.annotations.When in project javaparser by javaparser.
the class ManipulationSteps method whenABlockStmtIsAddedToMethodInClass.
@When("a BlockStmt is added to method $methodPosition in class $classPosition")
public void whenABlockStmtIsAddedToMethodInClass(int methodPosition, int classPosition) {
CompilationUnit compilationUnit = (CompilationUnit) state.get("cu1");
MethodDeclaration method = getMethodByPositionAndClassPosition(compilationUnit, methodPosition, classPosition);
method.setBody(new BlockStmt());
}
Aggregations