From 95d016c08569f74a2c76eac40c4f5656bb773951 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Tue, 20 Dec 2016 17:50:32 +0200 Subject: Global java code cleanup using Eclipse Neon.1 --- .../vaadin/benchmarks/PerformanceTester8759.java | 2 +- .../vaadin/data/BeanBinderInstanceFieldTest.java | 2 +- .../test/java/com/vaadin/data/BeanBinderTest.java | 3 +- .../vaadin/data/BinderConverterValidatorTest.java | 7 +-- .../com/vaadin/data/BinderMultiSelectTest.java | 3 +- .../test/java/com/vaadin/data/BinderTestBase.java | 6 +-- .../test/java/com/vaadin/data/HasValueTest.java | 2 - .../src/test/java/com/vaadin/data/ResultTest.java | 9 ++-- .../data/provider/AbstractDataProviderTest.java | 3 -- .../data/provider/BackendDataProviderTest.java | 2 - .../vaadin/data/provider/DataCommunicatorTest.java | 3 -- .../vaadin/data/provider/DataProviderTestBase.java | 9 +--- .../vaadin/data/provider/ListDataProviderTest.java | 4 -- .../data/validator/StringLengthValidatorTest.java | 4 +- .../com/vaadin/tests/data/bean/BeanToValidate.java | 2 +- .../vaadin/tests/design/ComponentFactoryTest.java | 59 +++++++++++++--------- .../vaadin/tests/design/DesignFormatterTest.java | 3 +- .../ExtendedDesignWithEmptyAnnotation.java | 1 - .../com/vaadin/tests/event/EventRouterTest.java | 1 - .../com/vaadin/tests/event/ShortcutActionTest.java | 3 +- .../tests/server/ClassesSerializableTest.java | 5 +- .../clientconnector/AttachDetachListenersTest.java | 4 +- .../component/DeclarativeMarginTestBase.java | 11 ++-- .../AbstractDateFieldDeclarativeTest.java | 2 +- .../AbstractOrderedLayoutDeclarativeTest.java | 1 - .../RemoveFromParentLockingTest.java | 14 ++--- .../server/component/button/ButtonClickTest.java | 1 - .../AbstractColorPickerDeclarativeTest.java | 2 +- .../ColorPickerAreaDeclarativeTest.java | 2 +- .../colorpicker/ColorPickerDeclarativeTest.java | 2 +- .../combobox/ComboBoxDeclarativeTest.java | 3 +- .../server/component/grid/GridDeclarativeTest.java | 1 + .../gridlayout/GridLayoutDeclarativeTest.java | 3 +- .../listselect/ListSelectDeclarativeTest.java | 4 +- .../nativeselect/NativeSelectDeclarativeTest.java | 2 +- .../PasswordFieldDeclarativeTest.java | 2 +- .../RadioButtonGroupDeclarativeTest.java | 4 +- .../server/component/tabsheet/TabSheetTest.java | 2 +- .../TwinColSelectDeclarativeTest.java | 4 +- .../component/window/AttachDetachWindowTest.java | 2 - .../com/vaadin/ui/AbstractMultiSelectTest.java | 6 +-- .../com/vaadin/ui/AbstractSingleSelectTest.java | 5 +- .../com/vaadin/ui/RadioButtonGroupBoVTest.java | 9 +--- .../java/com/vaadin/ui/RadioButtonGroupTest.java | 4 +- .../test/java/com/vaadin/ui/RichTextAreaTest.java | 11 ++-- .../java/com/vaadin/util/CurrentInstanceTest.java | 25 +++++---- 46 files changed, 122 insertions(+), 137 deletions(-) (limited to 'server/src/test/java/com/vaadin') diff --git a/server/src/test/java/com/vaadin/benchmarks/PerformanceTester8759.java b/server/src/test/java/com/vaadin/benchmarks/PerformanceTester8759.java index af7e613bbf..6c4594eb34 100644 --- a/server/src/test/java/com/vaadin/benchmarks/PerformanceTester8759.java +++ b/server/src/test/java/com/vaadin/benchmarks/PerformanceTester8759.java @@ -5,7 +5,7 @@ import com.vaadin.ui.Label; /* * This simple test shows the performance difference between the StringTokenizer implementation and the String.split() implementation in AbstractComponent. * Your results will vary. - * The real world use case motivating it was a 10k Row table, which generated labels for 10 columns. + * The real world use case motivating it was a 10k Row table, which generated labels for 10 columns. * This is 1/10th of what this performance tester demonstrates. * * Please run with -server and -Xloggc:/tmp/gclog.vgc -verbose:gc -XX:+PrintCompilation diff --git a/server/src/test/java/com/vaadin/data/BeanBinderInstanceFieldTest.java b/server/src/test/java/com/vaadin/data/BeanBinderInstanceFieldTest.java index e0f6e2eaa5..9ed2e8edda 100644 --- a/server/src/test/java/com/vaadin/data/BeanBinderInstanceFieldTest.java +++ b/server/src/test/java/com/vaadin/data/BeanBinderInstanceFieldTest.java @@ -32,7 +32,7 @@ import com.vaadin.ui.TextField; /** * Unit tests for {@link BeanBinder#bindInstanceFields(Object)} method. - * + * * @author Vaadin Ltd * */ diff --git a/server/src/test/java/com/vaadin/data/BeanBinderTest.java b/server/src/test/java/com/vaadin/data/BeanBinderTest.java index d45cfe04fd..1b9f2f0ac7 100644 --- a/server/src/test/java/com/vaadin/data/BeanBinderTest.java +++ b/server/src/test/java/com/vaadin/data/BeanBinderTest.java @@ -198,7 +198,8 @@ public class BeanBinderTest private void assertInvalid(HasValue field, String message) { BinderValidationStatus status = binder.validate(); - List> errors = status.getFieldValidationErrors(); + List> errors = status + .getFieldValidationErrors(); assertEquals(1, errors.size()); assertSame(field, errors.get(0).getField()); assertEquals(message, errors.get(0).getMessage().get()); diff --git a/server/src/test/java/com/vaadin/data/BinderConverterValidatorTest.java b/server/src/test/java/com/vaadin/data/BinderConverterValidatorTest.java index bc46395d08..64bde4d772 100644 --- a/server/src/test/java/com/vaadin/data/BinderConverterValidatorTest.java +++ b/server/src/test/java/com/vaadin/data/BinderConverterValidatorTest.java @@ -97,12 +97,13 @@ public class BinderConverterValidatorTest binding.bind(Person::getFirstName, Person::setFirstName); BinderValidationStatus status = binder.validate(); - List> errors = status.getFieldValidationErrors(); + List> errors = status + .getFieldValidationErrors(); assertEquals(1, errors.size()); - BindingValidationStatus validationStatus = errors.stream().findFirst() - .get(); + BindingValidationStatus validationStatus = errors.stream() + .findFirst().get(); String msg = validationStatus.getMessage().get(); assertEquals(msg1, msg); diff --git a/server/src/test/java/com/vaadin/data/BinderMultiSelectTest.java b/server/src/test/java/com/vaadin/data/BinderMultiSelectTest.java index 820447172e..78a132b04d 100644 --- a/server/src/test/java/com/vaadin/data/BinderMultiSelectTest.java +++ b/server/src/test/java/com/vaadin/data/BinderMultiSelectTest.java @@ -65,8 +65,7 @@ public class BinderMultiSelectTest converterBinder.forField(select) .withConverter(new TestEnumSetToStringConverter()) - .bind(AtomicReference::get, - AtomicReference::set); + .bind(AtomicReference::get, AtomicReference::set); } @Test diff --git a/server/src/test/java/com/vaadin/data/BinderTestBase.java b/server/src/test/java/com/vaadin/data/BinderTestBase.java index 7a238ac7ce..8cad82d570 100644 --- a/server/src/test/java/com/vaadin/data/BinderTestBase.java +++ b/server/src/test/java/com/vaadin/data/BinderTestBase.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2016 Vaadin Ltd. - * + * * 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 - * + * * 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. See the diff --git a/server/src/test/java/com/vaadin/data/HasValueTest.java b/server/src/test/java/com/vaadin/data/HasValueTest.java index f250d6a5b6..b40b7e64a1 100644 --- a/server/src/test/java/com/vaadin/data/HasValueTest.java +++ b/server/src/test/java/com/vaadin/data/HasValueTest.java @@ -18,8 +18,6 @@ package com.vaadin.data; import org.junit.Test; import org.mockito.Mockito; -import com.vaadin.data.HasValue; - /** * @author Vaadin Ltd * diff --git a/server/src/test/java/com/vaadin/data/ResultTest.java b/server/src/test/java/com/vaadin/data/ResultTest.java index 1dcda58a4d..8f594c1300 100644 --- a/server/src/test/java/com/vaadin/data/ResultTest.java +++ b/server/src/test/java/com/vaadin/data/ResultTest.java @@ -15,10 +15,11 @@ */ package com.vaadin.data; -import com.vaadin.server.SerializableFunction; import org.junit.Assert; import org.junit.Test; +import com.vaadin.server.SerializableFunction; + /** * @author Vaadin Ltd * @@ -70,7 +71,8 @@ public class ResultTest { Result result = new SimpleResult("foo", null) { @Override - public Result flatMap(SerializableFunction> mapper) { + public Result flatMap( + SerializableFunction> mapper) { return mapper.apply("foo"); } }; @@ -89,7 +91,8 @@ public class ResultTest { Result result = new SimpleResult("foo", null) { @Override - public Result flatMap(SerializableFunction> mapper) { + public Result flatMap( + SerializableFunction> mapper) { return new SimpleResult<>(null, "bar"); } }; diff --git a/server/src/test/java/com/vaadin/data/provider/AbstractDataProviderTest.java b/server/src/test/java/com/vaadin/data/provider/AbstractDataProviderTest.java index 58ce4c3f75..5fbaaaeb8a 100644 --- a/server/src/test/java/com/vaadin/data/provider/AbstractDataProviderTest.java +++ b/server/src/test/java/com/vaadin/data/provider/AbstractDataProviderTest.java @@ -21,9 +21,6 @@ import java.util.stream.Stream; import org.junit.Assert; import org.junit.Test; -import com.vaadin.data.provider.AbstractDataProvider; -import com.vaadin.data.provider.DataChangeEvent; -import com.vaadin.data.provider.Query; import com.vaadin.shared.Registration; /** diff --git a/server/src/test/java/com/vaadin/data/provider/BackendDataProviderTest.java b/server/src/test/java/com/vaadin/data/provider/BackendDataProviderTest.java index 6e9727af3f..585abc230a 100644 --- a/server/src/test/java/com/vaadin/data/provider/BackendDataProviderTest.java +++ b/server/src/test/java/com/vaadin/data/provider/BackendDataProviderTest.java @@ -7,8 +7,6 @@ import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; -import com.vaadin.data.provider.BackEndDataProvider; -import com.vaadin.data.provider.SortOrder; import com.vaadin.server.SerializablePredicate; import com.vaadin.shared.data.sort.SortDirection; diff --git a/server/src/test/java/com/vaadin/data/provider/DataCommunicatorTest.java b/server/src/test/java/com/vaadin/data/provider/DataCommunicatorTest.java index f185d0969e..f49dbf1f88 100644 --- a/server/src/test/java/com/vaadin/data/provider/DataCommunicatorTest.java +++ b/server/src/test/java/com/vaadin/data/provider/DataCommunicatorTest.java @@ -21,9 +21,6 @@ import org.junit.Assert; import org.junit.Test; import org.mockito.Mockito; -import com.vaadin.data.provider.DataCommunicator; -import com.vaadin.data.provider.DataProviderListener; -import com.vaadin.data.provider.ListDataProvider; import com.vaadin.server.MockVaadinSession; import com.vaadin.server.SerializablePredicate; import com.vaadin.server.VaadinRequest; diff --git a/server/src/test/java/com/vaadin/data/provider/DataProviderTestBase.java b/server/src/test/java/com/vaadin/data/provider/DataProviderTestBase.java index fa7ca2d840..da909af29a 100644 --- a/server/src/test/java/com/vaadin/data/provider/DataProviderTestBase.java +++ b/server/src/test/java/com/vaadin/data/provider/DataProviderTestBase.java @@ -12,12 +12,6 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import com.vaadin.data.provider.DataChangeEvent; -import com.vaadin.data.provider.DataProvider; -import com.vaadin.data.provider.DataProviderListener; -import com.vaadin.data.provider.Query; -import com.vaadin.data.provider.Sort; -import com.vaadin.data.provider.SortOrder; import com.vaadin.server.SerializablePredicate; public abstract class DataProviderTestBase>> { @@ -66,8 +60,7 @@ public abstract class DataProviderTestBase> createQuery( List> sortOrder, Comparator comp, SerializablePredicate filter) { - return new Query<>(0, - Integer.MAX_VALUE, sortOrder, comp, filter); + return new Query<>(0, Integer.MAX_VALUE, sortOrder, comp, filter); } private Query> createQuery( diff --git a/server/src/test/java/com/vaadin/data/provider/ListDataProviderTest.java b/server/src/test/java/com/vaadin/data/provider/ListDataProviderTest.java index 8cb9c2a4fe..148b5f98f8 100644 --- a/server/src/test/java/com/vaadin/data/provider/ListDataProviderTest.java +++ b/server/src/test/java/com/vaadin/data/provider/ListDataProviderTest.java @@ -6,10 +6,6 @@ import java.util.List; import org.junit.Assert; import org.junit.Test; -import com.vaadin.data.provider.DataProvider; -import com.vaadin.data.provider.ListDataProvider; -import com.vaadin.data.provider.Query; -import com.vaadin.data.provider.SortOrder; import com.vaadin.server.SerializablePredicate; public class ListDataProviderTest diff --git a/server/src/test/java/com/vaadin/data/validator/StringLengthValidatorTest.java b/server/src/test/java/com/vaadin/data/validator/StringLengthValidatorTest.java index 7fb1c2ff76..758059c288 100644 --- a/server/src/test/java/com/vaadin/data/validator/StringLengthValidatorTest.java +++ b/server/src/test/java/com/vaadin/data/validator/StringLengthValidatorTest.java @@ -7,8 +7,8 @@ import org.junit.Test; public class StringLengthValidatorTest extends ValidatorTestBase { - private static final String LONG_STRING = Stream.generate(() -> "x").limit(1000) - .collect(Collectors.joining()); + private static final String LONG_STRING = Stream.generate(() -> "x") + .limit(1000).collect(Collectors.joining()); @Test public void testNullStringFails() { diff --git a/server/src/test/java/com/vaadin/tests/data/bean/BeanToValidate.java b/server/src/test/java/com/vaadin/tests/data/bean/BeanToValidate.java index 23270cab5e..591debe9ba 100644 --- a/server/src/test/java/com/vaadin/tests/data/bean/BeanToValidate.java +++ b/server/src/test/java/com/vaadin/tests/data/bean/BeanToValidate.java @@ -99,7 +99,7 @@ public class BeanToValidate { } public void setAddresses(Address[] address) { - this.addresses = address; + addresses = address; } public Address getAddress() { diff --git a/server/src/test/java/com/vaadin/tests/design/ComponentFactoryTest.java b/server/src/test/java/com/vaadin/tests/design/ComponentFactoryTest.java index 1aacaf44cc..98224d90c1 100644 --- a/server/src/test/java/com/vaadin/tests/design/ComponentFactoryTest.java +++ b/server/src/test/java/com/vaadin/tests/design/ComponentFactoryTest.java @@ -24,7 +24,6 @@ import org.junit.Assert; import org.junit.Test; import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Component; import com.vaadin.ui.Label; import com.vaadin.ui.declarative.Design; import com.vaadin.ui.declarative.Design.ComponentFactory; @@ -40,15 +39,16 @@ public class ComponentFactoryTest { // Set static component factory that delegate to a thread local factory static { - Design.setComponentFactory((String fullyQualifiedClassName, DesignContext context) -> { - ComponentFactory componentFactory = currentComponentFactory - .get(); - if (componentFactory == null) { - componentFactory = defaultFactory; - } - return componentFactory.createComponent(fullyQualifiedClassName, - context); - }); + Design.setComponentFactory( + (String fullyQualifiedClassName, DesignContext context) -> { + ComponentFactory componentFactory = currentComponentFactory + .get(); + if (componentFactory == null) { + componentFactory = defaultFactory; + } + return componentFactory + .createComponent(fullyQualifiedClassName, context); + }); } @Test(expected = IllegalArgumentException.class) @@ -59,11 +59,13 @@ public class ComponentFactoryTest { @Test public void testComponentFactoryLogging() { final List messages = new ArrayList<>(); - currentComponentFactory.set((ComponentFactory) (String fullyQualifiedClassName, DesignContext context) -> { - messages.add("Requested class " + fullyQualifiedClassName); - return defaultFactory.createComponent(fullyQualifiedClassName, - context); - }); + currentComponentFactory + .set((ComponentFactory) (String fullyQualifiedClassName, + DesignContext context) -> { + messages.add("Requested class " + fullyQualifiedClassName); + return defaultFactory + .createComponent(fullyQualifiedClassName, context); + }); Design.read(new ByteArrayInputStream("".getBytes())); @@ -75,15 +77,24 @@ public class ComponentFactoryTest { @Test(expected = DesignException.class) public void testComponentFactoryReturningNull() { - currentComponentFactory.set((ComponentFactory) (String fullyQualifiedClassName, DesignContext context) -> null); + currentComponentFactory + .set((ComponentFactory) (String fullyQualifiedClassName, + DesignContext context) -> null); Design.read(new ByteArrayInputStream("".getBytes())); } @Test(expected = DesignException.class) public void testComponentFactoryThrowingStuff() { - currentComponentFactory.set((ComponentFactory) (String fullyQualifiedClassName, DesignContext context) -> defaultFactory.createComponent( - "foobar." + fullyQualifiedClassName, context) // Will throw because class is not found + currentComponentFactory.set((ComponentFactory) ( + String fullyQualifiedClassName, + DesignContext context) -> defaultFactory.createComponent( + "foobar." + fullyQualifiedClassName, context) // Will + // throw + // because + // class + // is not + // found ); Design.read(new ByteArrayInputStream("".getBytes())); @@ -92,11 +103,13 @@ public class ComponentFactoryTest { @Test public void testGetDefaultInstanceUsesComponentFactory() { final List classes = new ArrayList<>(); - currentComponentFactory.set((ComponentFactory) (String fullyQualifiedClassName, DesignContext context) -> { - classes.add(fullyQualifiedClassName); - return defaultFactory.createComponent(fullyQualifiedClassName, - context); - }); + currentComponentFactory + .set((ComponentFactory) (String fullyQualifiedClassName, + DesignContext context) -> { + classes.add(fullyQualifiedClassName); + return defaultFactory + .createComponent(fullyQualifiedClassName, context); + }); DesignContext designContext = new DesignContext(); designContext.getDefaultInstance(new DefaultInstanceTestComponent()); diff --git a/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java b/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java index 30c07ccb11..f448f5c2b2 100644 --- a/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java +++ b/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java @@ -361,8 +361,7 @@ public class DesignFormatterTest { && SharedUtil.equals(other.getIcon(), act.getIcon()) && act.getKeyCode() == other.getKeyCode() && act.getModifiers().length == other.getModifiers().length) { - HashSet thisSet = new HashSet<>( - act.getModifiers().length); + HashSet thisSet = new HashSet<>(act.getModifiers().length); // this is a bit tricky comparison, but there is no nice way of // making int[] into a Set for (int mod : act.getModifiers()) { diff --git a/server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithEmptyAnnotation.java b/server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithEmptyAnnotation.java index cfea7a6fda..f3a44a7bf2 100644 --- a/server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithEmptyAnnotation.java +++ b/server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithEmptyAnnotation.java @@ -16,7 +16,6 @@ package com.vaadin.tests.design.designroot; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Notification; import com.vaadin.ui.TextField; diff --git a/server/src/test/java/com/vaadin/tests/event/EventRouterTest.java b/server/src/test/java/com/vaadin/tests/event/EventRouterTest.java index 7286b7ea2d..a290d43ea3 100644 --- a/server/src/test/java/com/vaadin/tests/event/EventRouterTest.java +++ b/server/src/test/java/com/vaadin/tests/event/EventRouterTest.java @@ -23,7 +23,6 @@ import org.junit.Before; import org.junit.Test; import com.vaadin.event.EventRouter; -import com.vaadin.server.ErrorEvent; import com.vaadin.server.ErrorHandler; import com.vaadin.ui.Component; import com.vaadin.ui.Component.Listener; diff --git a/server/src/test/java/com/vaadin/tests/event/ShortcutActionTest.java b/server/src/test/java/com/vaadin/tests/event/ShortcutActionTest.java index 90bc775efa..f701e089ce 100644 --- a/server/src/test/java/com/vaadin/tests/event/ShortcutActionTest.java +++ b/server/src/test/java/com/vaadin/tests/event/ShortcutActionTest.java @@ -98,8 +98,7 @@ public class ShortcutActionTest { && SharedUtil.equals(other.getIcon(), act.getIcon()) && act.getKeyCode() == other.getKeyCode() && act.getModifiers().length == other.getModifiers().length) { - HashSet thisSet = new HashSet<>( - act.getModifiers().length); + HashSet thisSet = new HashSet<>(act.getModifiers().length); // this is a bit tricky comparison, but there is no nice way of // making int[] into a Set for (int mod : act.getModifiers()) { diff --git a/server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java b/server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java index e33f8373ce..8a97e2217c 100644 --- a/server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java +++ b/server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java @@ -14,6 +14,7 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.lang.reflect.Type; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Comparator; @@ -30,7 +31,6 @@ import org.junit.Assert; import org.junit.Test; import com.vaadin.ui.Component; -import java.util.Arrays; public class ClassesSerializableTest { @@ -42,7 +42,8 @@ public class ClassesSerializableTest { private static final String[] BASE_PACKAGES = { "com.vaadin" }; - private static final String[] EXCLUDED_PATTERNS = { "com\\.vaadin\\.demo\\..*", // + private static final String[] EXCLUDED_PATTERNS = { + "com\\.vaadin\\.demo\\..*", // "com\\.vaadin\\.external\\.org\\.apache\\.commons\\.fileupload\\..*", // "com\\.vaadin\\.launcher\\..*", // "com\\.vaadin\\.client\\..*", // diff --git a/server/src/test/java/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java b/server/src/test/java/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java index 7a44e861da..65b7b437e0 100644 --- a/server/src/test/java/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java +++ b/server/src/test/java/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java @@ -160,7 +160,9 @@ public class AttachDetachListenersTest { @Override public void appendTo(StringBuffer buffer) { buffer.append("EventEquals("); - buffer.append("expected ").append(expected.getClass().getSimpleName()).append(" with connector ").append(expected.getConnector()); + buffer.append("expected ") + .append(expected.getClass().getSimpleName()) + .append(" with connector ").append(expected.getConnector()); buffer.append(")"); } diff --git a/server/src/test/java/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java b/server/src/test/java/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java index 7aabfe4f7f..b333c89fc8 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java +++ b/server/src/test/java/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java @@ -35,8 +35,8 @@ public abstract class DeclarativeMarginTestBase returnType = readMethod.getReturnType(); - if (StyleGenerator.class.equals(returnType)) + if (StyleGenerator.class.equals(returnType)) { return false; + } } return super.acceptProperty(clazz, readMethod, writeMethod); } diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java index d8b75b130e..8c435f831d 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java @@ -586,6 +586,7 @@ public class GridDeclarativeTest extends AbstractListingDeclarativeTest { return testRead(design, expected, false); } + @Override @SuppressWarnings("rawtypes") public Grid testRead(String design, Grid expected, boolean retestWrite) { return testRead(design, expected, retestWrite, false); diff --git a/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java index 43176a5ce8..6b81df7e70 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java @@ -22,7 +22,6 @@ import java.io.IOException; import org.junit.Assert; import org.junit.Test; -import com.vaadin.shared.ui.MarginInfo; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.tests.server.component.DeclarativeMarginTestBase; import com.vaadin.ui.Alignment; @@ -38,7 +37,7 @@ public class GridLayoutDeclarativeTest @Test public void testMargins() { - testMargins("vaadin-grid-layout",false); + testMargins("vaadin-grid-layout", false); } @Test diff --git a/server/src/test/java/com/vaadin/tests/server/component/listselect/ListSelectDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/listselect/ListSelectDeclarativeTest.java index a71aed674b..baae580ccc 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/listselect/ListSelectDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/listselect/ListSelectDeclarativeTest.java @@ -26,9 +26,9 @@ import com.vaadin.ui.ListSelect; * There is only {@link ListSelect#setRows(int)}/{@link ListSelect#getRows()} * explicit test. All other tests are in the super class ( * {@link AbstractMultiSelectDeclarativeTest}). - * + * * @see AbstractMultiSelectDeclarativeTest - * + * * @author Vaadin Ltd * */ diff --git a/server/src/test/java/com/vaadin/tests/server/component/nativeselect/NativeSelectDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/nativeselect/NativeSelectDeclarativeTest.java index f7114394d4..2b80546e80 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/nativeselect/NativeSelectDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/nativeselect/NativeSelectDeclarativeTest.java @@ -22,7 +22,7 @@ import com.vaadin.ui.NativeSelect; * Declarative support tests for {@link NativeSelect}. All tests are in the * super class ({@link AbstractSingleSelectDeclarativeTest}). This class * declares only tag name and native select class (test parameters). - * + * * @author Vaadin Ltd * */ diff --git a/server/src/test/java/com/vaadin/tests/server/component/passwordfield/PasswordFieldDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/passwordfield/PasswordFieldDeclarativeTest.java index c7908fd6b0..bb96bf0c3d 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/passwordfield/PasswordFieldDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/passwordfield/PasswordFieldDeclarativeTest.java @@ -22,7 +22,7 @@ import com.vaadin.ui.TextField; /** * Declarative test for PasswordField. Provides only information about * ColorPickerArea class. All tests are in the superclass. - * + * * @author Vaadin Ltd * */ diff --git a/server/src/test/java/com/vaadin/tests/server/component/radiobuttongroup/RadioButtonGroupDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/radiobuttongroup/RadioButtonGroupDeclarativeTest.java index d25c12a4d7..fbc1d912a9 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/radiobuttongroup/RadioButtonGroupDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/radiobuttongroup/RadioButtonGroupDeclarativeTest.java @@ -29,9 +29,9 @@ import com.vaadin.ui.RadioButtonGroup; * Only {@link RadioButtonGroup#setHtmlContentAllowed(boolean)} is tested here * explicitly. All other tests are in the super class ( * {@link AbstractSingleSelectDeclarativeTest}). - * + * * @see AbstractSingleSelectDeclarativeTest - * + * * @author Vaadin Ltd * */ diff --git a/server/src/test/java/com/vaadin/tests/server/component/tabsheet/TabSheetTest.java b/server/src/test/java/com/vaadin/tests/server/component/tabsheet/TabSheetTest.java index 60ec97ad50..b48a3477ab 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/tabsheet/TabSheetTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/tabsheet/TabSheetTest.java @@ -7,6 +7,7 @@ import static org.junit.Assert.assertSame; import java.util.Iterator; +import org.junit.Assert; import org.junit.Test; import com.vaadin.ui.Component; @@ -15,7 +16,6 @@ import com.vaadin.ui.TabSheet; import com.vaadin.ui.TabSheet.SelectedTabChangeEvent; import com.vaadin.ui.TabSheet.SelectedTabChangeListener; import com.vaadin.ui.TabSheet.Tab; -import org.junit.Assert; public class TabSheetTest { diff --git a/server/src/test/java/com/vaadin/tests/server/component/twincolselect/TwinColSelectDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/twincolselect/TwinColSelectDeclarativeTest.java index 99841e9cf9..5f1eba4176 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/twincolselect/TwinColSelectDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/twincolselect/TwinColSelectDeclarativeTest.java @@ -25,9 +25,9 @@ import com.vaadin.ui.TwinColSelect; *

* There are only TwinColSelect specific properties explicit tests. All other * tests are in the super class ( {@link AbstractMultiSelectDeclarativeTest}). - * + * * @see AbstractMultiSelectDeclarativeTest - * + * * @author Vaadin Ltd * */ diff --git a/server/src/test/java/com/vaadin/tests/server/component/window/AttachDetachWindowTest.java b/server/src/test/java/com/vaadin/tests/server/component/window/AttachDetachWindowTest.java index 872683cec3..8416a216c1 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/window/AttachDetachWindowTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/window/AttachDetachWindowTest.java @@ -11,9 +11,7 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinSession; import com.vaadin.tests.util.AlwaysLockedVaadinSession; import com.vaadin.ui.HasComponents.ComponentAttachEvent; -import com.vaadin.ui.HasComponents.ComponentAttachListener; import com.vaadin.ui.HasComponents.ComponentDetachEvent; -import com.vaadin.ui.HasComponents.ComponentDetachListener; import com.vaadin.ui.Label; import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; diff --git a/server/src/test/java/com/vaadin/ui/AbstractMultiSelectTest.java b/server/src/test/java/com/vaadin/ui/AbstractMultiSelectTest.java index 68461b676f..d98477c66d 100644 --- a/server/src/test/java/com/vaadin/ui/AbstractMultiSelectTest.java +++ b/server/src/test/java/com/vaadin/ui/AbstractMultiSelectTest.java @@ -37,8 +37,8 @@ import org.junit.runners.Parameterized.Parameters; import org.mockito.Mockito; import com.vaadin.data.HasValue.ValueChangeEvent; -import com.vaadin.data.provider.DataProvider; import com.vaadin.data.Listing; +import com.vaadin.data.provider.DataProvider; import com.vaadin.event.selection.MultiSelectionEvent; import com.vaadin.event.selection.MultiSelectionListener; import com.vaadin.shared.Registration; @@ -318,8 +318,8 @@ public class AbstractMultiSelectTest & Lis Assert.assertSame(registration, actualRegistration); - selectionListener.get().selectionChange(new MultiSelectionEvent<>(select, - Mockito.mock(Set.class), true)); + selectionListener.get().selectionChange(new MultiSelectionEvent<>( + select, Mockito.mock(Set.class), true)); Assert.assertEquals(select, event.get().getComponent()); Assert.assertEquals(set, event.get().getValue()); diff --git a/server/src/test/java/com/vaadin/ui/AbstractSingleSelectTest.java b/server/src/test/java/com/vaadin/ui/AbstractSingleSelectTest.java index 51e4fa71e9..1b814921e7 100644 --- a/server/src/test/java/com/vaadin/ui/AbstractSingleSelectTest.java +++ b/server/src/test/java/com/vaadin/ui/AbstractSingleSelectTest.java @@ -32,9 +32,9 @@ import org.junit.Test; import org.mockito.Mockito; import com.vaadin.data.HasValue.ValueChangeEvent; +import com.vaadin.data.Listing; import com.vaadin.data.provider.DataProvider; import com.vaadin.data.provider.bov.Person; -import com.vaadin.data.Listing; import com.vaadin.event.selection.SingleSelectionEvent; import com.vaadin.event.selection.SingleSelectionListener; import com.vaadin.shared.Registration; @@ -81,8 +81,7 @@ public class AbstractSingleSelectTest { listing = new PersonListing(); listing.setItems(PERSON_A, PERSON_B, PERSON_C); selectionChanges = new ArrayList<>(); - listing.addSelectionListener( - e -> selectionChanges.add(e.getValue())); + listing.addSelectionListener(e -> selectionChanges.add(e.getValue())); } public static final Person PERSON_C = new Person("c", 3); diff --git a/server/src/test/java/com/vaadin/ui/RadioButtonGroupBoVTest.java b/server/src/test/java/com/vaadin/ui/RadioButtonGroupBoVTest.java index 2fa64ee0ec..82124454e2 100644 --- a/server/src/test/java/com/vaadin/ui/RadioButtonGroupBoVTest.java +++ b/server/src/test/java/com/vaadin/ui/RadioButtonGroupBoVTest.java @@ -23,20 +23,15 @@ import java.util.EnumSet; * @author Vaadin Ltd * @since 8.0 */ -public class RadioButtonGroupBoVTest -{ +public class RadioButtonGroupBoVTest { public enum Status { - STATE_A, - STATE_B, - STATE_C, - STATE_D; + STATE_A, STATE_B, STATE_C, STATE_D; public String getCaption() { return "** " + toString(); } } - public void createOptionGroup() { RadioButtonGroup s = new RadioButtonGroup<>(); s.setItems(EnumSet.allOf(Status.class)); diff --git a/server/src/test/java/com/vaadin/ui/RadioButtonGroupTest.java b/server/src/test/java/com/vaadin/ui/RadioButtonGroupTest.java index 8dfbc70e56..281690d7ee 100644 --- a/server/src/test/java/com/vaadin/ui/RadioButtonGroupTest.java +++ b/server/src/test/java/com/vaadin/ui/RadioButtonGroupTest.java @@ -34,8 +34,8 @@ public class RadioButtonGroupTest { public void setUp() { radioButtonGroup = new RadioButtonGroup<>(); // Intentional deviation from upcoming selection order - radioButtonGroup - .setDataProvider(DataProvider.create("Third", "Second", "First")); + radioButtonGroup.setDataProvider( + DataProvider.create("Third", "Second", "First")); } @Test diff --git a/server/src/test/java/com/vaadin/ui/RichTextAreaTest.java b/server/src/test/java/com/vaadin/ui/RichTextAreaTest.java index a18105b5bb..56f1293556 100644 --- a/server/src/test/java/com/vaadin/ui/RichTextAreaTest.java +++ b/server/src/test/java/com/vaadin/ui/RichTextAreaTest.java @@ -15,6 +15,11 @@ */ package com.vaadin.ui; +import static com.vaadin.ui.ComponentTest.getRpcProxy; +import static com.vaadin.ui.ComponentTest.isDirty; +import static com.vaadin.ui.ComponentTest.syncToClient; +import static com.vaadin.ui.ComponentTest.updateDiffState; + import org.junit.Assert; import org.junit.Test; @@ -22,12 +27,8 @@ import com.vaadin.server.ClientConnector; import com.vaadin.server.ServerRpcManager.RpcInvocationException; import com.vaadin.shared.ui.richtextarea.RichTextAreaServerRpc; import com.vaadin.tests.util.MockUI; -import static com.vaadin.ui.ComponentTest.getRpcProxy; -import static com.vaadin.ui.ComponentTest.isDirty; -import static com.vaadin.ui.ComponentTest.syncToClient; -import static com.vaadin.ui.ComponentTest.updateDiffState; -public class RichTextAreaTest { +public class RichTextAreaTest { @Test public void initiallyEmpty() { diff --git a/server/src/test/java/com/vaadin/util/CurrentInstanceTest.java b/server/src/test/java/com/vaadin/util/CurrentInstanceTest.java index 3505ef7532..e2da8e0278 100644 --- a/server/src/test/java/com/vaadin/util/CurrentInstanceTest.java +++ b/server/src/test/java/com/vaadin/util/CurrentInstanceTest.java @@ -15,14 +15,7 @@ */ package com.vaadin.util; -import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinService; -import com.vaadin.server.VaadinSession; -import com.vaadin.ui.UI; -import org.easymock.EasyMock; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import static org.junit.Assert.assertNull; import java.lang.ref.WeakReference; import java.lang.reflect.Field; @@ -33,7 +26,15 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; -import static org.junit.Assert.assertNull; +import org.easymock.EasyMock; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.server.VaadinService; +import com.vaadin.server.VaadinSession; +import com.vaadin.ui.UI; public class CurrentInstanceTest { @@ -78,8 +79,7 @@ public class CurrentInstanceTest { IllegalAccessException { Field f = CurrentInstance.class.getDeclaredField("instances"); f.setAccessible(true); - return (ThreadLocal, CurrentInstance>>) f - .get(null); + return (ThreadLocal, CurrentInstance>>) f.get(null); } public void testInheritedClearedAfterRemove() { @@ -149,8 +149,7 @@ public class CurrentInstanceTest { .setCurrent(session2); // Use weak ref to verify object is collected - WeakReference ref = new WeakReference<>( - session1); + WeakReference ref = new WeakReference<>(session1); session1 = null; waitUntilGarbageCollected(ref); -- cgit v1.2.3