Skip to content

Commit

Permalink
Merge branch 'work/using-react-with-bootstrap4'
Browse files Browse the repository at this point in the history
  • Loading branch information
steinarb committed Aug 1, 2024
2 parents dbca829 + 1401b62 commit 6a6f81a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>no.priv.bang.pom</groupId>
<artifactId>bang-authservice-client-pom</artifactId>
<version>2.0.2</version>
<version>2.0.3</version>
</parent>
<groupId>no.priv.bang.ukelonn</groupId>
<artifactId>ukelonn</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import org.osgi.service.log.LogService;
import org.osgi.service.log.Logger;

import liquibase.Scope;
import liquibase.ThreadLocalScopeManager;
import no.priv.bang.ukelonn.db.liquibase.UkelonnLiquibase;

@Component(immediate=true, property = "name=ukelonndb")
Expand All @@ -46,7 +44,6 @@ public void setLogService(LogService logService) {
@Activate
public void activate(Map<String, Object> config) {
databaselanguage = (String) config.get("databaselanguage");
Scope.setScopeManager(new ThreadLocalScopeManager());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@

import liquibase.Liquibase;
import liquibase.Scope;
import liquibase.ThreadLocalScopeManager;
import liquibase.changelog.ChangeLogHistoryService;
import liquibase.changelog.ChangeLogHistoryServiceFactory;
import liquibase.changelog.RanChangeSet;
import liquibase.database.Database;
import liquibase.database.DatabaseFactory;
import liquibase.database.jvm.JdbcConnection;
import liquibase.exception.DatabaseException;
Expand All @@ -54,7 +55,6 @@ public void setLogService(LogService logService) {
@Activate
public void activate(Map<String, Object> config) {
databaselanguage = (String) config.get("databaselanguage");
Scope.setScopeManager(new ThreadLocalScopeManager());
}

@Override
Expand Down Expand Up @@ -110,8 +110,8 @@ public boolean rollbackMockData(DataSource datasource) {
List<RanChangeSet> getChangeLogHistory(DataSource datasource) throws DatabaseException, SQLException {
try(var connect = datasource.getConnection()) {
try(var databaseConnection = new JdbcConnection(connect)) {
var database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(databaseConnection);
var logHistoryService = Scope.getCurrentScope().getSingleton(ChangeLogHistoryServiceFactory.class).getChangeLogService(database);
var database = findCorrectDatabaseImplementation(databaseConnection);
var logHistoryService = findChangeLogService(database);
return logHistoryService.getRanChangeSets();
} catch (Exception e) {
logger.error("Failed to create derby test database schema", e);
Expand All @@ -121,6 +121,14 @@ List<RanChangeSet> getChangeLogHistory(DataSource datasource) throws DatabaseExc
return Collections.emptyList();
}

private Database findCorrectDatabaseImplementation(JdbcConnection databaseConnection) throws DatabaseException {
return DatabaseFactory.getInstance().findCorrectDatabaseImplementation(databaseConnection);
}

private ChangeLogHistoryService findChangeLogService(Database database) {
return Scope.getCurrentScope().getSingleton(ChangeLogHistoryServiceFactory.class).getChangeLogService(database);
}

String dummyDataResourceName() {
if (databaselanguage == null) {
return DEFAULT_DUMMY_DATA_CHANGELOG;
Expand Down

0 comments on commit 6a6f81a

Please sign in to comment.