Skip to content
This repository has been archived by the owner on Dec 30, 2018. It is now read-only.

Commit

Permalink
changeset: 23:f600a60aed88
Browse files Browse the repository at this point in the history
user:        Developer:svanteschubert;Reviewer:Hans-Peter,Devin
date:        Thu Feb 24 13:22:27 2011 +0100
Adding ODF 1.2 to tests, calculating ODF 1.2 number of elements&attributes

git-svn-id: https://svn.apache.org/repos/asf/incubator/odf/trunk/generator@1167974 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
devin committed Aug 26, 2011
1 parent f892976 commit 9c63745
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
Expand Up @@ -69,11 +69,12 @@ public class OdfHelper {
"table:table-template"
NOTE: Ignoring the '*' there can be 525 elements parsed, but with fixed schema it should be 535. */
public static final int ODF11_ELEMENT_NUMBER = 525; //ToDo: 535 - by search/Replace using RNGSchema and tools, prior exchange <name> to element or attribute declaration

public static final int ODF12_ELEMENT_NUMBER = 598;

/** Expresses the amount of attributes in ODF 1.1. There are some issues in the schema that have to be fixed before the full number can be returned by MSV:
Following references are never used, therefore its attribute is not taking into account::
draw-glue-points-attlist with "draw:escape-direction"
office-process-content with "office:process-content"
office-process-content with "office:process-content" (DEPRECATED in ODF1.2 only on foreign elements)
Following attributes are member of the not referenced element "table:table-template":
"text:first-row-end-column"
Expand All @@ -84,7 +85,7 @@ public class OdfHelper {
NOTE: Ignoring the '*' there can be 1162 elements parsed, but with fixed schema it should be 1169. */
public static final int ODF11_ATTRIBUTE_NUMBER = 1162; //ToDo: 1169 - by search/Replace using RNGSchema and tools, prior exchange <name> to element or attribute declaration

public static final int ODF12_ATTRIBUTE_NUMBER = 1300; //in RNG 1301 as there is one deprecated attribute on foreign elements not referenced (ie. @office:process-content)
public static String odfResourceDir;
public static String outputRoot;
public static final String INPUT_ROOT = "target" + File.separator + "classes" + File.separator
Expand Down
17 changes: 12 additions & 5 deletions schema2template/src/test/java/schema2template/PuzzlePieceTest.java
Expand Up @@ -136,12 +136,19 @@ private String readFileAsString(String filePath) throws java.io.IOException {
@Test
public void testExtractPuzzlePieces() {
try {
PuzzlePieceSet allElements = new PuzzlePieceSet();
PuzzlePieceSet allAttributes = new PuzzlePieceSet();
PuzzlePiece.extractPuzzlePieces(OdfHelper.loadSchemaODF11(), allElements, allAttributes);
PuzzlePieceSet allElements_ODF11 = new PuzzlePieceSet();
PuzzlePieceSet allAttributes_ODF11 = new PuzzlePieceSet();
PuzzlePiece.extractPuzzlePieces(OdfHelper.loadSchemaODF11(), allElements_ODF11, allAttributes_ODF11);
// There is a difference of one wildcard "*" representing anyElement/anyAttribute
checkFoundNumber(allElements.withoutMultiples(), ODF11_ELEMENT_NUMBER + 1, "element");
checkFoundNumber(allAttributes.withoutMultiples(), ODF11_ATTRIBUTE_NUMBER + 1, "attribute");
checkFoundNumber(allElements_ODF11.withoutMultiples(), ODF11_ELEMENT_NUMBER + 1, "element");
checkFoundNumber(allAttributes_ODF11.withoutMultiples(), ODF11_ATTRIBUTE_NUMBER + 1, "attribute");

PuzzlePieceSet allElements_ODF12 = new PuzzlePieceSet();
PuzzlePieceSet allAttributes_ODF12 = new PuzzlePieceSet();
PuzzlePiece.extractPuzzlePieces(OdfHelper.loadSchemaODF12(), allElements_ODF12, allAttributes_ODF12);
// There is a difference of one wildcard "*" representing anyElement/anyAttribute
checkFoundNumber(allElements_ODF12.withoutMultiples(), ODF12_ELEMENT_NUMBER + 1, "element");
checkFoundNumber(allAttributes_ODF12.withoutMultiples(), ODF12_ATTRIBUTE_NUMBER + 1, "attribute");
} catch (Exception ex) {
Logger.getLogger(PuzzlePieceTest.class.getName()).log(Level.SEVERE, null, ex);
Assert.fail(ex.toString());
Expand Down

0 comments on commit 9c63745

Please sign in to comment.