2 * Copyright (c) 2016 Red Hat, Inc. 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
8 package org.opendaylight.mdsal.binding.testutils;
10 import ch.vorburger.xtendbeans.AssertBeans;
11 import org.junit.Test;
12 import org.opendaylight.yangtools.yang.binding.DataObject;
15 * Tests that the {@link AssertDataObjects} utility also works for any Java
16 * object that is not a {@link DataObject}, like the {@link AssertBeans} which
17 * it's based on. There is absolutely no particular reason why it wouldn't,
18 * because {@link AssertDataObjects} is essentially just a customization of
19 * {@link AssertBeans} - this is just to make sure none of the base
20 * functionality gets broken in the customization.
22 * @author Michael Vorburger
24 public class AssertNonDataObjectsTest {
26 public static class SomeBean {
29 public String getName() {
33 public void setName(String name) {
39 public void testString() {
40 AssertDataObjects.assertEqualBeans("hello, world", "hello, world");
44 public void testSomeBean() {
45 SomeBean first = new SomeBean();
46 first.setName("hello, world");
48 SomeBean second = new SomeBean();
49 second.setName("hello, world");
51 AssertDataObjects.assertEqualBeans(first, second);