Introduce top-level pom file.
[mdsal.git] / code-generator / binding-generator-impl / src / test / java / org / opendaylight / yangtools / sal / binding / generator / impl / AbstractTypesTest.java
1 /*
2  * Copyright (c) 2013 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.yangtools.sal.binding.generator.impl;
9
10 import com.google.common.base.Preconditions;
11 import java.io.File;
12 import java.net.URISyntaxException;
13 import java.net.URL;
14 import java.util.HashSet;
15 import java.util.Set;
16 import org.junit.Before;
17
18 public abstract class AbstractTypesTest {
19
20     private final URL testSourcesDirUrl;
21     protected Set<File> testModels;
22
23     AbstractTypesTest(final URL testSourcesDirUrl) {
24         this.testSourcesDirUrl = testSourcesDirUrl;
25     }
26
27     @Before
28     public void loadTestResources() throws URISyntaxException {
29         File testSourcesDir = new File(testSourcesDirUrl.toURI());
30         File[] testFiles = Preconditions.checkNotNull(testSourcesDir.listFiles(), testSourcesDir
31                 + " does not denote a directory");
32         testModels = new HashSet<>();
33         for (File file : testFiles) {
34             if (file.isFile()) {
35                 testModels.add(file);
36             }
37         }
38     }
39
40 }