Skip to content

Commit

Permalink
Fix supplementing/paiting tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ksclarke committed Jul 21, 2024
1 parent a490f2d commit 59483e8
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,133 +321,145 @@ public final void testRangeFromString() throws IOException {
/**
* Tests {@link AccompanyingCanvas#supplementWith(boolean, List)}.
*/
@Test
public final void testSupplementWithChoiceContentResourceList() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final AccompanyingCanvas canvas = new AccompanyingCanvas(myMinter, label);

checkSupplementingPages(canvas.paintWith(true, List.of(new TextContent(myID))), true);
checkSupplementingPages(canvas.supplementWith(true, List.of(new TextContent(myID))), true);
}

/**
* Tests {@link AccompanyingCanvas#supplementWith(boolean, ContentResource...)}.
*/
@Test
public final void testSupplementWithChoiceContentResources() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final AccompanyingCanvas canvas = new AccompanyingCanvas(myMinter, label);

checkSupplementingPages(canvas.paintWith(true, new TextContent(myID)), true);
checkSupplementingPages(canvas.supplementWith(true, new TextContent(myID)), true);
}

/**
* Tests {@link AccompanyingCanvas#supplementWith(List)}.
*/
@Test
public final void testSupplementWithContentResourceList() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final AccompanyingCanvas canvas = new AccompanyingCanvas(myMinter, label);

checkSupplementingPages(canvas.paintWith(List.of(new TextContent(myID))), false);
checkSupplementingPages(canvas.supplementWith(List.of(new TextContent(myID))), false);
}

/**
* Tests {@link AccompanyingCanvas#supplementWith(ContentResource...)}.
*/
@Test
public final void testSupplementWithContentResources() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final AccompanyingCanvas canvas = new AccompanyingCanvas(myMinter, label);

checkSupplementingPages(canvas.paintWith(new TextContent(myID)), false);
checkSupplementingPages(canvas.supplementWith(new TextContent(myID)), false);
}

/**
* Tests {@link AccompanyingCanvas#supplementWith(String, boolean, List)}.
*/
@Test
public final void testSupplementWithRegionChoiceContentResourceList() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final AccompanyingCanvas canvas = new AccompanyingCanvas(myMinter, label);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(SELECTOR, true, List.of(new TextContent(myID))), true);
checkSupplementingPages(canvas.supplementWith(SELECTOR, true, List.of(new TextContent(myID))), true);
}

/**
* Tests {@link AccompanyingCanvas#supplementWith(String, boolean, ContentResource...)}.
*/
@Test
public final void testSupplementWithRegionChoiceContentResources() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final AccompanyingCanvas canvas = new AccompanyingCanvas(myMinter, label);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(SELECTOR, true, new TextContent(myID)), true);
checkSupplementingPages(canvas.supplementWith(SELECTOR, true, new TextContent(myID)), true);
}

/**
* Tests {@link AccompanyingCanvas#supplementWith(String, List)}.
*/
@Test
public final void testSupplementWithRegionContentResourceList() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final AccompanyingCanvas canvas = new AccompanyingCanvas(myMinter, label);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(SELECTOR, List.of(new TextContent(myID))), false);
checkSupplementingPages(canvas.supplementWith(SELECTOR, List.of(new TextContent(myID))), false);
}

/**
* Tests {@link AccompanyingCanvas#supplementWith(String, ContentResource...)}.
*/
@Test
public final void testSupplementWithRegionContentResources() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final AccompanyingCanvas canvas = new AccompanyingCanvas(myMinter, label);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(SELECTOR, new TextContent(myID)), false);
checkSupplementingPages(canvas.supplementWith(SELECTOR, new TextContent(myID)), false);
}

/**
* Tests {@link AccompanyingCanvas#supplementWith(MediaFragmentSelector, boolean, List)}.
*/
@Test
public final void testSupplementWithSelectorChoiceContentResourceList() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final AccompanyingCanvas canvas = new AccompanyingCanvas(myMinter, label);
final MediaFragmentSelector selector = new MediaFragmentSelector(0, 0, 100, 100);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(selector, true, List.of(new TextContent(myID))), true);
checkSupplementingPages(canvas.supplementWith(selector, true, List.of(new TextContent(myID))), true);
}

/**
* Tests {@link AccompanyingCanvas#supplementWith(MediaFragmentSelector, boolean, ContentResource...)}.
*/
@Test
public final void testSupplementWithSelectorChoiceContentResources() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final AccompanyingCanvas canvas = new AccompanyingCanvas(myMinter, label);
final MediaFragmentSelector selector = new MediaFragmentSelector(0, 0, 100, 100);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(selector, true, new TextContent(myID)), true);
checkSupplementingPages(canvas.supplementWith(selector, true, new TextContent(myID)), true);
}

/**
* Tests {@link AccompanyingCanvas#supplementWith(MediaFragmentSelector, List)}.
*/
@Test
public final void testSupplementWithSelectorContentResourceList() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final AccompanyingCanvas canvas = new AccompanyingCanvas(myMinter, label);
final MediaFragmentSelector selector = new MediaFragmentSelector(0, 0, 100, 100);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(selector, List.of(new TextContent(myID))), false);
checkSupplementingPages(canvas.supplementWith(selector, List.of(new TextContent(myID))), false);
}

/**
* Tests {@link AccompanyingCanvas#supplementWith(MediaFragmentSelector, ContentResource...)}.
*/
@Test
public final void testSupplementWithSelectorContentResources() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final AccompanyingCanvas canvas = new AccompanyingCanvas(myMinter, label);
final MediaFragmentSelector selector = new MediaFragmentSelector(0, 0, 100, 100);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(selector, new TextContent(myID)), false);
checkSupplementingPages(canvas.supplementWith(selector, new TextContent(myID)), false);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,133 +299,145 @@ public final void testRangeFromString() throws IOException {
/**
* Tests {@link PlaceholderCanvas#supplementWith(boolean, List)}.
*/
@Test
public final void testSupplementWithChoiceContentResourceList() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final PlaceholderCanvas canvas = new PlaceholderCanvas(myMinter, label);

checkSupplementingPages(canvas.paintWith(true, List.of(new TextContent(myID))), true);
checkSupplementingPages(canvas.supplementWith(true, List.of(new TextContent(myID))), true);
}

/**
* Tests {@link PlaceholderCanvas#supplementWith(boolean, ContentResource...)}.
*/
@Test
public final void testSupplementWithChoiceContentResources() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final PlaceholderCanvas canvas = new PlaceholderCanvas(myMinter, label);

checkSupplementingPages(canvas.paintWith(true, new TextContent(myID)), true);
checkSupplementingPages(canvas.supplementWith(true, new TextContent(myID)), true);
}

/**
* Tests {@link PlaceholderCanvas#supplementWith(List)}.
*/
@Test
public final void testSupplementWithContentResourceList() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final PlaceholderCanvas canvas = new PlaceholderCanvas(myMinter, label);

checkSupplementingPages(canvas.paintWith(List.of(new TextContent(myID))), false);
checkSupplementingPages(canvas.supplementWith(List.of(new TextContent(myID))), false);
}

/**
* Tests {@link PlaceholderCanvas#supplementWith(ContentResource...)}.
*/
@Test
public final void testSupplementWithContentResources() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final PlaceholderCanvas canvas = new PlaceholderCanvas(myMinter, label);

checkSupplementingPages(canvas.paintWith(new TextContent(myID)), false);
checkSupplementingPages(canvas.supplementWith(new TextContent(myID)), false);
}

