Поправил checkSavingForAllMapStoreTest.
This commit is contained in:
parent
e00969fa4b
commit
4616e5c735
2 changed files with 13 additions and 7 deletions
|
|
@ -14,7 +14,7 @@ public class BusinessObjectAndBusinessEventForCheckMapStore<T> {
|
|||
public final Matcher<T> MATCHER;
|
||||
private final String mapName;
|
||||
private final Class<T> clazz;
|
||||
private SettingOperation settingOperation;
|
||||
private SettingOperation[] settingOperations;
|
||||
|
||||
private SpcexObjectBase predictableObj;
|
||||
|
||||
|
|
@ -24,10 +24,10 @@ public class BusinessObjectAndBusinessEventForCheckMapStore<T> {
|
|||
this.MATCHER = usingIgnoringFieldsComparator();
|
||||
}
|
||||
|
||||
public BusinessObjectAndBusinessEventForCheckMapStore(String mapName, Class<T> clazz, SettingOperation settingOperation) {
|
||||
public BusinessObjectAndBusinessEventForCheckMapStore(String mapName, Class<T> clazz, SettingOperation... settingOperations) {
|
||||
this.mapName = mapName;
|
||||
this.clazz = clazz;
|
||||
this.settingOperation = settingOperation;
|
||||
this.settingOperations = settingOperations;
|
||||
this.MATCHER = usingIgnoringFieldsComparator();
|
||||
}
|
||||
|
||||
|
|
@ -54,9 +54,11 @@ public class BusinessObjectAndBusinessEventForCheckMapStore<T> {
|
|||
}
|
||||
|
||||
public void setPredictableObj(SpcexObjectBase predictableObj) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
|
||||
if (settingOperation != null) {
|
||||
Method method = clazz.getDeclaredMethod(settingOperation.getMethodName(), settingOperation.getParameterTypes());
|
||||
method.invoke(predictableObj, settingOperation.getParams());
|
||||
if (settingOperations != null) {
|
||||
for (SettingOperation settingOperation : settingOperations) {
|
||||
Method method = clazz.getDeclaredMethod(settingOperation.getMethodName(), settingOperation.getParameterTypes());
|
||||
method.invoke(predictableObj, settingOperation.getParams());
|
||||
}
|
||||
}
|
||||
this.predictableObj = predictableObj;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,11 @@ public class RunnableMapNamesForTesting {
|
|||
new SettingOperation("setAmount", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("23.22")})));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_UserConnect, UserConnect.class));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_User, User.class));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_VerificationResult, VerificationResult.class));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_VerificationResult, VerificationResult.class,
|
||||
new SettingOperation("setDiffSum", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("13.22")}),
|
||||
new SettingOperation("setInSum", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("14.22")}),
|
||||
new SettingOperation("setOutExtSum", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("15.22")}),
|
||||
new SettingOperation("setOutIntSum", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("19.22")})));
|
||||
|
||||
//dictionary
|
||||
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_AccountStatusDictionary, AccountStatusDictionary.class));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue