Adding test
This commit is contained in:
parent
7a8725b270
commit
6c5838e810
|
@ -187,7 +187,7 @@ public class DocumentationGenerator {
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringBuffer generatePropertySection(Type type) {
|
protected StringBuffer generatePropertySection(Type type) {
|
||||||
StringBuffer stringBuffer = new StringBuffer();
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
stringBuffer.append("\n");
|
stringBuffer.append("\n");
|
||||||
String name = type.getName();
|
String name = type.getName();
|
||||||
|
@ -206,7 +206,7 @@ public class DocumentationGenerator {
|
||||||
return stringBuffer;
|
return stringBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringBuffer generateResourceSection(Type type) {
|
protected StringBuffer generateResourceSection(Type type) {
|
||||||
StringBuffer stringBuffer = new StringBuffer();
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
stringBuffer.append("\n");
|
stringBuffer.append("\n");
|
||||||
String name = type.getName();
|
String name = type.getName();
|
||||||
|
@ -225,7 +225,7 @@ public class DocumentationGenerator {
|
||||||
return stringBuffer;
|
return stringBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringBuffer generateFacetSection(Type type) {
|
protected StringBuffer generateFacetSection(Type type) {
|
||||||
StringBuffer stringBuffer = new StringBuffer();
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
stringBuffer.append("\n");
|
stringBuffer.append("\n");
|
||||||
String name = type.getName();
|
String name = type.getName();
|
||||||
|
@ -282,7 +282,12 @@ public class DocumentationGenerator {
|
||||||
return stringBuffer;
|
return stringBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generate(List<Package> pkgs) throws Exception {
|
public void generate() throws Exception {
|
||||||
|
List<Package> pkgs = Discovery.discoverPackages();
|
||||||
|
generate(pkgs);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void generate(List<Package> pkgs) throws Exception {
|
||||||
|
|
||||||
DocumentationSchemaAction schemaAction = new DocumentationSchemaAction(pkgs);
|
DocumentationSchemaAction schemaAction = new DocumentationSchemaAction(pkgs);
|
||||||
Discovery.discover(schemaAction);
|
Discovery.discover(schemaAction);
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package org.gcube.informationsystem.utils.documentation.rst.table;
|
package org.gcube.informationsystem.utils.documentation.rst.table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
public enum RowType {
|
public enum RowType {
|
||||||
HEADING(Table.ROW_SEPARATOR_HEADING),
|
HEADING(Table.ROW_SEPARATOR_HEADING),
|
||||||
NORMAL(Table.ROW_SEPARATOR);
|
NORMAL(Table.ROW_SEPARATOR);
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
package org.gcube.informationsystem.utils.documentation;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
*/
|
||||||
|
public class GenerateTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDocGeneration() throws Exception {
|
||||||
|
URL jsonFileURL = GenerateTest.class.getClassLoader().getResource("logback-test.xml");
|
||||||
|
File file = new File(jsonFileURL.toURI());
|
||||||
|
DocumentationGenerator documentationGenerator = new DocumentationGenerator(file.getParentFile());
|
||||||
|
documentationGenerator.generate();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE xml>
|
||||||
|
<configuration>
|
||||||
|
|
||||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{0}: %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
|
||||||
|
<logger name="org.gcube" level="ERROR" />
|
||||||
|
<logger name="org.gcube.informationsystem.utils.documentation" level="INFO" />
|
||||||
|
|
||||||
|
<root level="WARN">
|
||||||
|
<appender-ref ref="STDOUT" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
</configuration>
|
Loading…
Reference in New Issue