-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support existing database in directory subsubprotocol (GH #15)
Added support to skip the create=true attribute in the JDBC URL to initialize the database. Fixed / Cleaned up tests and documentation Resolves #15 Change-Id: Id8bd785c102868a1cd6b27bf284572b1cf5a121b
- Loading branch information
Showing
16 changed files
with
203 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- | ||
Copyright 2016 Development Entropy (deventropy.org) Contributors | ||
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. | ||
--> | ||
|
||
# JUnit Helper Changelog | ||
|
||
The *Changes Report* is available on each individual module's site. | ||
|
||
* [JUnit Helper Changes Report](http://www.deventropy.org/junit-helper/changes-report.html) | ||
* [JUnit Helper :: Derby Changes Report](http://www.deventropy.org/junit-helper/junit-helper-derby/changes-report.html) |
This file contains 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 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 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 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 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 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 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 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 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
60 changes: 60 additions & 0 deletions
60
...ava/org/deventropy/junithelper/derby/directory/simple01/DirectoryDbExistingDbDirTest.java
This file contains 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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2016 Development Entropy (deventropy.org) Contributors | ||
* | ||
* 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 org.deventropy.junithelper.derby.directory.simple01; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.sql.SQLException; | ||
|
||
import org.deventropy.junithelper.derby.AbstractEmbeddedDerbyResourceTest; | ||
import org.deventropy.junithelper.derby.DerbyResourceConfig; | ||
import org.deventropy.junithelper.derby.EmbeddedDerbyResource; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.rules.TemporaryFolder; | ||
|
||
/** | ||
* @author Bindul Bhowmik | ||
* | ||
*/ | ||
public class DirectoryDbExistingDbDirTest extends AbstractEmbeddedDerbyResourceTest { | ||
|
||
private static final String DB_NAME = "test-database-dir-test04-custom-existing"; | ||
|
||
@Rule | ||
public TemporaryFolder tempFolder = new TemporaryFolder(); | ||
|
||
@Test | ||
public void testStartingDbFromExistingDbDir () throws IOException, SQLException { | ||
final File dbPathFile = createAndShutdownDbInDirSimple01(tempFolder, DB_NAME); | ||
final File derbyHome = tempFolder.newFolder(); | ||
final DerbyResourceConfig config = DerbyResourceConfig.buildDefault() | ||
.useDatabaseInDirectory(dbPathFile.getAbsolutePath(), true); | ||
final EmbeddedDerbyResource embeddedDerbyResource = new EmbeddedDerbyResource(config, derbyHome); | ||
embeddedDerbyResource.start(); | ||
|
||
// Make sure derby loads up | ||
final String jdbcUrl = embeddedDerbyResource.getJdbcUrl(); | ||
assertNotNull(jdbcUrl); | ||
|
||
simpleDb01Check01(jdbcUrl); | ||
|
||
// Done, shut it down | ||
closeEmbeddedDerbyResource(embeddedDerbyResource); | ||
} | ||
} |
This file contains 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.