-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BS-258 | Vijay, Siva | Fixing failed tests
- Loading branch information
1 parent
67cc777
commit 74a3e3c
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/test/java/org/bahmni/reports/extensions/sample/SampleResultSetExtension.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.bahmni.reports.extensions.sample; | ||
|
||
import net.sf.dynamicreports.jasper.builder.JasperReportBuilder; | ||
import net.sf.dynamicreports.report.constant.HorizontalAlignment; | ||
import org.bahmni.reports.extensions.ResultSetExtension; | ||
|
||
import java.sql.SQLException; | ||
import java.util.Collection; | ||
import java.util.Map; | ||
import java.util.Random; | ||
|
||
import static net.sf.dynamicreports.report.builder.DynamicReports.col; | ||
import static net.sf.dynamicreports.report.builder.DynamicReports.type; | ||
import static org.bahmni.reports.template.Templates.columnStyle; | ||
|
||
public class SampleResultSetExtension implements ResultSetExtension { | ||
public static final String SAMPLE_COLUMN_NAME = "Sample Column"; | ||
|
||
public void enrich(Collection<Map<String, ?>> collection, JasperReportBuilder jasperReport) throws SQLException { | ||
for (Map<String, ?> rowMap : collection) { | ||
enrichRow(rowMap, SAMPLE_COLUMN_NAME, String.valueOf(new Random().nextInt())); | ||
} | ||
jasperReport.addColumn(col.column(SAMPLE_COLUMN_NAME, SAMPLE_COLUMN_NAME, type.stringType()).setStyle(columnStyle).setHorizontalAlignment(HorizontalAlignment.CENTER)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters