public void testDataEntry() {
CategoryManager dataObjectManager = new CategoryManager(categoryDB, categoryDBFormat);
//create new category
Category dataObject1 = new Category("CLO", "Clothing");
try {
dataObjectManager.addCategory(dataObject1);
} catch (AppException ex) {
Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
}
Category dataObject2 = new Category("MUG", "Mugs");
try {
dataObjectManager.addCategory(dataObject2);
} catch (AppException ex) {
Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
}
Category dataObject3 = new Category("STA", "Stationary");
try {
dataObjectManager.addCategory(dataObject3);
} catch (AppException ex) {
Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
}
Category dataObject4 = new Category("DIA", "Diary");
try {
dataObjectManager.addCategory(dataObject4);
} catch (AppException ex) {
Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
}
//try to creat duplicate category followed by valid category
Category dataObject5 = new Category("CLO", "Clothing");
try {
dataObjectManager.addCategory(dataObject5);
} catch (AppException ex) {
Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
}
Category dataObject6 = new Category("TEST", "Testing");
try {
dataObjectManager.addCategory(dataObject6);
} catch (AppException ex) {
Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
}