[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-6953) Disable Usage Reporting in Tests

Andre Dietisheim (JIRA) jira-events at lists.jboss.org
Wed Sep 1 13:20:11 EDT 2010


    [ https://jira.jboss.org/browse/JBIDE-6953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12548408#action_12548408 ] 

Andre Dietisheim commented on JBIDE-6953:
-----------------------------------------

I tried it today, too, but didn't succeed either. I tracked the problem down and read some documentation but I'm still not sure what's the reason that the properties are not set when specified in config.ini

I added 

org.jboss.tools.usage.ask_user_for_usage_report_preference=false (I changed the key names today as max asked me to)


and checked if the false value reaches the runtime. It did not in my case.

To my current understanding scopes are just a concept that allow values to cascade. It shouldn't bother about it in this context. Config.ini settings should make it up to the runtime:

http://help.eclipse.org/helios/topic/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html#locations

I traced through the platform code and found the following implementation, that fetches preference values from an empty map:

<snip>
EclipsePreferences#internalGet(String key) {
		// throw NPE if key is null
		if (key == null)
			throw new NullPointerException();
		// illegal state if this node has been removed
		checkRemoved();
		String result = properties.get(key);
		if (DEBUG_PREFERENCE_GET)
			PrefsMessages.message("Getting preference value: " + absolutePath() + '/' + key + "->" + result); //$NON-NLS-1$ //$NON-NLS-2$
		return result;
}
</snip>

At that point properties is an ImmutableMap$EmptyMap. 

ImmutableMap$EmptyMap#get(String value) {
		return null;
}

Strange stuff. I currently dont understand why this map is immutable and empty.

My current thought is that we might achieve the same with plugin customization:

http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html -> 

eclipse.pluginCustomization {-pluginCustomization}
the file system location of a properties file containing default settings for plug-in preferences. These default settings override default settings specified in the primary feature. Relative paths are interpreted relative to the current working directory for Eclipse itself.

Ideas?

> Disable Usage Reporting in Tests
> --------------------------------
>
>                 Key: JBIDE-6953
>                 URL: https://jira.jboss.org/browse/JBIDE-6953
>             Project: Tools (JBoss Tools)
>          Issue Type: Release
>         Environment: CI, Tests
>            Reporter: Andre Dietisheim
>            Assignee: Denis Golovin
>            Priority: Blocker
>             Fix For: 3.2.0.M2
>
>
> the UI tests we run should not trigger hits in our usage tracking. The plugin has a preferences setting that disables reporting. 
> It looks like we disable reporting for our UI test by having a custom config.ini for our UI tests.
> The "org.jboss.tools.usage" bundle has 2 preferences settings: 
> "allowUsageReportPreference"
> Furthermore the usage plugin shall not pop up a dialog that asks the user if he allows us to report hits. This can be done with 
> "askUserForUsageReportPreference"
> Both are in the Configuration Scope (common to all workbenches of a particular eclipse instance).
> For further lookup @see IUsageReportPreferenceConstants#USAGEREPORT_ENABLED_ID and IUsageReportPreferenceConstants#ASK_USER_USAGEREPORT_ID

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list