-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestApp.java
More file actions
33 lines (24 loc) · 1.34 KB
/
TestApp.java
File metadata and controls
33 lines (24 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package beanbags;
import java.io.IOException;
import java.lang.ClassNotFoundException;
public class TestApp
{
public static void main(String[] args) throws IllegalNumberOfBeanBagsAddedException,BeanBagMismatchException,
IllegalIDException, InvalidMonthException, InvalidPriceException, InsufficientStockException,
IllegalNumberOfBeanBagsSoldException, BeanBagNotInStockException, BeanBagIDNotRecognisedException,
ReservationNumberNotRecognisedException, IllegalNumberOfBeanBagsReservedException, PriceNotSetException,
IOException, ClassNotFoundException {
Store firstStore = new Store();
firstStore.addBeanBags(10, "manufact1", "bag1", "aaaaaaaa", (short) 2016, (byte) 3);
firstStore.setBeanBagPrice("aaaaaaaa", 100);
firstStore.addBeanBags(10, "manufact2", "bag2", "bbbbbbbb", (short) 2016, (byte) 3);
firstStore.setBeanBagPrice("bbbbbbbb", 200);
firstStore.addBeanBags(10, "manufact3", "bag3", "cccccccc", (short) 2016, (byte) 3);
firstStore.setBeanBagPrice("cccccccc", 300);
firstStore.reserveBeanBags(5, "aaaaaaaa");
firstStore.reserveBeanBags(3, "bbbbbbbb");
firstStore.saveStoreContents("firstStore.ser");
firstStore.loadStoreContents("firstStore.ser");
System.out.println(firstStore.getNumberOfDifferentBeanBagsInStock());
}
}