2 * Copyright (c) 2016 Cisco Systems, 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.dom.adapter;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertNotNull;
14 import com.google.common.collect.ImmutableSet;
15 import java.util.concurrent.TimeUnit;
16 import org.junit.Test;
17 import org.opendaylight.yangtools.yang.common.QNameModule;
18 import org.opendaylight.yangtools.yang.common.XMLNamespace;
20 public class FutureSchemaTest {
22 public void basicTest() {
23 final FutureSchema futureSchema = FutureSchema.create(0, TimeUnit.MICROSECONDS, true);
24 assertNotNull(futureSchema);
25 assertFalse(futureSchema.waitForSchema(QNameModule.create(XMLNamespace.of("test"))));
26 assertFalse(futureSchema.waitForSchema(ImmutableSet.of()));
27 assertEquals(0, futureSchema.getDuration());
28 assertEquals(TimeUnit.MICROSECONDS, futureSchema.getUnit());