Search in sources :

Example 6 with JavaClientConnection

use of org.eclipse.jdt.ls.core.internal.JavaClientConnection in project eclipse.jdt.ls by eclipse.

the class MavenClasspathTest method setup.

@Before
public void setup() throws Exception {
    sharedASTProvider = CoreASTProvider.getInstance();
    sharedASTProvider.disposeAST();
    // sharedASTProvider.clearASTCreationCount();
    javaClient = new JavaClientConnection(client);
    lifeCycleHandler = new DocumentLifeCycleHandler(javaClient, preferenceManager, projectsManager, false);
}
Also used : DocumentLifeCycleHandler(org.eclipse.jdt.ls.core.internal.handlers.DocumentLifeCycleHandler) JavaClientConnection(org.eclipse.jdt.ls.core.internal.JavaClientConnection) Before(org.junit.Before)

Example 7 with JavaClientConnection

use of org.eclipse.jdt.ls.core.internal.JavaClientConnection in project eclipse.jdt.ls by eclipse.

the class DiagnosticHandlerTest method setup.

@Before
public void setup() throws Exception {
    CoreASTProvider sharedASTProvider = CoreASTProvider.getInstance();
    sharedASTProvider.disposeAST();
    // sharedASTProvider.clearASTCreationCount();
    javaClient = new JavaClientConnection(client);
}
Also used : CoreASTProvider(org.eclipse.jdt.core.manipulation.CoreASTProvider) JavaClientConnection(org.eclipse.jdt.ls.core.internal.JavaClientConnection) Before(org.junit.Before)

Example 8 with JavaClientConnection

use of org.eclipse.jdt.ls.core.internal.JavaClientConnection in project eclipse.jdt.ls by eclipse.

the class ShowAllQuickFixTest method setup.

@Before
public void setup() throws Exception {
    javaClient = new JavaClientConnection(client);
    mockJDTLanguageServer();
    JavaLanguageServerPlugin.getInstance().getProtocol().connectClient(client);
    fJProject1 = newEmptyProject();
    Hashtable<String, String> options = TestOptions.getDefaultOptions();
    options.put(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER, JavaCore.ERROR);
    options.put(JavaCore.COMPILER_PB_DEAD_CODE, JavaCore.WARNING);
    fJProject1.setOptions(options);
    fSourceFolder = fJProject1.getPackageFragmentRoot(fJProject1.getProject().getFolder("src"));
    preferenceManager.getPreferences().setJavaQuickFixShowAt("problem");
}
Also used : JavaClientConnection(org.eclipse.jdt.ls.core.internal.JavaClientConnection) Before(org.junit.Before)

Example 9 with JavaClientConnection

use of org.eclipse.jdt.ls.core.internal.JavaClientConnection in project eclipse.jdt.ls by eclipse.

the class EclipseProjectImporterTest method ignoreMissingResourceFilters.

@Test
public void ignoreMissingResourceFilters() throws Exception {
    JavaClientConnection javaClient = new JavaClientConnection(client);
    try {
        String name = "ignored-filter";
        importProjects("eclipse/" + name);
        IProject project = getProject(name);
        assertIsJavaProject(project);
        assertNoErrors(project);
        // 1 message sent to the platform logger
        assertEquals(logListener.getErrors().toString(), 1, logListener.getErrors().size());
        String error = logListener.getErrors().get(0);
        assertTrue("Unexpected error: " + error, error.startsWith("Missing resource filter type: 'org.eclipse.ui.ide.missingFilter'"));
        // but no message sent to the client
        List<Object> loggedMessages = clientRequests.get("logMessage");
        assertNull("Unexpected logs " + loggedMessages, loggedMessages);
    } finally {
        javaClient.disconnect();
    }
}
Also used : JavaClientConnection(org.eclipse.jdt.ls.core.internal.JavaClientConnection) IProject(org.eclipse.core.resources.IProject) Test(org.junit.Test)

Example 10 with JavaClientConnection

use of org.eclipse.jdt.ls.core.internal.JavaClientConnection in project eclipse.jdt.ls by eclipse.

the class InvisibleProjectPreferenceChangeListenerTest method setup.

@Before
public void setup() throws Exception {
    javaClient = new JavaClientConnection(client);
    lifeCycleHandler = new DocumentLifeCycleHandler(javaClient, preferenceManager, projectsManager, false);
    mockJDTLanguageServer();
}
Also used : DocumentLifeCycleHandler(org.eclipse.jdt.ls.core.internal.handlers.DocumentLifeCycleHandler) JavaClientConnection(org.eclipse.jdt.ls.core.internal.JavaClientConnection) Before(org.junit.Before)

Aggregations

JavaClientConnection (org.eclipse.jdt.ls.core.internal.JavaClientConnection)10 Before (org.junit.Before)9 DocumentLifeCycleHandler (org.eclipse.jdt.ls.core.internal.handlers.DocumentLifeCycleHandler)3 CoreASTProvider (org.eclipse.jdt.core.manipulation.CoreASTProvider)2 IProject (org.eclipse.core.resources.IProject)1 Test (org.junit.Test)1