Hello So I am debugging into this code by 'step into or even step over' but I face a "The jar of this class file belongs to container 'Junit4' which does not allow modifications too source attachments of it's entries."
when I step into or step over. The code itself is fully functional , maybe it has something to do with eclipse . I am using MacBook Air m1 for my eclipse java.
Line 'assertEquals(u1, u2) is the issue part when I debug . When I step into or step over that line I face the "source attachments ' issue. I have tried reinstalling eclipse multiple times and it does not work. I even tried it on my brother laptops who has the same m1 air as me and it has the same issue as well.
Here is also a picture of the error in eclipse : https://i.stack.imgur.com/hL8RD.jpg
@Test
public void test_unit_03() {
/*
* Create three new units with their intended functions and dimensions.
*/
Unit u1 = new Unit("Master Bedroom", 14, 9);
Unit u2 = new Unit("Master Bedroom", 18, 7);
Unit u3 = new Unit("Master Bedroom", 18, 8);
Unit u4 = new Unit("Office", 18, 7);
assertEquals("A unit of 126 square feet (14' wide and 9' long) functioning as Master Bedroom", u1.toString());
assertEquals("A unit of 126 square feet (18' wide and 7' long) functioning as Master Bedroom", u2.toString());
assertEquals("A unit of 144 square feet (18' wide and 8' long) functioning as Master Bedroom", u3.toString());
assertEquals("A unit of 126 square feet (18' wide and 7' long) functioning as Office", u4.toString());
/*
* Two units are considered equal if their intended functions are the same (case-sensitive)
* and the areas (in square feet) are the same (even if the dimensions may be different).
*/
assertEquals(u1, u2);
// assertTrue(u1.equals(u2));
/* Note. Result of assertNotEquals is just the opposite to assertEquals. */
assertNotEquals(u1, u3);
assertNotEquals(u1, u4);
assertNotEquals(u2, u3);
assertNotEquals(u2, u4);
/*
* The above assertions do not cover all cases of the equals method as discussed in the lecture.
* Your implementation of the overridden equals method should cover them.
*/
}