Skip to content

Commit d66b537

Browse files
dejan-milisavljevic-sonarsourcesonartech
authored andcommitted
NO-JIRA Use released version of unified core 1.2.1.1077
1 parent 18f44b1 commit d66b537

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,11 @@ subprojects {
366366
dependency "org.sonarsource.sonarqube:webapp-assets:$webappVersion"
367367

368368
// Shared libraries from sonarqube-unification
369-
dependency 'org.sonarsource.sonarqube:sonar-db-commons:1.2.1.1077'
370-
dependency 'org.sonarsource.sonarqube:sonar-db-commons-testfixtures:1.2.0.791'
371-
dependency 'org.sonarsource.sonarqube:sonar-spring:1.2.1.990'
369+
dependencySet(group: 'org.sonarsource.sonarqube', version: '1.2.1.1077') {
370+
entry 'sonar-db-commons'
371+
entry 'sonar-db-commons-testfixtures'
372+
entry 'sonar-spring'
373+
}
372374

373375
// please keep this list alphabetically ordered
374376
dependencySet(group: 'ch.qos.logback', version: '1.5.28') {

server/sonar-db-dao/src/testFixtures/java/org/sonar/db/DbTester.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
import java.util.Map;
2929
import java.util.stream.Stream;
3030
import javax.annotation.Nullable;
31+
import org.junit.rules.TestRule;
32+
import org.junit.runner.Description;
33+
import org.junit.runners.model.Statement;
3134
import org.sonar.api.utils.System2;
3235
import org.sonar.core.util.SequenceUuidFactory;
3336
import org.sonar.core.util.UuidFactory;
@@ -62,7 +65,7 @@
6265
* This class should be called using @Rule.
6366
* Data is truncated between each test. The schema is created between each test.
6467
*/
65-
public class DbTester extends AbstractDbTester<TestDbImpl> {
68+
public class DbTester extends AbstractDbTester<TestDbImpl> implements TestRule {
6669

6770
private final UuidFactory uuidFactory;
6871
private final System2 system2;
@@ -126,6 +129,21 @@ private DbTester(UuidFactory uuidFactory, System2 system2, @Nullable String sche
126129
this.anticipatedTransitionDbTester = new AnticipatedTransitionDbTester(this);
127130
}
128131

132+
@Override
133+
public Statement apply(Statement base, Description description) {
134+
return new Statement() {
135+
@Override
136+
public void evaluate() throws Throwable {
137+
before();
138+
try {
139+
base.evaluate();
140+
} finally {
141+
after();
142+
}
143+
}
144+
};
145+
}
146+
129147
public static DbTester create() {
130148
return create(System2.INSTANCE, new NoOpAuditPersister());
131149
}

0 commit comments

Comments
 (0)