JBoss Tools SVN: r24912 - in trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test: ca and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-09-14 10:35:41 -0400 (Tue, 14 Sep 2010)
New Revision: 24912
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
Log:
JBIDE-6827: JUnit Content Assist tests don't work with WTP 3.2.0
The CA initialization is fixed
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java 2010-09-14 11:25:25 UTC (rev 24911)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java 2010-09-14 14:35:41 UTC (rev 24912)
@@ -2,19 +2,24 @@
import java.lang.reflect.Method;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.contentassist.IContentAssistantExtension;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.texteditor.AbstractTextEditor;
+import org.eclipse.wst.sse.ui.internal.contentassist.StructuredContentAssistant;
public class TestUtil {
+ /** The Constant MAX_IDLE. */
+ public static final long MAX_IDLE = 15*1000L;
/**
* Returns the CA Processor from content assistant for the given offset in the document.
@@ -64,6 +69,18 @@
}
}
}
+
+ /**
+ * Wait for idle.
+ */
+ public static void waitForIdle(long maxIdle) {
+ long start = System.currentTimeMillis();
+ while (!Job.getJobManager().isIdle()) {
+ delay(500);
+ if ( (System.currentTimeMillis()-start) > maxIdle )
+ throw new RuntimeException("A long running task detected"); //$NON-NLS-1$
+ }
+ }
public static SourceViewerConfiguration getSourceViewerConfiguration(AbstractTextEditor editor) {
Class editorClass = editor.getClass();
@@ -85,4 +102,16 @@
}
+ public static void prepareCAInvokation(IContentAssistant ca, ITextViewer viewer, int offset) {
+ if (ca == null || viewer == null)
+ return;
+
+ // sets cursor position
+ viewer.getTextWidget().setCaretOffset(offset);
+
+ TestUtil.waitForIdle(TestUtil.MAX_IDLE);
+ TestUtil.delay(1000);
+
+ ca.showPossibleCompletions();
+ }
}
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2010-09-14 11:25:25 UTC (rev 24911)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2010-09-14 14:35:41 UTC (rev 24912)
@@ -4,6 +4,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContentAssistant;
@@ -12,6 +13,7 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.eclipse.wst.sse.ui.internal.contentassist.StructuredContentAssistant;
import org.jboss.tools.common.text.ext.util.Utils;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
@@ -73,18 +75,20 @@
ICompletionProposal[] result = null;
// System.out.println("checkProposals >>> invoking TestUtil.getProcessor() for position " + (position + offset));
+
IContentAssistProcessor p = TestUtil.getProcessor(viewer, position + offset, contentAssistant);
-// System.out.println("checkProposals >>> TestUtil.getProcessor() is invoked for " + (position + offset));
+ TestUtil.prepareCAInvokation(contentAssistant, viewer, position+offset);
+ // System.out.println("checkProposals >>> TestUtil.getProcessor() is invoked for " + (position + offset));
if (p != null) {
try {
-// System.out.println("checkProposals >>> invoking p.computeCompletionProposals() for position " + (position + offset));
+ // System.out.println("checkProposals >>> invoking p.computeCompletionProposals() for position " + (position + offset));
result = p.computeCompletionProposals(viewer, position + offset);
-// System.out.println("checkProposals >>> p.computeCompletionProposals() is invoked for " + (position + offset));
+ // System.out.println("checkProposals >>> p.computeCompletionProposals() is invoked for " + (position + offset));
} catch (Throwable x) {
x.printStackTrace();
}
}
-// System.out.println("checkProposals >>> Performing the values check up");
+ // System.out.println("checkProposals >>> Performing the values check up");
assertTrue("Content Assistant returned no proposals", (result != null && result.length > 0));
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2010-09-14 11:25:25 UTC (rev 24911)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2010-09-14 14:35:41 UTC (rev 24912)
@@ -6,6 +6,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.FindReplaceDocumentAdapter;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
@@ -57,6 +58,8 @@
" var=\"msg\"", true, true, false, false);
String errorMessage = null;
+ TestUtil.prepareCAInvokation(contentAssistant, viewer, reg.getOffset());
+
final IContentAssistProcessor p= TestUtil.getProcessor(viewer, reg.getOffset(), contentAssistant);
if (p != null) {
result= p.computeCompletionProposals(viewer, reg.getOffset());
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java 2010-09-14 11:25:25 UTC (rev 24911)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java 2010-09-14 14:35:41 UTC (rev 24912)
@@ -60,6 +60,7 @@
ICompletionProposal[] result= null;
String errorMessage = null;
+ TestUtil.prepareCAInvokation(contentAssistant, viewer, offsetToTest);
IContentAssistProcessor p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
if (p != null) {
try {
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java 2010-09-14 11:25:25 UTC (rev 24911)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java 2010-09-14 14:35:41 UTC (rev 24912)
@@ -3,6 +3,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
@@ -51,17 +52,26 @@
jspTextEditor.setText(documentContentModified);
+ // sets cursor position
+ viewer.getTextWidget().setCaretOffset(offsetToTest);
+
+ TestUtil.waitForIdle(TestUtil.MAX_IDLE);
+ TestUtil.delay(1000);
+
ICompletionProposal[] result= null;
String errorMessage = null;
- IContentAssistProcessor p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
- if (p != null) {
- try {
- result= p.computeCompletionProposals(viewer, offsetToTest);
- } catch (Throwable x) {
- x.printStackTrace();
+ if (contentAssistant instanceof ContentAssistant) {
+ TestUtil.prepareCAInvokation(contentAssistant, viewer, offsetToTest);
+ IContentAssistProcessor p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
+ if (p != null) {
+ try {
+ result= p.computeCompletionProposals(viewer, offsetToTest);
+ } catch (Throwable x) {
+ x.printStackTrace();
+ }
+ errorMessage= p.getErrorMessage();
}
- errorMessage= p.getErrorMessage();
}
assertTrue("Content Assistant returned no proposals", (result != null && result.length > 0));
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2010-09-14 11:25:25 UTC (rev 24911)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2010-09-14 14:35:41 UTC (rev 24912)
@@ -3,6 +3,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
@@ -61,6 +62,8 @@
ICompletionProposal[] result= null;
String errorMessage = null;
+ TestUtil.prepareCAInvokation(contentAssistant, viewer, offsetToTest);
+
IContentAssistProcessor p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
if (p != null) {
try {
15 years, 7 months
JBoss Tools SVN: r24911 - in trunk/usage: tests/org.jboss.tools.usage.test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-09-14 07:25:25 -0400 (Tue, 14 Sep 2010)
New Revision: 24911
Added:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/JBossToolsComponents.java
trunk/usage/tests/org.jboss.tools.usage.test/JBossToolsComponentsTest.launch
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsComponentsTest.java
Removed:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/JBossComponents.java
trunk/usage/tests/org.jboss.tools.usage.test/JBossComponentsTest.launch
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossComponentsTest.java
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/ReportingEclipseEnvironment.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentTest.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/UsageTestSuite.java
Log:
[JBIDE-7035] JBossComponents renamed to JBossToolsComponents
Deleted: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/JBossComponents.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/JBossComponents.java 2010-09-14 11:17:13 UTC (rev 24910)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/JBossComponents.java 2010-09-14 11:25:25 UTC (rev 24911)
@@ -1,139 +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.reporting;
-
-import java.util.Collection;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.runtime.IBundleGroup;
-import org.eclipse.core.runtime.IBundleGroupProvider;
-import org.jboss.tools.usage.util.collectionfilter.CollectionFilterUtils;
-import org.jboss.tools.usage.util.collectionfilter.CompositeCollectionFilter;
-import org.jboss.tools.usage.util.collectionfilter.ICollectionFilter;
-
-/**
- * @author Andre Dietisheim
- */
-public class JBossComponents {
-
- public enum JBossToolsFeatureNames {
- ARCHIVES("org.jboss.ide.eclipse.archives.feature"),
- BIRT("org.jboss.tools.birt.feature"),
- BPEL("org.jboss.tools.bpel.feature"),
- CDI("org.jboss.tools.cdi.feature"),
- COMMON("org.jboss.tools.common.feature"),
- DELTACLOUD("org.jboss.tools.deltacloud.feature"),
- DROOLS("org.drools.eclipse.feature"),
- ESB("org.jboss.tools.esb.feature"),
- EXAMPLES("org.jboss.tools.project.examples.feature"),
- FLOW("org.jboss.tools.flow.common.feature"),
- FREEMARKER("org.jboss.ide.eclipse.freemarker.feature"),
- GWT("org.jboss.tools.gwt.feature"),
- HIBERNATETOOLS("org.hibernate.eclipse.feature"),
- JBPM("org.jboss.tools.jbpm.common.feature"),
- JMX("org.jboss.tools.jmx.feature"),
- JSF("org.jboss.tools.jsf.feature"),
- MAVEN("org.jboss.tools.maven.feature"),
- MODESHAPE("org.jboss.tools.modeshape.rest.feature"),
- PORTLET("org.jboss.tools.portlet.feature"),
- PROFILER("org.jboss.tools.profiler.feature"),
- RUNTIME("org.jboss.tools.runtime.feature"),
- SEAM("org.jboss.tools.seam.feature"),
- SMOOKS("org.jboss.tools.smooks.feature"),
- STRUTS("org.jboss.tools.struts.feature"),
- TPTP("org.jboss.tools.tptp.feature"),
- USAGE("org.jboss.tools.usage.feature"),
- VPE("org.jboss.tools.vpe.feature"),
- WORKINGSET("org.jboss.tools.workingset.feature"),
- WS("org.jboss.tools.ws.feature"),
- XULRUNNER("org.mozilla.xulrunner.feature");
-
- private String featureName;
-
- JBossToolsFeatureNames(String featureName) {
- this.featureName = featureName;
- }
-
- /**
- * Returns whether the given bundle group has the same name as the this
- * feature name.
- *
- * @param bundleName
- * the bundle name to check whether it's a member of this
- * group of bundles.
- * @return <tt>true</tt>, if the given bundle
- */
- public boolean matches(IBundleGroup bundleGroup) {
- return featureName.equals(bundleGroup.getName());
- }
-
- public String getAbbreviation() {
- return name();
- }
- }
-
- private static final String JBOSS_TOOLS_BUNDLES_PREFIX = "org\\.jboss\\.tools.+"; //$NON-NLS-1$
-
- private JBossComponents() {
- // inhibit instantiation
- }
-
-
- /**
- * Returns the jboss components that the given bundle group provider provides
- *
- * @param bundles
- * the bundles group providers to check for jboss components
- * @return
- */
- @SuppressWarnings("unchecked")
- public static Collection<String> getComponentIds(IBundleGroupProvider[] bundleGroupProviders) {
- Set<String> componentNames = new TreeSet<String>();
- for (IBundleGroupProvider bundleGroupProvider : bundleGroupProviders) {
- CollectionFilterUtils.filter(
- new CompositeCollectionFilter<IBundleGroup>(
- new JBossToolsNameFilter()
- , new JBossToolsFeaturesFilter(componentNames))
- , bundleGroupProvider.getBundleGroups(), null);
- }
- return componentNames;
- }
-
- private static class JBossToolsNameFilter implements ICollectionFilter<IBundleGroup> {
-
- Pattern pattern = Pattern.compile(JBOSS_TOOLS_BUNDLES_PREFIX);
-
- public boolean matches(IBundleGroup bundleGroup) {
- return pattern.matcher(bundleGroup.getName()).matches();
- }
- }
-
- private static class JBossToolsFeaturesFilter implements ICollectionFilter<IBundleGroup> {
-
- private Collection<String> componentNames;
-
- private JBossToolsFeaturesFilter(Collection<String> componentNames) {
- this.componentNames = componentNames;
- }
-
- public boolean matches(IBundleGroup bundleGroup) {
- for (JBossToolsFeatureNames featureName : JBossToolsFeatureNames.values()) {
- if (featureName.matches(bundleGroup)) {
- this.componentNames.add(featureName.getAbbreviation());
- return true;
- }
- }
- return false;
- }
- }
-}
\ No newline at end of file
Copied: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/JBossToolsComponents.java (from rev 24908, trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/JBossComponents.java)
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/JBossToolsComponents.java (rev 0)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/JBossToolsComponents.java 2010-09-14 11:25:25 UTC (rev 24911)
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * 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.reporting;
+
+import java.util.Collection;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.runtime.IBundleGroup;
+import org.eclipse.core.runtime.IBundleGroupProvider;
+import org.jboss.tools.usage.util.collectionfilter.CollectionFilterUtils;
+import org.jboss.tools.usage.util.collectionfilter.CompositeCollectionFilter;
+import org.jboss.tools.usage.util.collectionfilter.ICollectionFilter;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class JBossToolsComponents {
+
+ public enum JBossToolsFeatureNames {
+ ARCHIVES("org.jboss.ide.eclipse.archives.feature"),
+ BIRT("org.jboss.tools.birt.feature"),
+ BPEL("org.jboss.tools.bpel.feature"),
+ CDI("org.jboss.tools.cdi.feature"),
+ COMMON("org.jboss.tools.common.feature"),
+ DELTACLOUD("org.jboss.tools.deltacloud.feature"),
+ DROOLS("org.drools.eclipse.feature"),
+ ESB("org.jboss.tools.esb.feature"),
+ EXAMPLES("org.jboss.tools.project.examples.feature"),
+ FLOW("org.jboss.tools.flow.common.feature"),
+ FREEMARKER("org.jboss.ide.eclipse.freemarker.feature"),
+ GWT("org.jboss.tools.gwt.feature"),
+ HIBERNATETOOLS("org.hibernate.eclipse.feature"),
+ JBPM("org.jboss.tools.jbpm.common.feature"),
+ JMX("org.jboss.tools.jmx.feature"),
+ JSF("org.jboss.tools.jsf.feature"),
+ MAVEN("org.jboss.tools.maven.feature"),
+ MODESHAPE("org.jboss.tools.modeshape.rest.feature"),
+ PORTLET("org.jboss.tools.portlet.feature"),
+ PROFILER("org.jboss.tools.profiler.feature"),
+ RUNTIME("org.jboss.tools.runtime.feature"),
+ SEAM("org.jboss.tools.seam.feature"),
+ SMOOKS("org.jboss.tools.smooks.feature"),
+ STRUTS("org.jboss.tools.struts.feature"),
+ TPTP("org.jboss.tools.tptp.feature"),
+ USAGE("org.jboss.tools.usage.feature"),
+ VPE("org.jboss.tools.vpe.feature"),
+ WORKINGSET("org.jboss.tools.workingset.feature"),
+ WS("org.jboss.tools.ws.feature"),
+ XULRUNNER("org.mozilla.xulrunner.feature");
+
+ private String featureName;
+
+ JBossToolsFeatureNames(String featureName) {
+ this.featureName = featureName;
+ }
+
+ /**
+ * Returns whether the given bundle group has the same name as the this
+ * feature name.
+ *
+ * @param bundleName
+ * the bundle name to check whether it's a member of this
+ * group of bundles.
+ * @return <tt>true</tt>, if the given bundle
+ */
+ public boolean matches(IBundleGroup bundleGroup) {
+ return featureName.equals(bundleGroup.getName());
+ }
+
+ public String getAbbreviation() {
+ return name();
+ }
+ }
+
+ private static final String JBOSS_TOOLS_BUNDLES_PREFIX = "org\\.jboss\\.tools.+"; //$NON-NLS-1$
+
+ private JBossToolsComponents() {
+ // inhibit instantiation
+ }
+
+
+ /**
+ * Returns the jboss components that the given bundle group provider provides
+ *
+ * @param bundles
+ * the bundles group providers to check for jboss components
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ public static Collection<String> getComponentIds(IBundleGroupProvider[] bundleGroupProviders) {
+ Set<String> componentNames = new TreeSet<String>();
+ for (IBundleGroupProvider bundleGroupProvider : bundleGroupProviders) {
+ CollectionFilterUtils.filter(
+ new CompositeCollectionFilter<IBundleGroup>(
+ new JBossToolsNameFilter()
+ , new JBossToolsFeaturesFilter(componentNames))
+ , bundleGroupProvider.getBundleGroups(), null);
+ }
+ return componentNames;
+ }
+
+ private static class JBossToolsNameFilter implements ICollectionFilter<IBundleGroup> {
+
+ Pattern pattern = Pattern.compile(JBOSS_TOOLS_BUNDLES_PREFIX);
+
+ public boolean matches(IBundleGroup bundleGroup) {
+ return pattern.matcher(bundleGroup.getName()).matches();
+ }
+ }
+
+ private static class JBossToolsFeaturesFilter implements ICollectionFilter<IBundleGroup> {
+
+ private Collection<String> componentNames;
+
+ private JBossToolsFeaturesFilter(Collection<String> componentNames) {
+ this.componentNames = componentNames;
+ }
+
+ public boolean matches(IBundleGroup bundleGroup) {
+ for (JBossToolsFeatureNames featureName : JBossToolsFeatureNames.values()) {
+ if (featureName.matches(bundleGroup)) {
+ this.componentNames.add(featureName.getAbbreviation());
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/ReportingEclipseEnvironment.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/ReportingEclipseEnvironment.java 2010-09-14 11:17:13 UTC (rev 24910)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/ReportingEclipseEnvironment.java 2010-09-14 11:25:25 UTC (rev 24911)
@@ -31,7 +31,7 @@
@Override
public String getKeyword() {
- Collection<String> jbossComponentNames = JBossComponents.getComponentIds(getBundleGroupProviders());
+ Collection<String> jbossComponentNames = JBossToolsComponents.getComponentIds(getBundleGroupProviders());
return bundleGroupsToKeywordString(jbossComponentNames );
}
Deleted: trunk/usage/tests/org.jboss.tools.usage.test/JBossComponentsTest.launch
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/JBossComponentsTest.launch 2010-09-14 11:17:13 UTC (rev 24910)
+++ trunk/usage/tests/org.jboss.tools.usage.test/JBossComponentsTest.launch 2010-09-14 11:25:25 UTC (rev 24911)
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<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="true"/>
-<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"/>
-<stringAttribute key="deselected_workspace_plugins" value="org.jboss.tools.gwt.core,org.jboss.tools.gwt.ui,org.jboss.tools.common,org.jboss.tools.common.model"/>
-<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/JBossComponentsTest.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.run"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-</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.MAIN_TYPE" value="org.jboss.tools.usage.test.JBossComponentsTest"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
-<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="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -XX:MaxPermSize=256m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xms40m -Xmx512m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
-<booleanAttribute key="run_in_ui_thread" value="true"/>
-<stringAttribute key="selected_target_plugins" value="javax.activation@default:default,org.eclipse.equinox.app@default:default,org.junit4@default:default,org.eclipse.core.filesystem.macosx@default:false,org.eclipse.core.runtime.compatibility.registry@default:false,javax.servlet@default:default,org.eclipse.core.runtime@default:true,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.swt.cocoa.macosx.x86_64@default:false,org.eclipse.update.configurator@3:true,org.apache.jasper@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.text@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.osgi.services@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ui.ide.application@default:default,org.eclipse.ant.core@default:default,org.apache.lucene@default:default,org.eclipse.ui@default:default,org!
.eclipse.ecf.filetransfer@default:default,org.eclipse.osgi@-1:true,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.apache.ant@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.jface.text@default:default,org.mortbay.jetty.server@default:default,org.eclipse.core.databinding@default:default,org.eclipse.help@default:default,org.eclipse.net4j.jms.api@default:default,org.apache.lucene.analysis@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.swt@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.http.jetty@default:default,org.hamcrest.core@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.common@2:true,org.eclipse.swtbot.ant.optional.junit4@default:false,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.p2.!
core@default:default,ch.qos.logback.classic@default:default,or!
g.eclips
e.equinox.security.macosx@default:false,org.eclipse.help.base@default:default,org.eclipse.ui.views@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.help.ui@default:default,org.eclipse.equinox.concurrent@default:default,ch.qos.logback.slf4j@default:false,ch.qos.logback.core@default:default,org.eclipse.core.variables@default:default,org.eclipse.ecf.identity@default:default,org.slf4j.api@default:default,org.eclipse.core.net@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.core.resources@default:default,org.mortbay.jetty.util@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.core.jobs@default:default,org.eclipse.equinox.security@default:default,org.eclipse.core.commands@default:default,org.apache.commons.logging*1.1.1.v201005080502@default:default,org.apache.commons.el!
@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.sdk@default:default,javax.servlet.jsp@default:default,org.eclipse.ui.cocoa@default:false,javax.mail@default:default,com.ibm.icu@default:default,org.eclipse.jface@default:default,org.eclipse.ecf@default:default,org.eclipse.ui.workbench@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="org.jboss.tools.usage.test@default:default,org.jboss.tools.usage@default:default,org.jboss.tools.xulrunner.initializer@default:false"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="false"/>
-<booleanAttribute key="useProduct" value="false"/>
-</launchConfiguration>
Added: trunk/usage/tests/org.jboss.tools.usage.test/JBossToolsComponentsTest.launch
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/JBossToolsComponentsTest.launch (rev 0)
+++ trunk/usage/tests/org.jboss.tools.usage.test/JBossToolsComponentsTest.launch 2010-09-14 11:25:25 UTC (rev 24911)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<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="true"/>
+<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"/>
+<stringAttribute key="deselected_workspace_plugins" value="org.jboss.tools.gwt.core,org.jboss.tools.gwt.ui,org.jboss.tools.common,org.jboss.tools.common.model"/>
+<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/JBossToolsComponentsTest.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.run"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+</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.MAIN_TYPE" value="org.jboss.tools.usage.test.JBossToolsComponentsTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<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="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -XX:MaxPermSize=256m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xms40m -Xmx512m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
+<booleanAttribute key="run_in_ui_thread" value="true"/>
+<stringAttribute key="selected_target_plugins" value="javax.activation@default:default,org.eclipse.equinox.app@default:default,org.junit4@default:default,org.eclipse.core.filesystem.macosx@default:false,org.eclipse.core.runtime.compatibility.registry@default:false,javax.servlet@default:default,org.eclipse.core.runtime@default:true,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.swt.cocoa.macosx.x86_64@default:false,org.eclipse.update.configurator@3:true,org.apache.jasper@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.text@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.osgi.services@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ui.ide.application@default:default,org.eclipse.ant.core@default:default,org.apache.lucene@default:default,org.eclipse.ui@default:default,org!
.eclipse.ecf.filetransfer@default:default,org.eclipse.osgi@-1:true,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.apache.ant@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.jface.text@default:default,org.mortbay.jetty.server@default:default,org.eclipse.core.databinding@default:default,org.eclipse.help@default:default,org.eclipse.net4j.jms.api@default:default,org.apache.lucene.analysis@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.swt@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.http.jetty@default:default,org.hamcrest.core@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.common@2:true,org.eclipse.swtbot.ant.optional.junit4@default:false,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.p2.!
core@default:default,ch.qos.logback.classic@default:default,or!
g.eclips
e.equinox.security.macosx@default:false,org.eclipse.help.base@default:default,org.eclipse.ui.views@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.help.ui@default:default,org.eclipse.equinox.concurrent@default:default,ch.qos.logback.slf4j@default:false,ch.qos.logback.core@default:default,org.eclipse.core.variables@default:default,org.eclipse.ecf.identity@default:default,org.slf4j.api@default:default,org.eclipse.core.net@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.core.resources@default:default,org.mortbay.jetty.util@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.core.jobs@default:default,org.eclipse.equinox.security@default:default,org.eclipse.core.commands@default:default,org.apache.commons.logging*1.1.1.v201005080502@default:default,org.apache.commons.el!
@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.sdk@default:default,javax.servlet.jsp@default:default,org.eclipse.ui.cocoa@default:false,javax.mail@default:default,com.ibm.icu@default:default,org.eclipse.jface@default:default,org.eclipse.ecf@default:default,org.eclipse.ui.workbench@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.jboss.tools.usage.test@default:default,org.jboss.tools.usage@default:default,org.jboss.tools.xulrunner.initializer@default:false"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" 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/JBossToolsComponentsTest.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossComponentsTest.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossComponentsTest.java 2010-09-14 11:17:13 UTC (rev 24910)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossComponentsTest.java 2010-09-14 11:25:25 UTC (rev 24911)
@@ -1,34 +0,0 @@
-package org.jboss.tools.usage.test;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertThat;
-
-import java.util.Collection;
-
-import org.eclipse.core.runtime.IBundleGroupProvider;
-import org.jboss.tools.usage.reporting.JBossComponents;
-import org.jboss.tools.usage.test.fakes.BundleGroupProviderFake;
-import org.junit.Test;
-import org.junit.matchers.JUnitMatchers;
-
-public class JBossComponentsTest {
-
- @Test
- public void reportedComponentsListIsComplete() {
- Collection<String> componentIds = JBossComponents.getComponentIds(
- new IBundleGroupProvider[] {
- new BundleGroupProviderFake("org.jboss.tools.gwt.feature")
- , new BundleGroupProviderFake(
- "rubbish",
- "org.jboss.tools.seam.feature")
- , new BundleGroupProviderFake("org.jboss.tools.smooks.feature")
- , new BundleGroupProviderFake("org.jboss.tools.usage.feature.bandname")
- });
-
- assertThat(componentIds, JUnitMatchers.hasItems(
- JBossComponents.JBossToolsFeatureNames.GWT.getAbbreviation(),
- JBossComponents.JBossToolsFeatureNames.SEAM.getAbbreviation(),
- JBossComponents.JBossToolsFeatureNames.SMOOKS.getAbbreviation()));
- assertFalse(componentIds.contains(JBossComponents.JBossToolsFeatureNames.USAGE.getAbbreviation()));
- }
-}
Copied: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsComponentsTest.java (from rev 24910, trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossComponentsTest.java)
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsComponentsTest.java (rev 0)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsComponentsTest.java 2010-09-14 11:25:25 UTC (rev 24911)
@@ -0,0 +1,34 @@
+package org.jboss.tools.usage.test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+
+import java.util.Collection;
+
+import org.eclipse.core.runtime.IBundleGroupProvider;
+import org.jboss.tools.usage.reporting.JBossToolsComponents;
+import org.jboss.tools.usage.test.fakes.BundleGroupProviderFake;
+import org.junit.Test;
+import org.junit.matchers.JUnitMatchers;
+
+public class JBossToolsComponentsTest {
+
+ @Test
+ public void reportedComponentsListIsComplete() {
+ Collection<String> componentIds = JBossToolsComponents.getComponentIds(
+ new IBundleGroupProvider[] {
+ new BundleGroupProviderFake("org.jboss.tools.gwt.feature")
+ , new BundleGroupProviderFake(
+ "rubbish",
+ "org.jboss.tools.seam.feature")
+ , new BundleGroupProviderFake("org.jboss.tools.smooks.feature")
+ , new BundleGroupProviderFake("org.jboss.tools.usage.feature.bandname")
+ });
+
+ assertThat(componentIds, JUnitMatchers.hasItems(
+ JBossToolsComponents.JBossToolsFeatureNames.GWT.getAbbreviation(),
+ JBossToolsComponents.JBossToolsFeatureNames.SEAM.getAbbreviation(),
+ JBossToolsComponents.JBossToolsFeatureNames.SMOOKS.getAbbreviation()));
+ assertFalse(componentIds.contains(JBossToolsComponents.JBossToolsFeatureNames.USAGE.getAbbreviation()));
+ }
+}
Property changes on: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsComponentsTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentTest.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentTest.java 2010-09-14 11:17:13 UTC (rev 24910)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentTest.java 2010-09-14 11:25:25 UTC (rev 24911)
@@ -17,7 +17,7 @@
import org.eclipse.core.runtime.IBundleGroupProvider;
import org.jboss.tools.usage.googleanalytics.eclipse.AbstractEclipseEnvironment;
-import org.jboss.tools.usage.reporting.JBossComponents;
+import org.jboss.tools.usage.reporting.JBossToolsComponents;
import org.jboss.tools.usage.test.fakes.BundleGroupProviderFake;
import org.jboss.tools.usage.test.fakes.ReportingEclipseEnvironmentFake;
import org.junit.Test;
@@ -46,9 +46,9 @@
Matcher matcher = Pattern.compile("(([A-Z]+)-){3}").matcher(keyword);
assertTrue(matcher.matches());
- assertTrue(keyword.indexOf(JBossComponents.JBossToolsFeatureNames.GWT.name()) >= 0);
- assertTrue(keyword.indexOf(JBossComponents.JBossToolsFeatureNames.SEAM.name()) >= 0);
- assertTrue(keyword.indexOf(JBossComponents.JBossToolsFeatureNames.SMOOKS.name()) >= 0);
+ assertTrue(keyword.indexOf(JBossToolsComponents.JBossToolsFeatureNames.GWT.name()) >= 0);
+ assertTrue(keyword.indexOf(JBossToolsComponents.JBossToolsFeatureNames.SEAM.name()) >= 0);
+ assertTrue(keyword.indexOf(JBossToolsComponents.JBossToolsFeatureNames.SMOOKS.name()) >= 0);
}
@Test
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/UsageTestSuite.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/UsageTestSuite.java 2010-09-14 11:17:13 UTC (rev 24910)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/UsageTestSuite.java 2010-09-14 11:25:25 UTC (rev 24911)
@@ -25,7 +25,7 @@
GoogleAnalyticsUrlStrategyTest.class,
EclipseUserAgentTest.class,
ReportingEclipseEnvironmentTest.class,
- JBossComponentsTest.class,
+ JBossToolsComponentsTest.class,
GlobalUsageReportingSettingsTest.class,
JBossToolsUsageIntegrationTest.class })
public class UsageTestSuite {
15 years, 7 months
JBoss Tools SVN: r24910 - in trunk/usage: tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-09-14 07:17:13 -0400 (Tue, 14 Sep 2010)
New Revision: 24910
Added:
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/BundleGroupProviderFake.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/EclipsePreferencesFake.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/EclipseUserAgentFake.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/ReportingEclipseEnvironmentFake.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/RepportingEclipseEnvironmentFakeSingleton.java
Removed:
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipsePreferencesFake.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipseUserAgentFake.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentFake.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/RepportingEclipseEnvironmentFakeSingleton.java
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsCookie.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipseUserAgentTest.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GoogleAnalyticsUrlStrategyTest.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossComponentsTest.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsUsageIntegrationTest.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentTest.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/UsageTestSuite.java
Log:
[JBIDE-7035] tests corrected, succeed again
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsCookie.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsCookie.java 2010-09-14 09:37:58 UTC (rev 24909)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/GoogleAnalyticsCookie.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.usage.googleanalytics;
-import org.eclipse.core.runtime.Assert;
public class GoogleAnalyticsCookie {
@@ -19,9 +18,6 @@
private char[] delimiters;
public GoogleAnalyticsCookie(String identifier, CharSequence value, char... delimiters) {
- Assert.isTrue(identifier != null && identifier.length() > 0);
- Assert.isTrue(value != null && value.length() > 0);
-
this.identifier = identifier;
this.value = value;
this.delimiters = delimiters;
@@ -32,11 +28,13 @@
}
public void appendTo(StringBuilder builder) {
- builder.append(identifier)
- .append(IGoogleAnalyticsParameters.EQUALS_SIGN)
- .append(value);
- for (char delimiter : delimiters) {
- builder.append(delimiter);
+ if (identifier != null && identifier.length() > 0 && value != null && value.length() > 0) {
+ builder.append(identifier)
+ .append(IGoogleAnalyticsParameters.EQUALS_SIGN)
+ .append(value);
+ for (char delimiter : delimiters) {
+ builder.append(delimiter);
+ }
}
}
}
Deleted: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipsePreferencesFake.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipsePreferencesFake.java 2010-09-14 09:37:58 UTC (rev 24909)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipsePreferencesFake.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -1,160 +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.test;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IPreferenceNodeVisitor;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-public class EclipsePreferencesFake implements IEclipsePreferences {
-
- private Map<String, String> preferences;
-
- public EclipsePreferencesFake() {
- this.preferences = new HashMap<String, String>();
- }
-
- public void accept(IPreferenceNodeVisitor visitor) throws BackingStoreException {
- throw new UnsupportedOperationException();
- }
-
- public void addNodeChangeListener(INodeChangeListener listener) {
- throw new UnsupportedOperationException();
- }
-
- public void addPreferenceChangeListener(IPreferenceChangeListener listener) {
- throw new UnsupportedOperationException();
- }
-
- public Preferences node(String path) {
- throw new UnsupportedOperationException();
- }
-
- public void removeNode() throws BackingStoreException {
- throw new UnsupportedOperationException();
- }
-
- public void removeNodeChangeListener(INodeChangeListener listener) {
- throw new UnsupportedOperationException();
- }
-
- public void removePreferenceChangeListener(IPreferenceChangeListener listener) {
- throw new UnsupportedOperationException();
- }
-
- public String absolutePath() {
- throw new UnsupportedOperationException();
- }
-
- public String[] childrenNames() throws BackingStoreException {
- throw new UnsupportedOperationException();
- }
-
- public void clear() throws BackingStoreException {
- this.preferences.clear();
- }
-
- public void flush() throws BackingStoreException {
- }
-
- public String get(String key, String defaultValue) {
- String value = preferences.get(key);
- if (value == null) {
- value = defaultValue;
- }
- return value;
- }
-
- public boolean getBoolean(String key, boolean defaultValue) {
- throw new UnsupportedOperationException();
- }
-
- public byte[] getByteArray(String key, byte[] defaultValue) {
- throw new UnsupportedOperationException();
- }
-
- public double getDouble(String key, double defaultValue) {
- throw new UnsupportedOperationException();
- }
-
- public float getFloat(String key, float defaultValue) {
- throw new UnsupportedOperationException();
- }
-
- public int getInt(String key, int defaultValue) {
- throw new UnsupportedOperationException();
- }
-
- public long getLong(String key, long defaultValue) {
- String value = preferences.get(key);
- if (value != null) {
- return Long.valueOf(value);
- } else {
- return defaultValue;
- }
- }
-
- public String[] keys() throws BackingStoreException {
- throw new UnsupportedOperationException();
- }
-
- public String name() {
- throw new UnsupportedOperationException();
- }
-
- public boolean nodeExists(String pathName) throws BackingStoreException {
- throw new UnsupportedOperationException();
- }
-
- public Preferences parent() {
- throw new UnsupportedOperationException();
- }
-
- public void put(String key, String value) {
- preferences.put(key, value);
- }
-
- public void putBoolean(String key, boolean value) {
- throw new UnsupportedOperationException();
- }
-
- public void putByteArray(String key, byte[] value) {
- throw new UnsupportedOperationException();
- }
-
- public void putDouble(String key, double value) {
- throw new UnsupportedOperationException();
- }
-
- public void putFloat(String key, float value) {
- throw new UnsupportedOperationException();
- }
-
- public void putInt(String key, int value) {
- throw new UnsupportedOperationException();
- }
-
- public void putLong(String key, long value) {
- preferences.put(key, String.valueOf(value));
- }
-
- public void remove(String key) {
- throw new UnsupportedOperationException();
- }
-
- public void sync() throws BackingStoreException {
- // ignore
- }
-}
\ No newline at end of file
Deleted: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipseUserAgentFake.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipseUserAgentFake.java 2010-09-14 09:37:58 UTC (rev 24909)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipseUserAgentFake.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -1,85 +0,0 @@
-package org.jboss.tools.usage.test;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.Platform;
-import org.jboss.tools.usage.googleanalytics.eclipse.EclipseUserAgent;
-
-public class EclipseUserAgentFake extends EclipseUserAgent {
-
- private static final String APPLICATION_NAME = "com.jboss.jbds.product";
- private static final String APPLICATION_VERSION = "3.0.1";
-
- public static final String LOCALE_US = "en_US";
-
- static final String WIN2000_VERSION = "5.0";
- static final String WINXP_VERSION = "5.1";
- static final String VISTA_VERSION = "6.0";
- static final String WIN7_VERSION = "6.1";
- static final String MACLEOPARD_VERSION = "10.5";
- static final String MACSNOWLEOPARD_VERSION = "10.6";
-
- private String applicationName;
- private String applicationVersion;
- private String nl;
- private String os;
- private String osVersion;
-
- public EclipseUserAgentFake() {
- this(APPLICATION_NAME, APPLICATION_VERSION, LOCALE_US, Platform.OS_WIN32, WIN7_VERSION);
- }
-
- public EclipseUserAgentFake(String nl) {
- this(APPLICATION_NAME, APPLICATION_VERSION, nl, Platform.OS_WIN32, WIN7_VERSION);
- }
-
- public EclipseUserAgentFake(String nl, String os, String osVersion) {
- this(APPLICATION_NAME, APPLICATION_VERSION, nl, os, osVersion);
- }
-
- /**
- * Instantiates a fake of the EclipseUserAgent class
- *
- * @param applicationName the name of the applicaiton
- * @param applicationVersion the version of the application
- * @param nl the platform locale as returned from <code>Platform.getNL()</code>
- * @param os the os name as return from <code>Platform.getOS()</code>
- * @param osVersion the version of the os as returned from <code>System.getProperty("os.name")</code>
- *
- * @see Platform#getNL()
- * @see Platform#getOS()
- * @see System#getProperty("os.version")
- */
- public EclipseUserAgentFake(String applicationName, String applicationVersion, String nl, String os, String osVersion) {
- Assert.isTrue(nl != null && nl.indexOf(JAVA_LOCALE_DELIMITER) >= 0, "nl parameter must for a java locale string <xx_XX>");
- this.applicationName = applicationName;
- this.applicationVersion = applicationVersion;
- this.nl = nl;
- this.os = os;
- this.osVersion = osVersion;
- }
-
- @Override
- protected String getNL() {
- return nl;
- }
-
- @Override
- protected String getApplicationName() {
- return applicationName;
- }
-
- @Override
- protected String getOS() {
- return os;
- }
-
- @Override
- protected String getOSVersion() {
- return osVersion;
- }
-
- @Override
- protected String getApplicationVersion() {
- return applicationVersion;
- }
-}
\ No newline at end of file
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipseUserAgentTest.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipseUserAgentTest.java 2010-09-14 09:37:58 UTC (rev 24909)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipseUserAgentTest.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -13,24 +13,15 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.core.runtime.Platform;
import org.jboss.tools.usage.googleanalytics.eclipse.AbstractEclipseEnvironment;
-import org.jboss.tools.usage.reporting.JBossComponents;
+import org.jboss.tools.usage.test.fakes.EclipsePreferencesFake;
+import org.jboss.tools.usage.test.fakes.EclipseUserAgentFake;
+import org.jboss.tools.usage.test.fakes.ReportingEclipseEnvironmentFake;
import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.Version;
/**
* @author Andre Dietisheim
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GoogleAnalyticsUrlStrategyTest.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GoogleAnalyticsUrlStrategyTest.java 2010-09-14 09:37:58 UTC (rev 24909)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/GoogleAnalyticsUrlStrategyTest.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -19,6 +19,7 @@
import org.jboss.tools.usage.googleanalytics.GoogleAnalyticsUrlStrategy;
import org.jboss.tools.usage.googleanalytics.IGoogleAnalyticsParameters;
import org.jboss.tools.usage.internal.JBossToolsUsageActivator;
+import org.jboss.tools.usage.test.fakes.ReportingEclipseEnvironmentFake;
import org.junit.Before;
import org.junit.Test;
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossComponentsTest.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossComponentsTest.java 2010-09-14 09:37:58 UTC (rev 24909)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossComponentsTest.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -1,78 +1,34 @@
package org.jboss.tools.usage.test;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import java.util.Collection;
-import org.eclipse.core.runtime.IBundleGroup;
import org.eclipse.core.runtime.IBundleGroupProvider;
import org.jboss.tools.usage.reporting.JBossComponents;
+import org.jboss.tools.usage.test.fakes.BundleGroupProviderFake;
import org.junit.Test;
import org.junit.matchers.JUnitMatchers;
-import org.osgi.framework.Bundle;
public class JBossComponentsTest {
@Test
public void reportedComponentsListIsComplete() {
- Collection<String> componentIds = JBossComponents.getComponentIds(getBundleGroupProviders());
+ Collection<String> componentIds = JBossComponents.getComponentIds(
+ new IBundleGroupProvider[] {
+ new BundleGroupProviderFake("org.jboss.tools.gwt.feature")
+ , new BundleGroupProviderFake(
+ "rubbish",
+ "org.jboss.tools.seam.feature")
+ , new BundleGroupProviderFake("org.jboss.tools.smooks.feature")
+ , new BundleGroupProviderFake("org.jboss.tools.usage.feature.bandname")
+ });
assertThat(componentIds, JUnitMatchers.hasItems(
- JBossComponents.JBossToolsFeatureNames.GWT.name(),
- JBossComponents.JBossToolsFeatureNames.SEAM.name(),
- JBossComponents.JBossToolsFeatureNames.SMOOKS.name()));
+ JBossComponents.JBossToolsFeatureNames.GWT.getAbbreviation(),
+ JBossComponents.JBossToolsFeatureNames.SEAM.getAbbreviation(),
+ JBossComponents.JBossToolsFeatureNames.SMOOKS.getAbbreviation()));
+ assertFalse(componentIds.contains(JBossComponents.JBossToolsFeatureNames.USAGE.getAbbreviation()));
}
-
- protected IBundleGroupProvider[] getBundleGroupProviders() {
- return new IBundleGroupProvider[] { new IBundleGroupProvider() {
-
- public String getName() {
- return "bundleGroupProviderFake";
- }
-
- public IBundleGroup[] getBundleGroups() {
- return new IBundleGroup[] {
- new BundleGroupFake("org.jboss.tools.usage")
- };
- }
- }
- };
- }
-
-
- private class BundleGroupFake implements IBundleGroup {
- private String name;
-
- private BundleGroupFake(String name) {
- this.name = name;
- }
-
- public String getIdentifier() {
- throw new UnsupportedOperationException();
- }
-
- public String getName() {
- return name;
- }
-
- public String getVersion() {
- throw new UnsupportedOperationException();
- }
-
- public String getDescription() {
- throw new UnsupportedOperationException();
- }
-
- public String getProviderName() {
- throw new UnsupportedOperationException();
- }
-
- public Bundle[] getBundles() {
- throw new UnsupportedOperationException();
- }
-
- public String getProperty(String key) {
- throw new UnsupportedOperationException();
- }
- }
}
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsUsageIntegrationTest.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsUsageIntegrationTest.java 2010-09-14 09:37:58 UTC (rev 24909)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossToolsUsageIntegrationTest.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -24,6 +24,8 @@
import org.jboss.tools.usage.PluginLogger;
import org.jboss.tools.usage.googleanalytics.GoogleAnalyticsUrlStrategy;
import org.jboss.tools.usage.googleanalytics.IGoogleAnalyticsParameters;
+import org.jboss.tools.usage.test.fakes.ReportingEclipseEnvironmentFake;
+import org.jboss.tools.usage.test.fakes.RepportingEclipseEnvironmentFakeSingleton;
import org.junit.Test;
/**
Deleted: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentFake.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentFake.java 2010-09-14 09:37:58 UTC (rev 24909)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentFake.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -1,69 +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.test;
-
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.jboss.tools.usage.googleanalytics.IUserAgent;
-import org.jboss.tools.usage.reporting.ReportingEclipseEnvironment;
-
-/**
- * @author Andre Dietisheim
- */
-public class ReportingEclipseEnvironmentFake extends ReportingEclipseEnvironment {
-
- public static final String GANALYTICS_ACCOUNTNAME = "UA-17645367-1";
- public static final String HOSTNAME = "jboss.org";
- public static final String JAVA_VERSION = "1.6.0_20";
-
- private String javaVersion;
-
- public ReportingEclipseEnvironmentFake() {
- this(GANALYTICS_ACCOUNTNAME, HOSTNAME, JAVA_VERSION, new EclipsePreferencesFake());
- }
-
- public ReportingEclipseEnvironmentFake(IEclipsePreferences preferences) {
- this(GANALYTICS_ACCOUNTNAME, HOSTNAME, JAVA_VERSION, preferences);
- }
-
- public ReportingEclipseEnvironmentFake(String accountName, String hostName) {
- this(accountName, hostName, JAVA_VERSION, new EclipsePreferencesFake());
- }
-
- public ReportingEclipseEnvironmentFake(String accountName, String hostName, String javaVersion,
- IEclipsePreferences preferences) {
- super(accountName, hostName, preferences);
- this.javaVersion = javaVersion;
- }
-
- @Override
- protected void initScreenSettings() {
- // do not access swt/display
- }
-
- @Override
- protected IUserAgent createEclipseUserAgent() {
- return new EclipseUserAgentFake();
- }
-
- @Override
- public String getScreenResolution() {
- return 1920 + SCREERESOLUTION_DELIMITER + 1080;
- }
-
- @Override
- public String getScreenColorDepth() {
- return 24 + SCREENCOLORDEPTH_POSTFIX;
- }
-
- public String getFlashVersion() {
- return javaVersion;
- }
-}
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentTest.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentTest.java 2010-09-14 09:37:58 UTC (rev 24909)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentTest.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.test;
import static org.junit.Assert.assertTrue;
@@ -5,13 +15,16 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.eclipse.core.runtime.IBundleGroup;
import org.eclipse.core.runtime.IBundleGroupProvider;
import org.jboss.tools.usage.googleanalytics.eclipse.AbstractEclipseEnvironment;
import org.jboss.tools.usage.reporting.JBossComponents;
+import org.jboss.tools.usage.test.fakes.BundleGroupProviderFake;
+import org.jboss.tools.usage.test.fakes.ReportingEclipseEnvironmentFake;
import org.junit.Test;
-import org.osgi.framework.Bundle;
+/**
+ * @author Andre Dietisheim
+ */
public class ReportingEclipseEnvironmentTest {
@Test
@@ -56,59 +69,5 @@
assertTrue(keyword != null && keyword.length() == 0);
}
- private static class BundleGroupProviderFake implements IBundleGroupProvider {
- private String[] featureNames;
-
- public BundleGroupProviderFake(String... featureNames) {
- this.featureNames = featureNames;
- }
-
- public String getName() {
- throw new UnsupportedOperationException();
- }
-
- public IBundleGroup[] getBundleGroups() {
- IBundleGroup[] bundleGroups = new IBundleGroup[featureNames.length];
- for (int i = 0; i < featureNames.length; i++) {
- bundleGroups[i] = createBundleGroup(featureNames[i]);
- }
- return bundleGroups;
- }
-
- private IBundleGroup createBundleGroup(final String name) {
- return new IBundleGroup() {
-
- public String getVersion() {
- throw new UnsupportedOperationException();
- }
-
- public String getProviderName() {
- throw new UnsupportedOperationException();
- }
-
- public String getProperty(String key) {
- throw new UnsupportedOperationException();
- }
-
- public String getName() {
- return name;
- }
-
- public String getIdentifier() {
- throw new UnsupportedOperationException();
- }
-
- public String getDescription() {
- throw new UnsupportedOperationException();
-
- }
-
- public Bundle[] getBundles() {
- throw new UnsupportedOperationException();
- }
- };
- }
-
- }
}
Deleted: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/RepportingEclipseEnvironmentFakeSingleton.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/RepportingEclipseEnvironmentFakeSingleton.java 2010-09-14 09:37:58 UTC (rev 24909)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/RepportingEclipseEnvironmentFakeSingleton.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -1,20 +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.test;
-
-/**
- * @author Andre Dietisheim
- */
-public class RepportingEclipseEnvironmentFakeSingleton {
-
- public static ReportingEclipseEnvironmentFake INSTANCE = new ReportingEclipseEnvironmentFake();
-
-}
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/UsageTestSuite.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/UsageTestSuite.java 2010-09-14 09:37:58 UTC (rev 24909)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/UsageTestSuite.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -13,17 +13,20 @@
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
+/**
+ * @author Andre Dietisheim
+ *
+ */
@RunWith(Suite.class)
-(a)Suite.SuiteClasses( {
+/**
+ */
+(a)Suite.SuiteClasses({
FocusPointTest.class,
GoogleAnalyticsUrlStrategyTest.class,
- JBossToolsUsageIntegrationTest.class,
EclipseUserAgentTest.class,
- GlobalUsageReportingSettingsTest.class})
-
-/**
- * @author Andre Dietisheim
- */
+ ReportingEclipseEnvironmentTest.class,
+ JBossComponentsTest.class,
+ GlobalUsageReportingSettingsTest.class,
+ JBossToolsUsageIntegrationTest.class })
public class UsageTestSuite {
-
-}
+}
\ No newline at end of file
Added: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/BundleGroupProviderFake.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/BundleGroupProviderFake.java (rev 0)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/BundleGroupProviderFake.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * 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.test.fakes;
+
+import org.eclipse.core.runtime.IBundleGroup;
+import org.eclipse.core.runtime.IBundleGroupProvider;
+import org.osgi.framework.Bundle;
+
+/*******************************************************************************
+ * 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
+ ******************************************************************************/
+public class BundleGroupProviderFake implements IBundleGroupProvider {
+
+ private String[] featureNames;
+
+ public BundleGroupProviderFake(String... featureNames) {
+ this.featureNames = featureNames;
+ }
+
+ public String getName() {
+ throw new UnsupportedOperationException();
+ }
+
+ public IBundleGroup[] getBundleGroups() {
+ IBundleGroup[] bundleGroups = new IBundleGroup[featureNames.length];
+ for (int i = 0; i < featureNames.length; i++) {
+ bundleGroups[i] = createBundleGroup(featureNames[i]);
+ }
+ return bundleGroups;
+ }
+
+ private IBundleGroup createBundleGroup(final String name) {
+ return new IBundleGroup() {
+
+ public String getVersion() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getProviderName() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getProperty(String key) {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getIdentifier() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getDescription() {
+ throw new UnsupportedOperationException();
+
+ }
+
+ public Bundle[] getBundles() {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/BundleGroupProviderFake.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/EclipsePreferencesFake.java (from rev 24574, trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipsePreferencesFake.java)
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/EclipsePreferencesFake.java (rev 0)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/EclipsePreferencesFake.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * 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.test.fakes;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IPreferenceNodeVisitor;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
+
+public class EclipsePreferencesFake implements IEclipsePreferences {
+
+ private Map<String, String> preferences;
+
+ public EclipsePreferencesFake() {
+ this.preferences = new HashMap<String, String>();
+ }
+
+ public void accept(IPreferenceNodeVisitor visitor) throws BackingStoreException {
+ throw new UnsupportedOperationException();
+ }
+
+ public void addNodeChangeListener(INodeChangeListener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void addPreferenceChangeListener(IPreferenceChangeListener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Preferences node(String path) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void removeNode() throws BackingStoreException {
+ throw new UnsupportedOperationException();
+ }
+
+ public void removeNodeChangeListener(INodeChangeListener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void removePreferenceChangeListener(IPreferenceChangeListener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+ public String absolutePath() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String[] childrenNames() throws BackingStoreException {
+ throw new UnsupportedOperationException();
+ }
+
+ public void clear() throws BackingStoreException {
+ this.preferences.clear();
+ }
+
+ public void flush() throws BackingStoreException {
+ }
+
+ public String get(String key, String defaultValue) {
+ String value = preferences.get(key);
+ if (value == null) {
+ value = defaultValue;
+ }
+ return value;
+ }
+
+ public boolean getBoolean(String key, boolean defaultValue) {
+ throw new UnsupportedOperationException();
+ }
+
+ public byte[] getByteArray(String key, byte[] defaultValue) {
+ throw new UnsupportedOperationException();
+ }
+
+ public double getDouble(String key, double defaultValue) {
+ throw new UnsupportedOperationException();
+ }
+
+ public float getFloat(String key, float defaultValue) {
+ throw new UnsupportedOperationException();
+ }
+
+ public int getInt(String key, int defaultValue) {
+ throw new UnsupportedOperationException();
+ }
+
+ public long getLong(String key, long defaultValue) {
+ String value = preferences.get(key);
+ if (value != null) {
+ return Long.valueOf(value);
+ } else {
+ return defaultValue;
+ }
+ }
+
+ public String[] keys() throws BackingStoreException {
+ throw new UnsupportedOperationException();
+ }
+
+ public String name() {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean nodeExists(String pathName) throws BackingStoreException {
+ throw new UnsupportedOperationException();
+ }
+
+ public Preferences parent() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void put(String key, String value) {
+ preferences.put(key, value);
+ }
+
+ public void putBoolean(String key, boolean value) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void putByteArray(String key, byte[] value) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void putDouble(String key, double value) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void putFloat(String key, float value) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void putInt(String key, int value) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void putLong(String key, long value) {
+ preferences.put(key, String.valueOf(value));
+ }
+
+ public void remove(String key) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void sync() throws BackingStoreException {
+ // ignore
+ }
+}
\ No newline at end of file
Property changes on: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/EclipsePreferencesFake.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/EclipseUserAgentFake.java (from rev 24874, trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipseUserAgentFake.java)
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/EclipseUserAgentFake.java (rev 0)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/EclipseUserAgentFake.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -0,0 +1,85 @@
+package org.jboss.tools.usage.test.fakes;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.usage.googleanalytics.eclipse.EclipseUserAgent;
+
+public class EclipseUserAgentFake extends EclipseUserAgent {
+
+ private static final String APPLICATION_NAME = "com.jboss.jbds.product";
+ private static final String APPLICATION_VERSION = "3.0.1";
+
+ public static final String LOCALE_US = "en_US";
+
+ public static final String WIN2000_VERSION = "5.0";
+ public static final String WINXP_VERSION = "5.1";
+ public static final String VISTA_VERSION = "6.0";
+ public static final String WIN7_VERSION = "6.1";
+ public static final String MACLEOPARD_VERSION = "10.5";
+ public static final String MACSNOWLEOPARD_VERSION = "10.6";
+
+ private String applicationName;
+ private String applicationVersion;
+ private String nl;
+ private String os;
+ private String osVersion;
+
+ public EclipseUserAgentFake() {
+ this(APPLICATION_NAME, APPLICATION_VERSION, LOCALE_US, Platform.OS_WIN32, WIN7_VERSION);
+ }
+
+ public EclipseUserAgentFake(String nl) {
+ this(APPLICATION_NAME, APPLICATION_VERSION, nl, Platform.OS_WIN32, WIN7_VERSION);
+ }
+
+ public EclipseUserAgentFake(String nl, String os, String osVersion) {
+ this(APPLICATION_NAME, APPLICATION_VERSION, nl, os, osVersion);
+ }
+
+ /**
+ * Instantiates a fake of the EclipseUserAgent class
+ *
+ * @param applicationName the name of the applicaiton
+ * @param applicationVersion the version of the application
+ * @param nl the platform locale as returned from <code>Platform.getNL()</code>
+ * @param os the os name as return from <code>Platform.getOS()</code>
+ * @param osVersion the version of the os as returned from <code>System.getProperty("os.name")</code>
+ *
+ * @see Platform#getNL()
+ * @see Platform#getOS()
+ * @see System#getProperty("os.version")
+ */
+ public EclipseUserAgentFake(String applicationName, String applicationVersion, String nl, String os, String osVersion) {
+ Assert.isTrue(nl != null && nl.indexOf(JAVA_LOCALE_DELIMITER) >= 0, "nl parameter must for a java locale string <xx_XX>");
+ this.applicationName = applicationName;
+ this.applicationVersion = applicationVersion;
+ this.nl = nl;
+ this.os = os;
+ this.osVersion = osVersion;
+ }
+
+ @Override
+ protected String getNL() {
+ return nl;
+ }
+
+ @Override
+ protected String getApplicationName() {
+ return applicationName;
+ }
+
+ @Override
+ protected String getOS() {
+ return os;
+ }
+
+ @Override
+ protected String getOSVersion() {
+ return osVersion;
+ }
+
+ @Override
+ protected String getApplicationVersion() {
+ return applicationVersion;
+ }
+}
\ No newline at end of file
Property changes on: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/EclipseUserAgentFake.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/ReportingEclipseEnvironmentFake.java (from rev 24874, trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentFake.java)
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/ReportingEclipseEnvironmentFake.java (rev 0)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/ReportingEclipseEnvironmentFake.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * 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.test.fakes;
+
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.jboss.tools.usage.googleanalytics.IUserAgent;
+import org.jboss.tools.usage.reporting.ReportingEclipseEnvironment;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class ReportingEclipseEnvironmentFake extends ReportingEclipseEnvironment {
+
+ public static final String GANALYTICS_ACCOUNTNAME = "UA-17645367-1";
+ public static final String HOSTNAME = "jboss.org";
+ public static final String JAVA_VERSION = "1.6.0_20";
+
+ private String javaVersion;
+
+ public ReportingEclipseEnvironmentFake() {
+ this(GANALYTICS_ACCOUNTNAME, HOSTNAME, JAVA_VERSION, new EclipsePreferencesFake());
+ }
+
+ public ReportingEclipseEnvironmentFake(IEclipsePreferences preferences) {
+ this(GANALYTICS_ACCOUNTNAME, HOSTNAME, JAVA_VERSION, preferences);
+ }
+
+ public ReportingEclipseEnvironmentFake(String accountName, String hostName) {
+ this(accountName, hostName, JAVA_VERSION, new EclipsePreferencesFake());
+ }
+
+ public ReportingEclipseEnvironmentFake(String accountName, String hostName, String javaVersion,
+ IEclipsePreferences preferences) {
+ super(accountName, hostName, preferences);
+ this.javaVersion = javaVersion;
+ }
+
+ @Override
+ protected void initScreenSettings() {
+ // do not access swt/display
+ }
+
+ @Override
+ protected IUserAgent createEclipseUserAgent() {
+ return new EclipseUserAgentFake();
+ }
+
+ @Override
+ public String getScreenResolution() {
+ return 1920 + SCREERESOLUTION_DELIMITER + 1080;
+ }
+
+ @Override
+ public String getScreenColorDepth() {
+ return 24 + SCREENCOLORDEPTH_POSTFIX;
+ }
+
+ public String getFlashVersion() {
+ return javaVersion;
+ }
+}
Property changes on: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/ReportingEclipseEnvironmentFake.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/RepportingEclipseEnvironmentFakeSingleton.java (from rev 24874, trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/RepportingEclipseEnvironmentFakeSingleton.java)
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/RepportingEclipseEnvironmentFakeSingleton.java (rev 0)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/RepportingEclipseEnvironmentFakeSingleton.java 2010-09-14 11:17:13 UTC (rev 24910)
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * 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.test.fakes;
+
+
+/**
+ * @author Andre Dietisheim
+ */
+public class RepportingEclipseEnvironmentFakeSingleton {
+
+ public static ReportingEclipseEnvironmentFake INSTANCE = new ReportingEclipseEnvironmentFake();
+
+}
Property changes on: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/RepportingEclipseEnvironmentFakeSingleton.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 7 months
JBoss Tools SVN: r24909 - in trunk/usage/tests/org.jboss.tools.usage.test: META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-09-14 05:37:58 -0400 (Tue, 14 Sep 2010)
New Revision: 24909
Added:
trunk/usage/tests/org.jboss.tools.usage.test/JBossComponentsTest.launch
trunk/usage/tests/org.jboss.tools.usage.test/ReportingEclipseEnvironmentTest.launch
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossComponentsTest.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentTest.java
Modified:
trunk/usage/tests/org.jboss.tools.usage.test/JBossToolsUsageRequestsTest.launch
trunk/usage/tests/org.jboss.tools.usage.test/META-INF/MANIFEST.MF
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipseUserAgentTest.java
Log:
[JBIDE-7035] implemented & tested
Added: trunk/usage/tests/org.jboss.tools.usage.test/JBossComponentsTest.launch
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/JBossComponentsTest.launch (rev 0)
+++ trunk/usage/tests/org.jboss.tools.usage.test/JBossComponentsTest.launch 2010-09-14 09:37:58 UTC (rev 24909)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<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="true"/>
+<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"/>
+<stringAttribute key="deselected_workspace_plugins" value="org.jboss.tools.gwt.core,org.jboss.tools.gwt.ui,org.jboss.tools.common,org.jboss.tools.common.model"/>
+<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/JBossComponentsTest.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.run"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+</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.MAIN_TYPE" value="org.jboss.tools.usage.test.JBossComponentsTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<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="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -XX:MaxPermSize=256m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xms40m -Xmx512m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
+<booleanAttribute key="run_in_ui_thread" value="true"/>
+<stringAttribute key="selected_target_plugins" value="javax.activation@default:default,org.eclipse.equinox.app@default:default,org.junit4@default:default,org.eclipse.core.filesystem.macosx@default:false,org.eclipse.core.runtime.compatibility.registry@default:false,javax.servlet@default:default,org.eclipse.core.runtime@default:true,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.swt.cocoa.macosx.x86_64@default:false,org.eclipse.update.configurator@3:true,org.apache.jasper@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.text@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.osgi.services@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ui.ide.application@default:default,org.eclipse.ant.core@default:default,org.apache.lucene@default:default,org.eclipse.ui@default:default,org!
.eclipse.ecf.filetransfer@default:default,org.eclipse.osgi@-1:true,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.apache.ant@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.jface.text@default:default,org.mortbay.jetty.server@default:default,org.eclipse.core.databinding@default:default,org.eclipse.help@default:default,org.eclipse.net4j.jms.api@default:default,org.apache.lucene.analysis@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.swt@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.http.jetty@default:default,org.hamcrest.core@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.common@2:true,org.eclipse.swtbot.ant.optional.junit4@default:false,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.p2.!
core@default:default,ch.qos.logback.classic@default:default,or!
g.eclips
e.equinox.security.macosx@default:false,org.eclipse.help.base@default:default,org.eclipse.ui.views@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.help.ui@default:default,org.eclipse.equinox.concurrent@default:default,ch.qos.logback.slf4j@default:false,ch.qos.logback.core@default:default,org.eclipse.core.variables@default:default,org.eclipse.ecf.identity@default:default,org.slf4j.api@default:default,org.eclipse.core.net@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.core.resources@default:default,org.mortbay.jetty.util@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.core.jobs@default:default,org.eclipse.equinox.security@default:default,org.eclipse.core.commands@default:default,org.apache.commons.logging*1.1.1.v201005080502@default:default,org.apache.commons.el!
@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.sdk@default:default,javax.servlet.jsp@default:default,org.eclipse.ui.cocoa@default:false,javax.mail@default:default,com.ibm.icu@default:default,org.eclipse.jface@default:default,org.eclipse.ecf@default:default,org.eclipse.ui.workbench@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.jboss.tools.usage.test@default:default,org.jboss.tools.usage@default:default,org.jboss.tools.xulrunner.initializer@default:false"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" 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/JBossComponentsTest.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/usage/tests/org.jboss.tools.usage.test/JBossToolsUsageRequestsTest.launch
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/JBossToolsUsageRequestsTest.launch 2010-09-14 09:37:06 UTC (rev 24908)
+++ trunk/usage/tests/org.jboss.tools.usage.test/JBossToolsUsageRequestsTest.launch 2010-09-14 09:37:58 UTC (rev 24909)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
<booleanAttribute key="append.args" value="true"/>
<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
@@ -21,8 +21,8 @@
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
<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"/>
@@ -36,8 +36,8 @@
<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="javax.transaction@default:false,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.hamcrest.core@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.common@default:default,org.eclipse.text@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.contenttype@default:default,org.eclipse.core.commands@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.ui.cocoa@default:false,org.eclipse.jface.databinding@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.core.expressions@default:default,org.junit4@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse!
.ui.workbench@default:default,org.eclipse.jface.text@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.equinox.app@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.equinox.preferences@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.equinox.transforms.hook@default:false,com.ibm.icu@default:default,org.eclipse.core.variables@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.ui.views@default:default,org.eclipse.core.resources.compatibility@default:false,org.eclipse.equinox.security.macosx@default:false,org.eclipse.swt@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.help@default:default,org.eclipse.osgi,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.core.filesystem@default:default,!
org.eclipse.ecf@default:default,org.eclipse.core.databinding@d!
efault:d
efault,org.eclipse.core.jobs@default:default,org.eclipse.ant.core@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.eclipse.equinox.concurrent@default:default,org.eclipse.core.filesystem.macosx@default:false,org.eclipse.swt.cocoa.macosx@default:false,org.eclipse.ui@default:default,org.eclipse.core.net@default:default,org.eclipse.equinox.security@default:default,org.eclipse.ui.ide@default:default,org.eclipse.jface@default:default,javax.servlet@default:default,org.eclipse.osgi.services@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="org.jboss.tools.usage.test@default:default,org.jboss.tools.usage@default:default"/>
+<stringAttribute key="selected_target_plugins" value="org.eclipse.equinox.app@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.junit4@default:default,org.eclipse.core.filesystem.macosx@default:false,org.eclipse.core.runtime.compatibility.registry@default:false,javax.servlet@default:default,org.eclipse.core.runtime@default:true,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.text@default:default,org.eclipse.osgi.services@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ant.core@default:default,org.eclipse.ui@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.osgi@-1:true,org.eclipse.core.databinding.property@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.contenttype@default:default,org.ecli!
pse.jface.text@default:default,org.eclipse.core.databinding@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.help@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.swt@default:default,org.eclipse.equinox.p2.engine@default:default,org.hamcrest.core@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.security.macosx@default:false,org.eclipse.ui.views@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.ui.ide@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.core.variables@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.core.net@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.ecf.provider.filetransfer@def!
ault:default,org.eclipse.core.jobs@default:default,org.eclipse!
.equinox
.security@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.ui.cocoa@default:false,com.ibm.icu@default:default,org.eclipse.jface@default:default,org.eclipse.ecf@default:default,org.eclipse.ui.workbench@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.jboss.tools.usage.test@default:default,org.jboss.tools.gwt.ui@default:default,org.jboss.tools.usage@default:default,org.jboss.tools.common.model@default:default,org.jboss.tools.gwt.core@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.jboss.tools.common@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
Modified: trunk/usage/tests/org.jboss.tools.usage.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/META-INF/MANIFEST.MF 2010-09-14 09:37:06 UTC (rev 24908)
+++ trunk/usage/tests/org.jboss.tools.usage.test/META-INF/MANIFEST.MF 2010-09-14 09:37:58 UTC (rev 24909)
@@ -7,6 +7,6 @@
Require-Bundle: org.jboss.tools.usage;bundle-version="1.0.0",
org.eclipse.osgi;bundle-version="3.5.2",
org.eclipse.core.runtime;bundle-version="3.5.0",
- org.junit4;bundle-version="4.0.0"
+ org.junit4;bundle-version="[4.8.1,5.0.0)"
Bundle-Activator: org.jboss.tools.usage.test.JBossToolsUsageTestActivator
Bundle-ActivationPolicy: lazy
Added: trunk/usage/tests/org.jboss.tools.usage.test/ReportingEclipseEnvironmentTest.launch
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/ReportingEclipseEnvironmentTest.launch (rev 0)
+++ trunk/usage/tests/org.jboss.tools.usage.test/ReportingEclipseEnvironmentTest.launch 2010-09-14 09:37:58 UTC (rev 24909)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<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="true"/>
+<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="true"/>
+<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/ReportingEclipseEnvironmentTest.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.run"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+</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.MAIN_TYPE" value="org.jboss.tools.usage.test.ReportingEclipseEnvironmentTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<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="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -XX:MaxPermSize=256m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xms40m -Xmx512m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
+<booleanAttribute key="run_in_ui_thread" value="true"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" 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/ReportingEclipseEnvironmentTest.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipseUserAgentTest.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipseUserAgentTest.java 2010-09-14 09:37:06 UTC (rev 24908)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/EclipseUserAgentTest.java 2010-09-14 09:37:58 UTC (rev 24909)
@@ -69,30 +69,6 @@
assertOs("Windows", "Windows NT " + EclipseUserAgentFake.WIN7_VERSION, userAgent);
}
- @Test
- public void testKeyword() {
- AbstractEclipseEnvironment eclipseEnvironment = new ReportingEclipseEnvironmentFake() {
- @Override
- protected Bundle[] getBundles() {
- return new Bundle[] {
- new BundleSymbolicNameFake("org.jboss.tools.seam.ui"),
- new BundleSymbolicNameFake("org.jboss.tools.seam.core"),
- new BundleSymbolicNameFake("org.jboss.tools.gwt.ui"),
- new BundleSymbolicNameFake("org.jboss.tools.gwt.core"),
- new BundleSymbolicNameFake("org.jboss.tools.smooks.core"),
- new BundleSymbolicNameFake("org.eclipse.core.runtime"),
- };
- }
- };
- String keyword = eclipseEnvironment.getKeyword();
-
- Matcher matcher = Pattern.compile("(([A-Z]+)-){3}").matcher(keyword);
- assertTrue(matcher.matches());
- assertTrue(keyword.indexOf(JBossComponents.BundleGroup.GWT.name()) >= 0);
- assertTrue(keyword.indexOf(JBossComponents.BundleGroup.SEAM.name()) >= 0);
- assertTrue(keyword.indexOf(JBossComponents.BundleGroup.SMOOKS.name()) >= 0);
- }
-
private void assertApplicationNameAndVersion(String applicationName, String applicationVersion, String userAgent) {
Matcher matcher = Pattern.compile("([a-zA-Z\\.]+)/([0-9\\.]+).+").matcher(userAgent);
assertTrue(matcher.matches());
@@ -116,122 +92,6 @@
assertEquals(language, matcher.group(1));
}
- private class BundleSymbolicNameFake implements Bundle {
-
- private String symbolicName;
-
- public BundleSymbolicNameFake(String symbolicName) {
- this.symbolicName = symbolicName;
- }
-
- public Enumeration<?> findEntries(String path, String filePattern, boolean recurse) {
- throw new UnsupportedOperationException();
- }
-
- public BundleContext getBundleContext() {
- throw new UnsupportedOperationException();
- }
-
- public long getBundleId() {
- throw new UnsupportedOperationException();
- }
-
- public URL getEntry(String path) {
- throw new UnsupportedOperationException();
- }
-
- public Enumeration<?> getEntryPaths(String path) {
- throw new UnsupportedOperationException();
- }
-
- public Dictionary<?, ?> getHeaders() {
- throw new UnsupportedOperationException();
- }
-
- public Dictionary<?, ?> getHeaders(String locale) {
- throw new UnsupportedOperationException();
- }
-
- public long getLastModified() {
- throw new UnsupportedOperationException();
- }
-
- public String getLocation() {
- throw new UnsupportedOperationException();
- }
-
- public ServiceReference[] getRegisteredServices() {
- throw new UnsupportedOperationException();
- }
-
- public URL getResource(String name) {
- throw new UnsupportedOperationException();
- }
-
- public Enumeration<?> getResources(String name) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- public ServiceReference[] getServicesInUse() {
- throw new UnsupportedOperationException();
- }
-
- public Map<?, ?> getSignerCertificates(int signersType) {
- throw new UnsupportedOperationException();
- }
-
- public int getState() {
- throw new UnsupportedOperationException();
- }
-
- public String getSymbolicName() {
- return this.symbolicName;
- }
-
- public Version getVersion() {
- throw new UnsupportedOperationException();
-
- }
-
- public boolean hasPermission(Object permission) {
- throw new UnsupportedOperationException();
-
- }
-
- public Class<?> loadClass(String name) throws ClassNotFoundException {
- throw new UnsupportedOperationException();
- }
-
- public void start() throws BundleException {
- throw new UnsupportedOperationException();
-
- }
-
- public void start(int options) throws BundleException {
- throw new UnsupportedOperationException();
- }
-
- public void stop() throws BundleException {
- throw new UnsupportedOperationException();
- }
-
- public void stop(int options) throws BundleException {
- throw new UnsupportedOperationException();
- }
-
- public void uninstall() throws BundleException {
- throw new UnsupportedOperationException();
- }
-
- public void update() throws BundleException {
- throw new UnsupportedOperationException();
- }
-
- public void update(InputStream input) throws BundleException {
- throw new UnsupportedOperationException();
- }
- }
-
@Test
public void testVisitsOnFirstVisit() {
EclipsePreferencesFake preferences = new EclipsePreferencesFake();
Added: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossComponentsTest.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossComponentsTest.java (rev 0)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossComponentsTest.java 2010-09-14 09:37:58 UTC (rev 24909)
@@ -0,0 +1,78 @@
+package org.jboss.tools.usage.test;
+
+import static org.junit.Assert.assertThat;
+
+import java.util.Collection;
+
+import org.eclipse.core.runtime.IBundleGroup;
+import org.eclipse.core.runtime.IBundleGroupProvider;
+import org.jboss.tools.usage.reporting.JBossComponents;
+import org.junit.Test;
+import org.junit.matchers.JUnitMatchers;
+import org.osgi.framework.Bundle;
+
+public class JBossComponentsTest {
+
+ @Test
+ public void reportedComponentsListIsComplete() {
+ Collection<String> componentIds = JBossComponents.getComponentIds(getBundleGroupProviders());
+
+ assertThat(componentIds, JUnitMatchers.hasItems(
+ JBossComponents.JBossToolsFeatureNames.GWT.name(),
+ JBossComponents.JBossToolsFeatureNames.SEAM.name(),
+ JBossComponents.JBossToolsFeatureNames.SMOOKS.name()));
+ }
+
+ protected IBundleGroupProvider[] getBundleGroupProviders() {
+ return new IBundleGroupProvider[] { new IBundleGroupProvider() {
+
+ public String getName() {
+ return "bundleGroupProviderFake";
+ }
+
+ public IBundleGroup[] getBundleGroups() {
+ return new IBundleGroup[] {
+ new BundleGroupFake("org.jboss.tools.usage")
+ };
+ }
+ }
+ };
+ }
+
+
+ private class BundleGroupFake implements IBundleGroup {
+ private String name;
+
+ private BundleGroupFake(String name) {
+ this.name = name;
+ }
+
+ public String getIdentifier() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getVersion() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getDescription() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getProviderName() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Bundle[] getBundles() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getProperty(String key) {
+ throw new UnsupportedOperationException();
+ }
+ }
+}
Property changes on: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/JBossComponentsTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentTest.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentTest.java (rev 0)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentTest.java 2010-09-14 09:37:58 UTC (rev 24909)
@@ -0,0 +1,114 @@
+package org.jboss.tools.usage.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.runtime.IBundleGroup;
+import org.eclipse.core.runtime.IBundleGroupProvider;
+import org.jboss.tools.usage.googleanalytics.eclipse.AbstractEclipseEnvironment;
+import org.jboss.tools.usage.reporting.JBossComponents;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+
+public class ReportingEclipseEnvironmentTest {
+
+ @Test
+ public void keywordReportsJbossComponents() {
+ AbstractEclipseEnvironment eclipseEnvironment = new ReportingEclipseEnvironmentFake() {
+
+ @Override
+ protected IBundleGroupProvider[] getBundleGroupProviders() {
+ return new IBundleGroupProvider[] {
+ new BundleGroupProviderFake(
+ "org.jboss.tools.gwt.feature",
+ "org.jboss.tools.seam.feature",
+ "org.jboss.tools.smooks.feature")
+ };
+ }
+ };
+
+ String keyword = eclipseEnvironment.getKeyword();
+
+ Matcher matcher = Pattern.compile("(([A-Z]+)-){3}").matcher(keyword);
+ assertTrue(matcher.matches());
+ assertTrue(keyword.indexOf(JBossComponents.JBossToolsFeatureNames.GWT.name()) >= 0);
+ assertTrue(keyword.indexOf(JBossComponents.JBossToolsFeatureNames.SEAM.name()) >= 0);
+ assertTrue(keyword.indexOf(JBossComponents.JBossToolsFeatureNames.SMOOKS.name()) >= 0);
+ }
+
+ @Test
+ public void keywordIsEmptyIfNoJBossFeaturesFound() {
+ AbstractEclipseEnvironment eclipseEnvironment = new ReportingEclipseEnvironmentFake() {
+
+ @Override
+ protected IBundleGroupProvider[] getBundleGroupProviders() {
+ return new IBundleGroupProvider[] {
+ new BundleGroupProviderFake(
+ "org.jboss.tools.gwt",
+ "org.eclipse.emf.cdo")
+ };
+ }
+ };
+
+ String keyword = eclipseEnvironment.getKeyword();
+ assertTrue(keyword != null && keyword.length() == 0);
+ }
+
+ private static class BundleGroupProviderFake implements IBundleGroupProvider {
+
+ private String[] featureNames;
+
+ public BundleGroupProviderFake(String... featureNames) {
+ this.featureNames = featureNames;
+ }
+
+ public String getName() {
+ throw new UnsupportedOperationException();
+ }
+
+ public IBundleGroup[] getBundleGroups() {
+ IBundleGroup[] bundleGroups = new IBundleGroup[featureNames.length];
+ for (int i = 0; i < featureNames.length; i++) {
+ bundleGroups[i] = createBundleGroup(featureNames[i]);
+ }
+ return bundleGroups;
+ }
+
+ private IBundleGroup createBundleGroup(final String name) {
+ return new IBundleGroup() {
+
+ public String getVersion() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getProviderName() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getProperty(String key) {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getIdentifier() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getDescription() {
+ throw new UnsupportedOperationException();
+
+ }
+
+ public Bundle[] getBundles() {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+
+ }
+}
Property changes on: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/ReportingEclipseEnvironmentTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 7 months
JBoss Tools SVN: r24908 - in trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage: util and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-09-14 05:37:06 -0400 (Tue, 14 Sep 2010)
New Revision: 24908
Added:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/CollectionFilterUtils.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/CompositeCollectionFilter.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/ICollectionEntryConverter.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/ICollectionFilter.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/NoopConverter.java
Removed:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/CollectionFilterUtils.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/ICollectionEntryFilter.java
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/JBossComponents.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/ReportingEclipseEnvironment.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/BundleUtils.java
Log:
[JBIDE-7035] implemented & tested
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/JBossComponents.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/JBossComponents.java 2010-09-14 03:59:49 UTC (rev 24907)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/JBossComponents.java 2010-09-14 09:37:06 UTC (rev 24908)
@@ -17,244 +17,99 @@
import org.eclipse.core.runtime.IBundleGroup;
import org.eclipse.core.runtime.IBundleGroupProvider;
-import org.jboss.tools.usage.util.BundleUtils;
-import org.jboss.tools.usage.util.CollectionFilterUtils;
-import org.jboss.tools.usage.util.ICollectionEntryFilter;
-import org.osgi.framework.Bundle;
+import org.jboss.tools.usage.util.collectionfilter.CollectionFilterUtils;
+import org.jboss.tools.usage.util.collectionfilter.CompositeCollectionFilter;
+import org.jboss.tools.usage.util.collectionfilter.ICollectionFilter;
/**
* @author Andre Dietisheim
*/
public class JBossComponents {
- public enum BundleGroup {
- ARCHIVES("org.jboss.ide.eclipse.archives.core",
- "org.jboss.ide.eclipse.archives.jdt.integration",
- "org.jboss.ide.eclipse.archives.ui"
- )
- , AS("org.jboss.ide.eclipse.archives.webtools",
- "org.jboss.ide.eclipse.as.classpath.core",
- "org.jboss.ide.eclipse.as.classpath.ui",
- "org.jboss.ide.eclipse.as.core",
- "org.jboss.ide.eclipse.as.doc.user",
- "org.jboss.ide.eclipse.as.ssh",
- "org.jboss.ide.eclipse.as.ui",
- "org.jboss.ide.eclipse.as.ui.mbeans",
- "org.jboss.ide.eclipse.as.wtp.core",
- "org.jboss.ide.eclipse.as.wtp.ui")
- , BIRT("org.jboss.tools.birt.core",
- "org.jboss.tools.birt.oda",
- "org.jboss.tools.birt.oda.ui")
- , BPEL("org.eclipse.bpel.apache.ode.deploy.model",
- "org.eclipse.bpel.apache.ode.deploy.ui",
- "org.eclipse.bpel.common.model",
- "org.eclipse.bpel.common.ui",
- "org.eclipse.bpel.model",
- "org.eclipse.bpel.ui",
- "org.eclipse.bpel.validator",
- "org.eclipse.bpel.wsil.model",
- "org.eclipse.bpel.xpath10",
- "org.jboss.tools.bpel.cheatsheet",
- "org.jboss.tools.bpel.runtimes")
- , CDI("org.jboss.tools.cdi.core",
- "org.jboss.tools.cdi.text.ext",
- "org.jboss.tools.cdi.ui",
- "org.jboss.tools.cdi.xml",
- "org.jboss.tools.cdi.xml.ui")
- , DELTACLOUD("org.jboss.tools.deltacloud.core",
- "org.jboss.tools.deltacloud.ui")
- , DROOLS("org.drools.eclipse",
- "org.drools.eclipse.task",
- "org.eclipse.webdav",
- "org.guvnor.tools",
- "org.jboss.tools.flow.ruleflow")
- , ESB("org.jboss.tools.esb.core",
- "org.jboss.tools.esb.project.core",
- "org.jboss.tools.esb.project.ui",
- "org.jboss.tools.esb.ui",
- "org.jboss.tools.esb.validator")
- , FLOW("org.jboss.tools.flow.common")
- , FREEMARKER("org.jboss.ide.eclipse.freemarker")
- , GWT("org.jboss.tools.gwt.core",
- "org.jboss.tools.gwt.ui")
- , HIBERNATETOOLS("org.hibernate.eclipse",
- "org.hibernate.eclipse.console",
- "org.hibernate.eclipse.help",
- "org.hibernate.eclipse.jdt.apt.ui",
- "org.hibernate.eclipse.jdt.ui",
- "org.hibernate.eclipse.mapper",
- "org.jboss.tools.hibernate.jpt.core",
- "org.jboss.tools.hibernate.jpt.ui",
- "org.jboss.tools.hibernate.ui",
- "org.jboss.tools.hibernate.xml",
- "org.jboss.tools.hibernate.xml.ui")
- , JBPM("org.jboss.tools.flow.jpdl4",
- "org.jboss.tools.flow.jpdl4.multipage",
- "org.jboss.tools.jbpm.common",
- "org.jboss.tools.jbpm.convert",
- "org.jbpm.gd.jpdl")
- , JMX("org.jboss.tools.jmx.core",
- "org.jboss.tools.jmx.ui")
- , JSF("org.jboss.tools.jsf",
- "org.jboss.tools.jsf.doc.user",
- "org.jboss.tools.jsf.text.ext",
- "org.jboss.tools.jsf.text.ext.facelets",
- "org.jboss.tools.jsf.text.ext.richfaces",
- "org.jboss.tools.jsf.ui",
- "org.jboss.tools.jsf.verification",
- "org.jboss.tools.jsf.vpe.ajax4jsf",
- "org.jboss.tools.jsf.vpe.facelets",
- "org.jboss.tools.jsf.vpe.jbpm",
- "org.jboss.tools.jsf.vpe.jsf",
- "org.jboss.tools.jsf.vpe.jstl",
- "org.jboss.tools.jsf.vpe.myfaces",
- "org.jboss.tools.jsf.vpe.richfaces",
- "org.jboss.tools.jsf.vpe.seam")
- , JST("org.jboss.tools.jst.css",
- "org.jboss.tools.jst.firstrun",
- "org.jboss.tools.jst.jsp",
- "org.jboss.tools.jst.text.ext",
- "org.jboss.tools.jst.web",
- "org.jboss.tools.jst.web.kb",
- "org.jboss.tools.jst.web.tiles",
- "org.jboss.tools.jst.web.tiles.ui",
- "org.jboss.tools.jst.web.ui",
- "org.jboss.tools.jst.web.verification")
- , LABS("org.jboss.tools.labs.pde.sourceprovider")
- , MAVEN("org.jboss.tools.maven.cdi",
- "org.jboss.tools.maven.core",
- "org.jboss.tools.maven.hibernate",
- "org.jboss.tools.maven.jsf",
- "org.jboss.tools.maven.portlet",
- "org.jboss.tools.maven.seam",
- "org.jboss.tools.maven.ui")
- , MODESHAPE("org.jboss.tools.modeshape.rest")
- , PORTLET("org.jboss.tools.portlet.core",
- "org.jboss.tools.portlet.ui")
- , PROFILER("org.jboss.tools.profiler.ui")
- , RUNTIME("org.jboss.tools.runtime")
- , SEAM("org.jboss.tools.seam.core",
- "org.jboss.tools.seam.doc.user",
- "org.jboss.tools.seam.pages.xml",
- "org.jboss.tools.seam.text.ext",
- "org.jboss.tools.seam.ui",
- "org.jboss.tools.seam.ui.pages",
- "org.jboss.tools.seam.xml",
- "org.jboss.tools.seam.xml.ui")
- , SMOOKS("org.jboss.tools.smooks.core",
- "org.jboss.tools.smooks.runtime",
- "org.jboss.tools.smooks.templating",
- "org.jboss.tools.smooks.ui")
- , STRUTS("org.jboss.tools.struts",
- "org.jboss.tools.struts.text.ext",
- "org.jboss.tools.struts.ui",
- "org.jboss.tools.struts.validator.ui",
- "org.jboss.tools.struts.verification",
- "org.jboss.tools.struts.vpe.struts")
- , TPTP("org.jboss.tools.eclipse.as.tptp")
- , VPE("org.jboss.tools.vpe",
- "org.jboss.tools.vpe.docbook",
- "org.jboss.tools.vpe.html",
- "org.jboss.tools.vpe.jsp",
- "org.jboss.tools.vpe.resref",
- "org.jboss.tools.vpe.spring",
- "org.jboss.tools.vpe.ui.palette",
- "org.jboss.tools.vpe.xulrunner",
- "org.jboss.tools.xulrunner",
- "org.jboss.tools.xulrunner.initializer")
- , WORKINGSET("org.jboss.tools.workingset.core",
- "org.jboss.tools.workingset.ui")
- , WS("rg.jboss.tools.ws.core",
- "org.jboss.tools.ws.creation.core",
- "org.jboss.tools.ws.creation.ui",
- "org.jboss.tools.ws.ui")
- , XULRUNNER("org.mozilla.xpcom",
- "org.mozilla.xulrunner.carbon.macosx",
- "org.mozilla.xulrunner.cocoa.macosx",
- "org.mozilla.xulrunner.gtk.linux.x86",
- "org.mozilla.xulrunner.gtk.linux.x86_64",
- "org.mozilla.xulrunner.win32.win32.x86");
+ public enum JBossToolsFeatureNames {
+ ARCHIVES("org.jboss.ide.eclipse.archives.feature"),
+ BIRT("org.jboss.tools.birt.feature"),
+ BPEL("org.jboss.tools.bpel.feature"),
+ CDI("org.jboss.tools.cdi.feature"),
+ COMMON("org.jboss.tools.common.feature"),
+ DELTACLOUD("org.jboss.tools.deltacloud.feature"),
+ DROOLS("org.drools.eclipse.feature"),
+ ESB("org.jboss.tools.esb.feature"),
+ EXAMPLES("org.jboss.tools.project.examples.feature"),
+ FLOW("org.jboss.tools.flow.common.feature"),
+ FREEMARKER("org.jboss.ide.eclipse.freemarker.feature"),
+ GWT("org.jboss.tools.gwt.feature"),
+ HIBERNATETOOLS("org.hibernate.eclipse.feature"),
+ JBPM("org.jboss.tools.jbpm.common.feature"),
+ JMX("org.jboss.tools.jmx.feature"),
+ JSF("org.jboss.tools.jsf.feature"),
+ MAVEN("org.jboss.tools.maven.feature"),
+ MODESHAPE("org.jboss.tools.modeshape.rest.feature"),
+ PORTLET("org.jboss.tools.portlet.feature"),
+ PROFILER("org.jboss.tools.profiler.feature"),
+ RUNTIME("org.jboss.tools.runtime.feature"),
+ SEAM("org.jboss.tools.seam.feature"),
+ SMOOKS("org.jboss.tools.smooks.feature"),
+ STRUTS("org.jboss.tools.struts.feature"),
+ TPTP("org.jboss.tools.tptp.feature"),
+ USAGE("org.jboss.tools.usage.feature"),
+ VPE("org.jboss.tools.vpe.feature"),
+ WORKINGSET("org.jboss.tools.workingset.feature"),
+ WS("org.jboss.tools.ws.feature"),
+ XULRUNNER("org.mozilla.xulrunner.feature");
- private String[] bundleNames;
+ private String featureName;
- BundleGroup(String... bundleNames) {
- this.bundleNames = bundleNames;
+ JBossToolsFeatureNames(String featureName) {
+ this.featureName = featureName;
}
/**
- * Returns <tt>true</tt> if the given bundle name is a member of this
- * bundle group.
+ * Returns whether the given bundle group has the same name as the this
+ * feature name.
*
* @param bundleName
* the bundle name to check whether it's a member of this
* group of bundles.
* @return <tt>true</tt>, if the given bundle
*/
- public boolean isMember(String bundleName) {
- boolean isMember = false;
- for (String name : bundleNames) {
- if (name.equals(bundleName)) {
- return true;
- }
- }
- return isMember;
+ public boolean matches(IBundleGroup bundleGroup) {
+ return featureName.equals(bundleGroup.getName());
}
- public void addGroupIdTo(Collection<String> bundleGroupIds) {
- bundleGroupIds.add(name());
+ public String getAbbreviation() {
+ return name();
}
}
private static final String JBOSS_TOOLS_BUNDLES_PREFIX = "org\\.jboss\\.tools.+"; //$NON-NLS-1$
- private static class JBossComponentBundlesFilter implements ICollectionEntryFilter<Bundle> {
-
- private Collection<String> componentNames;
-
- private JBossComponentBundlesFilter(Collection<String> componentNames) {
- this.componentNames = componentNames;
- }
-
- /**
- * Collects the bundle groups the bundles it gets belong to. Always
- * returns <tt>true</tt> (does match) while collecting
- */
- public boolean matches(Bundle bundle) {
- String bundleName = bundle.getSymbolicName();
- for (BundleGroup bundleGroup : BundleGroup.values()) {
- if (bundleGroup.isMember(bundleName)) {
- componentNames.add(bundleGroup.name());
- break;
- }
- }
- return true;
- }
- }
-
private JBossComponents() {
// inhibit instantiation
}
+
/**
- * Returns the jboss components that the given bundles are members of
+ * Returns the jboss components that the given bundle group provider provides
*
* @param bundles
- * the bundles to check
+ * the bundles group providers to check for jboss components
* @return
*/
- public static Collection<String> getComponentIds(Bundle[] bundles) {
- Set<String> jbossComponentNames = new TreeSet<String>();
- ICollectionEntryFilter<Bundle> jbossToolsFilter = new BundleUtils.BundleSymbolicNameFilter(
- JBOSS_TOOLS_BUNDLES_PREFIX);
- @SuppressWarnings("unchecked")
- ICollectionEntryFilter<Bundle> compositeFilter = new CollectionFilterUtils.CompositeCollectionFilter<Bundle>(
- jbossToolsFilter
- , new JBossComponentBundlesFilter(jbossComponentNames));
- BundleUtils.getBundles(compositeFilter, bundles);
- return jbossComponentNames;
+ @SuppressWarnings("unchecked")
+ public static Collection<String> getComponentIds(IBundleGroupProvider[] bundleGroupProviders) {
+ Set<String> componentNames = new TreeSet<String>();
+ for (IBundleGroupProvider bundleGroupProvider : bundleGroupProviders) {
+ CollectionFilterUtils.filter(
+ new CompositeCollectionFilter<IBundleGroup>(
+ new JBossToolsNameFilter()
+ , new JBossToolsFeaturesFilter(componentNames))
+ , bundleGroupProvider.getBundleGroups(), null);
+ }
+ return componentNames;
}
- private static class JBossBundleGroupNameFilter implements ICollectionEntryFilter<IBundleGroup> {
+ private static class JBossToolsNameFilter implements ICollectionFilter<IBundleGroup> {
Pattern pattern = Pattern.compile(JBOSS_TOOLS_BUNDLES_PREFIX);
@@ -263,11 +118,22 @@
}
}
- public static Collection<String> getComponentIds(IBundleGroupProvider[] bundleGroupProviders) {
- Set<String> components = new TreeSet<String>();
- for (IBundleGroupProvider bundleGroupProvider : bundleGroupProviders) {
- CollectionFilterUtils.filter(new JBossBundleGroupNameFilter(), bundleGroupProvider.getBundleGroups());
+ private static class JBossToolsFeaturesFilter implements ICollectionFilter<IBundleGroup> {
+
+ private Collection<String> componentNames;
+
+ private JBossToolsFeaturesFilter(Collection<String> componentNames) {
+ this.componentNames = componentNames;
}
- return components;
+
+ public boolean matches(IBundleGroup bundleGroup) {
+ for (JBossToolsFeatureNames featureName : JBossToolsFeatureNames.values()) {
+ if (featureName.matches(bundleGroup)) {
+ this.componentNames.add(featureName.getAbbreviation());
+ return true;
+ }
+ }
+ return false;
+ }
}
}
\ No newline at end of file
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/ReportingEclipseEnvironment.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/ReportingEclipseEnvironment.java 2010-09-14 03:59:49 UTC (rev 24907)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/reporting/ReportingEclipseEnvironment.java 2010-09-14 09:37:06 UTC (rev 24908)
@@ -12,17 +12,18 @@
import java.util.Collection;
+import org.eclipse.core.runtime.IBundleGroupProvider;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.jboss.tools.usage.googleanalytics.eclipse.AbstractEclipseEnvironment;
import org.jboss.tools.usage.internal.JBossToolsUsageActivator;
-import org.osgi.framework.Bundle;
/**
* @author Andre Dietisheim
*/
public class ReportingEclipseEnvironment extends AbstractEclipseEnvironment {
- private static final char BUNDLE_GROUP_DELIMITER = '-';
+ private static final char JBOSS_COMPONENTS_DELIMITER = '-';
public ReportingEclipseEnvironment(String accountName, String hostName, IEclipsePreferences preferences) {
super(accountName, hostName, preferences);
@@ -30,15 +31,16 @@
@Override
public String getKeyword() {
- return bundleGroupsToKeywordString(JBossComponents.getComponentIds(getBundles()));
+ Collection<String> jbossComponentNames = JBossComponents.getComponentIds(getBundleGroupProviders());
+ return bundleGroupsToKeywordString(jbossComponentNames );
}
- protected Bundle[] getBundles() {
- return JBossToolsUsageActivator.getDefault().getBundle().getBundleContext().getBundles();
+ protected IBundleGroupProvider[] getBundleGroupProviders() {
+ return Platform.getBundleGroupProviders();
}
private String bundleGroupsToKeywordString(Collection<String> jbossComponentNames) {
- char delimiter = BUNDLE_GROUP_DELIMITER;
+ char delimiter = JBOSS_COMPONENTS_DELIMITER;
StringBuilder builder = new StringBuilder();
for (String componentName : jbossComponentNames) {
builder.append(componentName)
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/BundleUtils.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/BundleUtils.java 2010-09-14 03:59:49 UTC (rev 24907)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/BundleUtils.java 2010-09-14 09:37:06 UTC (rev 24908)
@@ -14,6 +14,8 @@
import java.util.regex.Pattern;
import org.eclipse.core.runtime.Assert;
+import org.jboss.tools.usage.util.collectionfilter.CollectionFilterUtils;
+import org.jboss.tools.usage.util.collectionfilter.ICollectionFilter;
import org.osgi.framework.Bundle;
/**
@@ -23,30 +25,38 @@
/**
* Returns the bundles among the available ones that match the given filter.
- *
- * @param filter the filter to match the available bundles against
- * @param bundles the bundles
+ *
+ * @param filter
+ * the filter to match the available bundles against
+ * @param bundles
+ * the bundles
* @return the bundles that match the given filter
*/
- public static Collection<Bundle> getBundles(ICollectionEntryFilter<Bundle> filter, Bundle[] bundles) {
- return CollectionFilterUtils.filter(filter, bundles);
+ public static void getBundles(ICollectionFilter<Bundle> filter, Collection<Bundle> filteredBundleCollection,
+ Bundle[] bundles) {
+ CollectionFilterUtils.filter(filter, bundles, filteredBundleCollection);
}
/**
* Returns the bundles that have a symbolic name that match the given regex.
- *
- * @param bundleSymbolicNameRegex the symbolic name regex to match.
- * @param bundles the bundles
+ *
+ * @param bundleSymbolicNameRegex
+ * the symbolic name regex to match.
+ * @param bundles
+ * the bundles
* @return the bundles
*/
- public static Collection<Bundle> getBundles(String bundleSymbolicNameRegex, Bundle[] bundles) {
- return getBundles(new BundleSymbolicNameFilter(bundleSymbolicNameRegex), bundles);
+ public static void getBundles(String bundleSymbolicNameRegex, Collection<Bundle> filteredBundleCollection,
+ Bundle[] bundles) {
+ getBundles(new BundleSymbolicNameFilter(bundleSymbolicNameRegex)
+ , filteredBundleCollection
+ , bundles);
}
/**
* A filter that matches bundles against a given symbolic name regex.
*/
- public static class BundleSymbolicNameFilter implements ICollectionEntryFilter<Bundle> {
+ public static class BundleSymbolicNameFilter implements ICollectionFilter<Bundle> {
private Pattern pattern;
Deleted: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/CollectionFilterUtils.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/CollectionFilterUtils.java 2010-09-14 03:59:49 UTC (rev 24907)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/CollectionFilterUtils.java 2010-09-14 09:37:06 UTC (rev 24908)
@@ -1,72 +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 java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-
-/**
- * @author Andre Dietisheim
- */
-public class CollectionFilterUtils {
-
- /**
- * A filter that applies several given filters
- */
- public static class CompositeCollectionFilter<E> implements ICollectionEntryFilter<E> {
-
- private ICollectionEntryFilter<E> filters[];
-
- /**
- * Instantiates a new composite filter that applies several given
- * filters.
- *
- * @param filters
- * the filters
- */
- public CompositeCollectionFilter(ICollectionEntryFilter<E>... filters) {
- this.filters = filters;
- }
-
- /**
- * Applies the filters this composite filter has. All filters have to
- * match so that the filter says the given bundle matches.
- */
- public boolean matches(E entry) {
- for (ICollectionEntryFilter<E> filter : filters) {
- if (!filter.matches(entry)) {
- return false;
- }
- }
- return true;
- }
- }
-
- /**
- * Returns the entries that match the given filter.
- *
- * @param filter the filter to match the available entries against
- * @param entries the entries to filter
- * @return the entries that match the given filter
- */
- public static <E> Collection<E> filter(ICollectionEntryFilter<E> filter, E[] entries) {
- List<E> filteredList = new ArrayList<E>();
- for (E entry : entries) {
- if (filter.matches(entry)) {
- filteredList.add(entry);
- }
- }
- return filteredList;
- }
-
-}
Deleted: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/ICollectionEntryFilter.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/ICollectionEntryFilter.java 2010-09-14 03:59:49 UTC (rev 24907)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/ICollectionEntryFilter.java 2010-09-14 09:37:06 UTC (rev 24908)
@@ -1,25 +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;
-/**
- * @authro Andre Dietisheim
- */
-public interface ICollectionEntryFilter<E> {
-
- /**
- * Matches.
- *
- * @param bundle
- * the bundle
- * @return true, if successful
- */
- public boolean matches(E entry);
-}
\ No newline at end of file
Copied: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/CollectionFilterUtils.java (from rev 24877, trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/CollectionFilterUtils.java)
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/CollectionFilterUtils.java (rev 0)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/CollectionFilterUtils.java 2010-09-14 09:37:06 UTC (rev 24908)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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.collectionfilter;
+
+import java.util.Collection;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class CollectionFilterUtils {
+
+ public static <E, T> void filter(ICollectionFilter<E> filter, E[] entries, Collection<T> targetColletion) {
+ filter(filter, new NoopConverter<E, T>(), entries, targetColletion);
+ }
+
+ /**
+ * Returns the entries that match the given filter.
+ *
+ * @param filter
+ * the filter to match the available entries against
+ * @param entries
+ * the entries to filter
+ * @return the entries that match the given filter
+ */
+ public static <E, T> void filter(ICollectionFilter<E> filter, ICollectionEntryConverter<E, T> converter,
+ E[] entries, Collection<T> targetColletion) {
+ for (E entry : entries) {
+ if (filter.matches(entry)) {
+ if (targetColletion != null) {
+ targetColletion.add(converter.convert(entry));
+ }
+ }
+ }
+ }
+}
Property changes on: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/CollectionFilterUtils.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/CompositeCollectionFilter.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/CompositeCollectionFilter.java (rev 0)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/CompositeCollectionFilter.java 2010-09-14 09:37:06 UTC (rev 24908)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * 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.collectionfilter;
+
+public class CompositeCollectionFilter<E> implements ICollectionFilter<E> {
+
+ private ICollectionFilter<E> filters[];
+
+ /**
+ * Instantiates a new composite filter that applies several given
+ * filters.
+ *
+ * @param filters
+ * the filters
+ */
+ public CompositeCollectionFilter(ICollectionFilter<E>... filters) {
+ this.filters = filters;
+ }
+
+ /**
+ * Applies the filters this composite filter has. All filters have to
+ * match so that the filter says the given bundle matches.
+ */
+ public boolean matches(E entry) {
+ for (ICollectionFilter<E> filter : filters) {
+ if (!filter.matches(entry)) {
+ return false;
+ }
+ }
+ return true;
+ }
+}
\ No newline at end of file
Property changes on: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/CompositeCollectionFilter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/ICollectionEntryConverter.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/ICollectionEntryConverter.java (rev 0)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/ICollectionEntryConverter.java 2010-09-14 09:37:06 UTC (rev 24908)
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * 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.collectionfilter;
+
+public interface ICollectionEntryConverter<E, T> {
+ public T convert(E entry);
+}
\ No newline at end of file
Property changes on: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/ICollectionEntryConverter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/ICollectionFilter.java (from rev 24874, trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/ICollectionEntryFilter.java)
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/ICollectionFilter.java (rev 0)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/ICollectionFilter.java 2010-09-14 09:37:06 UTC (rev 24908)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * 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.collectionfilter;
+/**
+ * @authro Andre Dietisheim
+ */
+public interface ICollectionFilter<E> {
+
+ /**
+ * Matches.
+ *
+ * @param bundle
+ * the bundle
+ * @return true, if successful
+ */
+ public boolean matches(E entry);
+}
\ No newline at end of file
Property changes on: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/ICollectionFilter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/NoopConverter.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/NoopConverter.java (rev 0)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/NoopConverter.java 2010-09-14 09:37:06 UTC (rev 24908)
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * 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.collectionfilter;
+
+
+public class NoopConverter<E, T> implements ICollectionEntryConverter<E, T> {
+
+ @SuppressWarnings("unchecked")
+ public T convert(E entry) {
+ return (T) entry;
+ }
+}
\ No newline at end of file
Property changes on: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/collectionfilter/NoopConverter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 7 months
JBoss Tools SVN: r24907 - in trunk/hibernatetools/docs/task-reference/en-US: images and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: benlc
Date: 2010-09-13 23:59:49 -0400 (Mon, 13 Sep 2010)
New Revision: 24907
Modified:
trunk/hibernatetools/docs/task-reference/en-US/create_configuration_file-tasks.xml
trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-create_hibernate_configuration_file_01.png
trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-create_hibernate_configuration_file_02.png
trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-create_hibernate_configuration_file_03.png
trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-edit_mapping_file_01.png
trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-edit_mapping_file_02.png
trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-edit_mapping_file_03.png
trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-new_hibernate_xml_mapping_files_01.png
trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-new_hibernate_xml_mapping_files_02.png
trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-new_hibernate_xml_mapping_files_03.png
trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-new_hibernate_xml_mapping_files_04.png
trunk/hibernatetools/docs/task-reference/en-US/images/image-jbt-new_jpa_project_01.png
trunk/hibernatetools/docs/task-reference/en-US/images/image-jbt-new_jpa_project_02.png
trunk/hibernatetools/docs/task-reference/en-US/images/image-jbt-new_jpa_project_03.png
trunk/hibernatetools/docs/task-reference/en-US/images/image-jbt-new_jpa_project_04.png
trunk/hibernatetools/docs/task-reference/en-US/images/image-jbt-new_jpa_project_05.png
trunk/hibernatetools/docs/task-reference/en-US/images/image-jbt-open_perspective_01.png
trunk/hibernatetools/docs/task-reference/en-US/proc-hib-create_hibernate_configuration_file.xml
trunk/hibernatetools/docs/task-reference/en-US/proc-hib-new_hibernate_xml_mapping_files.xml
trunk/hibernatetools/docs/task-reference/en-US/proc-jbt-new_jpa_project.xml
trunk/hibernatetools/docs/task-reference/en-US/project_creation-tasks.xml
Log:
'committing changes to image dpi settings and removal of arbitrary screen-shots'
Modified: trunk/hibernatetools/docs/task-reference/en-US/create_configuration_file-tasks.xml
===================================================================
--- trunk/hibernatetools/docs/task-reference/en-US/create_configuration_file-tasks.xml 2010-09-14 02:30:57 UTC (rev 24906)
+++ trunk/hibernatetools/docs/task-reference/en-US/create_configuration_file-tasks.xml 2010-09-14 03:59:49 UTC (rev 24907)
@@ -6,7 +6,7 @@
<section id="tasks-hibernate_configuration_file-create_configuration_file">
<title>Create configuration file</title>
<para>
- A Hibernate configuration file can be created by following the procedure in <xref linkend="proc-hib-create_hibernate_configuration_file"></xref>
+ A Hibernate configuration file can be created by following the steps in <xref linkend="proc-hib-create_hibernate_configuration_file"></xref>
</para>
<xi:include href="proc-hib-create_hibernate_configuration_file.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<para>&FEEDBACK-tasks-hibernate_configuration_file-create_configuration_file;</para>
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-create_hibernate_configuration_file_01.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-create_hibernate_configuration_file_02.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-create_hibernate_configuration_file_03.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-edit_mapping_file_01.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-edit_mapping_file_02.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-edit_mapping_file_03.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-new_hibernate_xml_mapping_files_01.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-new_hibernate_xml_mapping_files_02.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-new_hibernate_xml_mapping_files_03.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-hib-new_hibernate_xml_mapping_files_04.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-jbt-new_jpa_project_01.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-jbt-new_jpa_project_02.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-jbt-new_jpa_project_03.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-jbt-new_jpa_project_04.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-jbt-new_jpa_project_05.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/images/image-jbt-open_perspective_01.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/docs/task-reference/en-US/proc-hib-create_hibernate_configuration_file.xml
===================================================================
--- trunk/hibernatetools/docs/task-reference/en-US/proc-hib-create_hibernate_configuration_file.xml 2010-09-14 02:30:57 UTC (rev 24906)
+++ trunk/hibernatetools/docs/task-reference/en-US/proc-hib-create_hibernate_configuration_file.xml 2010-09-14 03:59:49 UTC (rev 24907)
@@ -24,6 +24,7 @@
The <guilabel>Create Hibernate configuration file</guilabel> dialog displays. The file location will default to the <filename>src</filename> folder.
</para>
</formalpara>
+ <!--
<figure id="figure-hib-create_hibernate_configuration_file_01">
<title>Create Hibernate configuration file</title>
<mediaobject>
@@ -35,48 +36,13 @@
</textobject>
</mediaobject>
</figure>
+
<para>&HORIZ_LINE;</para>
</step>
<step>
<title>Define the file attributes</title>
- <!--
- <orderedlist numeration ="loweralpha">
- <listitem>
- <para>
- Specify the location of the file.
- </para>
- </listitem>
- <listitem>
- <para>
- Accept the default file name or specify an alternative.
- </para>
- </listitem>
- <listitem>
- <para>
- Click the <guibutton>Next</guibutton> button to proceed.
- </para>
- </listitem>
- </orderedlist>
- <formalpara><title>Result:</title>
- <para>
- The <guilabel>Create Hibernate configuration file</guilabel> dialog displays. The file location will default to the <filename>src</filename> folder.
- </para>
- </formalpara>
- <figure id="figure-hib-create_hibernate_configuration_file_01">
- <title>Create Hibernate configuration file</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/image-hib-create_hibernate_configuration_file_01.png" format="PNG"/>
- </imageobject>
- <textobject>
- <para>The Create Hibernate configuration file dialog.</para>
- </textobject>
- </mediaobject>
- </figure>
- <para>&HORIZ_LINE;</para>
- </step>
- -->
+
<table id="table-hib-create_hibernate_configuration_file_01" frame='all'>
<title>New Hibernate configuration</title>
@@ -116,6 +82,7 @@
</tbody>
</tgroup>
</table>
+ -->
<para>&HORIZ_LINE;</para>
</step>
<step><title>Access the sub-dialog</title>
@@ -233,6 +200,7 @@
The file is opened in the <guilabel>Session Factory</guilabel> view of the <guilabel>Hibernate Configuration XML Editor</guilabel> for editing.
</para>
</formalpara>
+ <!--
<figure id="figure-hib-create_hibernate_configuration_file_03">
<title>Hibernate configuration file - Session factory view</title>
<mediaobject>
@@ -244,9 +212,7 @@
</textobject>
</mediaobject>
</figure>
- <!-- Design Notes:
- Provide a single link to a document navigation section relating to the current task. This section will include all of the relevant concepts, tasks and references in a single table facilitating ease of maintenance.
- -->
+ -->
<formalpara><title>Related material</title>
<para>
Further tasks and information relating to this task are accessible from: <xref linkend="document_navigation-hibernate_configuration"/>.
Modified: trunk/hibernatetools/docs/task-reference/en-US/proc-hib-new_hibernate_xml_mapping_files.xml
===================================================================
--- trunk/hibernatetools/docs/task-reference/en-US/proc-hib-new_hibernate_xml_mapping_files.xml 2010-09-14 02:30:57 UTC (rev 24906)
+++ trunk/hibernatetools/docs/task-reference/en-US/proc-hib-new_hibernate_xml_mapping_files.xml 2010-09-14 03:59:49 UTC (rev 24907)
@@ -54,8 +54,9 @@
<step>
<title>Access the sub-dialog</title>
<para>
- Click the <guibutton>Next</guibutton> button to proceed.
+ Click the <guibutton>Next</guibutton> button to proceed. The selected class name and mapping file name are displayed.
</para>
+ <!--
<formalpara><title>Result:</title>
<para>
The class name and mapping file name are displayed in the wizard.
@@ -72,13 +73,14 @@
</textobject>
</mediaobject>
</figure>
+ -->
<para>&HORIZ_LINE;</para>
</step>
<step>
<title>Review the file</title>
<para>
Click the <guilabel>Next</guilabel> button to view the file to be created.
- </para>
+ </para>
<formalpara><title>Result:</title>
<para>
The file is displayed for review.
@@ -95,6 +97,12 @@
</textobject>
</mediaobject>
</figure>
+ <note><title>Creating multiple mapping files</title>
+ <para>
+ It is possible to select the project, src folder or an individual package to create multiple mapping files in a single action. In this instance, all Java classes will be identified and listed in the display of <xref linkend="figure-hib-new_hibernate_xml_mapping_files_03"></xref>. Individual classes may then be selected and deselected by clicking the appropriate checkbox.
+ </para>
+ </note>
+ <para>&HORIZ_LINE;</para>
</step>
<step>
<title>Create the mapping file</title>
@@ -106,6 +114,8 @@
The file is created and ready for editing.
</para>
</formalpara>
+ <para>&HORIZ_LINE;</para>
+ <!--
<figure id="figure-hib-new_hibernate_xml_mapping_files_04">
<title>The New Hibernate XML Mapping files dialog - File created</title>
<mediaobject>
@@ -117,11 +127,7 @@
</textobject>
</mediaobject>
</figure>
- <note><title>Creating multiple mapping files</title>
- <para>
- It is possible to select the project, src folder or an individual package to create multiple mapping files in a single action. In this instance, all Java classes will be identified and listed in the display of <xref linkend="figure-hib-new_hibernate_xml_mapping_files_03"></xref>. Individual classes may then be selected and deselected by clicking the appropriate checkbox.
- </para>
- </note>
+ -->
<!-- Design Notes:
Provide a single link to a document navigation section relating to the current task. This section will include all of the relevant concepts, tasks and references in a single table facilitating ease of maintenance.
-->
Modified: trunk/hibernatetools/docs/task-reference/en-US/proc-jbt-new_jpa_project.xml
===================================================================
--- trunk/hibernatetools/docs/task-reference/en-US/proc-jbt-new_jpa_project.xml 2010-09-14 02:30:57 UTC (rev 24906)
+++ trunk/hibernatetools/docs/task-reference/en-US/proc-jbt-new_jpa_project.xml 2010-09-14 03:59:49 UTC (rev 24907)
@@ -6,6 +6,43 @@
<procedure id="proc-jbt-new_jpa_project">
<title>JPA Project Creation</title>
<step>
+ <title>Access the New JPA Project dialog</title>
+ <substeps>
+ <step>
+ <para>
+ Click <menuchoice><guimenu>File</guimenu><guisubmenu>New</guisubmenu><guimenuitem>Other</guimenuitem></menuchoice>
+ </para>
+ </step>
+ <step>
+ <para>
+ Expand the <guilabel>JPA</guilabel> node and select <guilabel>JPA Project</guilabel>
+ </para>
+ </step>
+ <step>
+ <para>
+ Click <guilabel>Next</guilabel>
+ </para>
+ </step>
+ </substeps>
+ <formalpara><title>Result:</title>
+ <para>
+ The <guilabel>New JPA Project</guilabel> dialog displays.
+ </para>
+ </formalpara>
+ <figure id="figure-jbt-new_jpa_project_01">
+ <title>JPA Project Attributes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/image-jbt-new_jpa_project_01.png" format="PNG"/>
+ </imageobject>
+ <textobject>
+ <para>The New JPA Project Dialog.</para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ <para>&HORIZ_LINE;</para>
+ </step>
+ <!-- <step>
<title>Define the Project Type</title>
<orderedlist numeration ="loweralpha">
<listitem>
@@ -37,6 +74,7 @@
</figure>
<para>&HORIZ_LINE;</para>
</step>
+ -->
<step>
<title>Define the Project Attributes</title>
<para>
@@ -162,6 +200,7 @@
The <guilabel>New JPA Project - Java</guilabel> dialog displays.
</para>
</formalpara>
+ <!--
<figure id="figure-jbt-new_jpa_project_02">
<title>New JPA Project - Java</title>
<mediaobject>
@@ -172,7 +211,8 @@
<para>The New JPA Project - Java Dialog</para>
</textobject>
</mediaobject>
- </figure>
+ </figure>
+ -->
<para>&HORIZ_LINE;</para>
</step>
<step>
@@ -310,7 +350,7 @@
</table>
<para>&HORIZ_LINE;</para>
</step>
- <step><title>Open the JPA perspective.</title>
+ <step><title>Open the JPA perspective.</title>
<orderedlist numeration="loweralpha">
<listitem>
<para>
@@ -321,6 +361,7 @@
A dialog will appear prompting the user to open the relevant perspective.
</para>
</formalpara>
+ <!--
<figure id="figure-JBT_New_JPA_Project_04">
<title>JPA Open Perspective Dialog</title>
<mediaobject>
@@ -332,6 +373,7 @@
</textobject>
</mediaobject>
</figure>
+ -->
</listitem>
<listitem>
<para>
@@ -342,6 +384,7 @@
The project is configured and the JPA perspective is displayed.
</para>
</formalpara>
+ <!--
<figure id="figure-JBT_New_JPA_Project_05">
<title>JPA Perspective</title>
<mediaobject>
@@ -353,6 +396,7 @@
</textobject>
</mediaobject>
</figure>
+ -->
</listitem>
</orderedlist>
<formalpara><title>Related material</title>
Modified: trunk/hibernatetools/docs/task-reference/en-US/project_creation-tasks.xml
===================================================================
--- trunk/hibernatetools/docs/task-reference/en-US/project_creation-tasks.xml 2010-09-14 02:30:57 UTC (rev 24906)
+++ trunk/hibernatetools/docs/task-reference/en-US/project_creation-tasks.xml 2010-09-14 03:59:49 UTC (rev 24907)
@@ -5,12 +5,8 @@
]>
<section id="tasks-jpa-project_creation">
<title>Project creation</title>
- <para>
- <xref linkend="proc-jbt-new_project"/> describes the steps to create a new project in JBoss Tools.
- </para>
- <xi:include href="proc-jbt-new_project.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<para>
- Continue by defining a JPA project type as described in <xref linkend="proc-jbt-new_jpa_project"/>:
+ Creating a JPA project is described in <xref linkend="proc-jbt-new_jpa_project"/>:
</para>
<xi:include href="proc-jbt-new_jpa_project.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<para>&FEEDBACK-tasks-jpa-project_creation;</para>
15 years, 7 months
JBoss Tools SVN: r24906 - trunk/documentation/guides/GettingStartedGuide/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2010-09-13 22:30:57 -0400 (Mon, 13 Sep 2010)
New Revision: 24906
Modified:
trunk/documentation/guides/GettingStartedGuide/en-US/getting_started.xml
Log:
updated with fixes
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/getting_started.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en-US/getting_started.xml 2010-09-14 02:18:12 UTC (rev 24905)
+++ trunk/documentation/guides/GettingStartedGuide/en-US/getting_started.xml 2010-09-14 02:30:57 UTC (rev 24906)
@@ -110,7 +110,7 @@
<row>
<entry><para>Usage reporting</para></entry>
- <entry><para>The usage plug-in anonymously gathers information on how you use the provided tools. This information is used to improve and shape the JBoss Developer Studio product to better cater to your needs. For more information refer to <xref linkend="Reporting_Usage"/>.</para></entry>
+ <entry><para>The usage plug-in anonymously gathers information on how you use the provided tools. This information is used to improve and shape the JBoss Developer Studio product to better cater to your needs. For more information refer to <xref linkend="Usage_Reporting"/>.</para></entry>
</row>
</tbody>
</tgroup>
@@ -881,9 +881,20 @@
</itemizedlist>
</section>
- <section id="Reporting_Usage">
+ <section id="Usage_Reporting">
<title>Reporting Usage</title>
- <para>The JBoss Developer Studio now includes a usage plug-in that anonymously reports information back to JBoss. The plug-in is not enabled by default. To enable, make sure the <guilabel>Report usage of JBoss Tools to JBoss Tools team.</guilabel> box is ticked. Once enabled, the plug-in will remain active until turned off. To turn the active plug-in off, navigate to <menuchoice><guimenuitem>Window</guimenuitem><guimenuitem>Preferences</guimenuitem><guimenuitem>JBoss Tools</guimenuitem><guimenuitem>Usage Reporting Preferences</guimenuitem></menuchoice>.</para>
+ <para>
+ The JBoss Developer Studio now includes a usage plug-in that anonymously reports information back to JBoss. The plug-in is not enabled by default. To enable, make sure the <guilabel>Report usage of JBoss Tools to JBoss Tools team.</guilabel> box is ticked.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/getting_started/usage_plug-in_1.png"/>
+ </imageobject>
+ <caption>Usage plug-in pop-up</caption>
+ </mediaobject>
+ <para>
+ Once enabled, the plug-in will remain active until turned off. To turn the active plug-in off, navigate to <menuchoice><guimenuitem>Window</guimenuitem><guimenuitem>Preferences</guimenuitem><guimenuitem>JBoss Tools</guimenuitem><guimenuitem>Usage Reporting Preferences</guimenuitem></menuchoice>.
+ </para>
</section>
<section id="Support">
15 years, 7 months
JBoss Tools SVN: r24905 - in trunk/documentation/guides/GettingStartedGuide/en-US: images/getting_started and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2010-09-13 22:18:12 -0400 (Mon, 13 Sep 2010)
New Revision: 24905
Added:
trunk/documentation/guides/GettingStartedGuide/en-US/images/getting_started/usage_plug-in_1.png
Modified:
trunk/documentation/guides/GettingStartedGuide/en-US/getting_started.xml
Log:
updated to begin the write-up on the usage plug-in
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/getting_started.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en-US/getting_started.xml 2010-09-13 21:58:24 UTC (rev 24904)
+++ trunk/documentation/guides/GettingStartedGuide/en-US/getting_started.xml 2010-09-14 02:18:12 UTC (rev 24905)
@@ -107,6 +107,11 @@
<entry><para>JBossWeb Service</para></entry>
<entry><para>JBoss WS is a web service framework developed as a part of the JBoss Application Server. It implements the JAX-WS specification that defines a programming model and run-time architecture for implementing web services in Java, targeted at the Java Platform, Enterprise Edition 5 (Java EE 5).</para></entry>
</row>
+
+ <row>
+ <entry><para>Usage reporting</para></entry>
+ <entry><para>The usage plug-in anonymously gathers information on how you use the provided tools. This information is used to improve and shape the JBoss Developer Studio product to better cater to your needs. For more information refer to <xref linkend="Reporting_Usage"/>.</para></entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -876,6 +881,11 @@
</itemizedlist>
</section>
+ <section id="Reporting_Usage">
+ <title>Reporting Usage</title>
+ <para>The JBoss Developer Studio now includes a usage plug-in that anonymously reports information back to JBoss. The plug-in is not enabled by default. To enable, make sure the <guilabel>Report usage of JBoss Tools to JBoss Tools team.</guilabel> box is ticked. Once enabled, the plug-in will remain active until turned off. To turn the active plug-in off, navigate to <menuchoice><guimenuitem>Window</guimenuitem><guimenuitem>Preferences</guimenuitem><guimenuitem>JBoss Tools</guimenuitem><guimenuitem>Usage Reporting Preferences</guimenuitem></menuchoice>.</para>
+ </section>
+
<section id="Support">
<?dbhtml filename="Support.html"?>
<title>Support</title>
Added: trunk/documentation/guides/GettingStartedGuide/en-US/images/getting_started/usage_plug-in_1.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/guides/GettingStartedGuide/en-US/images/getting_started/usage_plug-in_1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 7 months
JBoss Tools SVN: r24904 - in trunk/bpel/plugins: org.eclipse.bpel.ui and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2010-09-13 17:58:24 -0400 (Mon, 13 Sep 2010)
New Revision: 24904
Modified:
trunk/bpel/plugins/org.eclipse.bpel.common.ui/plugin.xml
trunk/bpel/plugins/org.eclipse.bpel.ui/plugin.xml
Log:
https://jira.jboss.org/browse/JBIDE-7057
Modified: trunk/bpel/plugins/org.eclipse.bpel.common.ui/plugin.xml
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.common.ui/plugin.xml 2010-09-13 21:46:07 UTC (rev 24903)
+++ trunk/bpel/plugins/org.eclipse.bpel.common.ui/plugin.xml 2010-09-13 21:58:24 UTC (rev 24904)
@@ -50,7 +50,7 @@
base-type="org.eclipse.core.runtime.xml"
default-charset="UTF-8"
file-extensions="bpel,bpel2"
- id="org.eclipse.bpel.common.ui.bpel.content-type"
+ id="org.eclipse.bpel.contenttype"
name="BPEL Process"
priority="normal"/>
</extension>
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/plugin.xml
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/plugin.xml 2010-09-13 21:46:07 UTC (rev 24903)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/plugin.xml 2010-09-13 21:58:24 UTC (rev 24904)
@@ -669,7 +669,7 @@
base-type="org.eclipse.core.runtime.xml"
id="org.eclipse.bpel.contenttype"
name="BPEL Editor File"
- file-extensions="bpel,bpel2,xml"
+ file-extensions="bpel,bpel2"
priority="normal">
<!-- problems with XMLRootElementContentDescriber2 - had to roll my own -->
<describer
15 years, 7 months
JBoss Tools SVN: r24903 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/views and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jjohnstn
Date: 2010-09-13 17:46:07 -0400 (Mon, 13 Sep 2010)
New Revision: 24903
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
Log:
2010-09-13 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties: Add new messages
for disconnecting a cloud.
* src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java (.run): Add confirmation
dialog when disconnecting a cloud.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-09-13 21:03:31 UTC (rev 24902)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-09-13 21:46:07 UTC (rev 24903)
@@ -1,3 +1,10 @@
+2010-09-13 Jeff Johnston <jjohnstn(a)redhat.com>
+
+ * src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties: Add new messages
+ for disconnecting a cloud.
+ * src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java (.run): Add confirmation
+ dialog when disconnecting a cloud.
+
2010-09-08 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java: Fix warning.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-09-13 21:03:31 UTC (rev 24902)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-09-13 21:46:07 UTC (rev 24903)
@@ -50,6 +50,8 @@
DestroyingInstance.title=Destroying Instance
DestroyingInstance.msg=Destroying Instance: {0}
ConnectingRSE.msg=Connecting instance as: {0}
+ConfirmCloudDelete.title=Confirm Cloud Disconnect
+ConfirmCloudDelete.msg=Confirm disconnecting cloud: {0}
NAME=Name
ID=ID
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-09-13 21:03:31 UTC (rev 24902)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-09-13 21:46:07 UTC (rev 24903)
@@ -16,6 +16,7 @@
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
@@ -56,6 +57,8 @@
private static final String REMOVE_CLOUD = "RemoveCloud.label"; //$NON-NLS-1$
private static final String REFRESH = "Refresh.label"; //$NON-NLS-1$
private static final String CREATE_INSTANCE = "CreateInstance.label"; //$NON-NLS-1$
+ private static final String CONFIRM_CLOUD_DELETE_TITLE = "ConfirmCloudDelete.title"; //$NON-NLS-1$
+ private static final String CONFIRM_CLOUD_DELETE_MSG = "ConfirmCloudDelete.msg"; //$NON-NLS-1$
public static final String COLLAPSE_ALL = "CollapseAll.label"; //$NON-NLS-1$
@@ -177,16 +180,22 @@
}
if (element != null) {
CVCloudElement cve = (CVCloudElement)element;
- DeltaCloudManager.getDefault().removeCloud((DeltaCloud)element.getElement());
- CloudViewContentProvider p = (CloudViewContentProvider)viewer.getContentProvider();
- Object[] elements = p.getElements(getViewSite());
- int index = -1;
- for (int i = 0; i < elements.length; ++i) {
- if (elements[i] == cve)
- index = i;
+ Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
+ boolean confirmed = MessageDialog.openConfirm(shell,
+ CVMessages.getString(CONFIRM_CLOUD_DELETE_TITLE),
+ CVMessages.getFormattedString(CONFIRM_CLOUD_DELETE_MSG, cve.getName()));
+ if (confirmed) {
+ DeltaCloudManager.getDefault().removeCloud((DeltaCloud)element.getElement());
+ CloudViewContentProvider p = (CloudViewContentProvider)viewer.getContentProvider();
+ Object[] elements = p.getElements(getViewSite());
+ int index = -1;
+ for (int i = 0; i < elements.length; ++i) {
+ if (elements[i] == cve)
+ index = i;
+ }
+ if (index >= 0)
+ ((TreeViewer)cve.getViewer()).remove(getViewSite(), index);
}
- if (index >= 0)
- ((TreeViewer)cve.getViewer()).remove(getViewSite(), index);
}
}
};
15 years, 7 months