Examples of IInvocationContext


Examples of org.eclipse.jdt.ui.text.java.IInvocationContext

  public void testControllerRequestMappingMethods() throws JavaModelException {
    IType type = this.type.getType("ControllerAnnotation");
    ISourceRange sourceRange = type.getSourceRange();
    TypeDeclaration typeDecl = (TypeDeclaration) getASTNode(sourceRange, type, viewer);
    IInvocationContext context = getContext(sourceRange, type, typeDecl);

    List<IJavaCompletionProposal> proposals = processor.getAssists(typeDecl.getName(), context);
    assertTrue("No proposals expected", proposals.isEmpty());
  }
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IInvocationContext

  public void testBothNoRequestMappingMethods() throws JavaModelException {
    IType type = this.type.getType("BothAnnotationsNoRequestMapping");
    ISourceRange sourceRange = type.getSourceRange();
    TypeDeclaration typeDecl = (TypeDeclaration) getASTNode(sourceRange, type, viewer);
    IInvocationContext context = getContext(sourceRange, type, typeDecl);

    List<IJavaCompletionProposal> proposals = processor.getAssists(typeDecl.getName(), context);
    assertTrue("No proposals expected", proposals.isEmpty());
  }
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IInvocationContext

  public void testBothRequestMappingMethods() throws JavaModelException {
    IType type = this.type.getType("BothAnnotations");
    ISourceRange sourceRange = type.getSourceRange();
    TypeDeclaration typeDecl = (TypeDeclaration) getASTNode(sourceRange, type, viewer);
    IInvocationContext context = getContext(sourceRange, type, typeDecl);

    List<IJavaCompletionProposal> proposals = processor.getAssists(typeDecl.getName(), context);
    assertTrue("No proposals expected", proposals.isEmpty());
  }
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IInvocationContext

    return getContext(sourceRange, member, node, 0);
  }

  protected IInvocationContext getContext(final ISourceRange sourceRange, final IMember member, final ASTNode node,
      final int offset) {
    return new IInvocationContext() {

      public int getSelectionOffset() {
        return sourceRange.getOffset() + offset; // check to see if
                              // really needed
      }
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IInvocationContext

  public void testFieldWithNoAutowired() throws JavaModelException {
    IField field = type.getField("testBean1");
    ISourceRange sourceRange = field.getSourceRange();
    FieldDeclaration fieldDecl = (FieldDeclaration) getASTNode(sourceRange, type, viewer);
    IInvocationContext context = getContext(sourceRange, field, fieldDecl);

    List<IJavaCompletionProposal> proposals = processor.getAssists(fieldDecl, context);
    assertTrue("No proposals expected", proposals.isEmpty());
  }
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IInvocationContext

  public void testField() throws JavaModelException {
    IField field = type.getField("testBean2");
    ISourceRange sourceRange = field.getSourceRange();
    FieldDeclaration fieldDecl = (FieldDeclaration) getASTNode(sourceRange, type, viewer);
    IInvocationContext context = getContext(sourceRange, field, fieldDecl);

    List<IJavaCompletionProposal> proposals = processor.getAssists(fieldDecl, context);
    assertEquals("1 proposal is expected", 1, proposals.size());
    assertTrue("AddQualiferCompletionProposal expected", proposals.get(0) instanceof AddQualiferCompletionProposal);
    assertEquals("Add @Qualifier", proposals.get(0).getDisplayString());
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IInvocationContext

  public void testMethodWithNoAutowired() throws JavaModelException {
    IMethod method = type.getMethod("testMethod1", new String[] { "QTestClass;" });
    ISourceRange sourceRange = method.getSourceRange();
    MethodDeclaration methodDecl = (MethodDeclaration) getASTNode(sourceRange, type, viewer);
    IInvocationContext context = getContext(sourceRange, method, methodDecl);

    List<IJavaCompletionProposal> proposals = processor.getAssists(methodDecl, context);
    assertTrue("No proposals expected", proposals.isEmpty());
  }
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IInvocationContext

  public void testMethodWith1Param() throws JavaModelException {
    IMethod method = type.getMethod("testMethod2", new String[] { "QTestClass;" });
    ISourceRange sourceRange = method.getSourceRange();
    MethodDeclaration methodDecl = (MethodDeclaration) getASTNode(sourceRange, type, viewer);
    IInvocationContext context = getContext(sourceRange, method, methodDecl);

    List<IJavaCompletionProposal> proposals = processor.getAssists(methodDecl, context);
    assertEquals("1 proposal expected", 1, proposals.size());
    assertTrue("AddQualiferCompletionProposal expected",
        proposals.get(0) instanceof AddQualiferToMethodParamCompletionProposal);
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IInvocationContext

  public void testMethodWith2Params() throws JavaModelException {
    IMethod method = type.getMethod("testMethod3", new String[] { "QTestClass;", "QTestClass;" });
    ISourceRange sourceRange = method.getSourceRange();
    MethodDeclaration methodDecl = (MethodDeclaration) getASTNode(sourceRange, type, viewer);
    IInvocationContext context = getContext(sourceRange, method, methodDecl);

    List<IJavaCompletionProposal> proposals = processor.getAssists(methodDecl, context);
    assertEquals("1 proposal expected", 1, proposals.size());
    assertTrue("AddQualiferCompletionProposal expected",
        proposals.get(0) instanceof AddQualiferToMethodParamCompletionProposal);
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IInvocationContext

  public void testMethodWith2ParamsOnePrimitive() throws JavaModelException {
    IMethod method = type.getMethod("testMethod4", new String[] { "QTestClass;", "I" });
    ISourceRange sourceRange = method.getSourceRange();
    MethodDeclaration methodDecl = (MethodDeclaration) getASTNode(sourceRange, type, viewer);
    IInvocationContext context = getContext(sourceRange, method, methodDecl);

    List<IJavaCompletionProposal> proposals = processor.getAssists(methodDecl, context);
    assertEquals("1 proposal expected", 1, proposals.size());
    assertTrue("AddQualiferCompletionProposal expected",
        proposals.get(0) instanceof AddQualiferToMethodParamCompletionProposal);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.