Search in sources :

Example 1 with DeleteOperationRequest

use of org.kie.workbench.common.services.refactoring.service.impact.DeleteOperationRequest in project kie-wb-common by kiegroup.

the class QueryOperationRequestTest method exampleCode.

@Test
@SuppressWarnings("unused")
public void exampleCode() {
    String className = this.getClass().getName();
    String projectName = "org.my.package:my-project:1.0";
    String projectRootPathURI = "default://repo/my-project";
    String newClassName = Random.class.getName();
    DeleteOperationRequest delReq = DeleteOperationRequest.deleteReferences(className, ResourceType.JAVA).inModule(projectName).onAllBranches();
    delReq = DeleteOperationRequest.deleteReferences(className, ResourceType.JAVA).inModuleRootPathURI(projectRootPathURI).onAllBranches();
    delReq = DeleteOperationRequest.deletePartReferences(className, "setAge(long)", PartType.METHOD).inModule(projectName).onAllBranches();
    delReq = DeleteOperationRequest.deletePartReferences(className, "setAge(long)", PartType.METHOD).inModuleRootPathURI(projectRootPathURI).onAllBranches();
    RefactorOperationRequest refOp = RefactorOperationRequest.refactorReferences(className, ResourceType.JAVA, newClassName).inModule(projectName).onBranch("branch-name");
    refOp = RefactorOperationRequest.refactorReferences(className, ResourceType.JAVA, newClassName).inModuleRootPathURI(projectRootPathURI).onBranch("branch-name");
    refOp = RefactorOperationRequest.refactorPartReferences(className, "toName(int)", PartType.METHOD, "toSurName(int)").inModule(projectName).onAllBranches();
    refOp = RefactorOperationRequest.refactorPartReferences(className, "toName(int)", PartType.METHOD, "toSurName(int)").inModuleRootPathURI(projectRootPathURI).onAllBranches();
    refOp = RefactorOperationRequest.refactorPartReferences(className, "toName(int)", PartType.METHOD, "toSurName(int)").inModule(projectName).onBranch("branch-name");
    QueryOperationRequest queOp = QueryOperationRequest.references(className, ResourceType.JAVA).inModule(projectName).onBranch("branch-name");
    queOp = QueryOperationRequest.references(className, ResourceType.JAVA).inModuleRootPathURI(projectRootPathURI).onBranch("branch-name");
}
Also used : RefactorOperationRequest(org.kie.workbench.common.services.refactoring.service.impact.RefactorOperationRequest) QueryOperationRequest(org.kie.workbench.common.services.refactoring.service.impact.QueryOperationRequest) DeleteOperationRequest(org.kie.workbench.common.services.refactoring.service.impact.DeleteOperationRequest) BaseIndexingTest(org.kie.workbench.common.services.refactoring.backend.server.BaseIndexingTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 BaseIndexingTest (org.kie.workbench.common.services.refactoring.backend.server.BaseIndexingTest)1 DeleteOperationRequest (org.kie.workbench.common.services.refactoring.service.impact.DeleteOperationRequest)1 QueryOperationRequest (org.kie.workbench.common.services.refactoring.service.impact.QueryOperationRequest)1 RefactorOperationRequest (org.kie.workbench.common.services.refactoring.service.impact.RefactorOperationRequest)1