use of com.emc.apidocs.model.ApiDifferences in project coprhd-controller by CoprHD.
the class DifferenceEngineTest method main.
public static void main(String[] args) throws Exception {
List<ApiService> oldApi = MetaData.load(EncunciationReaderTests.class.getResourceAsStream("MetaData-1.1.json"));
List<ApiService> newApi = MetaData.load(EncunciationReaderTests.class.getResourceAsStream("MetaData-2.0.json"));
ApiDifferences differences = DifferenceEngine.calculateDifferences(oldApi, newApi);
ApiReferenceTocOrganizer organizer = new ApiReferenceTocOrganizer(new File("/Users/maddid/SourceCode/bourne/vipr-controller/tools/apidocs/src/content/reference/ApiReferenceGrouping.txt"));
Map<String, List<ApiService>> newServicesToc = organizer.organizeServices(differences.newServices);
Map<String, List<ApiService>> removedServicesToc = organizer.organizeServices(differences.removedServices);
System.out.println("\n===== NEW SERVICES:");
dumpServices(newServicesToc);
System.out.println("\n===== SERVICE CHANGES");
for (ApiServiceChanges changes : differences.modifiedServices) {
System.out.println(changes.service.getFqJavaClassName());
if (!changes.newMethods.isEmpty()) {
System.out.println("---- NEW METHODS");
for (ApiMethod apiMethod : changes.newMethods) {
System.out.println("-- " + apiMethod.httpMethod + " " + apiMethod.path);
}
}
if (!changes.removedMethods.isEmpty()) {
System.out.println("---- REMOVED METHODS");
for (ApiMethod apiMethod : changes.removedMethods) {
System.out.println("-- " + apiMethod.httpMethod + " " + apiMethod.path);
}
}
}
}
use of com.emc.apidocs.model.ApiDifferences in project coprhd-controller by CoprHD.
the class ApiDoclet method start.
/**
* MAIN Entry Point into the Doclet
*/
public static boolean start(RootDoc root) {
KnownPaths.init(contentDirectory, outputDirectory);
init();
loadServiceBlackList();
loadMethodBlackList();
List<ApiService> apiServices = findApiServices(root.classes());
List<ApiErrorCode> errorCodes = findErrorCodes(root.classes());
cleanupMethods(apiServices);
saveMetaData(apiServices);
ApiDifferences apiDifferences = calculateDifferences(apiServices);
generateFiles(apiDifferences, apiServices, errorCodes);
return true;
}
Aggregations