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 42002 - testUsingNbfsProtocol
Summary: testUsingNbfsProtocol
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Execution (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords: TEST
Depends on:
Blocks:
 
Reported: 2004-04-15 07:59 UTC by Jaroslav Tulach
Modified: 2008-12-22 20:35 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The failure (6.43 KB, text/html)
2004-04-15 07:59 UTC, Jaroslav Tulach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2004-04-15 07:59:37 UTC
testUsingNbfsProtocol	
	openide/test/work/sys/tests/unit/classes/org/openide/execution/data/foo.xml
(No such file or directory)
Comment 1 Jaroslav Tulach 2004-04-15 07:59:57 UTC
Created attachment 14404 [details]
The failure
Comment 2 Petr Nejedly 2004-05-28 22:09:28 UTC
The test fails in its own consistency check, before it gets to testing
the real functionality.
The problem is that the test infrastructure doesn't copy the data
file, while it probably used to copy it before.
Jirko, do you have any idea what may be wrong and how to fix the test?
Comment 3 Jiri Kovalsky 2004-05-30 21:23:05 UTC
I am sure you didn't mean me to be the evaluator. Maybe Jirka Skrivanek ?
Comment 4 Jiri Skrivanek 2004-05-31 08:45:28 UTC
data/foo.xml is on test classpath but its physical location is other
than expected. It is here

openide/test/work/sys/tests/unit/src/org/openide/execution/data/foo.xml

but the test expects it here

openide/test/work/sys/tests/unit/classes/
Comment 5 Petr Nejedly 2004-05-31 09:03:44 UTC
Of course, I know.
But for the sake of test, I need the .xml file to be next to classes
or at least on the same classpath. This is the usual deployment:
have all the resources next to the classes on the classpath, as the
resources are accessed through ClassLoaders. Having it somewhere else
is broken.

So I need to setup xtest (or at leas my test) to have it there,
essentially to copy everything but .java and .form to the area of
compiled classes.
Comment 6 Jiri Skrivanek 2004-05-31 12:53:40 UTC
> But for the sake of test, I need the .xml file to be next to classes
> or at least on the same classpath. This is the usual deployment:

It is on the same classpath. getClass().getResource("data/foo.xml")
returns a valid URL.

> have all the resources next to the classes on the classpath, as the
> resources are accessed through ClassLoaders. Having it somewhere 
> else is broken.

> So I need to setup xtest (or at leas my test) to have it there,
> essentially to copy everything but .java and .form to the area of
> compiled classes.

Not as easy. It would take some time to change XTest. If you need it
immediatelly, please update your test.
Comment 7 Petr Nejedly 2004-06-01 11:56:45 UTC
> It is on the same classpath. getClass().getResource("data/foo.xml")
> returns a valid URL.

OK, it is not enough for this test. They have to be in the same
hierarchy, as it simulates a classloader over that hierarchy.

> Not as easy. It would take some time to change XTest. If you need it
> immediatelly, please update your test.

So how can I modify the test build script to copy the file for me?
I'm not experienced in hacking the xtest infrastructure...
Comment 8 Jiri Skrivanek 2004-06-01 13:00:05 UTC
Actually you don't need to copy the file. You can create it in the test:

Index: NbClassLoaderTest.java
===================================================================
RCS file:
/cvs/openide/test/unit/src/org/openide/execution/NbClassLoaderTest.java,v
retrieving revision 1.4
diff -r1.4 NbClassLoaderTest.java
50a51,60
>         
>         File dataDir = new File(new File(new File(new File(here,
"org"), "openide"), "execution"), "data");
>         if(!dataDir.exists()) {
>             dataDir.mkdir();
>         }
>         File fooFile = new File(dataDir, "foo.xml");
>         if(!fooFile.exists()) {
>             fooFile.createNewFile();
>         }
>         
Comment 9 Petr Nejedly 2004-06-04 23:07:23 UTC
Fixed using provided patch.
openide/test/unit/src/org/openide/execution/NbClassLoaderTest.java,v1.5
openide/test/unit/src/org/openide/execution/data/foo.xml,v1.2
Comment 10 Marian Mirilovic 2004-08-11 10:24:57 UTC
verified