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 244161 - Functional testing - new file
Summary: Functional testing - new file
Status: RESOLVED INCOMPLETE
Alias: None
Product: qa
Classification: Unclassified
Component: Jellytools (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jiri Skrivanek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-29 09:17 UTC by zachy
Modified: 2014-05-02 16:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
qa-functional folder (15.88 KB, application/x-zip-compressed)
2014-04-29 15:12 UTC, zachy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zachy 2014-04-29 09:17:14 UTC
Testing of creating new file of custom filetype cant be done. 
Suppose we open new JavaProject.
Then we try to create new file by using NewFileWizardOperator. The file we would like to create is in category "Other" and it is called "NewTechnology file".
Then we should write code:

NewFileWizardOperator nfwo = NewFileWizardOperator.invoke();
nfwo.selectProject("Sample project");
nfwo.selectCategory("Other");
nfwo.selectFileType("NewTechnologyfile");
nfwo.next();
nfwo.finish();

When testing reaches the finish() statement, console starts to throw:


java.lang.OutOfMemoryError: PermGen space SEVERE [global] testing
Comment 1 Jiri Skrivanek 2014-04-29 09:31:22 UTC
It is not clear how do you run tests. Can you attach sample project? Also please attach IDE log file (http://wiki.netbeans.org/FaqLogMessagesFile).
Comment 2 zachy 2014-04-29 15:12:15 UTC
Created attachment 147010 [details]
qa-functional folder
Comment 3 zachy 2014-04-29 15:17:58 UTC
The attachment contains test and empty folder. In certain moment test freezes and output shows:
java.lang.OutOfMemoryError: PermGen space
...
some stack trace
...

Then repeating these two lines until i kill test
SEVERE [global]
java.lang.OutOfMemoryError: PermGen space
Comment 4 Jiri Skrivanek 2014-04-30 09:18:18 UTC
I tried it but I haven't found anything wrong on your test. Naturally it fails to find "Xdefinition file". I suspect it is a bug in a plugin which adds "Xdefinition file" template. Look at stack trace.
Comment 5 Jiri Kovalsky 2014-04-30 10:16:13 UTC
I also tried it with the same result - test failed, because it didn't find the XdefinitionTest project. See below. However, isn't that caused by insufficient perm gen size? Jirko, is there a way how to increase memory usage for the IDE opened by the test?

java.lang.IllegalArgumentException: Attempted to pass a null directory to findProject
	at org.netbeans.api.project.ProjectManager.findProject(ProjectManager.java:229)
Caused: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
[catch] at org.netbeans.jellytools.JellyTestCase.openProjects(JellyTestCase.java:404)
	at org.netbeans.jellytools.JellyTestCase.openDataProjects(JellyTestCase.java:452)
	at fileOperations.createNewFile.createNewFile(createNewFile.java:47)
Comment 6 Jiri Skrivanek 2014-04-30 10:31:34 UTC
> However, isn't that caused by insufficient perm gen size?

Hardly.

>  Jirko, is there a way how to increase memory usage for the IDE opened by the test?

Modify netbeans/etc/netbeans.conf or add test.run.args property with desired values to project.properties.
Comment 7 zachy 2014-05-02 16:20:25 UTC
Fixed by modifying project.properties, added two lines:
test.run.args=-ea -Xms128m -Xmx1024m -XX:MaxPermSpace=512m -XX:MaxPermSize=256m
test.run.args=-da -Xmx512M -XX:MaxPermSize=256m

However it revives an older bug report:
org.netbeans.junit.NbModuleSuite.Configuration.addStartupArgument(String[] arguments) does not support jvm startup arguments