@Test public void markImpactedObject() { DocumentReference document1 = new DocumentReference("wiki1", "space1", "document1"); DocumentReference document2 = new DocumentReference("wiki2", "space2", "document2"); DocumentReference docObjDoc1 = new DocumentReference("wiki1", "space1", "documentObject1"); DocumentReference docObjDoc2 = new DocumentReference("wiki1", "space1", "documentObject2"); DocumentReference docObjDoc3 = new DocumentReference("wiki2", "space1", "documentObject3"); EntitySelection selection1 = new EntitySelection(document1); EntitySelection selection2 = new EntitySelection(document2); Map<EntityReference, EntitySelection> concernedEntities = new HashMap<>(); concernedEntities.put(document1, selection1); concernedEntities.put(document2, selection2); XClassBreakingQuestion question = new XClassBreakingQuestion(concernedEntities); assertTrue(question.getImpactedObjects().isEmpty()); question.markImpactedObject(selection1, docObjDoc1); question.markImpactedObject(selection1, docObjDoc2); question.markImpactedObject(selection2, docObjDoc3); Map<EntityReference, Set<EntityReference>> expectedImpacted = new HashMap<>(); HashSet<EntityReference> impact1 = new HashSet<>(); impact1.add(docObjDoc1); impact1.add(docObjDoc2); expectedImpacted.put(document1, impact1); HashSet<EntityReference> impact2 = new HashSet<>(); impact2.add(docObjDoc3); expectedImpacted.put(document2, impact2); assertEquals(expectedImpacted, question.getImpactedObjects()); }
public void markImpactedObject(EntitySelection entitySelection, EntityReference documentObjectName) { DocumentReference xclassDocReference = (DocumentReference) entitySelection.getEntityReference(); if (xclassDocReference.getLocale() != null) { xclassDocReference = new DocumentReference(xclassDocReference, (Locale) null); } if (!this.impactedObjects.containsKey(xclassDocReference)) { this.impactedObjects.put(xclassDocReference, new LinkedHashSet<>()); this.xclassPages.add(entitySelection); } this.impactedObjects.get(xclassDocReference).add(documentObjectName); }
XClassBreakingQuestion { public void markImpactedObject(EntitySelection entitySelection, EntityReference documentObjectName) { DocumentReference xclassDocReference = (DocumentReference) entitySelection.getEntityReference(); if (xclassDocReference.getLocale() != null) { xclassDocReference = new DocumentReference(xclassDocReference, (Locale) null); } if (!this.impactedObjects.containsKey(xclassDocReference)) { this.impactedObjects.put(xclassDocReference, new LinkedHashSet<>()); this.xclassPages.add(entitySelection); } this.impactedObjects.get(xclassDocReference).add(documentObjectName); } }
XClassBreakingQuestion { public void markImpactedObject(EntitySelection entitySelection, EntityReference documentObjectName) { DocumentReference xclassDocReference = (DocumentReference) entitySelection.getEntityReference(); if (xclassDocReference.getLocale() != null) { xclassDocReference = new DocumentReference(xclassDocReference, (Locale) null); } if (!this.impactedObjects.containsKey(xclassDocReference)) { this.impactedObjects.put(xclassDocReference, new LinkedHashSet<>()); this.xclassPages.add(entitySelection); } this.impactedObjects.get(xclassDocReference).add(documentObjectName); } XClassBreakingQuestion(Map<EntityReference, EntitySelection> concernedEntities); }
XClassBreakingQuestion { public void markImpactedObject(EntitySelection entitySelection, EntityReference documentObjectName) { DocumentReference xclassDocReference = (DocumentReference) entitySelection.getEntityReference(); if (xclassDocReference.getLocale() != null) { xclassDocReference = new DocumentReference(xclassDocReference, (Locale) null); } if (!this.impactedObjects.containsKey(xclassDocReference)) { this.impactedObjects.put(xclassDocReference, new LinkedHashSet<>()); this.xclassPages.add(entitySelection); } this.impactedObjects.get(xclassDocReference).add(documentObjectName); } XClassBreakingQuestion(Map<EntityReference, EntitySelection> concernedEntities); void markAsFreePage(EntitySelection entitySelection); void markImpactedObject(EntitySelection entitySelection, EntityReference documentObjectName); Map<EntityReference, Set<EntityReference>> getImpactedObjects(); void unselectAll(); Set<EntitySelection> getXClassPages(); Set<EntitySelection> getFreePages(); void setSelectedDocuments(Set<DocumentReference> documents); void selectAllFreePages(); void setSelectAllFreePages(boolean select); boolean isRefactoringForbidden(); void setRefactoringForbidden(boolean refactoringForbidden); boolean isObjectsPotentiallyHidden(); void setObjectsPotentiallyHidden(boolean objectsPotentiallyHidden); Map<EntityReference, EntitySelection> getConcernedEntities(); }
XClassBreakingQuestion { public void markImpactedObject(EntitySelection entitySelection, EntityReference documentObjectName) { DocumentReference xclassDocReference = (DocumentReference) entitySelection.getEntityReference(); if (xclassDocReference.getLocale() != null) { xclassDocReference = new DocumentReference(xclassDocReference, (Locale) null); } if (!this.impactedObjects.containsKey(xclassDocReference)) { this.impactedObjects.put(xclassDocReference, new LinkedHashSet<>()); this.xclassPages.add(entitySelection); } this.impactedObjects.get(xclassDocReference).add(documentObjectName); } XClassBreakingQuestion(Map<EntityReference, EntitySelection> concernedEntities); void markAsFreePage(EntitySelection entitySelection); void markImpactedObject(EntitySelection entitySelection, EntityReference documentObjectName); Map<EntityReference, Set<EntityReference>> getImpactedObjects(); void unselectAll(); Set<EntitySelection> getXClassPages(); Set<EntitySelection> getFreePages(); void setSelectedDocuments(Set<DocumentReference> documents); void selectAllFreePages(); void setSelectAllFreePages(boolean select); boolean isRefactoringForbidden(); void setRefactoringForbidden(boolean refactoringForbidden); boolean isObjectsPotentiallyHidden(); void setObjectsPotentiallyHidden(boolean objectsPotentiallyHidden); Map<EntityReference, EntitySelection> getConcernedEntities();  }