GABController is a tool for searching inside the Yaml file content. At this moment is completely independent from any ONAPs component and can be used in any case where searching full json-path format keywords is needed. To use it, two things are required from the user: yaml document and list of fields to filter the results and nothing more.
GABController is provided as a standard JAVA archive and can be imported in any application by adding its JAR name into the classpath or using maven dependency management:
<dependency> <groupId>org.onap.sdc.common</groupId> <artifactId>onap-generic-artifact-browser-service</artifactId> <version>${project.version}</version> <scope>compile</scope> </dependency>
The most usable class is GABServiceImpl implements GABService and expose single method for searching paths inside the Yaml file.
GABService operates on 2 different types: GABQuery as an input and GABResults as an output model.
/* First You need to create GABService */ GABService gabService = new GABServiceImpl(); /* Next step is to prepare your query model. * In this example we will use file: * '/root/test.yml' * and will search for keywords: * 'event.structure.commonEventHeader' and 'event.presence' */ GABQuery gabQuery = new GABQuery(Arrays.asList( "event.structure.commonEventHeader","event.presence"), "/root/test.yml", GABQueryType.PATH); /* And at last ask for the results */ GABResults gabResults = gabService.searchFor(gabQuery); /* And thats it. Please notice that IOException can be thrown in some cases. * For more info please follow specification inside the JavaDocs. */
Generic Artifact Browser has got two independent layers of tests:
All layers are currently executed during the maven build of the main project.