@Test public void selectAllFreePages() { DocumentReference document1 = new DocumentReference("wiki1", "space1", "document1"); DocumentReference document2 = new DocumentReference("wiki2", "space2", "document2"); EntitySelection selection1 = new EntitySelection(document1); selection1.setSelected(false); EntitySelection selection2 = new EntitySelection(document2); selection2.setSelected(false); Map<EntityReference, EntitySelection> concernedEntities = new HashMap<>(); concernedEntities.put(document1, selection1); concernedEntities.put(document2, selection2); ExtensionBreakingQuestion question = new ExtensionBreakingQuestion(concernedEntities); assertEquals(document1, question.get(document1).getEntityReference()); assertFalse(question.get(document1).isSelected()); assertEquals(document2, question.get(document2).getEntityReference()); assertFalse(question.get(document2).isSelected()); question.selectAllFreePages(); assertFalse(question.get(document1).isSelected()); assertFalse(question.get(document2).isSelected()); question.markAsFreePage(question.get(document1)); question.selectAllFreePages(); assertTrue(question.get(document1).isSelected()); assertFalse(question.get(document2).isSelected()); }
public void selectAllFreePages() { for (EntitySelection entitySelection : freePages) { entitySelection.setSelected(true); } }
ExtensionBreakingQuestion { public void selectAllFreePages() { for (EntitySelection entitySelection : freePages) { entitySelection.setSelected(true); } } }
ExtensionBreakingQuestion { public void selectAllFreePages() { for (EntitySelection entitySelection : freePages) { entitySelection.setSelected(true); } } ExtensionBreakingQuestion(Map<EntityReference, EntitySelection> concernedEntities); }
ExtensionBreakingQuestion { public void selectAllFreePages() { for (EntitySelection entitySelection : freePages) { entitySelection.setSelected(true); } } ExtensionBreakingQuestion(Map<EntityReference, EntitySelection> concernedEntities); EntitySelection get(EntityReference entityReference); Map<EntityReference, EntitySelection> getConcernedEntities(); Map<String, ExtensionSelection> getExtensions(); List<EntitySelection> getFreePages(); void selectAllExtensions(); void setSelectAllExtensions(boolean select); void selectAllFreePages(); void setSelectAllFreePages(boolean select); void markAsFreePage(EntitySelection entitySelection); void pageBelongsToExtension(EntitySelection entitySelection, XarInstalledExtension extension); ExtensionSelection getExtension(String extensionId); void unselectAll(); void setSelectedExtensions(Set<String> extensionIds); void setSelectedDocuments(Set<DocumentReference> documents); }
ExtensionBreakingQuestion { public void selectAllFreePages() { for (EntitySelection entitySelection : freePages) { entitySelection.setSelected(true); } } ExtensionBreakingQuestion(Map<EntityReference, EntitySelection> concernedEntities); EntitySelection get(EntityReference entityReference); Map<EntityReference, EntitySelection> getConcernedEntities(); Map<String, ExtensionSelection> getExtensions(); List<EntitySelection> getFreePages(); void selectAllExtensions(); void setSelectAllExtensions(boolean select); void selectAllFreePages(); void setSelectAllFreePages(boolean select); void markAsFreePage(EntitySelection entitySelection); void pageBelongsToExtension(EntitySelection entitySelection, XarInstalledExtension extension); ExtensionSelection getExtension(String extensionId); void unselectAll(); void setSelectedExtensions(Set<String> extensionIds); void setSelectedDocuments(Set<DocumentReference> documents);  }