@Before public void beforeEach() { baseEntityService.deleteAll(Entity1VO.class.getName()); baseEntityService.deleteAll(Entity2VO.class.getName()); baseEntityService.deleteAll(Entity3VO.class.getName()); baseEntityService.deleteAll(CountryVO.class.getName()); DictionaryHookRegistry.getInstance().clearAll(); }
@Test public void testCountryReferenceControl() { baseEntityService.deleteAll(CountryVO.class.getName()); baseEntityService.deleteAll(CurrencyVO.class.getName()); DictionaryEditorModuleTestUI<CurrencyVO> currencyEditor = MangoClientSyncWebTest.getInstance() .openEditor(MangoDemoDictionaryModel.CURRENCY.CURRENCY_EDITOR); currencyEditor .getControl(MangoDemoDictionaryModel.CURRENCY.CURRENCY_EDITOR.CURRENCY_NAME) .setValue("AA"); currencyEditor .getControl(MangoDemoDictionaryModel.CURRENCY.CURRENCY_EDITOR.CURRENCY_ISO_CODE) .setValue("AAA"); currencyEditor.save(); currencyEditor.assertHasNoErrors(); currencyEditor = MangoClientSyncWebTest.getInstance() .openEditor(MangoDemoDictionaryModel.CURRENCY.CURRENCY_EDITOR); currencyEditor .getControl(MangoDemoDictionaryModel.CURRENCY.CURRENCY_EDITOR.CURRENCY_NAME) .setValue("AB"); currencyEditor .getControl(MangoDemoDictionaryModel.CURRENCY.CURRENCY_EDITOR.CURRENCY_ISO_CODE) .setValue("ABB"); currencyEditor.save(); currencyEditor.assertHasNoErrors(); DictionaryEditorModuleTestUI<CountryVO> countryEditor = MangoClientSyncWebTest.getInstance() .openEditor(MangoDemoDictionaryModel.COUNTRY.COUNTRY_EDITOR); countryEditor .getControl(MangoDemoDictionaryModel.COUNTRY.COUNTRY_EDITOR.COUNTRY_ISO_CODE2) .setValue("BB"); countryEditor .getControl(MangoDemoDictionaryModel.COUNTRY.COUNTRY_EDITOR.COUNTRY_ISO_CODE3) .setValue("BBB"); countryEditor .getControl(MangoDemoDictionaryModel.COUNTRY.COUNTRY_EDITOR.COUNTRY_NAME) .setValue("BBBB"); ReferenceTestControl<CurrencyVO> currencyControl = countryEditor.getControl(MangoDemoDictionaryModel.COUNTRY.COUNTRY_EDITOR.COUNTRY_CURRENCY); currencyControl.enterValue("a"); currencyControl.assertHasSuggestions(2); currencyControl.enterValue("aa"); currencyControl.assertHasSuggestions(1); }