+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
package org.opendaylight.yangtools.yang.unified.doc.generator.maven;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.FileNotFoundException;
+import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.List;
import java.util.Set;
final Set<Module> modulesToBuild = parser.parseYangModels(sourceFiles);
final SchemaContext context = parser.resolveSchemaContext(modulesToBuild);
final CodeGenerator generator = new DocumentationGeneratorImpl();
- generator.generateSources(context, GENERATOR_OUTPUT_DIR, modulesToBuild);
+ Collection<File> generatedFiles = generator.generateSources(context, GENERATOR_OUTPUT_DIR, modulesToBuild);
+ assertEquals(4, generatedFiles.size());
}
- private static List<File> getSourceFiles(String path) throws FileNotFoundException {
- final String resPath = DocGenTest.class.getResource(path).getPath();
+ private static List<File> getSourceFiles(String path) throws Exception {
+ final URI resPath = DocGenTest.class.getResource(path).toURI();
final File sourcesDir = new File(resPath);
if (sourcesDir.exists()) {
final List<File> sourceFiles = new ArrayList<>();