editorconfig: max line length set

max line length warnings removed
missing Copyright added
useless publics removed
unmaintainable Javadoc tags: @author removed
helper class warnings removed
field default value initialization removed
Multiple warnings removed
pref: checkstyle warnings removed
Checkstyle will fail the build process if it detects violations
switch default cases error logger added
This commit is contained in:
Andreas Mager
2017-04-13 22:16:57 +02:00
parent 6dc762f47f
commit 9221a87812
122 changed files with 999 additions and 454 deletions
@@ -1,3 +1,18 @@
/*
* Copyright (c) 2012-2017 The original author or authors
* ------------------------------------------------------
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* The Apache License v2.0 is available at
* http://www.opensource.org/licenses/apache2.0.php
*
* You may elect to redistribute this code under either of these licenses.
*/
package io.moquette.spi;
@@ -32,9 +32,6 @@ import static org.mockito.Matchers.refEq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
/**
* @author Wagner Macedo
*/
public class BrokerInterceptorTest {
// value to check for changes after every notification
@@ -22,8 +22,6 @@ import io.moquette.spi.security.IAuthenticator;
/**
* Test utility to implements authenticator instance.
*
* @author andrea
*/
class MockAuthenticator implements IAuthenticator {
@@ -27,7 +27,7 @@ import static org.junit.Assert.assertTrue;
/**
* Some useful assertions used by Netty's EmbeddedChannel in tests.
*/
class NettyChannelAssertions {
final class NettyChannelAssertions {
static void assertEqualsConnAck(MqttConnectReturnCode expectedCode, Object connAck) {
assertEqualsConnAck(null, expectedCode, connAck);
@@ -54,4 +54,6 @@ class NettyChannelAssertions {
// assertEquals(expectedCode, connAckMsg.getReturnCode());
}
private NettyChannelAssertions() {
}
}
@@ -40,10 +40,6 @@ import static io.moquette.spi.impl.ProtocolProcessor.lowerQosToTheSubscriptionDe
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
/**
*
* @author andrea
*/
public class ProtocolProcessorTest {
static final String FAKE_CLIENT_ID = "FAKE_123";
@@ -263,7 +259,7 @@ public class ProtocolProcessorTest {
m_processor.processSubscribe(m_channel, msg);
assertEquals(1, subscriptions.size());
//Exercise
m_processor.processSubscribe(m_channel, msg);
@@ -311,7 +307,8 @@ public class ProtocolProcessorTest {
@Test
public void testPublishOfRetainedMessage_afterNewSubscription() throws Exception {
// simulate a connect that register a clientID to an IoSession
final Subscription subscription = new Subscription(FAKE_PUBLISHER_ID, new Topic(FAKE_TOPIC), MqttQoS.AT_MOST_ONCE);
final Subscription subscription =
new Subscription(FAKE_PUBLISHER_ID, new Topic(FAKE_TOPIC), MqttQoS.AT_MOST_ONCE);
// subscriptions.matches(topic) redefine the method to return true
SubscriptionsStore subs = new SubscriptionsStore() {
@@ -43,10 +43,6 @@ import static io.netty.handler.codec.mqtt.MqttConnectReturnCode.*;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
*
* @author andrea
*/
public class ProtocolProcessor_CONNECT_Test {
EmbeddedChannel m_session;
@@ -23,9 +23,6 @@ import java.io.StringReader;
import java.text.ParseException;
import static org.junit.Assert.*;
/**
* @author andrea
*/
public class ACLFileParserTest {
@Test
@@ -22,9 +22,6 @@ import io.moquette.spi.impl.subscriptions.Topic;
import java.text.ParseException;
import static org.junit.Assert.*;
/**
* @author andrea
*/
public class AuthorizationsCollectorTest {
private static final Authorization RW_ANEMOMETER = new Authorization(new Topic("/weather/italy/anemometer"));
@@ -1,3 +1,18 @@
/*
* Copyright (c) 2012-2017 The original author or authors
* ------------------------------------------------------
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* The Apache License v2.0 is available at
* http://www.opensource.org/licenses/apache2.0.php
*
* You may elect to redistribute this code under either of these licenses.
*/
package io.moquette.spi.impl.security;
@@ -12,9 +27,6 @@ import java.sql.*;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* Created by mackristof on 12/05/2016.
*/
public class DBAuthenticatorTest {
private static final Logger LOG = LoggerFactory.getLogger(DBAuthenticatorTest.class);
@@ -21,10 +21,7 @@ import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
*
* @author andrea
*/
@SuppressWarnings("deprecation")
public class FileAuthenticatorTest {
@Test
@@ -27,10 +27,6 @@ import java.io.IOException;
import java.util.List;
import static org.assertj.core.api.Assertions.*;
/**
*
* @author andrea
*/
public class SubscriptionsStoreTest {
private SubscriptionsStore store;
@@ -1,3 +1,19 @@
/*
* Copyright (c) 2012-2017 The original author or authors
* ------------------------------------------------------
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* The Apache License v2.0 is available at
* http://www.opensource.org/licenses/apache2.0.php
*
* You may elect to redistribute this code under either of these licenses.
*/
package io.moquette.spi.impl.subscriptions;
import io.moquette.spi.ISessionsStore;
@@ -5,9 +21,6 @@ import org.junit.Test;
import static org.junit.Assert.*;
/**
* Created by andrea on 03/03/17.
*/
public class TreeNodeTest {
@Test
@@ -54,7 +67,8 @@ public class TreeNodeTest {
TreeNode updatedRoot = root.removeClientSubscriptions("Client1");
assertFalse("Remove a subscription shouldn't remove intermediate empty nodes", updatedRoot.m_children.isEmpty());
assertFalse("Remove a subscription shouldn't remove intermediate empty nodes",
updatedRoot.m_children.isEmpty());
}
}