blob: a6e2e081902881e6d698e4d3cd658d994a0809d1 [file] [log] [blame]
Gaurav Agrawalc5f63272016-06-16 13:09:53 +05301package org.onosproject.yangutils.plugin.manager;
2
3import java.io.File;
4import java.io.IOException;
5import org.apache.commons.io.FileUtils;
6import org.apache.maven.project.MavenProject;
7import org.junit.Test;
8import org.sonatype.plexus.build.incremental.BuildContext;
9import org.sonatype.plexus.build.incremental.DefaultBuildContext;
10
11import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.addToCompilationRoot;
12
13/**
14 * Created by root1 on 16/6/16.
15 */
16public class YangPluginUtilsTest {
17
18 private static final String BASE_DIR = "target/UnitTestCase";
19
20 /**
21 * This test case checks whether the source is getting added.
22 */
23 @Test
24 public void testForAddSource() throws IOException {
25
26 MavenProject project = new MavenProject();
27 BuildContext context = new DefaultBuildContext();
28 File sourceDir = new File(BASE_DIR + File.separator + "yang");
29 sourceDir.mkdirs();
30 addToCompilationRoot(sourceDir.toString(), project, context);
31 FileUtils.deleteDirectory(sourceDir);
32 }
33}