5041864899f18cb6a696d406f5708ec1d0f8f3e0
[mdsal.git] / binding / mdsal-binding-dom-adapter / src / test / java / org / opendaylight / mdsal / binding / dom / adapter / FutureSchemaTest.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.mdsal.binding.dom.adapter;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertNotNull;
13
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;
19
20 public class FutureSchemaTest {
21     @Test
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());
29     }
30 }