This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 84480 - I18N - generated output.xml and expected output.xml can have diff. encodings
Summary: I18N - generated output.xml and expected output.xml can have diff. encodings
Status: CLOSED FIXED
Alias: None
Product: soa
Classification: Unclassified
Component: JBI Test Driver (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jun Qian
URL:
Keywords:
Depends on: 81554 84533 86095
Blocks:
  Show dependency tree
 
Reported: 2006-09-08 00:31 UTC by naokoh
Modified: 2006-10-05 00:07 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Expected output.xml (88.06 KB, image/jpeg)
2006-09-26 22:05 UTC, naokoh
Details
Diff window showing incorrect encoding type (110.36 KB, image/jpeg)
2006-09-26 22:06 UTC, naokoh
Details
Actual output is missing in diff view (91.68 KB, image/jpeg)
2006-09-30 00:41 UTC, naokoh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description naokoh 2006-09-08 00:31:20 UTC
By default, there is no encoding specified for input.xml.  By default,
output.xml has UTF-8 as its encoding type.

I think it is ok to have different encoding types for input.xml and output.xml
files.  However, I think it makes sense to have the same encoding for expected
output.xml and generated (Actual**.xml) output.xml files.

Currently, when I change the output.xml encoding to something else (eg.,
EUC-JP), the generated output.xml is still in UTF-8.  It seems inconsistent. 
The interesting thing is, the test still passes, even though the encoding types
are different.  I am not sure why it still works.

I also ran native2ascii to verify that output.xml in EUC-JP is indeed in EUC-JP
and Actual**.xml (generated output.xml) in UTF-8 is indeed in UTF-8, so the
files are encoded correctly.

Steps to reproduce:

1.  Create a basic bpel and wsdl.
2.  Type some Japanese character in place of ?string? in input.xml.
3.  Run the test.  The system will ask if you want to use the current output.xml
as the expected output.xml, as it is currently empty.  Selec OK.
4.  Edit output.xml and change encoding to EUC-JP from UTF-8.
5.  Run the test again.
6.  View the generated output.xml file.  Encoding is set to UTF-8, but the
expected output.xml's encoding is set to EUC-JP.  Test still passes.
Comment 1 Jun Qian 2006-09-08 05:26:14 UTC
By simply changing the XML encoding attribute from UTF-8 to EUC-JP (in step 4),
you are not really changing the underlying encoding of the file. I am not sure
which encoding the XML parser will take precedence, the encoding in the XML
prolog, or the underlying encoding. 

We are still waiting for the XML team to provide us a real XML Diff utility. I
don't know if that utility will treat different encoding in the prolog as a
difference or not.

I will ask the XML team to answer these questions.
Comment 2 Ayub Khan 2006-09-08 18:58:33 UTC
I have filed a xdm bug 84533 to take care of the encoding issue. Our team would
prioritize this bug.
Comment 3 naokoh 2006-09-22 23:23:54 UTC
Hi,

Can you please advise me if the following is a valid test case?

1.  actual output.xml in EUC-JP.
2.  generated output.xml in EUC-JP.

I would like to confirm before adding the test case.

Thanks.
--Naoko
Comment 4 Jun Qian 2006-09-22 23:54:46 UTC
With the latest xml diff utility we get from the xml team, two xml files with
different encoding will be identified as different. That means if you manually
change the encoding of the expected output from "UTF-8" to "EUC-JP", and the
actual output has an encoding of "UTF-8", then the test case will fail. 

The xml diff change was just checked in earlier today . You need to wait for the
next installer build to test it.

FYI, with this new build, you need to close all your compapp projects and reopen
them in NetBeans to have those projects properly updated.

Comment 5 naokoh 2006-09-26 22:01:18 UTC
I tested this using the latest 060925_1 build.

Here is my test case.

1.  Modified Output.xml so that encoding is now set to EUC-JP. 
    See expected_output_xml_060925_1.jpg.

2.  Cleaned up all applications and restarted NetBeans.

3.  Did a clean build / deploy.  Ran the test.


Here is what I observed.

1.  The test did fail with the following error message:
    "The response is not identical to the expected output."
    This is expected.

2.  However, the diff window has some issues.
    a.  Diff window shows that expected Output.xml is still in UTF-8.
        It is strange, since I changed it to EUC-JP.
        See diff_window_060925_1.jpg.
    b.  Diff window does not tell me which line is breaking
        (it used to highlight the line that was causing the diff to fail).

Also, I am concerned about this statement here:
"FYI, with this new build, you need to close all your compapp
 projects and reopen them in NetBeans to have those projects
 properly updated."

Is this the final expected behavior or will this be fixed?

Re-openining the issue for further investigations.
Comment 6 naokoh 2006-09-26 22:05:30 UTC
Created attachment 34551 [details]
Expected output.xml
Comment 7 naokoh 2006-09-26 22:06:09 UTC
Created attachment 34552 [details]
Diff window showing incorrect encoding type
Comment 8 Jun Qian 2006-09-27 00:55:28 UTC
Fixed hard-coded UTF-8 encoding when presenting the diff view.

==========
Checking in DiffStreamSource.java;
/cvs/enterprise/compapp/projects/jbi/src/org/netbeans/modules/compapp/test/ui/Attic/DiffStreamSource.java,v
 <--  DiffStreamSource.java
new revision: 1.1.2.5; previous revision: 1.1.2.4
done
==========
Comment 9 naokoh 2006-09-27 19:34:02 UTC
All the builds are bad since 060925_1.  I will verify it once a good build
becomes available.
Comment 10 naokoh 2006-09-30 00:39:41 UTC
Tested on the latest 060929 build.

I don't see both output windows anymore - I only see the expected output. 
Please see the attached image (missing_actual_window_diff.jpg).

Re-opening the issue for further investigations.
Comment 11 naokoh 2006-09-30 00:41:06 UTC
Created attachment 34730 [details]
Actual output is missing in diff view
Comment 12 Jun Qian 2006-09-30 00:48:08 UTC
Could you open the actual output file and see if it looks something like this:

<?xml version="1.0"?>
<?xml version="1.
.........

If this is the case, then that explains why the actual output file in the diff
view is missing. This problem is tracked by IZ 86095 and is claimed to be fixed now.

If this is not the case, please reopen this ticket with the actual output file
attached. 
Comment 13 naokoh 2006-09-30 01:02:42 UTC
Verified that this is exactly the problem.

Adding IZ 86095 as an issue that this issue depends on.  Will close the issue
after I verify that everything is ok.  Please keep it open until then.
Comment 14 naokoh 2006-10-05 00:06:56 UTC
Tested using the latest 061002 build.
Verified that it is now working correctly.
Closing the issue as verified/closed.