JBoss Tools SVN: r24497 - branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-08-27 08:23:11 -0400 (Fri, 27 Aug 2010)
New Revision: 24497
Modified:
branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java
Log:
https://jira.jboss.org/browse/JBIDE-6923
Modified: branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java
===================================================================
--- branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java 2010-08-27 12:21:18 UTC (rev 24496)
+++ branches/jbosstools-3.2.0.M2/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java 2010-08-27 12:23:11 UTC (rev 24497)
@@ -25,6 +25,7 @@
import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
import org.eclipse.jpt.utility.model.value.ListValueModel;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Combo;
@@ -123,20 +124,23 @@
);
// Discriminator Value widgets
+ PropertyValueModel<Boolean> dvEnabled = this.buildDiscriminatorValueEnabledHolder();
Combo discriminatorValueCombo = addEditableCombo(
subPane,
buildDiscriminatorValueListHolder(),
buildDiscriminatorValueHolder(),
- buildDiscriminatorValueConverter()
+ buildDiscriminatorValueConverter(),
+ dvEnabled
);
Label discriminatorValueLabel = addLabel(
subPane,
- JptUiDetailsMessages.InheritanceComposite_discriminatorValue
+ JptUiDetailsMessages.InheritanceComposite_discriminatorValue,
+ dvEnabled
);
addLabeledComposite(
subPane,
discriminatorValueLabel,
- discriminatorValueCombo.getParent(),
+ discriminatorValueCombo,
null,
JpaHelpContextIds.ENTITY_INHERITANCE_DISCRIMINATOR_VALUE
);
15 years, 3 months
JBoss Tools SVN: r24496 - trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-08-27 08:21:18 -0400 (Fri, 27 Aug 2010)
New Revision: 24496
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/HttpResourceMap.java
Log:
[JBIDE-6880] exception throwing corrected
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/HttpResourceMap.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/HttpResourceMap.java 2010-08-27 12:20:53 UTC (rev 24495)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/HttpResourceMap.java 2010-08-27 12:21:18 UTC (rev 24496)
@@ -36,7 +36,7 @@
this.plugin = plugin;
}
- protected Map<String, String> getValueMap() throws UnsupportedEncodingException, IOException {
+ protected Map<String, String> getValueMap() throws IOException {
if (valuesMap == null) {
this.valuesMap = parse(keys, valueDelimiter, request(url), new HashMap<String, String>());
}
@@ -55,7 +55,7 @@
*
* @see HttpURLConnection
*/
- protected InputStreamReader request(String url) throws UnsupportedEncodingException {
+ protected InputStreamReader request(String url) throws IOException {
InputStreamReader responseReader = null;
try {
urlConnection.connect();
@@ -73,13 +73,14 @@
, UsageMessages.KillSwitchPreference_Error_Http, null, url);
plugin.getLog().log(status);
}
- } catch (Exception e) {
+ return responseReader;
+ } catch (IOException e) {
IStatus status = StatusUtils.getErrorStatus(
plugin.getBundle().getSymbolicName()
, UsageMessages.KillSwitchPreference_Error_Http, e, url);
plugin.getLog().log(status);
+ throw e;
}
- return responseReader;
}
private InputStreamReader getInputStreamReader(String contentType) throws UnsupportedEncodingException, IOException {
15 years, 3 months
JBoss Tools SVN: r24495 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-08-27 08:20:53 -0400 (Fri, 27 Aug 2010)
New Revision: 24495
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java
Log:
https://jira.jboss.org/browse/JBIDE-6923
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java 2010-08-27 12:17:16 UTC (rev 24494)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java 2010-08-27 12:20:53 UTC (rev 24495)
@@ -25,6 +25,7 @@
import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
import org.eclipse.jpt.utility.model.value.ListValueModel;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Combo;
@@ -123,20 +124,23 @@
);
// Discriminator Value widgets
+ PropertyValueModel<Boolean> dvEnabled = this.buildDiscriminatorValueEnabledHolder();
Combo discriminatorValueCombo = addEditableCombo(
subPane,
buildDiscriminatorValueListHolder(),
buildDiscriminatorValueHolder(),
- buildDiscriminatorValueConverter()
+ buildDiscriminatorValueConverter(),
+ dvEnabled
);
Label discriminatorValueLabel = addLabel(
subPane,
- JptUiDetailsMessages.InheritanceComposite_discriminatorValue
+ JptUiDetailsMessages.InheritanceComposite_discriminatorValue,
+ dvEnabled
);
addLabeledComposite(
subPane,
discriminatorValueLabel,
- discriminatorValueCombo.getParent(),
+ discriminatorValueCombo,
null,
JpaHelpContextIds.ENTITY_INHERITANCE_DISCRIMINATOR_VALUE
);
15 years, 3 months
JBoss Tools SVN: r24494 - trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-08-27 08:17:16 -0400 (Fri, 27 Aug 2010)
New Revision: 24494
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/GlobalUsageReportingSettings.java
Log:
[JBIDE-6880] defaults implemented (in case page to reachable)
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/GlobalUsageReportingSettings.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/GlobalUsageReportingSettings.java 2010-08-27 12:05:10 UTC (rev 24493)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/GlobalUsageReportingSettings.java 2010-08-27 12:17:16 UTC (rev 24494)
@@ -11,7 +11,6 @@
package org.jboss.tools.usage.preferences;
import java.io.IOException;
-import java.io.UnsupportedEncodingException;
import java.util.Map;
import org.eclipse.core.runtime.Plugin;
@@ -24,45 +23,60 @@
*/
public class GlobalUsageReportingSettings extends HttpResourceMap {
+ private static final String REPORT_ENABLEMENT_ENABLEDVALUE = "ENABLED"; //$NON-NLS-1$
+
private static final String REPORTING_ENABLEMENT_URL = "http://community.jboss.org/wiki/JBossToolsJBossDeveloperStudioUsageReport..."; //$NON-NLS-1$
- public static final String KEY_REPORT_ENABLEMENT = "Usage Reporting is ";
- public static final String KEY_DUMMY_VALUE = "Dummy Value is ";
- public static final String KEY_INTEGER_VALUE = "Integer Value is ";
+ public static final String REPORT_ENABLEMENT_KEY = "Usage Reporting is "; //$NON-NLS-1$
+ private static final boolean REPORT_ENABLEMENT_DEFAULT = true;
+ public static final String DUMMY_VALUE_KEY = "Dummy Value is "; //$NON-NLS-1$
+ public static final String INTEGER_VALUE_KEY = "Integer Value is "; //$NON-NLS-1$
+
+ /* the delimiter that delimits the value */
private static final char VALUE_DELIMITER = '<';
-
public GlobalUsageReportingSettings(Plugin plugin) throws IOException {
super(REPORTING_ENABLEMENT_URL
, VALUE_DELIMITER
, plugin
- , KEY_REPORT_ENABLEMENT
- , KEY_DUMMY_VALUE
- , KEY_INTEGER_VALUE);
+ , REPORT_ENABLEMENT_KEY
+ , DUMMY_VALUE_KEY
+ , INTEGER_VALUE_KEY);
this.plugin = plugin;
this.urlConnection = createURLConnection(REPORTING_ENABLEMENT_URL);
}
- public boolean isEnabled() throws UnsupportedEncodingException, IOException {
- Map<String, String> valueMap = getValueMap();
- String isEnabled = valueMap.get(KEY_REPORT_ENABLEMENT);
- return isEnabled != null && "ENABLED".equals(isEnabled.toUpperCase());
+ public boolean isEnabled() {
+ try {
+ Map<String, String> valueMap = getValueMap();
+ String isEnabled = valueMap.get(REPORT_ENABLEMENT_KEY);
+ return isEnabled != null && REPORT_ENABLEMENT_ENABLEDVALUE.equals(isEnabled.toUpperCase());
+ } catch (Exception e) {
+ return REPORT_ENABLEMENT_DEFAULT;
+ }
}
- public String getStringValue() throws UnsupportedEncodingException, IOException {
- Map<String, String> valueMap = getValueMap();
- return valueMap.get(KEY_DUMMY_VALUE);
+ public String getStringValue() {
+ try {
+ Map<String, String> valueMap = getValueMap();
+ return valueMap.get(DUMMY_VALUE_KEY);
+ } catch (Exception e) {
+ return "";
+ }
}
- public Integer getIntegerValue() throws UnsupportedEncodingException, IOException {
- Map<String, String> valueMap = getValueMap();
- String integerValue = valueMap.get(KEY_INTEGER_VALUE);
- if(integerValue != null) {
- return Integer.parseInt(integerValue);
- } else {
- return null;
+ public Integer getIntegerValue() {
+ Integer returnValue = null;
+ try {
+ Map<String, String> valueMap = getValueMap();
+ String integerValue = valueMap.get(INTEGER_VALUE_KEY);
+ if (integerValue != null) {
+ returnValue = Integer.parseInt(integerValue);
+ }
+ } catch (Exception e) {
}
+ return returnValue;
}
}
15 years, 3 months
JBoss Tools SVN: r24493 - in trunk/usage: plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-08-27 08:05:10 -0400 (Fri, 27 Aug 2010)
New Revision: 24493
Added:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/GlobalUsageReportingSettings.java
Removed:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/GlobalUsageReportingSettings.java
Modified:
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageReportingSettingsTest.java
Log:
[JBIDE-6880] GlobalReportingSettings moved to preferences package
Deleted: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/GlobalUsageReportingSettings.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/GlobalUsageReportingSettings.java 2010-08-27 12:03:35 UTC (rev 24492)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/GlobalUsageReportingSettings.java 2010-08-27 12:05:10 UTC (rev 24493)
@@ -1,67 +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;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Plugin;
-
-/**
- * A class that implements a global reporting enablement setting. The current
- * implementation queries a given url and extracts the enablement value out of
- * the response.
- */
-public class GlobalUsageReportingSettings extends HttpResourceMap {
-
- private static final String REPORTING_ENABLEMENT_URL = "http://community.jboss.org/wiki/JBossToolsJBossDeveloperStudioUsageReport..."; //$NON-NLS-1$
-
- public static final String KEY_REPORT_ENABLEMENT = "Usage Reporting is ";
- public static final String KEY_DUMMY_VALUE = "Dummy Value is ";
- public static final String KEY_INTEGER_VALUE = "Integer Value is ";
-
- private static final char VALUE_DELIMITER = '<';
-
-
- public GlobalUsageReportingSettings(Plugin plugin) throws IOException {
- super(REPORTING_ENABLEMENT_URL
- , VALUE_DELIMITER
- , plugin
- , KEY_REPORT_ENABLEMENT
- , KEY_DUMMY_VALUE
- , KEY_INTEGER_VALUE);
-
- this.plugin = plugin;
- this.urlConnection = createURLConnection(REPORTING_ENABLEMENT_URL);
- }
-
- public boolean isEnabled() throws UnsupportedEncodingException, IOException {
- Map<String, String> valueMap = getValueMap();
- String isEnabled = valueMap.get(KEY_REPORT_ENABLEMENT);
- return isEnabled != null && "ENABLED".equals(isEnabled.toUpperCase());
- }
-
- public String getStringValue() throws UnsupportedEncodingException, IOException {
- Map<String, String> valueMap = getValueMap();
- return valueMap.get(KEY_DUMMY_VALUE);
- }
-
- public Integer getIntegerValue() throws UnsupportedEncodingException, IOException {
- Map<String, String> valueMap = getValueMap();
- String integerValue = valueMap.get(KEY_INTEGER_VALUE);
- if(integerValue != null) {
- return Integer.parseInt(integerValue);
- } else {
- return null;
- }
- }
-}
Copied: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/GlobalUsageReportingSettings.java (from rev 24491, trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/GlobalUsageReportingSettings.java)
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/GlobalUsageReportingSettings.java (rev 0)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/GlobalUsageReportingSettings.java 2010-08-27 12:05:10 UTC (rev 24493)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * 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.preferences;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Plugin;
+import org.jboss.tools.usage.HttpResourceMap;
+
+/**
+ * A class that implements a global reporting enablement setting. The current
+ * implementation queries a given url and extracts the enablement value out of
+ * the response.
+ */
+public class GlobalUsageReportingSettings extends HttpResourceMap {
+
+ private static final String REPORTING_ENABLEMENT_URL = "http://community.jboss.org/wiki/JBossToolsJBossDeveloperStudioUsageReport..."; //$NON-NLS-1$
+
+ public static final String KEY_REPORT_ENABLEMENT = "Usage Reporting is ";
+ public static final String KEY_DUMMY_VALUE = "Dummy Value is ";
+ public static final String KEY_INTEGER_VALUE = "Integer Value is ";
+
+ private static final char VALUE_DELIMITER = '<';
+
+
+ public GlobalUsageReportingSettings(Plugin plugin) throws IOException {
+ super(REPORTING_ENABLEMENT_URL
+ , VALUE_DELIMITER
+ , plugin
+ , KEY_REPORT_ENABLEMENT
+ , KEY_DUMMY_VALUE
+ , KEY_INTEGER_VALUE);
+
+ this.plugin = plugin;
+ this.urlConnection = createURLConnection(REPORTING_ENABLEMENT_URL);
+ }
+
+ public boolean isEnabled() throws UnsupportedEncodingException, IOException {
+ Map<String, String> valueMap = getValueMap();
+ String isEnabled = valueMap.get(KEY_REPORT_ENABLEMENT);
+ return isEnabled != null && "ENABLED".equals(isEnabled.toUpperCase());
+ }
+
+ public String getStringValue() throws UnsupportedEncodingException, IOException {
+ Map<String, String> valueMap = getValueMap();
+ return valueMap.get(KEY_DUMMY_VALUE);
+ }
+
+ public Integer getIntegerValue() throws UnsupportedEncodingException, IOException {
+ Map<String, String> valueMap = getValueMap();
+ String integerValue = valueMap.get(KEY_INTEGER_VALUE);
+ if(integerValue != null) {
+ return Integer.parseInt(integerValue);
+ } else {
+ return null;
+ }
+ }
+}
Property changes on: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/preferences/GlobalUsageReportingSettings.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageReportingSettingsTest.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageReportingSettingsTest.java 2010-08-27 12:03:35 UTC (rev 24492)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageReportingSettingsTest.java 2010-08-27 12:05:10 UTC (rev 24493)
@@ -19,7 +19,7 @@
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
-import org.jboss.tools.usage.GlobalUsageReportingSettings;
+import org.jboss.tools.usage.preferences.GlobalUsageReportingSettings;
import org.junit.Test;
/**
15 years, 3 months
JBoss Tools SVN: r24492 - in trunk/usage: plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/reader and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-08-27 08:03:35 -0400 (Fri, 27 Aug 2010)
New Revision: 24492
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsUrlStrategy.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/reader/ReadUntilAlternativesImpl.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageReportingSettingsTest.java
Log:
[JBIDE-6880] cleanup
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsUrlStrategy.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsUrlStrategy.java 2010-08-27 11:49:55 UTC (rev 24491)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsUrlStrategy.java 2010-08-27 12:03:35 UTC (rev 24492)
@@ -163,20 +163,20 @@
, IGoogleAnalyticsParameters.PLUS_SIGN)
.appendTo(builder);
- new GoogleAnalyticsCookie(IGoogleAnalyticsParameters.PARAM_COOKIES_SESSION,
- new StringBuilder()
- .append("1"),
- IGoogleAnalyticsParameters.SEMICOLON
- , IGoogleAnalyticsParameters.PLUS_SIGN)
- .appendTo(builder);
+// new GoogleAnalyticsCookie(IGoogleAnalyticsParameters.PARAM_COOKIES_SESSION,
+// new StringBuilder()
+// .append("1"),
+// IGoogleAnalyticsParameters.SEMICOLON
+// , IGoogleAnalyticsParameters.PLUS_SIGN)
+// .appendTo(builder);
+//
+// new GoogleAnalyticsCookie(IGoogleAnalyticsParameters.PARAM_COOKIES_BROWSERSESSION,
+// new StringBuilder()
+// .append("1"),
+// IGoogleAnalyticsParameters.SEMICOLON
+// , IGoogleAnalyticsParameters.PLUS_SIGN)
+// .appendTo(builder);
- new GoogleAnalyticsCookie(IGoogleAnalyticsParameters.PARAM_COOKIES_BROWSERSESSION,
- new StringBuilder()
- .append("1"),
- IGoogleAnalyticsParameters.SEMICOLON
- , IGoogleAnalyticsParameters.PLUS_SIGN)
- .appendTo(builder);
-
new GoogleAnalyticsCookie(IGoogleAnalyticsParameters.PARAM_COOKIES_UTMCSR,
"(direct)",
IGoogleAnalyticsParameters.PIPE)
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/reader/ReadUntilAlternativesImpl.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/reader/ReadUntilAlternativesImpl.java 2010-08-27 11:49:55 UTC (rev 24491)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/reader/ReadUntilAlternativesImpl.java 2010-08-27 12:03:35 UTC (rev 24492)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.usage.util.reader;
-import java.io.IOException;
import java.io.Reader;
/**
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageReportingSettingsTest.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageReportingSettingsTest.java 2010-08-27 11:49:55 UTC (rev 24491)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageReportingSettingsTest.java 2010-08-27 12:03:35 UTC (rev 24492)
@@ -20,7 +20,6 @@
import java.io.UnsupportedEncodingException;
import org.jboss.tools.usage.GlobalUsageReportingSettings;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -200,7 +199,6 @@
+ "</html> ";
}
- @Ignore
@Test
public void isPageAccessible() throws IOException {
GlobalUsageReportingSettings reportEnablement = new GlobalUsageReportingSettings(JBossToolsUsageTestActivator
15 years, 3 months
JBoss Tools SVN: r24491 - in trunk/usage: plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/reader and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-08-27 07:49:55 -0400 (Fri, 27 Aug 2010)
New Revision: 24491
Added:
trunk/usage/tests/org.jboss.tools.usage.test/GlobalUsageReportingSettingsTest.launch
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/GlobalUsageReportingSettings.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/reader/ReadUntilAlternativesImpl.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/reader/ReadUntilImpl.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageReportingSettingsTest.java
Log:
[JBIDE-6880] test successfull
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/GlobalUsageReportingSettings.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/GlobalUsageReportingSettings.java 2010-08-27 11:29:48 UTC (rev 24490)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/GlobalUsageReportingSettings.java 2010-08-27 11:49:55 UTC (rev 24491)
@@ -25,9 +25,9 @@
private static final String REPORTING_ENABLEMENT_URL = "http://community.jboss.org/wiki/JBossToolsJBossDeveloperStudioUsageReport..."; //$NON-NLS-1$
- private static final String KEY_REPORT_ENABLEMENT = "Usage Reporting is ";
- private static final String KEY_DUMMY_VALUE = "Dummy Value is ";
- private static final String KEY_INTEGER_VALUE = "Integer Value is ";
+ public static final String KEY_REPORT_ENABLEMENT = "Usage Reporting is ";
+ public static final String KEY_DUMMY_VALUE = "Dummy Value is ";
+ public static final String KEY_INTEGER_VALUE = "Integer Value is ";
private static final char VALUE_DELIMITER = '<';
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/reader/ReadUntilAlternativesImpl.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/reader/ReadUntilAlternativesImpl.java 2010-08-27 11:29:48 UTC (rev 24490)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/reader/ReadUntilAlternativesImpl.java 2010-08-27 11:49:55 UTC (rev 24491)
@@ -18,8 +18,8 @@
*/
public class ReadUntilAlternativesImpl extends ReadUntilImpl {
- private char[][] alternativesCharSequences;
- private char[] alternativeCharacter;
+ private char[][] allAlternatives;
+ private char[] currentAlternative;
private int alternativesIndex = -1;
public ReadUntilAlternativesImpl(Reader reader, String... stringAlternatives) {
@@ -28,24 +28,16 @@
}
private void initAlternativesCharSequences(String... stringAlternatives) {
- this.alternativesCharSequences = new char[stringAlternatives.length][];
+ this.allAlternatives = new char[stringAlternatives.length][];
for (int i = 0; i < stringAlternatives.length; i++) {
- this.alternativesCharSequences[i] = stringAlternatives[i].toCharArray();
+ this.allAlternatives[i] = stringAlternatives[i].toCharArray();
}
}
- protected boolean doContinueRead(char character, int numberOfCharactersRead) throws IOException {
- boolean continueRead = super.doContinueRead(character, numberOfCharactersRead);
- if (!isMatching()) {
- setMatchingIndex(0);
- }
- return continueRead;
- }
-
@Override
protected int getNumberOfCharactersToMatch() {
- if (alternativeCharacter != null) {
- return alternativeCharacter.length;
+ if (currentAlternative != null) {
+ return currentAlternative.length;
} else {
return 0;
}
@@ -53,44 +45,71 @@
@Override
protected boolean doesMatch(char character) {
- if (alternativeCharacter == null || alternativeCharacter[getMatchingIndex()] != character) {
- return matchAlternative(character);
+ if (currentAlternative == null || currentAlternative[getMatchingIndex()] != character) {
+ // current alternative does not match new character, select a new
+ // alternative
+ boolean newAlternativeSelected = matchAlternative(character);
+ if (!newAlternativeSelected) {
+ // no alternative matches current character + new one
+ setMatchingIndex(0);
+ }
+ return newAlternativeSelected;
} else {
return true;
}
}
+ /**
+ * Returns whether the given character matches an alternative (in other
+ * words the given character matches an alternative at the current matching
+ * index).
+ *
+ * @param character
+ * the character
+ * @return true, if successful
+ */
private boolean matchAlternative(char character) {
- for (int i = alternativesIndex + 1; i < alternativesCharSequences.length; i++) {
- char[] alternative = alternativesCharSequences[i];
+ for (int i = alternativesIndex + 1; i < allAlternatives.length; i++) {
+ char[] alternative = allAlternatives[i];
if (doesMatch(character, alternative)) {
- this.alternativeCharacter = alternative;
+ this.currentAlternative = alternative;
this.alternativesIndex = i;
return true;
}
}
+ this.currentAlternative = null;
this.alternativesIndex = -1;
return false;
}
- private boolean doesMatch(char character, char[] alternative) {
- for (int j = 0; j <= getMatchingIndex(); j++) {
- if (alternative[j] != character) {
+ /**
+ * Returns whether the given potentially matching alternative (String)
+ * matches the currently selected alternative and the additional character.
+ *
+ * @param character
+ * @param potentiallyMatchingAlternative
+ * the new alternative that could match
+ * @return
+ */
+ private boolean doesMatch(char character, char[] potentiallyMatchingAlternative) {
+ int currentMatchingIndex = getMatchingIndex();
+ for (int j = 0; j < currentMatchingIndex; j++) {
+ if (potentiallyMatchingAlternative[j] != currentAlternative[j]) {
return false;
}
}
- return true;
+ return potentiallyMatchingAlternative[currentMatchingIndex] == character;
}
@Override
protected char[] getCharactersToMatch() {
- return alternativeCharacter;
+ return currentAlternative;
}
public String getAlternative() {
if (alternativesIndex >= 0) {
- return new String(alternativesCharSequences[alternativesIndex]);
+ return new String(allAlternatives[alternativesIndex]);
} else {
return null;
}
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/reader/ReadUntilImpl.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/reader/ReadUntilImpl.java 2010-08-27 11:29:48 UTC (rev 24490)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/reader/ReadUntilImpl.java 2010-08-27 11:49:55 UTC (rev 24491)
@@ -53,7 +53,7 @@
setMatches(matches);
return continueRead;
}
-
+
public boolean isMatching() {
return matched;
}
Added: trunk/usage/tests/org.jboss.tools.usage.test/GlobalUsageReportingSettingsTest.launch
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/GlobalUsageReportingSettingsTest.launch (rev 0)
+++ trunk/usage/tests/org.jboss.tools.usage.test/GlobalUsageReportingSettingsTest.launch 2010-08-27 11:49:55 UTC (rev 24491)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="false"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="false"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageReportingSettingsTest.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jboss.tools.usage.test.GlobalUsageReportingSettingsTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.jboss.tools.usage.test"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<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.eclipse.swt@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.core.resources@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.help.base@default:default,org.eclipse.core.databinding.property@default:default,com.springsource.org.apache.commons.logging@default:default,org.mortbay.jetty.util@default:default,org.eclipse.core.filesystem.macosx@default:false,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.core.runtime@default:true,org.eclipse.ecf@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.core.jobs@default:default,org.apache.jasper@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.help.ui@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.core.databinding@default:default,com.springsource.javax.!
el@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.osgi@-1:true,org.eclipse.ui.ide@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.equinox.preferences@default:default,org.apache.lucene@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.equinox.security@default:default,org.eclipse.text@default:default,org.eclipse.core.variables@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.eclipse.ui.ide.application@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.equinox.app@default:default,org.eclipse.osgi.services@default:default,org.junit4@default:default,org.apache.lucene.analysis@default:default,org.eclipse.equinox.security.macosx@default:false,org.eclipse.core.resources.compatibility@default:false,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.expressions@default:default,org.ec!
lipse.equinox.http.jetty@default:default,org.eclipse.jface@def!
ault:def
ault,org.eclipse.equinox.common@2:true,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.swt.cocoa.macosx@default:false,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.core.databinding.observable@default:default,com.springsource.javax.servlet.jsp@default:default,org.eclipse.compare.core@default:default,org.eclipse.ui.intro@default:default,org.eclipse.jface.text@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,javax.servlet@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.core.commands@default:default,org.apache.commons.el@default:default,org.mortbay.jetty.server@default:default,org.eclipse.ui.views@default:default,com.ibm.icu@default:default,com.jboss.jbds.product@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ui.cocoa@default:false,org.eclipse.ant.core@default!
:default,org.eclipse.ui.intro.universal@default:default,org.apache.ant@default:default,org.eclipse.equinox.transforms.hook@default:false,org.hamcrest.core@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.help@default:default,com.springsource.javax.servlet@default:default,org.eclipse.core.net@default:default,org.eclipse.equinox.registry@default:default,javax.transaction@default:false,org.eclipse.equinox.p2.repository@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui@default:default,org.eclipse.ui.cheatsheets@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.jboss.tools.usage.test@default:default,org.jboss.tools.usage@default:default"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="false"/>
+</launchConfiguration>
Property changes on: trunk/usage/tests/org.jboss.tools.usage.test/GlobalUsageReportingSettingsTest.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageReportingSettingsTest.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageReportingSettingsTest.java 2010-08-27 11:29:48 UTC (rev 24490)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GlobalUsageReportingSettingsTest.java 2010-08-27 11:49:55 UTC (rev 24491)
@@ -47,14 +47,12 @@
assertFalse(reportEnablement.isEnabled());
}
- @Ignore
@Test
public void canExtractStringValue() throws IOException {
GlobalReportingSettingsFake reportSettings = new GlobalReportingSettingsFake("", "dummy", "");
assertEquals("dummy", reportSettings.getStringValue());
}
- @Ignore
@Test
public void canExtractIntegerValue() throws IOException {
GlobalReportingSettingsFake reportSettings = new GlobalReportingSettingsFake("", "", "42");
@@ -83,91 +81,123 @@
}
private String getEnablementPageContent(String enablementValue, String dummyValue, String integerValue) {
- return "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\""
- + "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> "
- + " "
- + " "
- + "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\"> "
- + "<head> "
- + " <title> JBoss Tools / JBoss Developer Studio Usage Reporting Enablement - JBoss Community</title> "
- + " "
- + " <meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\" /> "
- + " "
- + " <script type=\"text/javascript\"> "
- + " var javascriptIsCool = false;"
- + " </script> "
- + " "
- + "</head> "
- + "<body class=\"jive-body-content jive-body-content-document\" > "
- + " <div id=\"jive-body\"> "
- + " "
- + "<div class=\"jive-content\"> "
- + " <div class=\"jive-content-header\"> "
- + " <div class=\"jive-wiki-post-moderating jive-content-header-moderating\"> "
- + " <span class=\"jive-icon-med jive-icon-moderation\"></span>Currently Being Moderated"
- + " </div> "
- + " <div class=\"jive-content-title\"> "
- + " <h2><span class=\"jive-icon-big jive-icon-document\"></span> JBoss Tools / JBoss Developer Studio Usage Reporting Enablement</h2> "
- + " </div> "
- + " <div class=\"jive-content-header-version\"> "
- + " VERSION 5 "
- + " <a href=\"/wiki/JBossToolsJBossDeveloperStudioUsageReportingEnablement/diff?secondVersionNumber=5\" title=\"Click to view article history\"><img class=\"jive-icon-sml jive-icon-search\" src=\"/4.0.5/images/transparent.png\" alt=\"Click to view article history\" /></a> "
- + " </div> "
- + " <div class=\"jive-content-header-details\"> "
- + " "
- + "Created on: Aug 24, 2010 5:39 AM by"
- + "<a href=\"/people/adietish\""
- + "id=\"jive-72036899,987,346,482,238\""
- + "onmouseover=\"quickuserprofile.getUserProfileTooltip(72036);\""
- + "onmouseout=\"quickuserprofile.cancelTooltip();\""
- + "class=\"jiveTT-hover-user jive-username-link\""
- + ">Andre Dietisheim</a> <span>-</span> "
- + "Last Modified: "
- + "Aug 24, 2010 5:53 AM"
- + "by <a href=\"/people/adietish\""
- + "id=\"jive-72036899,987,347,353,238\""
- + "onmouseover=\"quickuserprofile.getUserProfileTooltip(72036);\""
- + "onmouseout=\"quickuserprofile.cancelTooltip();\""
- + "class=\"jiveTT-hover-user jive-username-link\""
- + ">Andre Dietisheim</a> </div> "
- + " "
- + " </div> "
- + " <div class=\"jive-content-body\"> "
- + " "
- + "<!-- [DocumentBodyStart:e26c60c0-cb73-47b7-bded-f4eb7320305b] --><div class=\"jive-rendered-content\"><p>This article is queried by the JBoss Tools / JBoss Developer Studio usage reporting plugin. It implements a global kill-switch that allows us to disable usage reporting stats. The plugin looks for a string of the format:</p><p style=\"min-height: 8pt; height: 8pt; padding: 0px;\"> </p><p><strong>Usage  Reporting  is <"
- + "ENABLED></strong>. Any value that differs from ENABLED is interpreted as DISABLED.</p><p style=\"min-height: 8pt; height: 8pt; padding: 0px;\"> </p><h1>Usage Reporting is "
- + enablementValue
-
- + "</h1>"
- + "<h1>Dummy value is "
-
- + dummyValue
-
- + "</h1>"
-
- + "<h1>Integer value is "
-
- + integerValue
-
- + "</h1>"
-
- + "</div><!-- [DocumentBodyEnd:e26c60c0-cb73-47b7-bded-f4eb7320305b] --> "
- + " "
- + " </div> "
- + " <div class=\"jive-content-footer\"> "
- + " "
- + " "
- + " <!-- BEGIN content details --> "
- + " <span class=\"jive-content-footer-item\"> "
- + " 18 Views</a> "
- + " </span> "
- + " "
- + " "
- + " </div> "
- + "</div> "
- + "</body> "
- + "</html> ";
+ return
+// "Dummy Value would be cool but here follows the Boolean Value for the Report Enablement: "
+// + "<h1>" + GlobalUsageReportingSettings.KEY_REPORT_ENABLEMENT
+// + enablementValue
+// + "</h1>"
+//
+// + "The Dummy Value in this Resource is set to "
+// + "<h1>" + GlobalUsageReportingSettings.KEY_DUMMY_VALUE
+// + dummyValue
+// + "</h1>"
+//
+// + "Boolean Usage Reporting is set to:"
+// + "<h1>" + GlobalUsageReportingSettings.KEY_REPORT_ENABLEMENT
+// + enablementValue
+// + "</h1>"
+//
+// + "And the value of type Integer is "
+// + "<h1>" + GlobalUsageReportingSettings.KEY_INTEGER_VALUE
+// + integerValue
+// + "</h1>"
+// + " is the Value that is a String";
+ "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\""
+ + "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> "
+ + " "
+ + " "
+ +
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\"> "
+ + "<head> "
+ +
+ " <title> JBoss Tools / JBoss Developer Studio Usage Reporting Enablement - JBoss Community</title> "
+ + " "
+ +
+ " <meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\" /> "
+ + " "
+ + " <script type=\"text/javascript\"> "
+ + " var javascriptIsCool = false;"
+ + " </script> "
+ + " "
+ + "</head> "
+ + "<body class=\"jive-body-content jive-body-content-document\" > "
+ + " <div id=\"jive-body\"> "
+ + " "
+ + "<div class=\"jive-content\"> "
+ + " <div class=\"jive-content-header\"> "
+ +
+ " <div class=\"jive-wiki-post-moderating jive-content-header-moderating\"> "
+ +
+ " <span class=\"jive-icon-med jive-icon-moderation\"></span>Currently Being Moderated"
+ + " </div> "
+ + " <div class=\"jive-content-title\"> "
+ +
+ " <h2><span class=\"jive-icon-big jive-icon-document\"></span> JBoss Tools / JBoss Developer Studio Usage Reporting Enablement</h2> "
+ + " </div> "
+ + " <div class=\"jive-content-header-version\"> "
+ + " VERSION 5 "
+ +
+ " <a href=\"/wiki/JBossToolsJBossDeveloperStudioUsageReportingEnablement/diff?secondVersionNumber=5\" title=\"Click to view article history\"><img class=\"jive-icon-sml jive-icon-search\" src=\"/4.0.5/images/transparent.png\" alt=\"Click to view article history\" /></a> "
+ + " </div> "
+ + " <div class=\"jive-content-header-details\"> "
+ + " "
+ + "Created on: Aug 24, 2010 5:39 AM by"
+ + "<a href=\"/people/adietish\""
+ + "id=\"jive-72036899,987,346,482,238\""
+ + "onmouseover=\"quickuserprofile.getUserProfileTooltip(72036);\""
+ + "onmouseout=\"quickuserprofile.cancelTooltip();\""
+ + "class=\"jiveTT-hover-user jive-username-link\""
+ + ">Andre Dietisheim</a> <span>-</span> "
+ + "Last Modified: "
+ + "Aug 24, 2010 5:53 AM"
+ + "by <a href=\"/people/adietish\""
+ + "id=\"jive-72036899,987,347,353,238\""
+ + "onmouseover=\"quickuserprofile.getUserProfileTooltip(72036);\""
+ + "onmouseout=\"quickuserprofile.cancelTooltip();\""
+ + "class=\"jiveTT-hover-user jive-username-link\""
+ + ">Andre Dietisheim</a> </div> "
+ + " "
+ + " </div> "
+ + " <div class=\"jive-content-body\"> "
+ + " "
+ +
+ "<!-- [DocumentBodyStart:e26c60c0-cb73-47b7-bded-f4eb7320305b] --><div class=\"jive-rendered-content\"><p>This article is queried by the JBoss Tools / JBoss Developer Studio usage reporting plugin. It implements a global kill-switch that allows us to disable usage reporting stats. The plugin looks for a string of the format:</p><p style=\"min-height: 8pt; height: 8pt; padding: 0px;\"> </p><p><strong>Usage  Reporting  is <"
+ +
+ "ENABLED></strong>. Any value that differs from ENABLED is interpreted as DISABLED.</p><p style=\"min-height: 8pt; height: 8pt; padding: 0px;\"> </p><h1>Usage Reporting is "
+
+ + enablementValue
+
+ + "</h1>"
+ + "<h1>Dummy Value is "
+
+ + dummyValue
+
+ + "</h1>"
+
+ + "<h1>Integer Value is "
+
+ + integerValue
+
+ + "</h1>"
+
+ +
+ "</div><!-- [DocumentBodyEnd:e26c60c0-cb73-47b7-bded-f4eb7320305b] --> "
+ + " "
+ + " </div> "
+ + " <div class=\"jive-content-footer\"> "
+ + " "
+ + " "
+ + " <!-- BEGIN content details --> "
+ + " <span class=\"jive-content-footer-item\"> "
+ + " 18 Views</a> "
+ + " </span> "
+ + " "
+ + " "
+ + " </div> "
+ + "</div> "
+ + "</body> "
+ + "</html> ";
}
@Ignore
15 years, 3 months
JBoss Tools SVN: r24490 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-08-27 07:29:48 -0400 (Fri, 27 Aug 2010)
New Revision: 24490
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java
Log:
https://jira.jboss.org/browse/JBIDE-6729 , locale country string is manually transformed to upper case.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java 2010-08-27 09:04:36 UTC (rev 24489)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java 2010-08-27 11:29:48 UTC (rev 24490)
@@ -55,6 +55,7 @@
import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.i18n.MainLocaleProvider;
+import org.jboss.tools.vpe.editor.util.Constants;
public class BundleMap {
@@ -271,8 +272,19 @@
String resultUri = uri.replace('.','/');
ResourceBundle bundle = getBundleByUrl(uri, locale);
String localeString = bundle.getLocale().toString();
- if ((null != localeString) && (localeString.length() > 0)){
- resultUri += "_" + localeString; //$NON-NLS-1$
+ if ((null != localeString) && (localeString.length() > 0)) {
+ /*
+ * getLanguage() method in ResourceBundle could return "en_us" string.
+ * Bundle's file is case sensitive thus country name
+ * should be transformed to UpperCase.
+ */
+ String[] parts = localeString.split(Constants.UNDERSCORE);
+ if (parts.length == 2) {
+ parts[1] = parts[1].toUpperCase();
+ }
+ for (String part : parts) {
+ resultUri += Constants.UNDERSCORE + part;
+ }
}
resultUri += ".properties"; //$NON-NLS-1$
return resultUri;
15 years, 3 months
JBoss Tools SVN: r24489 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/console.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-08-27 05:04:36 -0400 (Fri, 27 Aug 2010)
New Revision: 24489
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/console/ShowConsoleServerStateListener.java
Log:
JBIDE-6552 - NPE for launching server console
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/console/ShowConsoleServerStateListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/console/ShowConsoleServerStateListener.java 2010-08-27 08:26:07 UTC (rev 24488)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/console/ShowConsoleServerStateListener.java 2010-08-27 09:04:36 UTC (rev 24489)
@@ -11,6 +11,7 @@
package org.jboss.ide.eclipse.as.ui.console;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
@@ -18,8 +19,11 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerEvent;
import org.eclipse.wst.server.ui.internal.view.servers.ShowInConsoleAction;
+import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
public class ShowConsoleServerStateListener extends UnitedServerListener {
private static ShowConsoleServerStateListener instance;
@@ -37,6 +41,11 @@
// server change event
if ((eventKind & ServerEvent.STATE_CHANGE) != 0) {
if( event.getServer().getServerState() == IServer.STATE_STARTING ) {
+ // do not launch console for remotes, for now
+ IJBossServerPublishMethodType type = DeploymentPreferenceLoader.getCurrentDeploymentMethodType(jbs.getServer());
+ if( !type.getId().equals(LocalPublishMethod.LOCAL_PUBLISH_METHOD))
+ return;
+
new Thread() {
public void run() {
try {
@@ -45,7 +54,9 @@
} catch(InterruptedException ie) {}
Display.getDefault().asyncExec(new Runnable() {
public void run() {
- new ShowInConsoleAction(getNullSelectionProvider()).perform(server);
+ ILaunch launch = server.getLaunch();
+ if( launch != null && launch.getProcesses().length > 0)
+ new ShowInConsoleAction(getNullSelectionProvider()).perform(server);
}
});
}
15 years, 3 months
JBoss Tools SVN: r24488 - trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-08-27 04:26:07 -0400 (Fri, 27 Aug 2010)
New Revision: 24488
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6523 beans.xml validation
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-08-27 07:42:20 UTC (rev 24487)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-08-27 08:26:07 UTC (rev 24488)
@@ -1462,7 +1462,119 @@
assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_SCOPE_TYPE.substring(0, 52) + ".*", 30);
}
+ // beans.xml
+
/**
+ * 5.1.1. Declaring selected alternatives for a bean archive
+ * - Each child <class> element must specify the name of an alternative bean class. If there is no class with the specified
+ * name the container automatically detects the problem
+ * and treats it as a deployment problem.
+ */
+ public void testNoAlternativeClassWithSpecifiedName() throws Exception {
+ //TODO
+ }
+
+ /**
+ * 5.1.1. Declaring selected alternatives for a bean archive
+ * - Each child <class> element must specify the name of an alternative bean class. If the class with the specified name is not an alternative bean class,
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ public void testIllegalAlternativeClassWithSpecifiedName() throws Exception {
+ //TODO
+ }
+
+ /**
+ * 5.1.1. Declaring selected alternatives for a bean archive
+ * - Each child <stereotype> element must specify the name of an @Alternative stereotype annotation. If there is no annotation
+ * with the specified name the container automatically detects the
+ * problem and treats it as a deployment problem.
+ */
+ public void testNoAlternativeAnnotationWithSpecifiedName() throws Exception {
+ //TODO
+ }
+
+ /**
+ * 5.1.1. Declaring selected alternatives for a bean archive
+ * - Each child <stereotype> element must specify the name of an @Alternative stereotype annotation. If the annotation is not an @Alternative stereotype,
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ public void testIllegalAlternativeAnnotationWithSpecifiedName() throws Exception {
+ //TODO
+ }
+
+ /**
+ * 5.1.1. Declaring selected alternatives for a bean archive
+ * - If the same type is listed twice under the <alternatives> element, the container automatically detects the problem and
+ * treats it as a deployment problem.
+ */
+ public void testSameAlternativeClassListedTwice() throws Exception {
+ //TODO
+ }
+
+ /**
+ * 5.1.1. Declaring selected alternatives for a bean archive
+ * - If the same type is listed twice under the <alternatives> element, the container automatically detects the problem and
+ * treats it as a deployment problem.
+ */
+ public void testSameAlternativeAnnotationListedTwice() throws Exception {
+ //TODO
+ }
+
+ /**
+ * 8.2. Decorator enablement and ordering
+ * - Each child <class> element must specify the name of a decorator bean class. If there is no class with the specified name,
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ public void testNonExistantDecoratorClassInBeansXmlNotOK() throws Exception {
+ //TODO
+ }
+
+ /**
+ * 8.2. Decorator enablement and ordering
+ * - Each child <class> element must specify the name of a decorator bean class. If the class with the specified name is not a decorator bean class,
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ public void testEnabledDecoratorNotADecorator() throws Exception {
+ //TODO
+ }
+
+ /**
+ * 8.2. Decorator enablement and ordering
+ * - If the same class is listed twice under the <decorators> element, the container automatically detects the problem and
+ * treats it as a deployment problem.
+ */
+ public void testDecoratorListedTwiceInBeansXmlNotOK() throws Exception {
+ //TODO
+ }
+
+ /**
+ * 9.4. Interceptor enablement and ordering
+ * - Each child <class> element must specify the name of an interceptor class. If there is no class with the specified name
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ public void testNonExistantClassInBeansXmlNotOk() throws Exception {
+ //TODO
+ }
+
+ /**
+ * 9.4. Interceptor enablement and ordering
+ * - Each child <class> element must specify the name of an interceptor class. If the class with the specified name is not an interceptor class,
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ public void testNonInterceptorClassInBeansXmlNotOk() throws Exception {
+ //TODO
+ }
+
+ /**
+ * 9.4. Interceptor enablement and ordering
+ * - If the same class is listed twice under the <interceptors> element, the container automatically detects the problem and treats it as
+ * a deployment problem.
+ */
+ public void testSameInterceptorClassListedTwiceInBeansXmlNotOk() throws Exception {
+ //TODO
+ }
+
+ /**
* https://jira.jboss.org/browse/JBIDE-6507
*
* @throws Exception
15 years, 3 months