Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions qa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,14 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<!-- The PDF backend (provider on the classpath so the relocated render
suites resolve a backend) plus its tests-classifier jar, which carries
the shared render harness (EngineComposerHarness + engine.assembly). -->
<!-- The PDF backend — the provider on the classpath so the relocated
render suites resolve a backend and can build/rasterize PDFs. -->
<dependency>
<groupId>io.github.demchaav</groupId>
<artifactId>graph-compose-render-pdf</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.demchaav</groupId>
<artifactId>graph-compose-render-pdf</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<!-- The built-in templates (the relocated visual-parity + smoke suites
render them) plus their tests-classifier jar, which carries the template
data fixtures (com.demcha.mock.*DataFixtures). -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.demcha.compose.document.api;

import com.demcha.compose.GraphCompose;
import com.demcha.compose.document.layout.LayoutGraph;
import com.demcha.compose.document.style.DocumentInsets;
import org.junit.jupiter.api.Test;

import java.nio.charset.StandardCharsets;

import static org.assertj.core.api.Assertions.assertThat;

/**
* End-to-end coverage for the canonical barcode DSL ({@code addBarcode}): a QR
* code and a linear CODE128 both lay out on a single page and render through the
* PDF backend without error. Guards barcode rendering on the canonical path.
*/
class BarcodeRenderTest {

@Test
void barcodesLayOutOnOnePageAndRenderToPdf() throws Exception {
try (DocumentSession session = GraphCompose.document()
.pageSize(240, 200)
.margin(DocumentInsets.of(12))
.create()) {
session.pageFlow()
.addBarcode(b -> b.qrCode().data("GC-2026-001").size(80, 80))
.addBarcode(b -> b.code128().data("GC-2026-001").size(160, 40))
.build();

LayoutGraph graph = session.layoutGraph();
assertThat(graph.totalPages()).isEqualTo(1);
assertThat(graph.nodes()).isNotEmpty();

byte[] pdf = session.toPdfBytes();
assertThat(new String(pdf, 0, 5, StandardCharsets.US_ASCII)).isEqualTo("%PDF-");
}
}
}

This file was deleted.

This file was deleted.

Loading