Skip to content

Commit

Permalink
IntegrationTests: Fix checkstyle issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vanitasvitae authored and guusdk committed Nov 4, 2021
1 parent 59c1df4 commit d4d687e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 27 deletions.
Expand Up @@ -58,6 +58,8 @@ public void unsubscribe() throws NotLoggedInException, NoResponseException, XMPP
/**
* Verifies that a notification is sent when a publication is received, assuming that notification filtering
* has been adjusted to allow for the notification to be delivered.
*
* @throws Exception if the test fails
*/
@SmackIntegrationTest
public void testNotification() throws Exception {
Expand Down Expand Up @@ -120,6 +122,8 @@ public void testNotification() throws Exception {
/**
* Verifies that a notification for a previously sent publication is received as soon as notification filtering
* has been adjusted to allow for the notification to be delivered.
*
* @throws Exception if the test fails
*/
@SmackIntegrationTest
public void testNotificationAfterFilterChange() throws Exception {
Expand Down Expand Up @@ -188,9 +192,10 @@ public void testNotificationAfterFilterChange() throws Exception {
* @param geoManager The GeoLocationManager instance for the connection that is expected to receive data.
* @param discoManager The ServiceDiscoveryManager instance for the connection that is expected to publish data.
* @param listener A listener instance for GeoLocation data that is to be registered.
*
* @throws Exception if the test fails
*/
public void registerListenerAndWait(GeoLocationManager geoManager, ServiceDiscoveryManager discoManager, PepEventListener<GeoLocation> listener) throws Exception
{
public void registerListenerAndWait(GeoLocationManager geoManager, ServiceDiscoveryManager discoManager, PepEventListener<GeoLocation> listener) throws Exception {
final SimpleResultSyncPoint notificationFilterReceived = new SimpleResultSyncPoint();
final EntityCapabilitiesChangedListener notificationFilterReceivedListener = info -> {
if (info.containsFeature(GeoLocationManager.GEOLOCATION_NODE + "+notify")) {
Expand All @@ -214,8 +219,7 @@ public void registerListenerAndWait(GeoLocationManager geoManager, ServiceDiscov
* @param geoManager The GeoLocationManager instance for the connection that was expected to receive data.
* @param listener A listener instance for GeoLocation data that is to be removed.
*/
public void unregisterListener(GeoLocationManager geoManager, PepEventListener<GeoLocation> listener)
{
public void unregisterListener(GeoLocationManager geoManager, PepEventListener<GeoLocation> listener) {
// Does it make sense to have a method implementation that's one line? This is provided to allow for symmetry in the API.
geoManager.removeGeoLocationListener(listener);
}
Expand All @@ -226,9 +230,10 @@ public void unregisterListener(GeoLocationManager geoManager, PepEventListener<G
* @param geoManager The GeoLocationManager instance for the connection that is expected to publish data.
* @param discoManager The ServiceDiscoveryManager instance for the connection that is expected to publish data.
* @param data The data to be published.
*
* @throws Exception if the test fails
*/
public void publishAndWait(GeoLocationManager geoManager, ServiceDiscoveryManager discoManager, GeoLocation data) throws Exception
{
public void publishAndWait(GeoLocationManager geoManager, ServiceDiscoveryManager discoManager, GeoLocation data) throws Exception {
final SimpleResultSyncPoint publicationEchoReceived = new SimpleResultSyncPoint();
final PepEventListener<GeoLocation> publicationEchoListener = (jid, geoLocation, id, message) -> {
if (geoLocation.equals(data)) {
Expand Down
Expand Up @@ -16,6 +16,8 @@
*/
package org.jivesoftware.smackx.mood;

import java.util.concurrent.TimeoutException;

import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.XMPPException;

Expand All @@ -32,8 +34,6 @@
import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
import org.junit.jupiter.api.Assertions;

import java.util.concurrent.TimeoutException;

public class MoodIntegrationTest extends AbstractSmackIntegrationTest {

private final MoodManager mm1;
Expand All @@ -55,6 +55,8 @@ public void unsubscribe()
/**
* Verifies that a notification is sent when a publication is received, assuming that notification filtering
* has been adjusted to allow for the notification to be delivered.
*
* @throws Exception if the test fails
*/
@SmackIntegrationTest
public void testNotification() throws Exception {
Expand Down Expand Up @@ -91,6 +93,8 @@ public void testNotification() throws Exception {
/**
* Verifies that a notification for a previously sent publication is received as soon as notification filtering
* has been adjusted to allow for the notification to be delivered.
*
* @throws Exception if the test fails
*/
@SmackIntegrationTest
public void testNotificationAfterFilterChange() throws Exception {
Expand Down Expand Up @@ -136,9 +140,10 @@ public void testNotificationAfterFilterChange() throws Exception {
* @param moodManager The MoodManager instance for the connection that is expected to receive data.
* @param discoManager The ServiceDiscoveryManager instance for the connection that is expected to publish data.
* @param listener A listener instance for Mood data that is to be registered.
*
* @throws Exception if the test fails
*/
public void registerListenerAndWait(MoodManager moodManager, ServiceDiscoveryManager discoManager, PepEventListener<MoodElement> listener) throws Exception
{
public void registerListenerAndWait(MoodManager moodManager, ServiceDiscoveryManager discoManager, PepEventListener<MoodElement> listener) throws Exception {
final SimpleResultSyncPoint notificationFilterReceived = new SimpleResultSyncPoint();
final EntityCapabilitiesChangedListener notificationFilterReceivedListener = info -> {
if (info.containsFeature(MoodManager.MOOD_NODE + "+notify")) {
Expand All @@ -162,8 +167,7 @@ public void registerListenerAndWait(MoodManager moodManager, ServiceDiscoveryMan
* @param moodManager The MoodManager instance for the connection that was expected to receive data.
* @param listener A listener instance for Mood data that is to be removed.
*/
public void unregisterListener(MoodManager moodManager, PepEventListener<MoodElement> listener)
{
public void unregisterListener(MoodManager moodManager, PepEventListener<MoodElement> listener) {
// Does it make sense to have a method implementation that's one line? This is provided to allow for symmetry in the API.
moodManager.removeMoodListener(listener);
}
Expand All @@ -174,9 +178,10 @@ public void unregisterListener(MoodManager moodManager, PepEventListener<MoodEle
* @param moodManager The MoodManager instance for the connection that is expected to publish data.
* @param discoManager The ServiceDiscoveryManager instance for the connection that is expected to publish data.
* @param data The data to be published.
*
* @throws Exception if the test fails
*/
public void publishAndWait(MoodManager moodManager, ServiceDiscoveryManager discoManager, Mood data) throws Exception
{
public void publishAndWait(MoodManager moodManager, ServiceDiscoveryManager discoManager, Mood data) throws Exception {
final SimpleResultSyncPoint publicationEchoReceived = new SimpleResultSyncPoint();
final PepEventListener<MoodElement> publicationEchoListener = (jid, moodElement, id, message) -> {
if (moodElement.getMood().equals(data)) {
Expand Down
Expand Up @@ -57,19 +57,21 @@ public void unsubscribe()
/**
* Verifies that a notification is sent when a publication is received, assuming that notification filtering
* has been adjusted to allow for the notification to be delivered.
*
* @throws Exception if the test fails
*/
@SmackIntegrationTest
public void testNotification() throws Exception {
URI uri = new URI("http://www.yesworld.com/lyrics/Fragile.html#9");
UserTuneElement.Builder builder = UserTuneElement.getBuilder();
UserTuneElement data = builder.setArtist("Yes")
.setLength(686)
.setRating(8)
.setSource("Yessongs")
.setTitle("Heart of the Sunrise")
.setTrack("3")
.setUri(uri)
.build();
.setLength(686)
.setRating(8)
.setSource("Yessongs")
.setTitle("Heart of the Sunrise")
.setTrack("3")
.setUri(uri)
.build();

IntegrationTestRosterUtil.ensureBothAccountsAreSubscribedToEachOther(conOne, conTwo, timeout);

Expand Down Expand Up @@ -105,6 +107,8 @@ public void testNotification() throws Exception {
/**
* Verifies that a notification for a previously sent publication is received as soon as notification filtering
* has been adjusted to allow for the notification to be delivered.
*
* @throws Exception if the test fails
*/
@SmackIntegrationTest
public void testNotificationAfterFilterChange() throws Exception {
Expand Down Expand Up @@ -159,9 +163,10 @@ public void testNotificationAfterFilterChange() throws Exception {
* @param userTuneManager The UserTuneManager instance for the connection that is expected to receive data.
* @param discoManager The ServiceDiscoveryManager instance for the connection that is expected to publish data.
* @param listener A listener instance for UserTune data that is to be registered.
*
* @throws Exception if the test fails
*/
public void registerListenerAndWait(UserTuneManager userTuneManager, ServiceDiscoveryManager discoManager, PepEventListener<UserTuneElement> listener) throws Exception
{
public void registerListenerAndWait(UserTuneManager userTuneManager, ServiceDiscoveryManager discoManager, PepEventListener<UserTuneElement> listener) throws Exception {
final SimpleResultSyncPoint notificationFilterReceived = new SimpleResultSyncPoint();
final EntityCapabilitiesChangedListener notificationFilterReceivedListener = info -> {
if (info.containsFeature(UserTuneManager.USERTUNE_NODE + "+notify")) {
Expand All @@ -185,8 +190,7 @@ public void registerListenerAndWait(UserTuneManager userTuneManager, ServiceDisc
* @param userTuneManager The UserTuneManager instance for the connection that was expected to receive data.
* @param listener A listener instance for UserTune data that is to be removed.
*/
public void unregisterListener(UserTuneManager userTuneManager, PepEventListener<UserTuneElement> listener)
{
public void unregisterListener(UserTuneManager userTuneManager, PepEventListener<UserTuneElement> listener) {
// Does it make sense to have a method implementation that's one line? This is provided to allow for symmetry in the API.
userTuneManager.removeUserTuneListener(listener);
}
Expand All @@ -197,9 +201,10 @@ public void unregisterListener(UserTuneManager userTuneManager, PepEventListener
* @param userTuneManager The UserTuneManager instance for the connection that is expected to publish data.
* @param discoManager The ServiceDiscoveryManager instance for the connection that is expected to publish data.
* @param data The data to be published.
*
* @throws Exception if the test fails
*/
public void publishAndWait(UserTuneManager userTuneManager, ServiceDiscoveryManager discoManager, UserTuneElement data) throws Exception
{
public void publishAndWait(UserTuneManager userTuneManager, ServiceDiscoveryManager discoManager, UserTuneElement data) throws Exception {
final SimpleResultSyncPoint publicationEchoReceived = new SimpleResultSyncPoint();
final PepEventListener<UserTuneElement> publicationEchoListener = (jid, userTune, id, message) -> {
if (userTune.equals(data)) {
Expand Down

0 comments on commit d4d687e

Please sign in to comment.