Last Comment Bug 350886 - JavaXPCOM Unit Test
: JavaXPCOM Unit Test
Status: RESOLVED FIXED
: fixed1.8.1.4
Product: Core Graveyard
Classification: Graveyard
Component: Java to XPCOM Bridge (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: jhp (no longer active)
:
Mentors:
: 369397 (view as bug list)
Depends on: 351871 367792 367793
Blocks: test-suites
  Show dependency treegraph
 
Reported: 2006-08-31 10:48 PDT by jhp (no longer active)
Modified: 2014-09-24 05:43 PDT (History)
3 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch (28.96 KB, patch)
2006-08-31 10:51 PDT, jhp (no longer active)
no flags Details | Diff | Review
patch v2 - make check (130.60 KB, patch)
2007-01-22 14:34 PST, jhp (no longer active)
no flags Details | Diff | Review
patch v2.1 - make check (133.70 KB, patch)
2007-01-30 09:10 PST, jhp (no longer active)
no flags Details | Diff | Review
patch v2.2 - make check (138.21 KB, patch)
2007-02-07 19:45 PST, jhp (no longer active)
benjamin: review+
Details | Diff | Review
1.8.1 patch - makefile changes (5.56 KB, patch)
2007-03-02 14:53 PST, jhp (no longer active)
dveditz: approval1.8.1.4+
Details | Diff | Review

Description jhp (no longer active) 2006-08-31 10:48:49 PDT
 
Comment 1 jhp (no longer active) 2006-08-31 10:51:24 PDT
Created attachment 236251 [details] [diff] [review]
patch

This is an attempt at a browser based JavaXPCOM unit test.  This patch creates a Java component (using Java Component Loader code from bug 299263).  The tests are run by loading the web page and clicking on the 'Run' button.
Comment 2 jhp (no longer active) 2007-01-22 14:34:40 PST
Created attachment 252381 [details] [diff] [review]
patch v2 - make check

Different approach.  This patch cleans up the existing tests and adds some new ones, which can all be run from the command line when calling 'make check'.

As before, I am using the interfaces from the XPConnect tests.  However, since the C++ component of the XPConnect tests isn't built when building XULRunner (see bug 315090), I rolled my own version in Javascript (xpctests.js).

There is one issue remaining.  The Java tests are all built against MozillaInterfaces.jar, which isn't built until the end of 'libs' step (after the Java tests have supposedly been built).  So I need to find a clever way to build the Java tests after MozillaInterfaces.jar has been built.
Comment 3 jhp (no longer active) 2007-01-30 09:10:48 PST
Created attachment 253345 [details] [diff] [review]
patch v2.1 - make check

This patch rearranges how JavaXPCOM is built.  Currently, the main make call to JavaXPCOM happens in tier_toolkit.  This results in building the JNI code (which gets linked in to libXUL) and the glue code.  Later, there is a special call to extensions/java/xpcom/interfaces in tier_app (for XULRunner) to build MozillaInterfaces.jar.  This setup isn't very good since it requires special rules in order to build any other Java code that depends on MozillaInterfaces.jar.

This patch moves the main make call to JavaXPCOM to the tier_app XULRunner group.  Since this is the last tier, MozillaInterfaces.jar can be built during the 'libs' stage in order to pick up all of the interfaces.  Then any Java code depending on MozillaInterfaces.jar is built during the same 'libs' stage.

The only special case that needs to be handled is the JNI code.  Since it is linked into libXUL, it needs to be built before the call to build libXUL.  So there is a line in tier_toolkit to make in extensions/java/xpcom/src.

Benjamin, can you review the Makefile changes?
Comment 4 jhp (no longer active) 2007-02-07 19:45:31 PST
Created attachment 254381 [details] [diff] [review]
patch v2.2 - make check

Properly handle "install" make target.
Comment 5 jhp (no longer active) 2007-02-07 19:49:21 PST
*** Bug 369397 has been marked as a duplicate of this bug. ***
Comment 6 Benjamin Smedberg [:bsmedberg] 2007-03-01 09:45:58 PST
Comment on attachment 254381 [details] [diff] [review]
patch v2.2 - make check

>Index: extensions/java/xpcom/Makefile.in

>+# Build the implementation Java classes
>+libs::
>+	make -C src jar-libs
>+install::
>+	make -C src jar-install

Please add a line of whitespace between rules.
Comment 7 jhp (no longer active) 2007-03-02 09:36:43 PST
Since I am making a change to nsIXPCTestIn interface (fixing a method declaration), do I need to change the IID?
Comment 8 Benjamin Smedberg [:bsmedberg] 2007-03-02 10:37:58 PST
In general, yes.
Comment 9 jhp (no longer active) 2007-03-02 13:33:20 PST
Checked in to trunk.  -> FIXED
Comment 10 jhp (no longer active) 2007-03-02 14:53:20 PST
Created attachment 257077 [details] [diff] [review]
1.8.1 patch - makefile changes

This is the 1.8.1 branch version of the makefile reorg changes from the trunk patch.  XULRunner only.
Comment 11 Benjamin Smedberg [:bsmedberg] 2007-03-05 05:54:57 PST
This caused a build failure on the FF+XR tinderbox (the only one with --enable-tests):
d:/builds/tinderbox/Fx-XR/WINNT_5.2_Depend/mozilla/extensions/java/xpcom/tests/testparams/TestParams.java:64: warning: unmappable character for encoding Cp1252
	   "Non-Ascii 1 byte chars: Ž‰ŠˆŒ?, 2 byte chars: \u1234 \u1235 \u1236";

See http://tinderbox.mozilla.org/showlog.cgi?log=MozillaExperimental/1173081480.1173084330.23199.gz&fulltext=1
Comment 12 jhp (no longer active) 2007-03-05 14:30:02 PST
Actually, there error is that it cannot find LocationProvider.java.  Seems that this bit of the command is failing:

-sourcepath ".;/cygdrive/d/builds/tinderbox/Fx-XR/WINNT_5.2_Depend/mozilla/extensions/java/xpcom/tests/testparams;/cygdrive/d/builds/tinderbox/Fx-XR/WINNT_5.2_Depend/mozilla/extensions/java/xpcom/tests/testparams/.."

I know that 'javac' is sensitive to windows build paths.  The command is called using 'cygwin-wrapper', so I assume that is replacing the 'cygdrive' instances.  Plus, why is this failing for this build, but not for the standalone XULRunner?

I don't have cygwin installed any more, but I did try to reproduce using Benjamin's new Windows tools (MSYS).  This build failed in mozilla/extensions/java/xpcom/interfaces, for what seems to be a similar issue.  The '-sourcepath' flag arguments have MSYS style paths (i.e. "/e/builds/trunk/...").  When I manually edited this to start with "e:/builds/...", then 'javac' completed just fine.

Really not sure what is going on.
Comment 13 Benjamin Smedberg [:bsmedberg] 2007-03-05 14:46:12 PST
(In reply to comment #12)
> Actually, there error is that it cannot find LocationProvider.java.  Seems that
> this bit of the command is failing:
> 
> -sourcepath
> ".;/cygdrive/d/builds/tinderbox/Fx-XR/WINNT_5.2_Depend/mozilla/extensions/java/xpcom/tests/testparams;/cygdrive/d/builds/tinderbox/Fx-XR/WINNT_5.2_Depend/mozilla/extensions/java/xpcom/tests/testparams/.."

The problem is that both the cygwin wrapper and the msys magic /c/path know how to convert standalone arguments, but they don't know how to convert an argument with semicolons.

>  Plus, why is this failing for this build, but not for the standalone
> XULRunner?

The main build has --disable-tests
Comment 14 jhp (no longer active) 2007-03-06 11:54:10 PST
Moving Cygwin/MSYS build break discussion to already existing bug 363485.
Comment 15 Daniel Veditz [:dveditz] 2007-03-29 11:21:15 PDT
Comment on attachment 257077 [details] [diff] [review]
1.8.1 patch - makefile changes

approved for 1.8.1.4, a=dveditz for release-drivers
Comment 16 jhp (no longer active) 2007-04-03 12:08:30 PDT
Makefile changes checked in to MOZILLA_1_8_BRANCH.
Comment 17 Mike Hommey [:glandium] 2007-05-26 00:23:45 PDT
Comment on attachment 257077 [details] [diff] [review]
1.8.1 patch - makefile changes

>+jar-install:: $(JARFILE)
>+	$(SYSINSTALL) $(IFLAGS2) $(JARFILE) $(DESTDIR)$(mozappdir)

This should be IFLAGS1, not IFLAGS2.

Note You need to log in before you can comment on or make changes to this bug.