/**
* Tests {@link PlaceholderCanvas#supplementWith(String, boolean, List)}.
*/
@Test
public final void testSupplementWithRegionChoiceContentResourceList() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final PlaceholderCanvas canvas = new PlaceholderCanvas(myMinter, label);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(SELECTOR, true, List.of(new TextContent(myID))), true);
checkSupplementingPages(canvas.supplementWith(SELECTOR, true, List.of(new TextContent(myID))), true);
}

/**
* Tests {@link PlaceholderCanvas#supplementWith(String, boolean, ContentResource...)}.
*/
@Test
public final void testSupplementWithRegionChoiceContentResources() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final PlaceholderCanvas canvas = new PlaceholderCanvas(myMinter, label);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(SELECTOR, true, new TextContent(myID)), true);
checkSupplementingPages(canvas.supplementWith(SELECTOR, true, new TextContent(myID)), true);
}

/**
* Tests {@link PlaceholderCanvas#supplementWith(String, List)}.
*/
@Test
public final void testSupplementWithRegionContentResourceList() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final PlaceholderCanvas canvas = new PlaceholderCanvas(myMinter, label);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(SELECTOR, List.of(new TextContent(myID))), false);
checkSupplementingPages(canvas.supplementWith(SELECTOR, List.of(new TextContent(myID))), false);
}

/**
* Tests {@link PlaceholderCanvas#supplementWith(String, ContentResource...)}.
*/
@Test
public final void testSupplementWithRegionContentResources() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final PlaceholderCanvas canvas = new PlaceholderCanvas(myMinter, label);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(SELECTOR, new TextContent(myID)), false);
checkSupplementingPages(canvas.supplementWith(SELECTOR, new TextContent(myID)), false);
}

/**
* Tests {@link PlaceholderCanvas#supplementWith(MediaFragmentSelector, boolean, List)}.
*/
@Test
public final void testSupplementWithSelectorChoiceContentResourceList() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final PlaceholderCanvas canvas = new PlaceholderCanvas(myMinter, label);
final MediaFragmentSelector selector = new MediaFragmentSelector(0, 0, 100, 100);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(selector, true, List.of(new TextContent(myID))), true);
checkSupplementingPages(canvas.supplementWith(selector, true, List.of(new TextContent(myID))), true);
}

/**
* Tests {@link PlaceholderCanvas#supplementWith(MediaFragmentSelector, boolean, ContentResource...)}.
*/
@Test
public final void testSupplementWithSelectorChoiceContentResources() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final PlaceholderCanvas canvas = new PlaceholderCanvas(myMinter, label);
final MediaFragmentSelector selector = new MediaFragmentSelector(0, 0, 100, 100);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(selector, true, new TextContent(myID)), true);
checkSupplementingPages(canvas.supplementWith(selector, true, new TextContent(myID)), true);
}

/**
* Tests {@link PlaceholderCanvas#supplementWith(MediaFragmentSelector, List)}.
*/
@Test
public final void testSupplementWithSelectorContentResourceList() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final PlaceholderCanvas canvas = new PlaceholderCanvas(myMinter, label);
final MediaFragmentSelector selector = new MediaFragmentSelector(0, 0, 100, 100);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(selector, List.of(new TextContent(myID))), false);
checkSupplementingPages(canvas.supplementWith(selector, List.of(new TextContent(myID))), false);
}

/**
* Tests {@link PlaceholderCanvas#supplementWith(MediaFragmentSelector, ContentResource...)}.
*/
@Test
public final void testSupplementWithSelectorContentResources() {
final Label label = new Label(StringUtils.format(LABEL, myID));
final PlaceholderCanvas canvas = new PlaceholderCanvas(myMinter, label);
final MediaFragmentSelector selector = new MediaFragmentSelector(0, 0, 100, 100);

canvas.setWidthHeight(200, 200);
checkSupplementingPages(canvas.paintWith(selector, new TextContent(myID)), false);
checkSupplementingPages(canvas.supplementWith(selector, new TextContent(myID)), false);
}

/**
Expand Down

0 comments on commit 59483e8

Please sign in to comment.