You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ol...@apache.org on 2023/07/14 22:06:09 UTC
[sling-org-apache-sling-jcr-presence] branch master updated: replace Truth by Hamcrest and clean up
This is an automated email from the ASF dual-hosted git repository.
olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-presence.git
The following commit(s) were added to refs/heads/master by this push:
new 3129e1e replace Truth by Hamcrest and clean up
3129e1e is described below
commit 3129e1e1963350b791a380724d929829704050f8
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Fri Jul 14 23:52:52 2023 +0200
replace Truth by Hamcrest and clean up
---
pom.xml | 31 +++++-----------------
.../sling/jcr/presence/JcrPresenceTestSupport.java | 14 ----------
.../apache/sling/jcr/presence/UserPresenterIT.java | 13 ++++-----
3 files changed, 13 insertions(+), 45 deletions(-)
diff --git a/pom.xml b/pom.xml
index 7e4c689..6982e59 100644
--- a/pom.xml
+++ b/pom.xml
@@ -169,19 +169,6 @@
<version>4.0.0</version>
<scope>test</scope>
</dependency>
- <!-- Google -->
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>30.1.1-jre</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>failureaccess</artifactId>
- <version>1.0.1</version>
- <scope>test</scope>
- </dependency>
<!-- nullability -->
<dependency>
<groupId>org.jetbrains</groupId>
@@ -201,21 +188,15 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.awaitility</groupId>
- <artifactId>awaitility</artifactId>
- <version>4.1.0</version>
+ <groupId>org.apache.servicemix.bundles</groupId>
+ <artifactId>org.apache.servicemix.bundles.hamcrest</artifactId>
+ <version>1.3_1</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>com.google.truth</groupId>
- <artifactId>truth</artifactId>
- <version>1.1.3</version>
- <scope>test</scope>
- </dependency>
- <dependency> <!-- truth dep -->
- <groupId>com.googlecode.java-diff-utils</groupId>
- <artifactId>diffutils</artifactId>
- <version>1.3.0</version>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <version>4.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/src/test/java/org/apache/sling/jcr/presence/JcrPresenceTestSupport.java b/src/test/java/org/apache/sling/jcr/presence/JcrPresenceTestSupport.java
index a6bc959..26d7ea7 100644
--- a/src/test/java/org/apache/sling/jcr/presence/JcrPresenceTestSupport.java
+++ b/src/test/java/org/apache/sling/jcr/presence/JcrPresenceTestSupport.java
@@ -18,26 +18,17 @@
*/
package org.apache.sling.jcr.presence;
-import java.util.Objects;
-
import javax.inject.Inject;
import org.apache.sling.jcr.api.SlingRepository;
import org.apache.sling.testing.paxexam.TestSupport;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.options.ModifiableCompositeOption;
-import org.ops4j.pax.exam.options.OptionalCompositeOption;
-import org.ops4j.pax.exam.options.extra.VMOption;
import org.osgi.framework.BundleContext;
import static org.apache.sling.testing.paxexam.SlingOptions.awaitility;
import static org.apache.sling.testing.paxexam.SlingOptions.slingQuickstartOakTar;
import static org.ops4j.pax.exam.CoreOptions.composite;
-import static org.ops4j.pax.exam.CoreOptions.junitBundles;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.vmOption;
-import static org.ops4j.pax.exam.CoreOptions.when;
-import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration;
@@ -61,12 +52,7 @@ public abstract class JcrPresenceTestSupport extends TestSupport {
})
.asOption(),
// testing
- junitBundles(),
awaitility(),
- wrappedBundle(mavenBundle().groupId("com.google.truth").artifactId("truth").versionAsInProject()),
- mavenBundle().groupId("com.google.guava").artifactId("guava").versionAsInProject(),
- mavenBundle().groupId("com.google.guava").artifactId("failureaccess").versionAsInProject(),
- mavenBundle().groupId("com.googlecode.java-diff-utils").artifactId("diffutils").versionAsInProject(),
newConfiguration("org.apache.sling.jcr.base.internal.LoginAdminWhitelist")
.put("whitelist.bundles.regexp", "PAXEXAM-PROBE-.*")
.asOption()
diff --git a/src/test/java/org/apache/sling/jcr/presence/UserPresenterIT.java b/src/test/java/org/apache/sling/jcr/presence/UserPresenterIT.java
index fa34a01..a3ca7dc 100644
--- a/src/test/java/org/apache/sling/jcr/presence/UserPresenterIT.java
+++ b/src/test/java/org/apache/sling/jcr/presence/UserPresenterIT.java
@@ -37,9 +37,10 @@ import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;
import org.osgi.framework.ServiceReference;
-import static com.google.common.truth.Truth.assertThat;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.awaitility.Awaitility.with;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.ops4j.pax.exam.CoreOptions.options;
import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
@@ -74,11 +75,11 @@ public class UserPresenterIT extends JcrPresenceTestSupport {
until(() -> countUserPresences("sling-readall", false, true) == 1);
// test user
- assertThat(isUserPresent("test")).isFalse();
- assertThat(countUserPresences("test", false, true)).isEqualTo(0);
+ assertThat(isUserPresent("test"), is(false));
+ assertThat(countUserPresences("test", false, true), is(0));
createUser("test", true);
- assertThat(isUserPresent("test")).isTrue();
+ assertThat(isUserPresent("test"), is(true));
with().
pollInterval(1, SECONDS).
@@ -89,7 +90,7 @@ public class UserPresenterIT extends JcrPresenceTestSupport {
until(() -> countUserPresences("test", false, true) == 1);
disableUser("test");
- assertThat(isUserPresent("test")).isTrue();
+ assertThat(isUserPresent("test"), is(true));
with().
pollInterval(1, SECONDS).
@@ -100,7 +101,7 @@ public class UserPresenterIT extends JcrPresenceTestSupport {
until(() -> countUserPresences("test", true, true) == 1);
removeUser("test");
- assertThat(isUserPresent("test")).isFalse();
+ assertThat(isUserPresent("test"), is(false));
with().
pollInterval(1, SECONDS).