Examples of ILinkingDiagnosticContext


Examples of org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider.ILinkingDiagnosticContext

    verify(mocks);
  }

  @Test
  public void undefinedParserRule() {
    ILinkingDiagnosticContext diagnosticContext = createMock(ILinkingDiagnosticContext.class);
    ParserRule rule = createMock(ParserRule.class);
    RuleRef ref = createMock(RuleRef.class);

    expect(diagnosticContext.getLinkText()).andReturn("some");
    expect(diagnosticContext.getContext()).andReturn(ref);

    expect(ref.eContainer()).andReturn(null);
    expect(ref.eContainer()).andReturn(rule);

    Object[] mocks = {diagnosticContext, ref, rule };
View Full Code Here

Examples of org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider.ILinkingDiagnosticContext

    verify(mocks);
  }

  @Test
  public void undefinedLexerRule() {
    ILinkingDiagnosticContext diagnosticContext = createMock(ILinkingDiagnosticContext.class);
    LexerRule rule = createMock(LexerRule.class);
    RuleRef ref = createMock(RuleRef.class);

    expect(diagnosticContext.getLinkText()).andReturn("ID");
    expect(diagnosticContext.getContext()).andReturn(ref);

    expect(ref.eContainer()).andReturn(null);
    expect(ref.eContainer()).andReturn(rule);

    Object[] mocks = {diagnosticContext, ref, rule };
View Full Code Here

Examples of org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider.ILinkingDiagnosticContext

    verify(mocks);
  }

  @Test
  public void implicitTokenDefinition() {
    ILinkingDiagnosticContext diagnosticContext = createMock(ILinkingDiagnosticContext.class);
    ParserRule rule = createMock(ParserRule.class);
    RuleRef ref = createMock(RuleRef.class);

    expect(diagnosticContext.getLinkText()).andReturn("ID");
    expect(diagnosticContext.getContext()).andReturn(ref);

    expect(ref.eContainer()).andReturn(null);
    expect(ref.eContainer()).andReturn(rule);

    Object[] mocks = {diagnosticContext, ref, rule };
View Full Code Here

Examples of org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider.ILinkingDiagnosticContext

public class Antlr4MissingReferenceMessageProviderTest {

  @Test
  public void defaultModesOK() {
    ILinkingDiagnosticContext diagnosticContext = createMock(ILinkingDiagnosticContext.class);
    LexerCommand command = createMock(LexerCommand.class);
    LexerCommands commands = createMock(LexerCommands.class);

    expect(diagnosticContext.getLinkText()).andReturn("HIDDEN");
    expect(diagnosticContext.getContext()).andReturn(command);

    expect(command.eContainer()).andReturn(commands);

    Object[] mocks = {diagnosticContext, command, commands };
View Full Code Here

Examples of org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider.ILinkingDiagnosticContext

    verify(mocks);
  }

  @Test
  public void undefinedMode() {
    ILinkingDiagnosticContext diagnosticContext = createMock(ILinkingDiagnosticContext.class);
    LexerCommand command = createMock(LexerCommand.class);
    LexerCommands commands = createMock(LexerCommands.class);

    expect(diagnosticContext.getLinkText()).andReturn("INSIDE");
    expect(diagnosticContext.getContext()).andReturn(command);

    expect(command.eContainer()).andReturn(commands);

    Object[] mocks = {diagnosticContext, command, commands };
View Full Code Here

Examples of org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider.ILinkingDiagnosticContext

    verify(mocks);
  }

  @Test
  public void badImport() {
    ILinkingDiagnosticContext diagnosticContext = createMock(ILinkingDiagnosticContext.class);
    Grammar grammar = createMock(Grammar.class);
    Import delegate = createMock(Import.class);
    Resource resource = createMock(Resource.class);
    URI uri = createMock(URI.class);
    String name = "G.g4";

    expect(diagnosticContext.getLinkText()).andReturn("some");
    expect(diagnosticContext.getContext()).andReturn(delegate);

    expect(delegate.eContainer()).andReturn(null).times(2);

    expect(delegate.eContainer()).andReturn(grammar);
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.