void () { ProcessInfo info1 = new ProcessInfo(1, "command line 1", "exec1", "args1"); ProcessInfo info2 = new ProcessInfo(1, "command line 2", "exec1", "args1"); ProcessInfo info3 = new ProcessInfo(1, "command line 3", "exec1", "args1"); ProcessInfo info4 = new ProcessInfo(1, "command line 4", "exec1", "args1"); ProcessInfo info5 = new ProcessInfo(1, "command line 5", "exec1", "args1"); List<XAttachDebugger> debuggers = createDebuggers("gdb"); UserDataHolderBase dataHolder = new UserDataHolderBase(); AttachToProcessItem item1 = fixtureCreateAttachToProcessItem(TEST_GROUP, true, info1, debuggers, dataHolder); AttachToProcessItem item2 = fixtureCreateAttachToProcessItem(TEST_GROUP, true, info2, debuggers, dataHolder); AttachToProcessItem item3 = fixtureCreateAttachToProcessItem(TEST_GROUP, true, info3, debuggers, dataHolder); AttachToProcessItem item4 = fixtureCreateAttachToProcessItem(TEST_GROUP, true, info4, debuggers, dataHolder); AttachToProcessItem item5 = fixtureCreateAttachToProcessItem(TEST_GROUP, true, info5, debuggers, dataHolder); RecentItem recentItem1 = fixtureCreateHistoryItem(info1, TEST_GROUP, "gdb"); RecentItem recentItem2 = fixtureCreateHistoryItem(info2, TEST_GROUP, "gdb"); RecentItem recentItem3 = fixtureCreateHistoryItem(info3, TEST_GROUP, "gdb"); RecentItem recentItem4 = fixtureCreateHistoryItem(info4, TEST_GROUP, "gdb"); RecentItem recentItem5 = fixtureCreateHistoryItem(info5, TEST_GROUP, "gdb"); // empty assertEmpty(getRecentItems(LocalAttachHost.INSTANCE, getProject())); // adding some items addToRecent(getProject(), item1); addToRecent(getProject(), item2); assertOrderedEquals(getRecentItems(LocalAttachHost.INSTANCE, getProject()), recentItem1, recentItem2); addToRecent(getProject(), item3); addToRecent(getProject(), item4); assertOrderedEquals(getRecentItems(LocalAttachHost.INSTANCE, getProject()), recentItem1, recentItem2, recentItem3, recentItem4); // limiting size to 4 items addToRecent(getProject(), item5); assertOrderedEquals(getRecentItems(LocalAttachHost.INSTANCE, getProject()), recentItem2, recentItem3, recentItem4, recentItem5); // popping up recent items addToRecent(getProject(), item3); addToRecent(getProject(), item2); assertOrderedEquals(getRecentItems(LocalAttachHost.INSTANCE, getProject()), recentItem4, recentItem5, recentItem3, recentItem2); }