@Test public void checkInputEmpty() { Object[] data = {""}; ArrayList<String> choosenData = new ArrayList<String>(); choosenData.add("Dummy"); assertEquals(false, appManager.getBindingManager().checkInput(data, choosenData, true)); Object[] data2 = {"Fritz"}; assertEquals(true, appManager.getBindingManager().checkInput(data2, choosenData, true)); }
@Test public void checkInputChoose() { Object[] data = {"Heinz", "Klaus"}; ArrayList<String> choosenData = new ArrayList<String>(); choosenData.add("Dummy"); assertEquals(true, appManager.getBindingManager().checkInput(data, choosenData, true)); }
@Test public void checkInputIllegal() { Object[] data = {"drop table kontakte;", "delete * from buchungszeilen;"}; ArrayList<String> choosenData = new ArrayList<String>(); choosenData.add("Dummy"); assertEquals(false, appManager.getBindingManager().checkInput(data, choosenData, true)); }
public class DataBindingTests { ApplicationManager appManager = ApplicationManager.getInstance(); @Test public void checkInputEmpty() { Object[] data = {""}; ArrayList<String> choosenData = new ArrayList<String>(); choosenData.add("Dummy"); assertEquals(false, appManager.getBindingManager().checkInput(data, choosenData, true)); Object[] data2 = {"Fritz"}; assertEquals(true, appManager.getBindingManager().checkInput(data2, choosenData, true)); } @Test public void checkInputIllegal() { Object[] data = {"drop table kontakte;", "delete * from buchungszeilen;"}; ArrayList<String> choosenData = new ArrayList<String>(); choosenData.add("Dummy"); assertEquals(false, appManager.getBindingManager().checkInput(data, choosenData, true)); } @Test public void checkInputChoose() { Object[] data = {"Heinz", "Klaus"}; ArrayList<String> choosenData = new ArrayList<String>(); choosenData.add("Dummy"); assertEquals(true, appManager.getBindingManager().checkInput(data, choosenData, true)); } }
@BeforeClass public static void setUpBeforeClass() throws Exception { String[] args = {"config/app.properties"}; ApplicationManager.getInstance().applicationStarted(args); }