Bug 458 - Array Index Out of Bounds Exception optimize method 3
Summary: Array Index Out of Bounds Exception optimize method 3
Status: CONFIRMED
Alias: None
Product: Warehouse Management System
Classification: Unclassified
Component: Testing V1 (show other bugs)
Version: Specified
Hardware: PC Windows
: High major
Assignee: ANIRUDH
URL:
Depends on:
Blocks:
 
Reported: 2020-11-25 01:45 HKT by ANIRUDH
Modified: 2020-11-25 01:45 HKT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ANIRUDH 2020-11-25 01:45:33 HKT
Steps to Reproduce:

1. Give the item of size 10 along with the arrival and the departure dates.
2. Give the slot size of 0.

Throwing an exception i.e Array Index Out of Bounds for findOnePerfectFit in the optimize method! 

Also need to throw an exception stating the slot size 0 is not valid.

Given test case:

@Test
	void testOptimize7() {
		Item is = new Item(5, new Day("13-Oct-2020"),new Day("20-Oct-2020"));
		Slot ss = new Slot(5);
		ArrayList<Item> itemArray = new ArrayList<Item>();
		itemArray.add(is);
		Optimize opt = new Optimize();
	    opt.findOnePerfectFit(itemArray, ss);
	    assertEquals(true, opt.getFound());
	}