use of com.baidu.disconf.client.scan.inner.statically.strategy.ScanStaticStrategy in project disconf by knightliao.
the class ScanPackTestCase method scan.
@Test
public void scan() {
try {
ScanStaticStrategy scanStaticStrategy = new ReflectionScanStatic();
ScanStaticModel scanModel = scanStaticStrategy.scan(SCAN_PACK_NAME_LIST);
// PRINT SCAN STORE
ScanPrinterUtils.printStoreMap(scanModel.getReflections());
// disconf file item
LOGGER.info("=============DISCONF FILE ITEM===================");
Set<Method> methods = scanModel.getDisconfFileItemMethodSet();
ScanPrinterUtils.printFileItemMethod(methods);
Assert.assertEquals(6, methods.size());
Assert.assertEquals(4, scanModel.getDisconfFileClassSet().size());
// disconf file item
LOGGER.info("=============DISCONF FILE===================");
Map<Class<?>, Set<Method>> fileMap = scanModel.getDisconfFileItemMap();
Assert.assertEquals(4, fileMap.size());
// disconf item
LOGGER.info("=============DISCONF ITEM===================");
methods = scanModel.getDisconfItemMethodSet();
ScanPrinterUtils.printFileItemMethod(methods);
Assert.assertEquals(1, methods.size());
// Active backup
LOGGER.info("=============DISCONF ACTIVE BACKUP===================");
Set<Class<?>> classSet = scanModel.getDisconfActiveBackupServiceClassSet();
ScanPrinterUtils.printActiveBackup(classSet);
Assert.assertEquals(0, classSet.size());
// Update service
LOGGER.info("=============DISCONF Update service===================");
classSet = scanModel.getDisconfUpdateService();
ScanPrinterUtils.printUpdateFile(classSet);
Assert.assertEquals(2, classSet.size());
} catch (Exception e) {
Assert.assertTrue(false);
}
}
Aggregations