From 785f0689237388aeb3fc0468bcac29fd82255a7d Mon Sep 17 00:00:00 2001 From: Dmitrii Barnukov Date: Fri, 19 Dec 2025 10:45:11 +0100 Subject: [PATCH 1/9] dbeaver/pro#7618 moved lsp tests to cb --- .../META-INF/MANIFEST.MF | 10 +- .../DBLTextDocumentServiceContextTest.java | 131 ++++++++ .../model/lsp/DBLTextDocumentServiceTest.java | 294 ++++++++++++++++++ .../DBLTextDocumentServiceWorkspaceTest.java | 77 +++++ .../model/lsp/DocumentServiceTestUtils.java | 125 ++++++++ .../model/lsp/H2DataSourceTest.java | 79 +++++ .../model/lsp/TestSessionProvider.java | 48 +++ 7 files changed, 763 insertions(+), 1 deletion(-) create mode 100644 server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceContextTest.java create mode 100644 server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceTest.java create mode 100644 server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceWorkspaceTest.java create mode 100644 server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DocumentServiceTestUtils.java create mode 100644 server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/H2DataSourceTest.java create mode 100644 server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/TestSessionProvider.java diff --git a/server/test/io.cloudbeaver.test.platform/META-INF/MANIFEST.MF b/server/test/io.cloudbeaver.test.platform/META-INF/MANIFEST.MF index 031a387de73..69494315943 100644 --- a/server/test/io.cloudbeaver.test.platform/META-INF/MANIFEST.MF +++ b/server/test/io.cloudbeaver.test.platform/META-INF/MANIFEST.MF @@ -14,6 +14,9 @@ Require-Bundle: org.eclipse.core.runtime, org.jkiss.dbeaver.model, org.jkiss.dbeaver.osgi.test.runner;visibility:=reexport, org.jkiss.dbeaver.model.sql, + org.jkiss.dbeaver.model.lsp, + org.jkiss.dbeaver.model.rcp, + org.jkiss.dbeaver.model.jdbc, org.jkiss.dbeaver.registry, org.jkiss.dbeaver.ext.generic, org.jkiss.dbeaver.ext.h2, @@ -30,5 +33,10 @@ Require-Bundle: org.eclipse.core.runtime, org.jkiss.dbeaver.ext.mysql, org.jkiss.dbeaver.ext.postgresql, org.jkiss.dbeaver.ext.oracle, - org.jkiss.dbeaver.ext.mssql + org.jkiss.dbeaver.ext.mssql, + org.jkiss.dbeaver.ext.h2, + org.jkiss.dbeaver.ext.generic, + org.jkiss.dbeaver.test.platform, + org.eclipse.lsp4j, + org.eclipse.lsp4j.jsonrpc Export-Package: io.cloudbeaver.test.platform diff --git a/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceContextTest.java b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceContextTest.java new file mode 100644 index 00000000000..783fdf8616e --- /dev/null +++ b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceContextTest.java @@ -0,0 +1,131 @@ +/* + * DBeaver - Universal Database Manager + * Copyright (C) 2010-2025 DBeaver Corp and others + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.cloudbeaver.model.lsp; + +import org.eclipse.lsp4j.*; +import org.jkiss.dbeaver.ext.h2.model.H2SQLDialect; +import org.jkiss.dbeaver.model.lsp.context.ContextAwareDocument; +import org.junit.Assert; +import org.junit.Test; + +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +public class DBLTextDocumentServiceContextTest extends H2DataSourceTest { + + @Test + public void shouldInitH2Context() { + TextDocumentItem document = DocumentServiceTestUtils.createAndSaveDocument( + service, "select * from table", project.getId(), DocumentServiceTestUtils.BASIC_RESOURCE_PATH + ); + + ContextAwareDocument contextedDocument = DocumentServiceTestUtils.getDocument(service, document.getUri()); + Assert.assertNotNull(contextedDocument); + Assert.assertEquals(dataSourceDescriptor.getDataSource(), contextedDocument.getDataSource()); + Assert.assertNotNull(contextedDocument.getExecutionContext()); + Assert.assertEquals(dataSourceDescriptor.getDataSource(), contextedDocument.getExecutionContext().getDataSource()); + Assert.assertTrue(contextedDocument.getSyntaxManager().getDialect() instanceof H2SQLDialect); + Assert.assertNotNull(contextedDocument.getRuleManager()); + } + + @Test + public void shouldFormatQuery() throws ExecutionException, InterruptedException { + String query = """ + INSERT INTO users (id, profile) VALUES (1,'{"name": "JohnDoe"}'::jsonb) ON CONFLICT (id) + DO UPDATE SET profile = users.profile || EXCLUDED.profile RETURNING id, profile->>'name' AS name; + """.trim(); + DocumentFormattingParams formattingParams = DocumentServiceTestUtils.setupDocumentAndBuildFormattingParams(service, query); + + CompletableFuture> future = service.formatting(formattingParams); + + TextEdit edit = future.get().getFirst(); + String expectedQuery = """ + INSERT + INTO + users (id, + profile) + VALUES (1, + '{"name": "JohnDoe"}'::jsonb) ON + CONFLICT (id) + DO + UPDATE + SET + profile = users.profile || EXCLUDED.profile RETURNING id, + profile->>'name' AS name; + """.trim(); + + Assert.assertEquals(expectedQuery.trim(), edit.getNewText()); + Position start = edit.getRange().getStart(); + Assert.assertEquals(0, start.getLine()); + Assert.assertEquals(0, start.getCharacter()); + + Position end = edit.getRange().getEnd(); + Assert.assertEquals(1, end.getLine()); + Assert.assertEquals(97, end.getCharacter()); + } + + @Test + public void shouldReturnEmptyCompletionsForInvalidPosition() throws ExecutionException, InterruptedException { + String query = "SEL"; + ContextAwareDocument document = DocumentServiceTestUtils.createAndSaveDocument( + service, query, project.getId(), DocumentServiceTestUtils.BASIC_RESOURCE_PATH + ); + TextDocumentIdentifier documentId = new TextDocumentIdentifier(document.getUri()); + CompletionParams completionParams = new CompletionParams(documentId, new Position(1, 42)); + + CompletionList completions = service.completion(completionParams).get().getRight(); + + Assert.assertNotNull(completions); + Assert.assertTrue(completions.getItems().isEmpty()); + } + + @Test + public void shouldSuggestKeywordCompletion() throws ExecutionException, InterruptedException { + String query = "SEL"; + ContextAwareDocument document = DocumentServiceTestUtils.createAndSaveDocument( + service, query, project.getId(), DocumentServiceTestUtils.BASIC_RESOURCE_PATH + ); + TextDocumentIdentifier documentId = new TextDocumentIdentifier(document.getUri()); + CompletionParams completionParams = new CompletionParams(documentId, new Position(0, 3)); + + CompletionList completions = service.completion(completionParams).get().getRight(); + + Assert.assertNotNull(completions); + Assert.assertFalse(completions.getItems().isEmpty()); + Assert.assertEquals("SELECT", completions.getItems().getFirst().getLabel()); + } + + @Test + public void shouldSuggestMultilineKeywordCompletion() throws ExecutionException, InterruptedException { + String query = """ + SELECT * + FR + """; + ContextAwareDocument document = DocumentServiceTestUtils.createAndSaveDocument( + service, query, project.getId(), DocumentServiceTestUtils.BASIC_RESOURCE_PATH + ); + TextDocumentIdentifier documentId = new TextDocumentIdentifier(document.getUri()); + CompletionParams completionParams = new CompletionParams(documentId, new Position(1, 6)); + + CompletionList completions = service.completion(completionParams).get().getRight(); + + Assert.assertNotNull(completions); + Assert.assertEquals(1, completions.getItems().size()); + Assert.assertEquals("FROM", completions.getItems().getFirst().getLabel()); + } +} diff --git a/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceTest.java b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceTest.java new file mode 100644 index 00000000000..8aac7f0da8d --- /dev/null +++ b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceTest.java @@ -0,0 +1,294 @@ +/* + * DBeaver - Universal Database Manager + * Copyright (C) 2010-2025 DBeaver Corp and others + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.cloudbeaver.model.lsp; + +import io.cloudbeaver.CloudbeaverMockTest; +import org.eclipse.lsp4j.*; +import org.jkiss.dbeaver.model.impl.sql.BasicSQLDialect; +import org.jkiss.dbeaver.model.lsp.DBLTextDocumentService; +import org.jkiss.dbeaver.model.lsp.context.ContextAwareDocument; +import org.jkiss.dbeaver.model.sql.SQLSyntaxManager; +import org.jkiss.dbeaver.model.sql.parser.SQLRuleManager; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.util.List; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +/** + * Test scenarios to cover DBLTextDocumentService + */ +public class DBLTextDocumentServiceTest extends CloudbeaverMockTest { + private DBLTextDocumentService service; + + @Before + public void setUp() { + service = new DBLTextDocumentService(); + } + + @Test + public void shouldOpenDocumentWithArbitraryURI() { + String query = "SELECT * FROM table"; + String uri = "file:///Users/username/script.sql"; + TextDocumentItem textDocument = new TextDocumentItem( + uri, DocumentServiceTestUtils.SQL_LANGUAGE_ID, 0, query + ); + DidOpenTextDocumentParams params = new DidOpenTextDocumentParams(textDocument); + + service.didOpen(params); + + ContextAwareDocument document = DocumentServiceTestUtils.getDocument(service, uri); + Assert.assertNotNull(document); + Assert.assertEquals(document.getSyntaxManager().getDialect(), BasicSQLDialect.INSTANCE); + Assert.assertNull(document.getExecutionContext()); + } + + @Test + public void shouldOpenDocument() { + String query = "SELECT * FROM table"; + TextDocumentItem textDocument = DocumentServiceTestUtils.createQueryDocument(query); + service.didOpen(new DidOpenTextDocumentParams(textDocument)); + + ContextAwareDocument savedDocument = DocumentServiceTestUtils.getDocument(service, textDocument.getUri()); + Assert.assertNotNull(savedDocument); + Assert.assertEquals(query, savedDocument.getText()); + + SQLSyntaxManager syntaxManager = savedDocument.getSyntaxManager(); + Assert.assertNotNull(syntaxManager); + Assert.assertEquals(BasicSQLDialect.INSTANCE, syntaxManager.getDialect()); + SQLRuleManager ruleManager = savedDocument.getRuleManager(); + Assert.assertNotNull(ruleManager); + } + + @Test + public void shouldInitDefaultSyntax() { + TextDocumentItem textDocument = DocumentServiceTestUtils.createQueryDocument("SELECT * FROM table"); + service.didOpen(new DidOpenTextDocumentParams(textDocument)); + + ContextAwareDocument savedDocument = Objects.requireNonNull(DocumentServiceTestUtils.getDocument(service, textDocument.getUri())); + SQLSyntaxManager syntaxManager = savedDocument.getSyntaxManager(); + Assert.assertNotNull(syntaxManager); + Assert.assertEquals(BasicSQLDialect.INSTANCE, syntaxManager.getDialect()); + SQLRuleManager ruleManager = savedDocument.getRuleManager(); + Assert.assertNotNull(ruleManager); + } + + @Test + public void shouldOpenAndChangeDocument() { + String query = "SELECT * FROM table"; + TextDocumentItem textDocument = DocumentServiceTestUtils.createQueryDocument(query); + service.didOpen(new DidOpenTextDocumentParams(textDocument)); + + String updatedSql = "SELECT DISTINCT * FROM table"; + VersionedTextDocumentIdentifier textDocumentChange = new VersionedTextDocumentIdentifier(textDocument.getUri(), 0); + TextDocumentContentChangeEvent event = new TextDocumentContentChangeEvent(updatedSql); + List contentChanges = List.of(event); + service.didChange(new DidChangeTextDocumentParams(textDocumentChange, contentChanges)); + + ContextAwareDocument updatedDocument = DocumentServiceTestUtils.getDocument(service, textDocument.getUri()); + Assert.assertNotNull(updatedDocument); + Assert.assertEquals(updatedSql, updatedDocument.getText()); + } + + @Test + public void shouldFailSubmittingMultipleChangesToDocument() { + String query = "SELECT * FROM table"; + TextDocumentItem textDocument = DocumentServiceTestUtils.createQueryDocument(query); + service.didOpen(new DidOpenTextDocumentParams(textDocument)); + + String updatedSql1 = "SELECT DISTINCT * FROM table"; + String updatedSql2 = "DROP TABLE IF EXISTS table"; + VersionedTextDocumentIdentifier textDocumentChange = new VersionedTextDocumentIdentifier(textDocument.getUri(), 0); + TextDocumentContentChangeEvent event1 = new TextDocumentContentChangeEvent(updatedSql1); + TextDocumentContentChangeEvent event2 = new TextDocumentContentChangeEvent(updatedSql2); + List contentChanges = List.of(event1, event2); + + Assert.assertThrows( + "Unexpected number of document changes: 2", + IllegalArgumentException.class, + () -> service.didChange(new DidChangeTextDocumentParams(textDocumentChange, contentChanges)) + ); + } + + @Test + public void shouldOpenAndCloseDocument() { + String query = "SELECT * FROM table"; + TextDocumentItem textDocument = DocumentServiceTestUtils.createQueryDocument(query); + service.didOpen(new DidOpenTextDocumentParams(textDocument)); + + TextDocumentIdentifier textDocumentId = new TextDocumentIdentifier(textDocument.getUri()); + DidCloseTextDocumentParams closeParams = new DidCloseTextDocumentParams(textDocumentId); + service.didClose(closeParams); + + ContextAwareDocument updatedDocument = DocumentServiceTestUtils.getDocument(service, textDocument.getUri()); + Assert.assertNull(updatedDocument); + } + + @Test + public void shouldFormatSingleLineQuery() throws ExecutionException, InterruptedException { + String query = "sElEcT dIsTiNcT * fRoM tablename As alias;"; + var formattingParams = DocumentServiceTestUtils.setupDocumentAndBuildFormattingParams(service, query); + + CompletableFuture> future = service.formatting(formattingParams); + + TextEdit textEdit = future.get().getFirst(); + String expectedQuery = """ + SELECT + DISTINCT * + FROM + tablename AS alias; + """; + Assert.assertEquals(expectedQuery.trim(), textEdit.getNewText()); + + Position start = textEdit.getRange().getStart(); + Assert.assertEquals(0, start.getCharacter()); + Assert.assertEquals(0, start.getLine()); + + Position end = textEdit.getRange().getEnd(); + Assert.assertEquals(0, end.getLine()); + Assert.assertEquals(42, end.getCharacter()); + } + + @Test + public void shouldFormatMultilineQuery() throws ExecutionException, InterruptedException { + String query = """ + select dbname1.schemaname1.tablename1.columnname1, schemaname2.tablename2.columnname2, + tablename3.columnname3 from + dbname1.schemaname1.tablename1,dbname2.schemaname2.tablename2,schemaname3.tablename3 + ; + """.trim(); + var formattingParams = DocumentServiceTestUtils.setupDocumentAndBuildFormattingParams(service, query); + + CompletableFuture> future = service.formatting(formattingParams); + + TextEdit textEdit = future.get().getFirst(); + String expectedQuery = """ + SELECT + dbname1.schemaname1.tablename1.columnname1, + schemaname2.tablename2.columnname2, + tablename3.columnname3 + FROM + dbname1.schemaname1.tablename1, + dbname2.schemaname2.tablename2, + schemaname3.tablename3 + ; + """.trim(); + Assert.assertEquals(expectedQuery.trim(), textEdit.getNewText()); + + Position start = textEdit.getRange().getStart(); + Assert.assertEquals(0, start.getCharacter()); + Assert.assertEquals(0, start.getLine()); + + Position end = textEdit.getRange().getEnd(); + Assert.assertEquals(3, end.getLine()); + Assert.assertEquals(1, end.getCharacter()); + } + + @Test + public void shouldFormatDialectSpecificQuery() throws ExecutionException, InterruptedException { + String query = """ + DO $$ BEGIN CREATE TABLE logs (id serial PRIMARY KEY,message text,created_at timestamptz DEFAULT now()); + ELSE RAISE NOTICE 'Table "logs" already exists.';END IF;END $$; + """.trim(); + var formattingParams = DocumentServiceTestUtils.setupDocumentAndBuildFormattingParams(service, query); + + CompletableFuture> future = service.formatting(formattingParams); + + TextEdit textEdit = future.get().getFirst(); + String expectedQuery = """ + DO $$ + BEGIN + CREATE TABLE logs (id serial PRIMARY KEY, + message text, + created_at timestamptz DEFAULT now()); + ELSE RAISE NOTICE 'Table "logs" already exists.'; + END IF; + END $$; + """.trim(); + + Assert.assertEquals(expectedQuery.trim(), textEdit.getNewText()); + Position end = textEdit.getRange().getEnd(); + Assert.assertEquals(1, end.getLine()); + Assert.assertEquals(63, end.getCharacter()); + } + + @Test + public void shouldReturnKeywordTokenData() throws ExecutionException, InterruptedException { + String query = "SELECT"; + TextDocumentItem document = DocumentServiceTestUtils.createQueryDocument(query); + service.didOpen(new DidOpenTextDocumentParams(document)); + + SemanticTokensParams params = new SemanticTokensParams(new TextDocumentIdentifier(document.getUri())); + Integer[] tokensData = service.semanticTokensFull(params).get().getData().toArray(new Integer[0]); + + Assert.assertArrayEquals( + new Integer[] {0, 0, 6, 0, 0}, + tokensData + ); + } + + @Test + public void shouldReturnMultipleTokensData() throws ExecutionException, InterruptedException { + String query = "SELECT name FROM users WHERE surname = 'Doe'"; + TextDocumentItem document = DocumentServiceTestUtils.createQueryDocument(query); + service.didOpen(new DidOpenTextDocumentParams(document)); + + SemanticTokensParams params = new SemanticTokensParams(new TextDocumentIdentifier(document.getUri())); + Integer[] tokensData = service.semanticTokensFull(params).get().getData().toArray(new Integer[0]); + + Integer[] expectedData = { + 0, 0, 6, 0, 0, // SELECT + 0, 12, 4, 0, 0, // FROM + 0, 23, 5, 0, 0, // WHERE + 0, 39, 5, 1, 0 // 'Doe' + }; + Assert.assertArrayEquals( + expectedData, + tokensData + ); + } + + @Test + public void shouldReturnMultilineTokensData() throws ExecutionException, InterruptedException { + String query = """ + SELECT name + FROM + users + WHERE + surname = 'Doe'; + """; + TextDocumentItem document = DocumentServiceTestUtils.createQueryDocument(query); + service.didOpen(new DidOpenTextDocumentParams(document)); + + SemanticTokensParams params = new SemanticTokensParams(new TextDocumentIdentifier(document.getUri())); + Integer[] tokensData = service.semanticTokensFull(params).get().getData().toArray(new Integer[0]); + + Integer[] expectedData = { + 0, 0, 6, 0, 0, // SELECT + 1, 0, 4, 0, 0, // FROM + 3, 0, 5, 0, 0, // WHERE + 4, 14, 5, 1, 0 // 'Doe' + }; + Assert.assertArrayEquals( + expectedData, + tokensData + ); + } +} diff --git a/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceWorkspaceTest.java b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceWorkspaceTest.java new file mode 100644 index 00000000000..028f669afb6 --- /dev/null +++ b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceWorkspaceTest.java @@ -0,0 +1,77 @@ +/* + * DBeaver - Universal Database Manager + * Copyright (C) 2010-2025 DBeaver Corp and others + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.cloudbeaver.model.lsp; + +import org.eclipse.lsp4j.DidOpenTextDocumentParams; +import org.eclipse.lsp4j.TextDocumentItem; +import org.jkiss.dbeaver.model.app.DBPProject; +import org.jkiss.dbeaver.model.app.DBPWorkspace; +import org.jkiss.dbeaver.model.lsp.DBLServerSessionProvider; +import org.jkiss.dbeaver.model.lsp.DBLTextDocumentService; +import org.jkiss.dbeaver.model.lsp.context.ContextAwareDocument; +import org.jkiss.dbeaver.registry.DataSourceRegistry; +import org.jkiss.dbeaver.utils.ResourceUtils; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; + + +public class DBLTextDocumentServiceWorkspaceTest extends H2DataSourceTest { + private static final String PROJECT_ID = "DBLTextDocumentServiceProject"; + private static final String DATA_SOURCE_ID = "workspace-test-data-source"; + + private DBLTextDocumentService service = new DBLTextDocumentService(new TestSessionProvider()); + + protected DBPWorkspace workspace; + protected DBPProject project; + + @Before + public void setUpWorkspace() { + workspace = Mockito.mock(DBPWorkspace.class); + project = Mockito.mock(DBPProject.class); + DataSourceRegistry registry = Mockito.mock(DataSourceRegistry.class); + dataSourceDescriptor.setId(DATA_SOURCE_ID); + + Mockito.when(workspace.getProject(PROJECT_ID)).thenReturn(project); + Mockito.when(project.getDataSourceRegistry()).thenReturn(registry); + Mockito.when(registry.getDataSource(dataSourceDescriptor.getId())) + .thenReturn(dataSourceDescriptor); + + DBLServerSessionProvider sessionProvider = new TestSessionProvider(workspace); + service = new DBLTextDocumentService(sessionProvider); + } + + @Test + public void shouldInitContextWithCustomWorkspace() { + Mockito.when(project.getResourceProperty( + DocumentServiceTestUtils.BASIC_RESOURCE_PATH, + ResourceUtils.PROP_CONTEXT_DEFAULT_DATASOURCE + )).thenReturn(DATA_SOURCE_ID); + + String uri = String.format("lsp://%s/%s", PROJECT_ID, DocumentServiceTestUtils.BASIC_RESOURCE_PATH); + TextDocumentItem document = new TextDocumentItem( + uri, DocumentServiceTestUtils.SQL_LANGUAGE_ID, 0, "select * from table" + ); + + service.didOpen(new DidOpenTextDocumentParams(document)); + + ContextAwareDocument contextAwareDocument = DocumentServiceTestUtils.getDocument(service, document.getUri()); + Assert.assertNotNull(contextAwareDocument); + Assert.assertEquals(dataSourceDescriptor.getDataSource(), contextAwareDocument.getDataSource()); + } +} diff --git a/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DocumentServiceTestUtils.java b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DocumentServiceTestUtils.java new file mode 100644 index 00000000000..1b62138bd91 --- /dev/null +++ b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DocumentServiceTestUtils.java @@ -0,0 +1,125 @@ +/* + * DBeaver - Universal Database Manager + * Copyright (C) 2010-2025 DBeaver Corp and others + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.cloudbeaver.model.lsp; + +import io.cloudbeaver.model.config.CBAppConfig; +import io.cloudbeaver.server.CBApplication; +import org.eclipse.lsp4j.*; +import org.jkiss.code.NotNull; +import org.jkiss.code.Nullable; +import org.jkiss.dbeaver.DBException; +import org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration; +import org.jkiss.dbeaver.model.connection.DBPDriver; +import org.jkiss.dbeaver.model.lsp.DBLTextDocumentService; +import org.jkiss.dbeaver.model.lsp.context.ContextAwareDocument; +import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor; +import org.jkiss.dbeaver.registry.DataSourceDescriptor; +import org.jkiss.dbeaver.registry.DataSourceProviderRegistry; +import org.jkiss.dbeaver.runtime.DBWorkbench; + +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.Map; +import java.util.Objects; + +public class DocumentServiceTestUtils { + + private static final String H2_DRIVER_ID = "h2_embedded_v2"; + public static final String BASIC_RESOURCE_PATH = "scripts/basic.sql"; + public static final String BASIC_URI = "lsp://project-id/" + BASIC_RESOURCE_PATH; + public static final String SQL_LANGUAGE_ID = "SQL"; + + @Nullable + public static ContextAwareDocument getDocument(@NotNull DBLTextDocumentService service, @NotNull String uri) { + try { + Field documentsField = service.getClass().getDeclaredField("documentCache"); + documentsField.setAccessible(true); + Map documents = + (Map) documentsField.get(service); + ContextAwareDocument document = documents.get(uri); + documentsField.setAccessible(false); + return document; + } catch (Exception e) { + throw new IllegalStateException(e); + } + } + + @NotNull + public static TextDocumentItem createQueryDocument(@NotNull String text) { + return new TextDocumentItem(BASIC_URI, SQL_LANGUAGE_ID, 0, text); + } + + @NotNull + public static ContextAwareDocument createAndSaveDocument( + @NotNull DBLTextDocumentService service, + @NotNull String text, + @NotNull String projectId, + @NotNull String resourcePath + ) { + String uri = String.format("lsp://%s/%s", projectId, resourcePath); + TextDocumentItem document = new TextDocumentItem(uri, SQL_LANGUAGE_ID, 0, text); + service.didOpen(new DidOpenTextDocumentParams(document)); + return Objects.requireNonNull(getDocument(service, uri)); + } + + @NotNull + public static DocumentFormattingParams setupDocumentAndBuildFormattingParams( + @NotNull DBLTextDocumentService service, + @NotNull String query + ) { + TextDocumentItem textDocument = createQueryDocument(query); + service.didOpen(new DidOpenTextDocumentParams(textDocument)); + DocumentFormattingParams formattingParams = new DocumentFormattingParams(); + formattingParams.setTextDocument(new TextDocumentIdentifier(BASIC_URI)); + FormattingOptions formattingOptions = new FormattingOptions(); + formattingParams.setOptions(formattingOptions); + return formattingParams; + } + + @NotNull + public static DataSourceDescriptor createDataSource( + @NotNull DBRProgressMonitor monitor + ) throws DBException { + final DBPDriver driver = DataSourceProviderRegistry.getInstance().findDriver(H2_DRIVER_ID); + if (driver == null) { + throw new DBException("Could not find H2 driver: " + H2_DRIVER_ID); + } + + CBAppConfig config = CBApplication.getInstance().getAppConfiguration(); + String[] disabledDrivers = Arrays.stream(config.getDisabledDrivers()) + .filter(driverId -> !Objects.equals(driverId, driver.getFullId())) + .toArray(String[]::new); + config.setDisabledDrivers(disabledDrivers); + config.setEnabledDrivers(new String[] {driver.getFullId()}); + + final DBPConnectionConfiguration configuration = new DBPConnectionConfiguration(); + configuration.setUrl("jdbc:h2:mem:"); + + final DataSourceDescriptor dataSourceDescriptor = new DataSourceDescriptor( + Objects.requireNonNull(DBWorkbench.getPlatform().getWorkspace().getActiveProject()).getDataSourceRegistry(), + DataSourceDescriptor.generateNewId(driver), + driver, + configuration + ); + dataSourceDescriptor.setName("Test DB"); + dataSourceDescriptor.setSavePassword(true); + dataSourceDescriptor.setTemporary(true); + dataSourceDescriptor.connect(monitor, true, true); + + return dataSourceDescriptor; + } +} diff --git a/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/H2DataSourceTest.java b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/H2DataSourceTest.java new file mode 100644 index 00000000000..9b97a90dddb --- /dev/null +++ b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/H2DataSourceTest.java @@ -0,0 +1,79 @@ +/* + * DBeaver - Universal Database Manager + * Copyright (C) 2010-2025 DBeaver Corp and others + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.cloudbeaver.model.lsp; + +import io.cloudbeaver.CloudbeaverMockTest; +import org.jkiss.dbeaver.DBException; +import org.jkiss.dbeaver.ModelPreferences; +import org.jkiss.dbeaver.model.DBUtils; +import org.jkiss.dbeaver.model.app.DBPProject; +import org.jkiss.dbeaver.model.exec.jdbc.JDBCSession; +import org.jkiss.dbeaver.model.exec.jdbc.JDBCStatement; +import org.jkiss.dbeaver.model.lsp.DBLTextDocumentService; +import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor; +import org.jkiss.dbeaver.model.runtime.LoggingProgressMonitor; +import org.jkiss.dbeaver.registry.DataSourceDescriptor; +import org.jkiss.dbeaver.runtime.DBWorkbench; +import org.jkiss.dbeaver.utils.PrefUtils; +import org.jkiss.dbeaver.utils.ResourceUtils; +import org.junit.Assert; +import org.junit.Before; + +import java.nio.file.Path; +import java.sql.SQLException; + +public abstract class H2DataSourceTest extends CloudbeaverMockTest { + + protected DataSourceDescriptor dataSourceDescriptor; + protected DBPProject project; + protected JDBCSession databaseSession; + protected final DBRProgressMonitor monitor = new LoggingProgressMonitor(); + + protected DBLTextDocumentService service; + + @Before + public void setUp() throws DBException { + PrefUtils.setDefaultPreferenceValue( + DBWorkbench.getPlatform().getPreferenceStore(), + ModelPreferences.UI_DRIVERS_HOME, + Path.of("../../../dbeaver-resources-drivers-jdbc/binaries") + ); + + dataSourceDescriptor = DocumentServiceTestUtils.createDataSource(monitor); + databaseSession = DBUtils.openUtilSession(monitor, dataSourceDescriptor, "Internal test session"); + project = DBWorkbench.getPlatform().getWorkspace().getProjects().getFirst(); + project.getDataSourceRegistry().addDataSource(dataSourceDescriptor); + project.setResourceProperty( + DocumentServiceTestUtils.BASIC_RESOURCE_PATH, + ResourceUtils.PROP_CONTEXT_DEFAULT_DATASOURCE, + dataSourceDescriptor.getId() + ); + + try (JDBCStatement stmt = databaseSession.createStatement()) { + Assert.assertFalse(stmt.execute("CREATE TABLE TEST_TABLE1 (id IDENTITY NOT NULL PRIMARY KEY, a VARCHAR, b INT)")); + Assert.assertFalse(stmt.execute("CREATE TABLE TEST_TABLE2 (id IDENTITY NOT NULL PRIMARY KEY, a VARCHAR, b INT)")); + for (int i = 0; i < 100; i++) { + Assert.assertFalse(stmt.execute("INSERT INTO TEST_TABLE1 (a, b) VALUES ('test" + i + "', " + i + ")")); + Assert.assertFalse(stmt.execute("INSERT INTO TEST_TABLE2 (a, b) VALUES ('test" + i + "', " + i + ")")); + } + } catch (SQLException e) { + throw new IllegalStateException(e); + } + + service = new DBLTextDocumentService(new TestSessionProvider()); + } +} diff --git a/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/TestSessionProvider.java b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/TestSessionProvider.java new file mode 100644 index 00000000000..32f7d993247 --- /dev/null +++ b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/TestSessionProvider.java @@ -0,0 +1,48 @@ +/* + * DBeaver - Universal Database Manager + * Copyright (C) 2010-2025 DBeaver Corp and others + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.cloudbeaver.model.lsp; + +import org.jkiss.code.NotNull; +import org.jkiss.code.Nullable; +import org.jkiss.dbeaver.model.app.DBPWorkspace; +import org.jkiss.dbeaver.model.auth.impl.AbstractSessionPersistent; +import org.jkiss.dbeaver.model.lsp.DBLServerSessionProvider; +import org.jkiss.dbeaver.runtime.DBWorkbench; + +class TestSessionProvider implements DBLServerSessionProvider { + private final DBPWorkspace workspace; + + public TestSessionProvider() { + this.workspace = DBWorkbench.getPlatform().getWorkspace(); + } + + public TestSessionProvider(@NotNull DBPWorkspace workspace) { + this.workspace = workspace; + } + + @Nullable + @Override + public AbstractSessionPersistent getSession() { + return null; + } + + @NotNull + @Override + public DBPWorkspace getWorkspace() { + return workspace; + } +} From 7cf4811f1b07a29e6892e6a89dd931d06c58d20e Mon Sep 17 00:00:00 2001 From: Dmitrii Barnukov Date: Mon, 22 Dec 2025 13:49:42 +0100 Subject: [PATCH 2/9] dbeaver/pro#7618 added plugin to feature --- server/features/io.cloudbeaver.server.feature/feature.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/server/features/io.cloudbeaver.server.feature/feature.xml b/server/features/io.cloudbeaver.server.feature/feature.xml index dc763c60765..5d6e8749343 100644 --- a/server/features/io.cloudbeaver.server.feature/feature.xml +++ b/server/features/io.cloudbeaver.server.feature/feature.xml @@ -49,5 +49,6 @@ + From f9faa7a675046a24b8ab13979846da0055bd40fc Mon Sep 17 00:00:00 2001 From: Dmitrii Barnukov Date: Mon, 22 Dec 2025 15:04:55 +0100 Subject: [PATCH 3/9] dbeaver/pro#7618 added module --- server/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/server/pom.xml b/server/pom.xml index 40f9c1fb8f2..34346400f3d 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -24,6 +24,7 @@ bundles features + org.jkiss.dbeaver.model.lsp From 6dd2ab357c6d70fd45f3f8cacae4123595a0e936 Mon Sep 17 00:00:00 2001 From: Dmitrii Barnukov Date: Mon, 22 Dec 2025 15:09:29 +0100 Subject: [PATCH 4/9] dbeaver/pro#7618 added module --- server/pom.xml | 1 - server/test/pom.xml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/server/pom.xml b/server/pom.xml index 34346400f3d..40f9c1fb8f2 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -24,7 +24,6 @@ bundles features - org.jkiss.dbeaver.model.lsp diff --git a/server/test/pom.xml b/server/test/pom.xml index 26b4da16e8e..550326462e3 100644 --- a/server/test/pom.xml +++ b/server/test/pom.xml @@ -14,6 +14,7 @@ pom + org.jkiss.dbeaver.model.lsp io.cloudbeaver.test.platform From 6b046badaecf22d17e7fa645b1135592bb251cb7 Mon Sep 17 00:00:00 2001 From: Dmitrii Barnukov Date: Tue, 23 Dec 2025 10:16:08 +0100 Subject: [PATCH 5/9] dbeaver/pro#7618 fix module --- server/test/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/server/test/pom.xml b/server/test/pom.xml index 550326462e3..26b4da16e8e 100644 --- a/server/test/pom.xml +++ b/server/test/pom.xml @@ -14,7 +14,6 @@ pom - org.jkiss.dbeaver.model.lsp io.cloudbeaver.test.platform From 012f0852772f05f83d5f77cfe0d0ec9bec467bf6 Mon Sep 17 00:00:00 2001 From: Dmitrii Barnukov Date: Tue, 23 Dec 2025 10:41:40 +0100 Subject: [PATCH 6/9] dbeaver/pro#7618 fix dependency --- server/test/io.cloudbeaver.test.platform/META-INF/MANIFEST.MF | 1 - 1 file changed, 1 deletion(-) diff --git a/server/test/io.cloudbeaver.test.platform/META-INF/MANIFEST.MF b/server/test/io.cloudbeaver.test.platform/META-INF/MANIFEST.MF index 69494315943..958fc41b4fd 100644 --- a/server/test/io.cloudbeaver.test.platform/META-INF/MANIFEST.MF +++ b/server/test/io.cloudbeaver.test.platform/META-INF/MANIFEST.MF @@ -36,7 +36,6 @@ Require-Bundle: org.eclipse.core.runtime, org.jkiss.dbeaver.ext.mssql, org.jkiss.dbeaver.ext.h2, org.jkiss.dbeaver.ext.generic, - org.jkiss.dbeaver.test.platform, org.eclipse.lsp4j, org.eclipse.lsp4j.jsonrpc Export-Package: io.cloudbeaver.test.platform From 7470bb639d4e1c30d519910fcc8f56883778cf50 Mon Sep 17 00:00:00 2001 From: Dmitrii Barnukov Date: Mon, 29 Dec 2025 14:39:51 +0100 Subject: [PATCH 7/9] dbeaver/pro#7618 moved resource utils to model --- .../model/lsp/DBLTextDocumentServiceWorkspaceTest.java | 4 ++-- .../src/io/cloudbeaver/model/lsp/H2DataSourceTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceWorkspaceTest.java b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceWorkspaceTest.java index 028f669afb6..2ad234344bb 100644 --- a/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceWorkspaceTest.java +++ b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceWorkspaceTest.java @@ -24,7 +24,7 @@ import org.jkiss.dbeaver.model.lsp.DBLTextDocumentService; import org.jkiss.dbeaver.model.lsp.context.ContextAwareDocument; import org.jkiss.dbeaver.registry.DataSourceRegistry; -import org.jkiss.dbeaver.utils.ResourceUtils; +import org.jkiss.dbeaver.utils.ProjectResourceUtils; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -60,7 +60,7 @@ public void setUpWorkspace() { public void shouldInitContextWithCustomWorkspace() { Mockito.when(project.getResourceProperty( DocumentServiceTestUtils.BASIC_RESOURCE_PATH, - ResourceUtils.PROP_CONTEXT_DEFAULT_DATASOURCE + ProjectResourceUtils.PROP_CONTEXT_DEFAULT_DATASOURCE )).thenReturn(DATA_SOURCE_ID); String uri = String.format("lsp://%s/%s", PROJECT_ID, DocumentServiceTestUtils.BASIC_RESOURCE_PATH); diff --git a/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/H2DataSourceTest.java b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/H2DataSourceTest.java index 9b97a90dddb..079b266a82a 100644 --- a/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/H2DataSourceTest.java +++ b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/H2DataSourceTest.java @@ -29,7 +29,7 @@ import org.jkiss.dbeaver.registry.DataSourceDescriptor; import org.jkiss.dbeaver.runtime.DBWorkbench; import org.jkiss.dbeaver.utils.PrefUtils; -import org.jkiss.dbeaver.utils.ResourceUtils; +import org.jkiss.dbeaver.utils.ProjectResourceUtils; import org.junit.Assert; import org.junit.Before; @@ -59,7 +59,7 @@ public void setUp() throws DBException { project.getDataSourceRegistry().addDataSource(dataSourceDescriptor); project.setResourceProperty( DocumentServiceTestUtils.BASIC_RESOURCE_PATH, - ResourceUtils.PROP_CONTEXT_DEFAULT_DATASOURCE, + ProjectResourceUtils.PROP_CONTEXT_DEFAULT_DATASOURCE, dataSourceDescriptor.getId() ); From 37b50dcd7fd4da16665698a87ef035044e23bb62 Mon Sep 17 00:00:00 2001 From: Dmitrii Barnukov Date: Mon, 29 Dec 2025 15:40:10 +0100 Subject: [PATCH 8/9] dbeaver/pro#7618 review improvements --- .../model/lsp/DBLTextDocumentServiceWorkspaceTest.java | 4 ++-- .../src/io/cloudbeaver/model/lsp/H2DataSourceTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceWorkspaceTest.java b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceWorkspaceTest.java index 2ad234344bb..6ff8ab8ac11 100644 --- a/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceWorkspaceTest.java +++ b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/DBLTextDocumentServiceWorkspaceTest.java @@ -18,13 +18,13 @@ import org.eclipse.lsp4j.DidOpenTextDocumentParams; import org.eclipse.lsp4j.TextDocumentItem; +import org.jkiss.dbeaver.model.DBConstants; import org.jkiss.dbeaver.model.app.DBPProject; import org.jkiss.dbeaver.model.app.DBPWorkspace; import org.jkiss.dbeaver.model.lsp.DBLServerSessionProvider; import org.jkiss.dbeaver.model.lsp.DBLTextDocumentService; import org.jkiss.dbeaver.model.lsp.context.ContextAwareDocument; import org.jkiss.dbeaver.registry.DataSourceRegistry; -import org.jkiss.dbeaver.utils.ProjectResourceUtils; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -60,7 +60,7 @@ public void setUpWorkspace() { public void shouldInitContextWithCustomWorkspace() { Mockito.when(project.getResourceProperty( DocumentServiceTestUtils.BASIC_RESOURCE_PATH, - ProjectResourceUtils.PROP_CONTEXT_DEFAULT_DATASOURCE + DBConstants.PROP_RESOURCE_DEFAULT_DATASOURCE )).thenReturn(DATA_SOURCE_ID); String uri = String.format("lsp://%s/%s", PROJECT_ID, DocumentServiceTestUtils.BASIC_RESOURCE_PATH); diff --git a/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/H2DataSourceTest.java b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/H2DataSourceTest.java index 079b266a82a..8d8bcc7b34e 100644 --- a/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/H2DataSourceTest.java +++ b/server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/lsp/H2DataSourceTest.java @@ -19,6 +19,7 @@ import io.cloudbeaver.CloudbeaverMockTest; import org.jkiss.dbeaver.DBException; import org.jkiss.dbeaver.ModelPreferences; +import org.jkiss.dbeaver.model.DBConstants; import org.jkiss.dbeaver.model.DBUtils; import org.jkiss.dbeaver.model.app.DBPProject; import org.jkiss.dbeaver.model.exec.jdbc.JDBCSession; @@ -29,7 +30,6 @@ import org.jkiss.dbeaver.registry.DataSourceDescriptor; import org.jkiss.dbeaver.runtime.DBWorkbench; import org.jkiss.dbeaver.utils.PrefUtils; -import org.jkiss.dbeaver.utils.ProjectResourceUtils; import org.junit.Assert; import org.junit.Before; @@ -59,7 +59,7 @@ public void setUp() throws DBException { project.getDataSourceRegistry().addDataSource(dataSourceDescriptor); project.setResourceProperty( DocumentServiceTestUtils.BASIC_RESOURCE_PATH, - ProjectResourceUtils.PROP_CONTEXT_DEFAULT_DATASOURCE, + DBConstants.PROP_RESOURCE_DEFAULT_DATASOURCE, dataSourceDescriptor.getId() ); From 4637ede98c86e4e7295c4b66480c39286b045954 Mon Sep 17 00:00:00 2001 From: Dmitrii Barnukov Date: Mon, 29 Dec 2025 17:45:56 +0100 Subject: [PATCH 9/9] dbeaver/pro#7618 removed rcp --- server/test/io.cloudbeaver.test.platform/META-INF/MANIFEST.MF | 1 - 1 file changed, 1 deletion(-) diff --git a/server/test/io.cloudbeaver.test.platform/META-INF/MANIFEST.MF b/server/test/io.cloudbeaver.test.platform/META-INF/MANIFEST.MF index 958fc41b4fd..405ae54bedc 100644 --- a/server/test/io.cloudbeaver.test.platform/META-INF/MANIFEST.MF +++ b/server/test/io.cloudbeaver.test.platform/META-INF/MANIFEST.MF @@ -15,7 +15,6 @@ Require-Bundle: org.eclipse.core.runtime, org.jkiss.dbeaver.osgi.test.runner;visibility:=reexport, org.jkiss.dbeaver.model.sql, org.jkiss.dbeaver.model.lsp, - org.jkiss.dbeaver.model.rcp, org.jkiss.dbeaver.model.jdbc, org.jkiss.dbeaver.registry, org.jkiss.dbeaver.ext.generic,