use of com.creditease.uav.datastore.api.DataStoreConnection in project uavstack by uavorg.
the class DoTestNotifyData4Mongo method testInsertNotifyMongoDB.
@SuppressWarnings({ "rawtypes" })
public static void testInsertNotifyMongoDB() {
DataStoreMsg msg = new DataStoreMsg();
// MongoDBHandler
String rawData = DataStoreUnitTest.getData(insertJson);
msg.put(MonitorDataFrame.MessageType.Notification.toString(), rawData);
msg.put(DataStoreProtocol.MONGO_COLLECTION_NAME, HealthManagerConstants.MONGO_COLLECTION_NOTIFY);
DataStoreConnection obj = new DataStoreConnection(userName, password, dbName, serverlist, DataStoreType.MONGODB);
AbstractDataStore store = DataStoreFactory.getInstance().build(HealthManagerConstants.DataStore_Notification, obj, new NotifyDataAdpater(), "");
store.start();
boolean rst = store.doInsert(msg);
store.stop();
DataStoreUnitTest.printTestResult("testInsertNotifyMongoDB", rst);
}
Aggregations