Binding generator v2 - augments fix #1
[mdsal.git] / binding2 / mdsal-binding2-generator-impl / src / test / java / org / opendaylight / mdsal / binding / javav2 / generator / impl / GeneratedClassLoadingStrategyTest.java
1 /*
2  * Copyright (c) 2017 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.javav2.generator.impl;
9
10 import org.junit.Assert;
11 import org.junit.Test;
12 import org.opendaylight.mdsal.binding.javav2.generator.util.generated.type.builder.GeneratedTypeBuilderImpl;
13 import org.opendaylight.mdsal.binding.javav2.model.api.type.builder.GeneratedTypeBuilder;
14
15 public class GeneratedClassLoadingStrategyTest {
16
17     @Test
18     public void loadClassTest() throws Exception {
19         final Dummy dummy = new Dummy();
20         final GeneratedTypeBuilder gtb = new GeneratedTypeBuilderImpl("test", "dummy");
21         final Class<?> loadClass = dummy.loadClass(gtb.toInstance());
22         Assert.assertNotNull(loadClass);
23     }
24
25     private class Dummy extends GeneratedClassLoadingStrategy {
26
27         @Override
28         public Class<?> loadClass(final String fqcn) throws ClassNotFoundException {
29             return Object.class;
30         }
31
32     }
33 }