2 * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.openflowjava.protocol.impl.deserialization;
11 import junit.framework.Assert;
13 import org.junit.Test;
14 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
15 import org.opendaylight.openflowjava.protocol.impl.util.TypeToClassKey;
21 public class TypeToClassKeyTest {
28 final short ver10 = EncodeConstants.OF10_VERSION_ID;
29 final short ver13 = EncodeConstants.OF13_VERSION_ID;
32 TypeToClassKey typeToClsKey10 = new TypeToClassKey(ver10,type1);
33 Assert.assertTrue("Wrong - equals to same object", typeToClsKey10.equals(typeToClsKey10));
34 Assert.assertFalse("Wrong - equals to null", typeToClsKey10.equals(null));
35 Assert.assertFalse("Wrong - equals to different class", typeToClsKey10.equals(new Object()));
36 TypeToClassKey typeToClsKey13 = new TypeToClassKey(ver13,type2);
37 Assert.assertFalse("Wrong - equals by different version", typeToClsKey13.equals(new Object()));
38 Assert.assertFalse("Wrong - equals by different type", typeToClsKey13.equals(typeToClsKey10));