Binding2-runtime JUnit code coverage increase
[mdsal.git] / binding2 / mdsal-binding2-runtime / src / test / java / org / opendaylight / mdsal / binding / javav2 / runtime / context / ModuleInfoBackedContextTest.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. 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
9 package org.opendaylight.mdsal.binding.javav2.runtime.context;
10
11 import static org.junit.Assert.assertNotNull;
12
13 import java.io.FileNotFoundException;
14 import java.net.URISyntaxException;
15 import org.junit.Before;
16 import org.junit.Test;
17 import org.opendaylight.mdsal.binding.javav2.generator.impl.GeneratedClassLoadingStrategy;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
19
20 public class ModuleInfoBackedContextTest {
21
22     private ModuleInfoBackedContext moduleInfoBackedContext;
23
24     @Before
25     public void setup() throws ReactorException, FileNotFoundException, URISyntaxException {
26         moduleInfoBackedContext = ModuleInfoBackedContext.create();
27     }
28
29     @Test
30     public void createTestWithStrategy() {
31         assertNotNull(ModuleInfoBackedContext.create(
32                 GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy()));
33     }
34
35     @Test(expected = ClassNotFoundException.class)
36     public void loadClassTest() throws ClassNotFoundException {
37         moduleInfoBackedContext.loadClass("org.opendaylight.mdsal.gen.javav2.test.rev990939.Dummy");
38     }
39 }