2 * Copyright (c) 2017 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.mdsal.binding.javav2.dom.adapter.spi.builder;
11 import static org.junit.Assert.assertTrue;
13 import com.google.common.collect.ClassToInstanceMap;
14 import com.google.common.collect.MutableClassToInstanceMap;
17 import org.junit.Test;
19 public class AdapterBuilderTest extends AdapterBuilder {
21 private static final ClassToInstanceMap<Object> DELEGATES = MutableClassToInstanceMap.create();
24 public void buildTest() throws Exception {
25 this.addDelegate(String.class, "test");
26 DELEGATES.putAll((Map) this.build());
27 assertTrue(DELEGATES.containsValue("test"));
28 this.addDelegate(Object.class, "test2");
29 DELEGATES.putAll((Map) this.build());
30 assertTrue(DELEGATES.containsValue("test"));
31 assertTrue(DELEGATES.get(Object.class).equals("test2"));
35 public Set<? extends Class> getRequiredDelegates() {
36 return DELEGATES.keySet();
40 protected Object createInstance(ClassToInstanceMap delegates) {