@@ -0,0 +1,1236 @@
+package com.izforge.izpack.panels.userinput.gui.file;%0A%0Aimport java.io.File;%0A%0Aimport junit.framework.Assert;%0A%0Aimport org.junit.Test;%0Aimport org.mockito.Mockito;%0A%0Aimport com.izforge.izpack.api.resource.Messages;%0Aimport com.izforge.izpack.installer.data.GUIInstallData;%0Aimport com.izforge.izpack.installer.gui.IzPanel;%0Aimport com.izforge.izpack.panels.userinput.field.file.AbstractFileField;%0Aimport com.izforge.izpack.panels.userinput.field.file.FileFieldView;%0A%0Apublic class FileInputFieldTest %7B%0A%0A%09@Test%0A%09public void testEmptyFieldValidation() %7B%0A%09%09AbstractFileField field = Mockito.mock(AbstractFileField.class);%0A%09%09Mockito.when(field.getAbsoluteFile(%22%22)).thenReturn(new File(%22/%22));%0A%09%09Mockito.when(field.getAllowEmptyValue()).thenReturn(Boolean.TRUE);%0A%09%09%0A%09%09IzPanel parent = Mockito.mock(IzPanel.class);%0A%09%09GUIInstallData installDataGUI = Mockito.mock(GUIInstallData.class);%0A%09%09Messages messages = Mockito.mock(Messages.class);%0A%09%09Mockito.when(installDataGUI.getMessages()).thenReturn(messages);%0A%0A%09%09FileFieldView view = new FileFieldView(field, null);%0A%09%09%0A%09%09FileInputField inputField = new FileInputField(view, parent, installDataGUI);%0A%09%09Assert.assertTrue(inputField.validateField());%0A%09%09%0A%09%09Assert.assertNull(inputField.getSelectedFile());%0A%09%7D%0A%0A%7D%0A

Test suite