Gaurav Agrawal | c5f6327 | 2016-06-16 13:09:53 +0530 | [diff] [blame] | 1 | package org.onosproject.yangutils.plugin.manager; |
| 2 | |
| 3 | import java.io.File; |
| 4 | import java.io.IOException; |
| 5 | import org.apache.commons.io.FileUtils; |
| 6 | import org.apache.maven.project.MavenProject; |
| 7 | import org.junit.Test; |
| 8 | import org.sonatype.plexus.build.incremental.BuildContext; |
| 9 | import org.sonatype.plexus.build.incremental.DefaultBuildContext; |
| 10 | |
| 11 | import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.addToCompilationRoot; |
| 12 | |
| 13 | /** |
| 14 | * Created by root1 on 16/6/16. |
| 15 | */ |
| 16 | public 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 | } |