File tree Expand file tree Collapse file tree
main/java/com/adobe/epubcheck Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828import java .util .HashSet ;
2929import java .util .LinkedList ;
3030import java .util .List ;
31- import java .util .Map ;
3231import java .util .Set ;
3332
3433import org .w3c .epubcheck .constants .MIMEType ;
@@ -319,7 +318,7 @@ private boolean checkContainerStructure(OCFCheckerState state)
319318 new OCFFilenameChecker (resource .getPath (), state .context ().build ()).check ();
320319
321320 // Report entry metadata
322- reportFeatures (resource . getProperties () );
321+ reportFeatures (resource );
323322
324323 // Add the resource to the container model
325324 state .addResource (resource );
@@ -553,11 +552,12 @@ private EPUBVersion checkPublicationVersion(OCFCheckerState state)
553552 }
554553 }
555554
556- private void reportFeatures (Map < FeatureEnum , String > features )
555+ private void reportFeatures (OCFResource resource )
557556 {
558- for (FeatureEnum feature : features .keySet ())
557+ for (FeatureEnum feature : resource . getProperties () .keySet ())
559558 {
560- report .info (context .path , feature , features .get (feature ));
559+ // report.info(context.path, feature, resource.getProperties().get(feature));
560+ report .info (resource .getPath (), feature , resource .getProperties ().get (feature ));
561561 }
562562 }
563563
Original file line number Diff line number Diff line change @@ -287,8 +287,6 @@ else if (name.equals("item"))
287287
288288 String mediaOverlay = e .getAttribute ("media-overlay" );
289289 itemBuilder .mediaOverlay (mediaOverlay );
290-
291- report .info (href , FeatureEnum .UNIQUE_IDENT , id );
292290 }
293291 }
294292 }
@@ -641,6 +639,7 @@ private void buildItems()
641639 */
642640 protected void reportItem (OPFItem item )
643641 {
642+ report .info (item .getPath (), FeatureEnum .UNIQUE_IDENT , item .getId ());
644643 if (item .isInSpine ())
645644 {
646645 report .info (item .getPath (), FeatureEnum .IS_SPINEITEM , "true" );
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html xmlns:epub ="http://www.idpf.org/2007/ops " xmlns ="http://www.w3.org/1999/xhtml " xml:lang ="en " lang ="en ">
3+ < head >
4+ < meta charset ="utf-8 "/>
5+ < title > Minimal EPUB</ title >
6+ </ head >
7+ < body >
8+ < h1 > Loomings</ h1 >
9+ < p > Call me Ishmael.</ p >
10+ </ body >
11+ </ html >
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html xmlns ="http://www.w3.org/1999/xhtml " xmlns:epub ="http://www.idpf.org/2007/ops " xml:lang ="en " lang ="en ">
3+ < head >
4+ < meta charset ="utf-8 "/>
5+ < title > Minimal Nav</ title >
6+ </ head >
7+ < body >
8+ < nav epub:type ="toc ">
9+ < ol >
10+ < li > < a href ="content_001.xhtml "> content 001</ a > </ li >
11+ </ ol >
12+ </ nav >
13+ </ body >
14+ </ html >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <package xmlns =" http://www.idpf.org/2007/opf" version =" 3.0" xml : lang =" en" unique-identifier =" q" >
3+ <metadata xmlns : dc =" http://purl.org/dc/elements/1.1/" >
4+ <dc : title id =" title" >Minimal EPUB 3.0</dc : title >
5+ <dc : language >en</dc : language >
6+ <dc : identifier id =" q" >NOID</dc : identifier >
7+ <meta property =" dcterms:modified" >2017-06-14T00:00:01Z</meta >
8+ </metadata >
9+ <manifest >
10+ <item id =" content_001" href =" content_001.xhtml" media-type =" application/xhtml+xml" />
11+ <item id =" nav" href =" nav.xhtml" media-type =" application/xhtml+xml" properties =" nav" />
12+ </manifest >
13+ <spine >
14+ <itemref idref =" content_001" />
15+ </spine >
16+ </package >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <container version =" 1.0" xmlns =" urn:oasis:names:tc:opendocument:xmlns:container" >
3+ <rootfiles >
4+ <rootfile full-path =" EPUB/package.opf" media-type =" application/oebps-package+xml" />
5+ </rootfiles >
6+ </container >
Original file line number Diff line number Diff line change 1+ application/epub+zip
Original file line number Diff line number Diff line change 1+ Feature : EPUBCheck - JSON Report tests
2+
3+ Checks the JSON report format
4+
5+
6+ Background :
7+ Given EPUB test files located at '/reporting/files/'
8+ And the reporting format is set to JSON
9+ And EPUBCheck with default settings
10+
11+ Scenario : Basic well-formedness checks
12+ When checking EPUB 'minimal'
13+ Then the JSON report is valid
14+ And JSON at '$.items' contains 5 items
15+ And JSON at '$..checkSum' has no null values
You can’t perform that action at this time.
0 commit comments