Browse Source

Extra logging for test execution

pull/204/head
Andrew Shvayka 9 years ago
parent
commit
0b3748357f
  1. 15
      application/src/test/java/org/thingsboard/server/controller/AbstractControllerTest.java
  2. 15
      transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/MqttSessionId.java

15
application/src/test/java/org/thingsboard/server/controller/AbstractControllerTest.java

@ -28,6 +28,10 @@ import org.hamcrest.Matcher;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TestRule;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootContextLoader;
@ -117,6 +121,17 @@ public abstract class AbstractControllerTest {
@Autowired
private WebApplicationContext webApplicationContext;
@Rule
public TestRule watcher = new TestWatcher() {
protected void starting(Description description) {
log.info("Starting test: {}", description.getMethodName());
}
protected void finished(Description description) {
log.info("Finished test: {}", description.getMethodName());
}
};
@Autowired
void setConverters(HttpMessageConverter<?>[] converters) {

15
transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/MqttSessionId.java

@ -1,12 +1,12 @@
/**
* Copyright © 2016-2017 The Thingsboard Authors
*
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -44,6 +44,13 @@ public class MqttSessionId implements SessionId {
}
@Override
public String toString() {
return "MqttSessionId{" +
"id=" + id +
'}';
}
@Override
public int hashCode() {
return (int) (id ^ (id >>> 32));

Loading…
Cancel
Save