-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[CAMEL-23481] replacing retired Apache Derby with HSQL and MariaDB in camel-sql #23597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tmielke
wants to merge
7
commits into
apache:main
Choose a base branch
from
tmielke:replace-derby
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bc273bc
[CAMEL-23481] first preparation to replace Derby with HSQL
5b35f70
[CAMEL-23481] replacing retired Apache Derby with HSQL and MariaDB for
d37e322
Merge remote-tracking branch 'upstream/main' into replace-derby
2b568fa
Merge branch 'apache:main' into replace-derby
tmielke 0c4e554
[CAMEL-23481] need to reintroduce <derby-version> in parent/pom.xml u…
256b770
Merge remote-tracking branch 'upstream/main' into replace-derby
c7cf75f
[CAMEL-23481] - adding a few improvements for camel-sql
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,17 +35,28 @@ | |
|
|
||
| public class CallableStatementWrapperTest extends CamelTestSupport { | ||
|
|
||
| /* This is necessary when debugging tests to enable HSQLDB to find | ||
| the classes in the classpath. */ | ||
| /* | ||
| static { | ||
| if (System.getProperty("hsqldb.method_class_names") == null) { | ||
| System.setProperty( | ||
| "hsqldb.method_class_names", | ||
| "org.apache.camel.component.sql.stored.*"); | ||
| } | ||
| } | ||
| */ | ||
|
|
||
| private TemplateParser templateParser; | ||
| private EmbeddedDatabase db; | ||
| private JdbcTemplate jdbcTemplate; | ||
| private CallableStatementWrapperFactory factory; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This commented-out |
||
|
|
||
| @Override | ||
|
|
||
| public void doPreSetup() throws Exception { | ||
| db = new EmbeddedDatabaseBuilder() | ||
| .setName(getClass().getSimpleName()) | ||
| .setType(EmbeddedDatabaseType.DERBY) | ||
| .setType(EmbeddedDatabaseType.HSQL) | ||
| .addScript("sql/storedProcedureTest.sql").build(); | ||
| jdbcTemplate = new JdbcTemplate(db); | ||
|
|
||
|
|
@@ -60,32 +71,7 @@ void setupTest() { | |
| @Test | ||
| public void shouldExecuteStoredProcedure() throws Exception { | ||
| CallableStatementWrapper wrapper = new CallableStatementWrapper( | ||
| "SUBNUMBERS" | ||
| + "(INTEGER ${header.v1},INTEGER ${header.v2},OUT INTEGER resultofsub)", | ||
| factory); | ||
|
|
||
| final Exchange exchange = createExchangeWithBody(null); | ||
| exchange.getIn().setHeader("v1", 1); | ||
| exchange.getIn().setHeader("v2", 2); | ||
|
|
||
| wrapper.call(new WrapperExecuteCallback() { | ||
| @Override | ||
| public void execute(StatementWrapper statementWrapper) throws SQLException, DataAccessException { | ||
| statementWrapper.populateStatement(null, exchange); | ||
|
|
||
| Map resultOfQuery = (Map) statementWrapper.executeStatement(); | ||
| assertEquals(-1, resultOfQuery.get("resultofsub")); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| @Test | ||
| public void shouldExecuteStoredFunction() throws Exception { | ||
| CallableStatementWrapperFactory factory = new CallableStatementWrapperFactory(jdbcTemplate, templateParser, true); | ||
|
|
||
| CallableStatementWrapper wrapper = new CallableStatementWrapper( | ||
| "SUBNUMBERS_FUNCTION" | ||
| + "(OUT INTEGER resultofsub, INTEGER ${header.v1},INTEGER ${header.v2})", | ||
| "SUBNUMBERS(INTEGER ${header.v1},INTEGER ${header.v2},OUT INTEGER resultofsub)", | ||
| factory); | ||
|
|
||
| final Exchange exchange = createExchangeWithBody(null); | ||
|
|
@@ -116,7 +102,6 @@ public void execute(StatementWrapper statementWrapper) throws SQLException, Data | |
| //no output parameter in stored procedure NILADIC() | ||
| //Spring sets #update-count-1 | ||
| assertNotNull(result.get("#update-count-1")); | ||
|
|
||
| } | ||
| }); | ||
| } | ||
|
|
@@ -127,5 +112,4 @@ public void doPostTearDown() throws Exception { | |
| db.shutdown(); | ||
| } | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.