Author: adietish
Date: 2010-11-30 05:01:15 -0500 (Tue, 30 Nov 2010)
New Revision: 27019
Removed:
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/LoggingUtils.java
Modified:
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/META-INF/MANIFEST.MF
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/http/HttpGetRequest.java
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/http/HttpRemotePropertiesProvider.java
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/GlobalUsageSettings.java
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/UsageReportPreferences.java
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReport.java
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportDispatcher.java
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/tracker/internal/Tracker.java
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/tracker/internal/UsagePluginLogger.java
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/JBoss Developer
Studio Usage Reporter.launch
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/JBoss Tools
Usage Reporter.launch
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/UsageTestSuite.launch
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageSettingsTest.java
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/HttpRemotePropertiesTest.java
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsUsageIntegrationTest.java
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsUsageRequestsTest.java
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/UrlRevealingTracker.java
Log:
[JBIDe-7751] [JBIDe-7552] removed dependency to org.jboss.tools.commons, fixed NPE when
logging (accessed a plugin instance variable that was never initialized), made
getting/setting pref values does always access pref store (code gets more clear)
Modified:
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/META-INF/MANIFEST.MF
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/META-INF/MANIFEST.MF 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/META-INF/MANIFEST.MF 2010-11-30
10:01:15 UTC (rev 27019)
@@ -23,6 +23,5 @@
Bundle-Activator: org.jboss.tools.usage.internal.JBossToolsUsageActivator
Bundle-Vendor: %bundle-vendor
Bundle-ActivationPolicy: lazy
-Import-Package: org.jboss.tools.common.log
Modified:
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/http/HttpGetRequest.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/http/HttpGetRequest.java 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/http/HttpGetRequest.java 2010-11-30
10:01:15 UTC (rev 27019)
@@ -15,7 +15,7 @@
import java.net.URL;
import java.text.MessageFormat;
-import org.jboss.tools.common.log.ILoggingAdapter;
+import org.jboss.tools.usage.tracker.internal.UsagePluginLogger;
/**
* Class that executes a HTTP Get request to the given url.
@@ -28,18 +28,13 @@
private static final String GET_METHOD_NAME = "GET"; //$NON-NLS-1$
- private ILoggingAdapter loggingAdapter = null;
+ private UsagePluginLogger logger = null;
-// private CookieHandler cookieHandler;
-
private String userAgent;
- public HttpGetRequest(String userAgent, ILoggingAdapter loggingAdapter) {
+ public HttpGetRequest(String userAgent, UsagePluginLogger logger) {
this.userAgent = userAgent;
- this.loggingAdapter = loggingAdapter;
-// this.cookieHandler = new CookieHandler();
-// this.cookieHandler = CookieHandler.getDefault();
-// cookieHandler.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
+ this.logger = logger;
}
/* (non-Javadoc)
@@ -47,20 +42,17 @@
*/
public void request(String urlString) {
-// CookieHandler currentCookieHandler = setCookieHandler(cookieHandler);
try {
HttpURLConnection urlConnection = createURLConnection(urlString, userAgent);
urlConnection.connect();
int responseCode = getResponseCode(urlConnection);
if (responseCode == HttpURLConnection.HTTP_OK) {
- loggingAdapter.debug(MessageFormat.format(HttpMessages.HttpGetMethod_Success,
urlString, responseCode));
+ logger.debug(MessageFormat.format(HttpMessages.HttpGetMethod_Success, urlString,
responseCode));
} else {
- loggingAdapter.error(MessageFormat.format(HttpMessages.HttpGetMethod_Error_Http,
urlString, responseCode));
+ logger.error(MessageFormat.format(HttpMessages.HttpGetMethod_Error_Http, urlString,
responseCode));
}
} catch (Exception e) {
- loggingAdapter.debug(MessageFormat.format(HttpMessages.HttpGetMethod_Error_Io,
urlString, e.toString()));
- } finally {
-// setCookieHandler(currentCookieHandler);
+ logger.debug(MessageFormat.format(HttpMessages.HttpGetMethod_Error_Io, urlString,
e.toString()));
}
}
@@ -76,12 +68,6 @@
return urlConnection.getResponseCode();
}
-// private CookieHandler setCookieHandler(CookieHandler cookieHandler) {
-// CookieHandler currentCookieHandler = CookieHandler.getDefault();
-// CookieHandler.setDefault(cookieHandler);
-// return currentCookieHandler;
-// }
-
/**
* Creates a new url connection.
*
Modified:
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/http/HttpRemotePropertiesProvider.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/http/HttpRemotePropertiesProvider.java 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/http/HttpRemotePropertiesProvider.java 2010-11-30
10:01:15 UTC (rev 27019)
@@ -21,12 +21,8 @@
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.jboss.tools.common.log.ILoggingAdapter;
+import org.jboss.tools.usage.tracker.internal.UsagePluginLogger;
import org.jboss.tools.usage.util.HttpEncodingUtils;
-import org.jboss.tools.usage.util.LoggingUtils;
-import org.jboss.tools.usage.util.StatusUtils;
import org.jboss.tools.usage.util.reader.ReaderUtils;
@@ -45,14 +41,13 @@
private String[] keys;
private String url;
private char valueDelimiter;
- protected Plugin plugin;
- private ILoggingAdapter loggingAdapter;
+ private UsagePluginLogger logger;
- public HttpRemotePropertiesProvider(String url, char valueDelimiter, ILoggingAdapter
loggingAdapter, String... keys) {
+ public HttpRemotePropertiesProvider(String url, char valueDelimiter, UsagePluginLogger
loggingAdapter, String... keys) {
this.url = url;
this.keys = keys;
this.valueDelimiter = valueDelimiter;
- this.loggingAdapter = loggingAdapter;
+ this.logger = loggingAdapter;
}
@@ -86,18 +81,14 @@
urlConnection.connect();
int responseCode = getResponseCode(urlConnection);
if (responseCode == HttpURLConnection.HTTP_OK) {
- IStatus status = StatusUtils.getInfoStatus(
- plugin.getBundle().getSymbolicName()
- , HttpMessages.HttpResourceMap_Info_HttpQuery
- , url);
- LoggingUtils.log(status, plugin);
+ logger.debug(MessageFormat.format(HttpMessages.HttpResourceMap_Info_HttpQuery,
url));
responseReader = getInputStreamReader(urlConnection.getInputStream(),
urlConnection.getContentType());
} else {
- loggingAdapter.error(MessageFormat.format(HttpMessages.HttpGetMethod_Error_Http, url,
responseCode));
+ logger.error(MessageFormat.format(HttpMessages.HttpGetMethod_Error_Http, url,
responseCode));
}
return responseReader;
} catch (IOException e) {
- loggingAdapter.debug(MessageFormat.format(HttpMessages.HttpGetMethod_Error_Io, url,
e.toString()));
+ logger.debug(MessageFormat.format(HttpMessages.HttpGetMethod_Error_Io, url,
e.toString()));
throw e;
}
}
Modified:
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/GlobalUsageSettings.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/GlobalUsageSettings.java 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/GlobalUsageSettings.java 2010-11-30
10:01:15 UTC (rev 27019)
@@ -32,8 +32,12 @@
* system property that enables/disables reporting for current eclipse
* instance
*/
- public static final String USAGE_REPORTING_ENABLED_KEY =
"usage_reporting_enabled";
+ public static final String USAGE_REPORTING_ENABLED_KEY =
"usage_reporting_enabled"; //$NON-NLS-1$
+ /**
+ * system property that enables/disables reporting for all eclipse
+ * instances
+ */
public static final String REMOTEPROPS_USAGE_REPORTING_ENABLED_KEY =
USAGE_REPORTING_ENABLED_KEY + "="; //$NON-NLS-1$
/** the enablement default for the local instance */
@@ -96,7 +100,8 @@
*
* @return true, if this instance shall report usage
*
- * @see #SYSPROPS_INSTANCE_ENABLED_KEY
+ * @see #USAGE_REPORTING_ENABLED_KEY
+ * @see #INSTANCE_USAGE_REPORTING_ENABLED_DEFAULT
*/
private boolean isInstanceReportingEnabled() {
return Boolean.valueOf(
Modified:
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/UsageReportPreferences.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/UsageReportPreferences.java 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/UsageReportPreferences.java 2010-11-30
10:01:15 UTC (rev 27019)
@@ -10,11 +10,12 @@
******************************************************************************/
package org.jboss.tools.usage.internal.preferences;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import java.io.IOException;
+
import org.eclipse.jface.preference.IPreferenceStore;
import org.jboss.tools.usage.internal.JBossToolsUsageActivator;
import org.jboss.tools.usage.internal.reporting.ReportingMessages;
-import org.jboss.tools.usage.util.StatusUtils;
+import org.jboss.tools.usage.tracker.internal.UsagePluginLogger;
import org.osgi.service.prefs.BackingStoreException;
/**
@@ -24,7 +25,8 @@
public static void setEnabled(boolean enabled) {
UsageReportPreferencesUtils.getStore().putValue(
- IUsageReportPreferenceConstants.USAGEREPORT_ENABLED_ID, String.valueOf(enabled));
+ IUsageReportPreferenceConstants.USAGEREPORT_ENABLED_ID, String.valueOf(enabled));
+ save();
}
public static boolean isEnabled() {
@@ -35,21 +37,24 @@
public static boolean isAskUser() {
return UsageReportPreferencesUtils.getPreferences().getBoolean(
- IUsageReportPreferenceConstants.ASK_USER_USAGEREPORT_ID,
+ IUsageReportPreferenceConstants.ASK_USER_USAGEREPORT_ID,
IUsageReportPreferenceConstants.ASK_USER_USAGEREPORT_DEFAULTVALUE);
}
public static void setAskUser(boolean askUser) {
+ UsageReportPreferencesUtils.getStore().putValue(IUsageReportPreferenceConstants.ASK_USER_USAGEREPORT_ID,
+ String.valueOf(askUser));
+ save();
+ }
+
+ private static void save() {
try {
- IEclipsePreferences preferences = UsageReportPreferencesUtils.getPreferences();
- preferences.putBoolean(IUsageReportPreferenceConstants.ASK_USER_USAGEREPORT_ID,
askUser);
- preferences.flush();
- } catch (BackingStoreException e) {
- JBossToolsUsageActivator.getDefault().getLog().log(
- StatusUtils.getErrorStatus(JBossToolsUsageActivator.PLUGIN_ID,
- ReportingMessages.UsageReport_Error_SavePreferences, e,
- IUsageReportPreferenceConstants.ASK_USER_USAGEREPORT_ID));
+ UsageReportPreferencesUtils.getStore().save();
+ } catch (IOException e) {
+ new UsagePluginLogger(JBossToolsUsageActivator.getDefault()).error(
+ ReportingMessages.UsageReport_Error_SavePreferences);
}
+
}
public static void flush() throws BackingStoreException {
Modified:
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReport.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReport.java 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReport.java 2010-11-30
10:01:15 UTC (rev 27019)
@@ -19,7 +19,6 @@
import org.eclipse.jface.window.Window;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.UIJob;
-import org.jboss.tools.common.log.ILoggingAdapter;
import org.jboss.tools.usage.googleanalytics.GoogleAnalyticsUrlStrategy;
import org.jboss.tools.usage.googleanalytics.IJBossToolsEclipseEnvironment;
import org.jboss.tools.usage.http.HttpGetRequest;
@@ -33,7 +32,6 @@
import org.jboss.tools.usage.tracker.internal.SuffixFocusPoint;
import org.jboss.tools.usage.tracker.internal.Tracker;
import org.jboss.tools.usage.tracker.internal.UsagePluginLogger;
-import org.jboss.tools.usage.util.StatusUtils;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.service.prefs.BackingStoreException;
@@ -48,13 +46,14 @@
private IJBossToolsEclipseEnvironment eclipseEnvironment;
+ UsagePluginLogger logger = new
UsagePluginLogger(JBossToolsUsageActivator.getDefault());
+
public UsageReport() throws InvalidSyntaxException {
eclipseEnvironment =
JBossToolsUsageActivator.getDefault().getJBossToolsEclipseEnvironment();
focusPoint = new SuffixFocusPoint("tools",
eclipseEnvironment.getJBossToolsVersion()) //$NON-NLS-1$
.setChild(new FocusPoint("usage") //$NON-NLS-1$
.setChild(new FocusPoint("action") //$NON-NLS-1$
.setChild(new FocusPoint("wsstartup")))); //$NON-NLS-1$
-
globalSettings = new GlobalUsageSettings(JBossToolsUsageActivator
.getDefault());
}
@@ -78,9 +77,7 @@
try {
UsageReportPreferences.flush();
} catch (BackingStoreException e) {
- IStatus status = StatusUtils.getErrorStatus(JBossToolsUsageActivator.PLUGIN_ID,
- ReportingMessages.UsageReport_Error_SavePreferences, e);
- JBossToolsUsageActivator.getDefault().getLog().log(status);
+ logger.error(ReportingMessages.UsageReport_Error_SavePreferences);
}
}
@@ -91,11 +88,10 @@
private void doReport() {
if (UsageReportPreferences.isEnabled()) {
IURLBuildingStrategy urlBuildingStrategy = new
GoogleAnalyticsUrlStrategy(eclipseEnvironment);
- ILoggingAdapter loggingAdapter = new
UsagePluginLogger(JBossToolsUsageActivator.getDefault());
ITracker tracker = new Tracker(
urlBuildingStrategy
- , new HttpGetRequest(eclipseEnvironment.getUserAgent(), loggingAdapter)
- , loggingAdapter);
+ , new HttpGetRequest(eclipseEnvironment.getUserAgent(), logger)
+ , logger);
tracker.trackAsynchronously(focusPoint);
}
}
Modified:
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportDispatcher.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportDispatcher.java 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportDispatcher.java 2010-11-30
10:01:15 UTC (rev 27019)
@@ -10,12 +10,10 @@
******************************************************************************/
package org.jboss.tools.usage.internal.reporting;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IStartup;
import org.jboss.tools.usage.internal.JBossToolsUsageActivator;
-import org.jboss.tools.usage.util.LoggingUtils;
-import org.jboss.tools.usage.util.StatusUtils;
+import org.jboss.tools.usage.tracker.internal.UsagePluginLogger;
/**
* @author Andre Dieitsheim
@@ -29,8 +27,7 @@
try {
new UsageReport().report();
} catch (Exception e) {
- IStatus status = StatusUtils.getErrorStatus(JBossToolsUsageActivator.PLUGIN_ID,
"could not start usage reporting", e);
- LoggingUtils.log(status, JBossToolsUsageActivator.getDefault());
+ new UsagePluginLogger(JBossToolsUsageActivator.getDefault()).error("could not
start usage reporting");
}
}
});
Modified:
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/tracker/internal/Tracker.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/tracker/internal/Tracker.java 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/tracker/internal/Tracker.java 2010-11-30
10:01:15 UTC (rev 27019)
@@ -20,7 +20,6 @@
import java.io.UnsupportedEncodingException;
import java.text.MessageFormat;
-import org.jboss.tools.common.log.ILoggingAdapter;
import org.jboss.tools.usage.http.IHttpGetRequest;
import org.jboss.tools.usage.tracker.IFocusPoint;
import org.jboss.tools.usage.tracker.ITracker;
@@ -37,21 +36,21 @@
private IURLBuildingStrategy urlBuildingStrategy = null;
private IHttpGetRequest httpRequest;
- private ILoggingAdapter loggingAdapter;
+ private UsagePluginLogger logger;
- public Tracker(IURLBuildingStrategy urlBuildingStrategy, IHttpGetRequest httpGetRequest,
ILoggingAdapter loggingAdapter) {
+ public Tracker(IURLBuildingStrategy urlBuildingStrategy, IHttpGetRequest httpGetRequest,
UsagePluginLogger loggingAdapter) {
this.httpRequest = httpGetRequest;
- this.loggingAdapter = loggingAdapter;
+ this.logger = loggingAdapter;
this.urlBuildingStrategy = urlBuildingStrategy;
}
public void trackSynchronously(IFocusPoint focusPoint) {
- loggingAdapter
+ logger
.debug(MessageFormat.format(TrackerMessages.Tracker_Synchronous,
focusPoint.getTitle()));
try {
httpRequest.request(getTrackingUrl(focusPoint));
} catch (Exception e) {
- loggingAdapter.error(MessageFormat.format(TrackerMessages.Tracker_Error,
e.getMessage()));
+ logger.error(MessageFormat.format(TrackerMessages.Tracker_Error, e.getMessage()));
}
}
@@ -60,7 +59,7 @@
}
public void trackAsynchronously(IFocusPoint focusPoint) {
- loggingAdapter.debug(MessageFormat
+ logger.debug(MessageFormat
.format(TrackerMessages.Tracker_Asynchronous, focusPoint.getTitle()));
new Thread(new TrackingRunnable(focusPoint)).start();
}
@@ -76,7 +75,7 @@
try {
httpRequest.request(getTrackingUrl(focusPoint));
} catch (Exception e) {
- loggingAdapter.error(MessageFormat.format(TrackerMessages.Tracker_Error,
e.getMessage()));
+ logger.error(MessageFormat.format(TrackerMessages.Tracker_Error, e.getMessage()));
}
}
}
Modified:
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/tracker/internal/UsagePluginLogger.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/tracker/internal/UsagePluginLogger.java 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/tracker/internal/UsagePluginLogger.java 2010-11-30
10:01:15 UTC (rev 27019)
@@ -10,21 +10,48 @@
******************************************************************************/
package org.jboss.tools.usage.tracker.internal;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
-import org.jboss.tools.common.log.PluginLogger;
-import org.jboss.tools.usage.util.LoggingUtils;
+import org.eclipse.core.runtime.Status;
/**
* @author Andre Dietisheim
- *
*/
-public class UsagePluginLogger extends PluginLogger {
+public class UsagePluginLogger {
+ private Plugin plugin;
+
public UsagePluginLogger(Plugin plugin) {
- super(plugin);
+ this.plugin = plugin;
}
+ public void error(String message) {
+ log(IStatus.ERROR, message);
+ }
+
+ public void debug(String message) {
+ log(IStatus.INFO, message);
+ }
+
+ private void log(int severity, String message) {
+ if (!isTracingEnabled()) {
+ return;
+ }
+
+ if (plugin != null) {
+ IStatus status = new Status(severity, plugin.getBundle().getSymbolicName(), message);
+ plugin.getLog().log(status);
+ }
+ }
+
+
protected boolean isTracingEnabled() {
- return LoggingUtils.isPluginTracingEnabled(getPlugin());
+ Plugin plugin = getPlugin();
+ return plugin != null && plugin.isDebugging();
}
+
+ protected Plugin getPlugin() {
+ return plugin;
+ }
+
}
Deleted:
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/LoggingUtils.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/LoggingUtils.java 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/LoggingUtils.java 2010-11-30
10:01:15 UTC (rev 27019)
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.usage.util;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-
-/**
- * @author Andre Dietisheim
- */
-public class LoggingUtils {
-
- public static boolean isPluginTracingEnabled(Plugin plugin) {
- return plugin != null && plugin.isDebugging();
- }
-
- public static void log(IStatus status, Plugin plugin) {
- if (status.getSeverity() == IStatus.INFO && !isPluginTracingEnabled(plugin)) {
- return;
- }
- plugin.getLog().log(status);
- }
-}
Modified: branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/JBoss
Developer Studio Usage Reporter.launch
===================================================================
--- branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/JBoss Developer
Studio Usage Reporter.launch 2010-11-30 09:58:35 UTC (rev 27018)
+++ branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/JBoss Developer
Studio Usage Reporter.launch 2010-11-30 10:01:15 UTC (rev 27019)
@@ -11,7 +11,7 @@
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation"
value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/JBoss Developer
Studio Usage Reporter"/>
<booleanAttribute key="default" value="false"/>
-<stringAttribute key="deselected_workspace_plugins"
value="org.jboss.tools.common.text.xml,org.jboss.tools.common.meta.ui,org.jboss.tools.common,org.jboss.tools.common.verification.ui.test,org.jboss.tools.common.projecttemplates,org.jboss.tools.common.el.core,org.jboss.tools.common.verification.ui,org.mozilla.xulrunner.gtk.linux.x86,org.jboss.tools.common.gef,org.mozilla.xulrunner.carbon.macosx,org.jboss.tools.common.test,org.jboss.tools.common.verification.test,org.jboss.tools.common.verification,org.jboss.tools.common.model,org.jboss.tools.gwt.ui,org.jboss.tools.common.model.ui.capabilities,org.jboss.tools.common.resref.core,org.mozilla.xulrunner.cocoa.macosx,org.jboss.tools.common.ui,org.mozilla.xulrunner.gtk.linux.x86_64,org.jboss.tools.common.el.ui,org.mozilla.xulrunner.win32.win32.x86,org.jboss.tools.usage.test,org.jboss.tools.common.text.ext,org.jboss.tools.gwt.core,org.jboss.tools.common.resref.ui,org.jboss.tools.common.el.core.test,org.jboss.tools.common.model.ui.t!
est,org.mozilla.xpcom,org.jboss.tools.tests,org.jboss.tools.common.model.ui,org.jboss.tools.common.model.test"/>
+<stringAttribute key="deselected_workspace_plugins"
value="org.jboss.tools.common,org.jboss.tools.usage.test"/>
<booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="location"
value="${workspace_loc}/../runtime-New_configuration(1)"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
@@ -23,8 +23,8 @@
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS"
value="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m
-Xmx1024m"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product"
value="com.jboss.jbds.product.product"/>
-<stringAttribute key="selected_target_plugins"
value="org.eclipse.equinox.ds@default:true,org.eclipse.core.runtime@default:true,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.ui.intro@default:default,org.eclipse.osgi@-1:true,org.eclipse.core.jobs@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.osgi.services@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.apache.lucene.analysis@default:default,javax.servlet.jsp@default:default,org.eclipse.core.net@default:default,org.eclipse.core.variables@default:default,org.eclipse.jface.text@default:default,org.eclipse.ecf@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.core.contenttype@default:default,org.apache.commons.el@default:default,org.eclipse.equinox.registry@default:default,org.apache.lucene@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf.filetransfer@default:default,jav!
ax.mail@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.util@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.help@default:default,javax.activation@default:default,org.eclipse.text@default:default,org.mortbay.jetty.util@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.equinox.app@default:default,org.eclipse.jface@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.help.base@default:default,org.eclipse.core.resources@default:default,org.apache.jasper@default:default,org.eclipse.core.expressions@default:default,com.ibm.icu@default:default,org.apache.!
ant@default:default,org.eclipse.swt@default:default,org.eclips!
e.core.r
untime.compatibility.registry@default:false,org.eclipse.core.filesystem@default:default,org.mortbay.jetty.server@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.security@default:default,org.eclipse.help.ui@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.eclipse.ui.ide.application@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.ui.intro.universal@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.ant.core@default:default,org.eclipse.ui.views@default:default,javax.servlet@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.commands@default:default,org.eclipse.ui.forms@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.ui@default:default"/>
-<stringAttribute key="selected_workspace_plugins"
value="org.eclipse.epp.usagedata.recording@default:default,org.eclipse.epp.usagedata.gathering@default:default,org.jboss.tools.deltacloud.core@default:default,org.jboss.tools.usage@default:default,com.jboss.jbds.usage.branding@default:default,org.eclipse.epp.usagedata.ui@default:default,org.jboss.tools.deltacloud.ui@default:default,org.jboss.tools.deltacloud.docs@default:default"/>
+<stringAttribute key="selected_target_plugins"
value="org.eclipse.core.jobs@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.osgi.services@default:default,org.apache.commons.el@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.views@default:default,org.apache.lucene@default:default,org.apache.lucene.analysis@default:default,org.apache.ant@default:default,org.apache.jasper@default:default,org.eclipse.equinox.app@default:default,org.eclipse.core.databinding@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.equinox.security@default:default,javax.activation@default:default,org.eclipse.ui@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.ui.ide@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclip!
se.core.net@default:default,javax.servlet@default:default,org.eclipse.core.expressions@default:default,com.ibm.icu@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.servlet@default:default,javax.mail@default:default,org.eclipse.osgi@-1:true,org.eclipse.equinox.ds@default:true,org.eclipse.jface@default:default,org.eclipse.swt@default:default,org.eclipse.ui.intro.universal@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.core.runtime@default:true,org.eclipse.help.base@default:default,javax.servlet.jsp@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.mortbay.jetty.util@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.core.variables@default:default,org.eclipse.equinox.p2.metadata@default:de!
fault,org.eclipse.ui.ide.application@default:default,org.eclip!
se.help.
ui@default:default,org.eclipse.equinox.common@2:true,org.eclipse.ecf.filetransfer@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.ecf@default:default,org.eclipse.ui.intro@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.core.contenttype@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.jface.text@default:default,org.eclipse.text@default:default,org.eclipse.equinox.preferences@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.eclipse.equinox.util@default:default,org.mortbay.jetty.server@default:default,org.eclipse.ant.core@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.help@default:default"/>
+<stringAttribute key="selected_workspace_plugins"
value="org.jboss.tools.usage@default:default,org.jboss.tools.deltacloud.ui@default:default,org.jboss.tools.deltacloud.test@default:default,org.jboss.tools.deltacloud.core@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig"
value="${target_home}/configuration/config.ini"/>
<booleanAttribute key="tracing" value="false"/>
Modified: branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/JBoss
Tools Usage Reporter.launch
===================================================================
--- branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/JBoss Tools
Usage Reporter.launch 2010-11-30 09:58:35 UTC (rev 27018)
+++ branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/JBoss Tools
Usage Reporter.launch 2010-11-30 10:01:15 UTC (rev 27019)
@@ -6,14 +6,14 @@
<booleanAttribute key="automaticValidate" value="false"/>
<stringAttribute key="bootstrap" value=""/>
<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="true"/>
-<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearConfig" value="false"/>
+<booleanAttribute key="clearws" value="false"/>
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation"
value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/JBoss Tools Usage
Reporter"/>
<booleanAttribute key="default" value="false"/>
-<stringAttribute key="deselected_workspace_plugins"
value="org.jboss.tools.common.text.xml,org.jboss.tools.common.meta.ui,org.jboss.tools.common,org.jboss.tools.common.verification.ui.test,org.jboss.tools.common.projecttemplates,org.jboss.tools.common.el.core,com.jboss.jbds.usage.branding,org.jboss.tools.common.verification.ui,org.mozilla.xulrunner.gtk.linux.x86,org.jboss.tools.common.gef,org.mozilla.xulrunner.carbon.macosx,org.jboss.tools.common.test,org.jboss.tools.common.verification.test,org.jboss.tools.common.verification,org.jboss.tools.common.model,org.jboss.tools.gwt.ui,org.jboss.tools.common.model.ui.capabilities,org.jboss.tools.common.resref.core,org.mozilla.xulrunner.cocoa.macosx,org.jboss.tools.common.ui,org.mozilla.xulrunner.gtk.linux.x86_64,org.jboss.tools.common.el.ui,org.mozilla.xulrunner.win32.win32.x86,org.jboss.tools.usage.test,org.jboss.tools.common.text.ext,org.jboss.tools.gwt.core,org.jboss.tools.common.resref.ui,org.jboss.tools.common.el.core.test,org!
.jboss.tools.common.model.ui.test,org.mozilla.xpcom,org.jboss.tools.tests,org.jboss.tools.common.model.ui,org.jboss.tools.common.model.test"/>
+<stringAttribute key="deselected_workspace_plugins"
value="org.jboss.tools.usage.test"/>
<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location"
value="${workspace_loc}/../runtime-New_configuration(1)"/>
+<stringAttribute key="location"
value="${workspace_loc}/../runtime-usage"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
@@ -23,8 +23,8 @@
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS"
value="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m
-Xmx1024m"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
-<stringAttribute key="selected_target_plugins"
value="org.eclipse.equinox.ds@default:true,org.eclipse.core.runtime@default:true,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.osgi@-1:true,org.eclipse.core.jobs@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.osgi.services@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.apache.lucene.analysis@default:default,javax.servlet.jsp@default:default,org.eclipse.core.net@default:default,org.eclipse.core.variables@default:default,org.eclipse.jface.text@default:default,org.eclipse.ecf@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.servlet@default:default,org.hamcrest.core@default:default,org.eclipse.core.contenttype@default:default,org.apache.commons.el@default:default,org.eclipse.equinox.registry@default:default,org.apache.lucene@default:default,org.eclipse.ecf.ssl@default:false,org.apache.commons.logging*1.0.4.v201005080501@defa!
ult:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.util@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.sdk@default:default,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.help@default:default,org.eclipse.text@default:default,org.mortbay.jetty.util@default:default,org.eclipse.swtbot.ant.optional.junit4@default:false,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.equinox.app@default:default,org.eclipse.jface@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.help.base@default:default,org.eclipse.core.reso!
urces@default:default,org.apache.jasper@default:default,org.ec!
lipse.co
re.expressions@default:default,com.ibm.icu@default:default,org.apache.ant@default:default,org.eclipse.swt@default:default,org.eclipse.swtbot.ant.optional.junit3@default:false,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.filesystem@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.mortbay.jetty.server@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.security@default:default,org.eclipse.help.ui@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.eclipse.ui.ide.application@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.update.configurator@3:true,org.eclipse.ant.core@default:default,org.eclipse.ui.views@default:default,javax.servlet@default:default,org.e!
clipse.core.databinding.property@default:default,org.junit4@default:default,org.eclipse.core.commands@default:default,org.eclipse.ui.forms@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.ui@default:default"/>
-<stringAttribute key="selected_workspace_plugins"
value="org.eclipse.epp.usagedata.recording@default:default,org.eclipse.epp.usagedata.gathering@default:default,org.jboss.tools.deltacloud.core@default:default,org.jboss.tools.usage@default:default,org.eclipse.epp.usagedata.ui@default:default,org.jboss.tools.deltacloud.ui@default:default,org.jboss.tools.deltacloud.docs@default:default"/>
+<stringAttribute key="selected_target_plugins"
value="org.eclipse.debug.core@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.osgi.util@default:default,org.eclipse.core.jobs@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.osgi.services@default:default,org.eclipse.wst.validation@default:default,org.apache.commons.el@default:default,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.ui.forms@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.sdk@default:default,org.eclipse.ui.views@default:default,org.apache.lucene@default:default,org.eclipse.ui.navigator.resources@default:default,org.apache.lucene.analysis@default:default,org.apache.ant@default:default,com.instantiations.d!
esigner.jdt.fragment@default:false,org.eclipse.jdt.core@default:default,org.hamcrest.core@default:default,org.apache.jasper@default:default,org.eclipse.equinox.app@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.emf.ecore@default:default,org.eclipse.search@default:default,org.eclipse.jdt.core.manipulation@default:default,org.apache.xerces@default:default,org.eclipse.core.databinding@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.wst.xml.core@default:default,org.eclipse.ui.console@default:default,org.apache.xml.serializer@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.emf.edit@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.equinox.security@default:default,org.eclipse.ui@default:default,org.eclipse.equinox.registry@default:default,org.junit4@default:default,org.eclipse.emf.ecore.xmi@default:default,o!
rg.eclipse.ui.ide@default:default,org.eclipse.core.resources@d!
efault:d
efault,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.core.net@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,javax.servlet@default:default,org.eclipse.core.expressions@default:default,com.ibm.icu@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.team.core@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.debug.ui@default:default,org.eclipse.osgi@-1:true,org.eclipse.rse.services@default:default,org.eclipse.equinox.ds@default:true,org.eclipse.jface@default:default,org.eclipse.swt@default:default,org.eclipse.ui.editors@default:default,org.eclipse.rse.core@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.core.runtime@default:true,org.eclipse.team.ui@default:default,org.eclipse.jdt.ui@default:d!
efault,org.eclipse.help.base@default:default,javax.servlet.jsp@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.mortbay.jetty.util@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.update.configurator@3:true,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.swtbot.ant.optional.junit3@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.core.variables@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.help.ui@default:default,org.eclipse.equinox.common@2:t!
rue,org.eclipse.ecf.filetransfer@default:default,org.eclipse.e!
quinox.p
2.metadata.repository@default:default,org.eclipse.swtbot.ant.optional.junit4@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.ecf@default:default,org.eclipse.emf.common@default:default,org.apache.xml.resolver@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.core.contenttype@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.jface.text@default:default,org.eclipse.text@default:default,javax.xml@default:default,org.eclipse.compare@default:default,org.eclipse.equinox.preferences@default:default,org!
.jboss.tools.xulrunner.initializer@default:false,org.eclipse.wst.sse.core@default:default,org.eclipse.equinox.util@default:default,org.mortbay.jetty.server@default:default,org.eclipse.jem.util@default:default,org.eclipse.ant.core@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.help@default:default"/>
+<stringAttribute key="selected_workspace_plugins"
value="org.jboss.tools.common@default:default,org.jboss.tools.usage@default:default,org.jboss.tools.deltacloud.ui@default:default,org.jboss.tools.deltacloud.test@default:default,org.jboss.tools.deltacloud.core@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig"
value="${target_home}/configuration/config.ini"/>
<booleanAttribute key="tracing" value="true"/>
Modified:
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/UsageTestSuite.launch
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/UsageTestSuite.launch 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/UsageTestSuite.launch 2010-11-30
10:01:15 UTC (rev 27019)
@@ -12,7 +12,7 @@
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation"
value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
<booleanAttribute key="default" value="false"/>
-<stringAttribute key="deselected_workspace_plugins"
value="org.eclipse.epp.usagedata.recording,org.jboss.tools.deltacloud.core,org.eclipse.epp.usagedata.gathering,org.mozilla.xulrunner.cocoa.macosx,org.jboss.tools.deltacloud.docs,org.mozilla.xulrunner.gtk.linux.x86_64,org.jboss.tools.deltacloud.test,org.mozilla.xulrunner.win32.win32.x86,com.jboss.jbds.usage.branding,org.mozilla.xulrunner.gtk.linux.x86,org.eclipse.epp.usagedata.ui,org.mozilla.xulrunner.carbon.macosx,org.mozilla.xpcom,org.jboss.tools.deltacloud.ui,org.jboss.tools.tests,org.jruby.jruby"/>
+<stringAttribute key="deselected_workspace_plugins"
value="org.jboss.tools.deltacloud.core,org.jboss.tools.deltacloud.ui,org.jboss.tools.deltacloud.test"/>
<booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="location"
value="${workspace_loc}/../junit-workspace"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
@@ -37,7 +37,7 @@
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product"
value="com.jboss.jbds.product.product"/>
<booleanAttribute key="run_in_ui_thread" value="true"/>
-<stringAttribute key="selected_target_plugins"
value="org.junit4@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.eclipse.equinox.app@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.jface.databinding@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.ant.core@default:default,org.eclipse.ui.editors@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.ui@default:default,org.eclipse.wst.xml.core@default:default,org.apache.xml.resolver@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.wst.validation@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.jdt.ui@defaul!
t:default,org.eclipse.equinox.preferences@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.net@default:default,org.eclipse.jem.util@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.ecf@default:default,org.eclipse.swt@default:default,org.eclipse.equinox.common@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.jface.text@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.core.expressions@default:default,org.eclipse.emf.common@default:default,javax.servlet@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.osgi.util@default:default,org.eclipse.wst.common.frameworks@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.eclipse.equinox.p2.core@default:default,org.eclipse.ecf.provider.fi!
letransfer.ssl@default:false,javax.xml@default:default,org.ecl!
ipse.jfa
ce@default:default,org.eclipse.emf.edit@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.jdt.compiler.apt@default:false,com.instantiations.designer.jdt.fragment@default:false,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.ui.views@default:default,org.eclipse.compare.core@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.ui.forms@default:default,org.apache.xerces@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.team.ui@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.equinox.p2.engine@default:defaul!
t,org.eclipse.jdt.launching@default:default,org.eclipse.search@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.console@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.core.commands@default:default,org.eclipse.core.jobs@default:default,org.eclipse.compare@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.debug.ui@default:default,org.eclipse.core.resources@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.osgi.services@default:default,org.eclipse.wst.common.uriresolver@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.help@default:default,org.eclipse.team.core@default:default,org.eclipse.text@default:default,org.eclipse.osgi,org.eclipse.core.filesystem@default:default,org.eclipse.debug.core@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.core.databinding@default:default,org.eclipse.equinox!
.security@default:default,org.apache.xml.serializer@default:de!
fault,co
m.ibm.icu@default:default,org.hamcrest.core@default:default,org.eclipse.jdt.core@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.core.variables@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.core.runtime@default:true,org.eclipse.equinox.concurrent@default:default"/>
+<stringAttribute key="selected_target_plugins"
value="org.eclipse.debug.core@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.osgi.util@default:default,org.eclipse.core.jobs@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.osgi.services@default:default,org.eclipse.wst.validation@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.ui.forms@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.navigator.resources@default:default,com.instantiations.designer.jdt.fragment@default:false,org.eclipse.jdt.core@default:default,org.hamcrest.core@default:default,org.eclipse.equinox.app@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.emf.ecore@default:default,org.ec!
lipse.search@default:default,org.eclipse.jdt.core.manipulation@default:default,org.apache.xerces@default:default,org.eclipse.core.databinding@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.wst.xml.core@default:default,org.eclipse.ui.console@default:default,org.apache.xml.serializer@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.emf.edit@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.equinox.security@default:default,org.eclipse.ui@default:default,org.eclipse.equinox.registry@default:default,org.junit4@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.ui.ide@default:default,org.eclipse.core.resources@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.core.net@default:default,org.apache.commons.httpclient*3.1.0.v201005080502!
@default:default,javax.servlet@default:default,org.eclipse.cor!
e.expres
sions@default:default,com.ibm.icu@default:default,org.eclipse.team.core@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.debug.ui@default:default,org.eclipse.osgi@-1:true,org.eclipse.jface@default:default,org.eclipse.swt@default:default,org.eclipse.ui.editors@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.core.runtime@default:true,org.eclipse.team.ui@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.ltk.ui.refactoring@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.core.variables@default:defaul!
t,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.equinox.common@2:true,org.eclipse.ecf.filetransfer@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.ecf@default:default,org.eclipse.emf.common@default:default,org.apache.xml.resolver@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.core.contenttype@default:default,org.eclipse.ui.workbench@default:d!
efault,org.eclipse.jface.text@default:default,org.eclipse.text!
@default
:default,javax.xml@default:default,org.eclipse.compare@default:default,org.eclipse.equinox.preferences@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.eclipse.wst.sse.core@default:default,org.eclipse.jem.util@default:default,org.eclipse.ant.core@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.help@default:default"/>
<stringAttribute key="selected_workspace_plugins"
value="org.jboss.tools.usage.test@default:default,org.jboss.tools.common@default:default,org.jboss.tools.usage@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/>
<booleanAttribute key="tracing" value="false"/>
Modified:
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageSettingsTest.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageSettingsTest.java 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageSettingsTest.java 2010-11-30
10:01:15 UTC (rev 27019)
@@ -22,6 +22,7 @@
import org.jboss.tools.usage.http.HttpRemotePropertiesProvider;
import org.jboss.tools.usage.http.IPropertiesProvider;
import org.jboss.tools.usage.internal.preferences.GlobalUsageSettings;
+import org.jboss.tools.usage.tracker.internal.UsagePluginLogger;
import org.junit.Test;
/**
@@ -110,7 +111,7 @@
@Override
protected IPropertiesProvider createRemoteMap(String url, char valueDelimiter, Plugin
plugin,
String... keys) {
- return new HttpRemotePropertiesProvider(url, valueDelimiter, new SystemOutLogger(),
keys) {
+ return new HttpRemotePropertiesProvider(url, valueDelimiter, new
UsagePluginLogger(plugin), keys) {
@Override
protected InputStreamReader request(HttpURLConnection urlConnection)
throws UnsupportedEncodingException {
Modified:
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/HttpRemotePropertiesTest.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/HttpRemotePropertiesTest.java 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/HttpRemotePropertiesTest.java 2010-11-30
10:01:15 UTC (rev 27019)
@@ -20,6 +20,7 @@
import org.jboss.tools.usage.http.HttpRemotePropertiesProvider;
import org.jboss.tools.usage.http.IPropertiesProvider;
+import org.jboss.tools.usage.tracker.internal.UsagePluginLogger;
import org.junit.Test;
/**
@@ -55,7 +56,7 @@
final String stringValue, final String anotherValue, char valueDelimiter, String...
keys) {
return new HttpRemotePropertiesProvider("http://dummy", valueDelimiter,
- new SystemOutLogger(), keys) {
+ new UsagePluginLogger(JBossToolsUsageTestActivator.getDefault()), keys) {
@Override
protected InputStreamReader request(HttpURLConnection urlConnection)
throws UnsupportedEncodingException {
Modified:
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsUsageIntegrationTest.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsUsageIntegrationTest.java 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsUsageIntegrationTest.java 2010-11-30
10:01:15 UTC (rev 27019)
@@ -100,10 +100,10 @@
}
private UrlRevealingTracker getTracker(IGoogleAnalyticsParameters environment) {
- ILoggingAdapter loggingAdapter = new
UsagePluginLogger(JBossToolsUsageTestActivator.getDefault());
+ UsagePluginLogger logger = new
UsagePluginLogger(JBossToolsUsageTestActivator.getDefault());
IURLBuildingStrategy urlStrategy = new GoogleAnalyticsUrlStrategy(environment);
- IHttpGetRequest httpGetRequest = new HttpGetRequest(environment.getUserAgent(),
loggingAdapter);
- return new UrlRevealingTracker(urlStrategy, httpGetRequest, loggingAdapter);
+ IHttpGetRequest httpGetRequest = new HttpGetRequest(environment.getUserAgent(),
logger);
+ return new UrlRevealingTracker(urlStrategy, httpGetRequest, logger);
}
private IFocusPoint createFocusPoint(String childFocusPoint) {
Modified:
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsUsageRequestsTest.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsUsageRequestsTest.java 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsUsageRequestsTest.java 2010-11-30
10:01:15 UTC (rev 27019)
@@ -14,8 +14,8 @@
import java.io.IOException;
import java.net.HttpURLConnection;
-import org.jboss.tools.common.log.ILoggingAdapter;
import org.jboss.tools.usage.http.HttpGetRequest;
+import org.jboss.tools.usage.tracker.internal.UsagePluginLogger;
import org.junit.Test;
/**
@@ -23,6 +23,8 @@
*/
public class JBossToolsUsageRequestsTest {
+ UsagePluginLogger logger = new
UsagePluginLogger(JBossToolsUsageTestActivator.getDefault());
+
// @Ignore
// @Test
// public void testUrl0() throws IOException {
@@ -1780,19 +1782,19 @@
private HttpURLConnection urlConnection;
public TestHttpGetMethod(String userAgentString) {
- this(userAgentString, new SystemOutLogger());
+ this(userAgentString, logger);
}
public TestHttpGetMethod(UserAgentString userAgentString) {
- this(userAgentString.toString(), new SystemOutLogger());
+ this(userAgentString.toString(), logger);
}
public TestHttpGetMethod() {
- super(UserAgentString.DEFAULT.toString(), new SystemOutLogger());
+ super(UserAgentString.DEFAULT.toString(), logger);
}
- public TestHttpGetMethod(String userAgent, ILoggingAdapter loggingAdapter) {
- super(userAgent, loggingAdapter);
+ public TestHttpGetMethod(String userAgent, UsagePluginLogger logger) {
+ super(userAgent, logger);
}
@Override
Modified:
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/UrlRevealingTracker.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/UrlRevealingTracker.java 2010-11-30
09:58:35 UTC (rev 27018)
+++
branches/jbosstools-3.2.0.Beta2/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/UrlRevealingTracker.java 2010-11-30
10:01:15 UTC (rev 27019)
@@ -14,11 +14,11 @@
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
-import org.jboss.tools.common.log.ILoggingAdapter;
import org.jboss.tools.usage.http.IHttpGetRequest;
import org.jboss.tools.usage.tracker.IFocusPoint;
import org.jboss.tools.usage.tracker.IURLBuildingStrategy;
import org.jboss.tools.usage.tracker.internal.Tracker;
+import org.jboss.tools.usage.tracker.internal.UsagePluginLogger;
/**
* @author Andre Dietisheim
@@ -29,8 +29,8 @@
private Lock lock;
public UrlRevealingTracker(IURLBuildingStrategy urlBuildingStrategy, IHttpGetRequest
httpGetRequest,
- ILoggingAdapter loggingAdapter) {
- super(urlBuildingStrategy, httpGetRequest, loggingAdapter);
+ UsagePluginLogger logger) {
+ super(urlBuildingStrategy, httpGetRequest, logger);
lock = new ReentrantLock();
}