JavaIdentifierNormalizer ThreadSafe/Memory leak fix
[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.context.ModuleContext;
13 import org.opendaylight.mdsal.binding.javav2.generator.util.generated.type.builder.GeneratedTypeBuilderImpl;
14 import org.opendaylight.mdsal.binding.javav2.model.api.type.builder.GeneratedTypeBuilder;
15
16 public class GeneratedClassLoadingStrategyTest {
17
18     @Test
19     public void loadClassTest() throws Exception {
20         final Dummy dummy = new Dummy();
21         final GeneratedTypeBuilder gtb = new GeneratedTypeBuilderImpl("test", "dummy", new ModuleContext());
22         final Class<?> loadClass = dummy.loadClass(gtb.toInstance());
23         Assert.assertNotNull(loadClass);
24     }
25
26     private class Dummy extends GeneratedClassLoadingStrategy {
27
28         @Override
29         public Class<?> loadClass(final String fqcn) throws ClassNotFoundException {
30             return Object.class;
31         }
32
33     }
34 }