Skip to content

Convert xinclude.Test to JUnit - #113

Open
elharo wants to merge 4 commits into
mainfrom
convert-xinclude-to-junit
Open

Convert xinclude.Test to JUnit#113
elharo wants to merge 4 commits into
mainfrom
convert-xinclude-to-junit

Conversation

@elharo

@elharo elharo commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Converts the xinclude test harness from main()-driven to JUnit 3.

  • Extends TestCase, implements XMLErrorHandler
  • Suite-based dispatching for 41 individual test cases
  • Uses assertEquals/assertTrue instead of System.out/System.err
  • Adds xinclude/Test.class to batchtest in build.xml
  • Removes the old java task for xinclude

Comment thread tests/xinclude/Test.java
/**
* Tests for XInclude implementation.
* Use -f option to see the error message log
* @author Peter McCracken, IBM

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can keep the @author tag

Comment thread tests/xinclude/Test.java
protected static final String ERROR_HANDLER =
"http://apache.org/xml/properties/internal/error-handler";

// this array contains whether the test number NN (contained in file testNN.xml)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is useful and should be retained

Comment thread tests/xinclude/Test.java
parserConfig.setFeature(SCHEMA_FULL_CHECKING_FEATURE_ID, true);
fWriter = new Writer(parserConfig);

// this has to be done AFTER fWriter is created

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is useful and should be retained

Comment thread tests/xinclude/Test.java
// strip ones in URI form
while ((start = str.indexOf(userURI, start)) != -1) {
end = start + userURI.length();
// we add one, to get rid of the '/' after the user directory path

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is useful and should be retained

Comment thread tests/xinclude/Test.java
String str = getPathWithoutEscapes(buf.toString());

int start = 0, end = 0;
// strip ones in URI form

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is useful and should be retained

Comment thread tests/xinclude/Test.java

while ((start = str.indexOf(userDir, start)) != -1) {
end = start + userDir.length();
// we add one, to get rid of the '/' after the user directory path

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is useful and should be retained

@elharo
elharo force-pushed the convert-xinclude-to-junit branch from 2e13a19 to 9d9b14e Compare July 8, 2026 12:47
@elharo

elharo commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

All review comments addressed: restored @author tag, test results comments, fWriter creation comment, and stripUserDir comments.

@elharo elharo changed the title Convert xinclude.Test to JUnit 3 Convert xinclude.Test to JUnit Jul 8, 2026
@elharo
elharo force-pushed the convert-xinclude-to-junit branch 2 times, most recently from 59407cb to d6fc886 Compare July 8, 2026 20:21
@elharo
elharo force-pushed the convert-xinclude-to-junit branch from 43464ef to 18f4ee5 Compare July 16, 2026 14:33
…Writer creation comment, and stripUserDir comments
@elharo
elharo requested a review from mrglavas July 16, 2026 18:45
@elharo
elharo force-pushed the convert-xinclude-to-junit branch from 4e21ccd to 0af9a3d Compare July 19, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant