File tree Expand file tree Collapse file tree 8 files changed +69
-7
lines changed
main/java/com/adobe/epubcheck Expand file tree Collapse file tree 8 files changed +69
-7
lines changed Original file line number Diff line number Diff line change 28
28
import java .util .HashSet ;
29
29
import java .util .LinkedList ;
30
30
import java .util .List ;
31
- import java .util .Map ;
32
31
import java .util .Set ;
33
32
34
33
import org .w3c .epubcheck .constants .MIMEType ;
@@ -319,7 +318,7 @@ private boolean checkContainerStructure(OCFCheckerState state)
319
318
new OCFFilenameChecker (resource .getPath (), state .context ().build ()).check ();
320
319
321
320
// Report entry metadata
322
- reportFeatures (resource . getProperties () );
321
+ reportFeatures (resource );
323
322
324
323
// Add the resource to the container model
325
324
state .addResource (resource );
@@ -553,11 +552,12 @@ private EPUBVersion checkPublicationVersion(OCFCheckerState state)
553
552
}
554
553
}
555
554
556
- private void reportFeatures (Map < FeatureEnum , String > features )
555
+ private void reportFeatures (OCFResource resource )
557
556
{
558
- for (FeatureEnum feature : features .keySet ())
557
+ for (FeatureEnum feature : resource . getProperties () .keySet ())
559
558
{
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 ));
561
561
}
562
562
}
563
563
Original file line number Diff line number Diff line change @@ -287,8 +287,6 @@ else if (name.equals("item"))
287
287
288
288
String mediaOverlay = e .getAttribute ("media-overlay" );
289
289
itemBuilder .mediaOverlay (mediaOverlay );
290
-
291
- report .info (href , FeatureEnum .UNIQUE_IDENT , id );
292
290
}
293
291
}
294
292
}
@@ -641,6 +639,7 @@ private void buildItems()
641
639
*/
642
640
protected void reportItem (OPFItem item )
643
641
{
642
+ report .info (item .getPath (), FeatureEnum .UNIQUE_IDENT , item .getId ());
644
643
if (item .isInSpine ())
645
644
{
646
645
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