From 632f1b4f5c0fca12f8f48eef64c78e0f48fa55e4 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Fri, 28 Nov 2014 16:07:41 +0100 Subject: [PATCH] Make sure to pick up junit version from odlparent Fixes 4.10/4.11 inconsistency reported by maven. Also migrates imports of Assert to the new place. Change-Id: Id0953e69207ac9507b6baa0cc47bfaa938d86655 Signed-off-by: Robert Varga --- .../protocol/api/keys/KeysTest.java | 3 +- .../protocol/api/util/BinContentTest.java | 127 +++++++++--------- .../ChannelOutboundQueue02Test.java | 3 +- .../ConnectionAdapterImp02lTest.java | 3 +- .../deserialization/TypeToClassKeyTest.java | 3 +- ...GetQueueConfigInputMessageFactoryTest.java | 3 +- .../MeterModInputMessageFactoryTest.java | 3 +- .../OF10PortModInputMessageFactoryTest.java | 3 +- ...QueueGetConfigInputMessageFactoryTest.java | 3 +- .../PortModInputMessageFactoryTest.java | 3 +- .../RoleRequestInputMessageFactoryTest.java | 3 +- .../TableModInputMessageFactoryTest.java | 3 +- .../impl/util/OF10MatchSerializerTest.java | 3 +- pom.xml | 2 +- 14 files changed, 76 insertions(+), 89 deletions(-) diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java index 6f2eb513..f270bd92 100644 --- a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java +++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java @@ -1,7 +1,6 @@ package org.opendaylight.openflowjava.protocol.api.keys; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Test; import org.opendaylight.openflowjava.protocol.api.keys.ActionDeserializerKey; import org.opendaylight.openflowjava.protocol.api.keys.ActionSerializerKey; diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/util/BinContentTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/util/BinContentTest.java index af09e0cb..3c2bc650 100644 --- a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/util/BinContentTest.java +++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/util/BinContentTest.java @@ -1,64 +1,63 @@ -/* - * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ - -package org.opendaylight.openflowjava.protocol.api.util; - -import junit.framework.Assert; - -import org.junit.Test; - -/** - * @author michal.polkorab - */ -public class BinContentTest { - - /** - * Testing correct conversion from signed int value to unsigned long value - */ - @Test - public void testIntToUnsignedLong() { - int a = 0; - int b = 1; - int c = -1; - int d = Integer.MAX_VALUE; - int e = Integer.MIN_VALUE; - int f = 12345; - Assert.assertEquals("Wrong conversion", 0, BinContent.intToUnsignedLong(a)); - Assert.assertEquals("Wrong conversion", 1, BinContent.intToUnsignedLong(b)); - Assert.assertEquals("Wrong conversion", 4294967295L, BinContent.intToUnsignedLong(c)); - Assert.assertEquals("Wrong conversion", Integer.MAX_VALUE, BinContent.intToUnsignedLong(d)); - Assert.assertEquals("Wrong conversion", ((long) Integer.MAX_VALUE) + 1, BinContent.intToUnsignedLong(e)); - Assert.assertEquals("Wrong conversion", 12345, BinContent.intToUnsignedLong(f)); - } - - /** - * Testing correct conversion from unsigned long value to signed int value - */ - @Test - public void testLongToSignedInt() { - long a = 0; - long b = 1; - long c = -1; - long d = Integer.MAX_VALUE; - long e = Integer.MIN_VALUE; - long f = 12345; - long g = Long.MAX_VALUE; - long h = 1094624935644L; - long i = ((long) Integer.MAX_VALUE) + 1; - Assert.assertEquals("Wrong conversion", 0, BinContent.longToSignedInt(a)); - Assert.assertEquals("Wrong conversion", 1, BinContent.longToSignedInt(b)); - Assert.assertEquals("Wrong conversion", -1, BinContent.longToSignedInt(c)); - Assert.assertEquals("Wrong conversion", Integer.MAX_VALUE, BinContent.longToSignedInt(d)); - Assert.assertEquals("Wrong conversion", Integer.MIN_VALUE, BinContent.longToSignedInt(e)); - Assert.assertEquals("Wrong conversion", 12345, BinContent.longToSignedInt(f)); - Assert.assertEquals("Wrong conversion", -1, BinContent.longToSignedInt(g)); - Assert.assertEquals("Wrong conversion", -591724836, BinContent.longToSignedInt(h)); - Assert.assertEquals("Wrong conversion", Integer.MIN_VALUE, BinContent.longToSignedInt(i)); - } - -} +/* + * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +package org.opendaylight.openflowjava.protocol.api.util; + +import org.junit.Assert; +import org.junit.Test; + +/** + * @author michal.polkorab + */ +public class BinContentTest { + + /** + * Testing correct conversion from signed int value to unsigned long value + */ + @Test + public void testIntToUnsignedLong() { + int a = 0; + int b = 1; + int c = -1; + int d = Integer.MAX_VALUE; + int e = Integer.MIN_VALUE; + int f = 12345; + Assert.assertEquals("Wrong conversion", 0, BinContent.intToUnsignedLong(a)); + Assert.assertEquals("Wrong conversion", 1, BinContent.intToUnsignedLong(b)); + Assert.assertEquals("Wrong conversion", 4294967295L, BinContent.intToUnsignedLong(c)); + Assert.assertEquals("Wrong conversion", Integer.MAX_VALUE, BinContent.intToUnsignedLong(d)); + Assert.assertEquals("Wrong conversion", ((long) Integer.MAX_VALUE) + 1, BinContent.intToUnsignedLong(e)); + Assert.assertEquals("Wrong conversion", 12345, BinContent.intToUnsignedLong(f)); + } + + /** + * Testing correct conversion from unsigned long value to signed int value + */ + @Test + public void testLongToSignedInt() { + long a = 0; + long b = 1; + long c = -1; + long d = Integer.MAX_VALUE; + long e = Integer.MIN_VALUE; + long f = 12345; + long g = Long.MAX_VALUE; + long h = 1094624935644L; + long i = ((long) Integer.MAX_VALUE) + 1; + Assert.assertEquals("Wrong conversion", 0, BinContent.longToSignedInt(a)); + Assert.assertEquals("Wrong conversion", 1, BinContent.longToSignedInt(b)); + Assert.assertEquals("Wrong conversion", -1, BinContent.longToSignedInt(c)); + Assert.assertEquals("Wrong conversion", Integer.MAX_VALUE, BinContent.longToSignedInt(d)); + Assert.assertEquals("Wrong conversion", Integer.MIN_VALUE, BinContent.longToSignedInt(e)); + Assert.assertEquals("Wrong conversion", 12345, BinContent.longToSignedInt(f)); + Assert.assertEquals("Wrong conversion", -1, BinContent.longToSignedInt(g)); + Assert.assertEquals("Wrong conversion", -591724836, BinContent.longToSignedInt(h)); + Assert.assertEquals("Wrong conversion", Integer.MIN_VALUE, BinContent.longToSignedInt(i)); + } + +} diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ChannelOutboundQueue02Test.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ChannelOutboundQueue02Test.java index 3719d3dc..80a58df2 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ChannelOutboundQueue02Test.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ChannelOutboundQueue02Test.java @@ -16,9 +16,8 @@ import io.netty.channel.embedded.EmbeddedChannel; import java.net.InetSocketAddress; import java.util.concurrent.TimeUnit; -import junit.framework.Assert; - import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterImp02lTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterImp02lTest.java index bc9e93ba..0e561fdc 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterImp02lTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterImp02lTest.java @@ -15,9 +15,8 @@ import io.netty.channel.embedded.EmbeddedChannel; import java.net.InetSocketAddress; import java.util.concurrent.TimeUnit; -import junit.framework.Assert; - import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassKeyTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassKeyTest.java index 71a56750..08cd1a4f 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassKeyTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassKeyTest.java @@ -8,8 +8,7 @@ package org.opendaylight.openflowjava.protocol.impl.deserialization; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Test; import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants; import org.opendaylight.openflowjava.protocol.impl.util.TypeToClassKey; diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetQueueConfigInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetQueueConfigInputMessageFactoryTest.java index 0c7b2911..f1da495a 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetQueueConfigInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetQueueConfigInputMessageFactoryTest.java @@ -10,8 +10,7 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories; import io.netty.buffer.ByteBuf; import io.netty.buffer.UnpooledByteBufAllocator; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey; diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactoryTest.java index 8dfa9554..7ac417a4 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactoryTest.java @@ -14,8 +14,7 @@ import io.netty.buffer.UnpooledByteBufAllocator; import java.util.ArrayList; import java.util.List; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey; diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactoryTest.java index d03f7983..b64d6c5c 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactoryTest.java @@ -10,8 +10,7 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories; import io.netty.buffer.ByteBuf; import io.netty.buffer.UnpooledByteBufAllocator; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey; diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactoryTest.java index cc2a7576..c8a41d2c 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactoryTest.java @@ -10,8 +10,7 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories; import io.netty.buffer.ByteBuf; import io.netty.buffer.UnpooledByteBufAllocator; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey; diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactoryTest.java index 8b5f8bfa..ce226535 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactoryTest.java @@ -10,8 +10,7 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories; import io.netty.buffer.ByteBuf; import io.netty.buffer.UnpooledByteBufAllocator; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey; diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleRequestInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleRequestInputMessageFactoryTest.java index 981a8901..a67b2a48 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleRequestInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleRequestInputMessageFactoryTest.java @@ -13,8 +13,7 @@ import io.netty.buffer.UnpooledByteBufAllocator; import java.math.BigInteger; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey; diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/TableModInputMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/TableModInputMessageFactoryTest.java index 823ed686..d547f064 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/TableModInputMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/TableModInputMessageFactoryTest.java @@ -10,8 +10,7 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories; import io.netty.buffer.ByteBuf; import io.netty.buffer.UnpooledByteBufAllocator; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey; diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializerTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializerTest.java index c6f566cb..ca295ea1 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializerTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializerTest.java @@ -10,8 +10,7 @@ package org.opendaylight.openflowjava.protocol.impl.util; import io.netty.buffer.ByteBuf; import io.netty.buffer.UnpooledByteBufAllocator; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey; diff --git a/pom.xml b/pom.xml index b54ddd59..71becad6 100644 --- a/pom.xml +++ b/pom.xml @@ -219,7 +219,7 @@ junit junit - 4.10 + ${junit.version} test true -- 2.36.6