Author: scabanovich
Date: 2011-05-24 14:25:13 -0400 (Tue, 24 May 2011)
New Revision: 31453
Added:
trunk/common/plugins/org.jboss.tools.common.base.test/.classpath
trunk/common/plugins/org.jboss.tools.common.base.test/.project
trunk/common/plugins/org.jboss.tools.common.base.test/META-INF/
trunk/common/plugins/org.jboss.tools.common.base.test/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.base.test/about.html
trunk/common/plugins/org.jboss.tools.common.base.test/build.properties
trunk/common/plugins/org.jboss.tools.common.base.test/plugin.properties
trunk/common/plugins/org.jboss.tools.common.base.test/plugin.xml
trunk/common/plugins/org.jboss.tools.common.base.test/plugin_ja.properties
trunk/common/plugins/org.jboss.tools.common.base.test/pom.xml
trunk/common/plugins/org.jboss.tools.common.base.test/src/
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/BaseTestPlugin.java
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/CATestUtil.java
Log:
JBIDE-8986
https://issues.jboss.org/browse/JBIDE-8986
Share project "org.jboss.tools.common.base.test" into
"https://svn.jboss.org/repos/jbosstools"
Added: trunk/common/plugins/org.jboss.tools.common.base.test/.classpath
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/.classpath
(rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/.classpath 2011-05-24 18:25:13
UTC (rev 31453)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/common/plugins/org.jboss.tools.common.base.test/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.base.test/.project
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/.project
(rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/.project 2011-05-24 18:25:13 UTC
(rev 31453)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.common.base.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/common/plugins/org.jboss.tools.common.base.test/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.base.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/META-INF/MANIFEST.MF
(rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/META-INF/MANIFEST.MF 2011-05-24
18:25:13 UTC (rev 31453)
@@ -0,0 +1,31 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-ActivationPolicy: lazy
+Bundle-Name: %Bundle-Name.0
+Bundle-Activator: org.jboss.tools.common.base.test.BaseTestPlugin
+Bundle-Vendor: %providerName
+Bundle-SymbolicName: org.jboss.tools.common.base.test;singleton:=true
+Bundle-Localization: plugin
+Export-Package: org.jboss.tools.common.base.test,
+ org.jboss.tools.common.base.test.contentassist
+Require-Bundle: org.jboss.tools.common,
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.jface.text;bundle-version="3.7.0",
+ org.eclipse.ui.workbench.texteditor;bundle-version="3.7.0",
+ org.eclipse.jdt.ui;bundle-version="3.7.0",
+ org.eclipse.jdt.core;bundle-version="3.7.0",
+ org.eclipse.wst.xml.ui;bundle-version="1.1.200",
+ org.eclipse.wst.sse.ui;bundle-version="1.3.0",
+ org.eclipse.wst.sse.core;bundle-version="1.1.600",
+ org.eclipse.core.resources;bundle-version="3.7.100",
+ org.eclipse.wst.xsd.ui;bundle-version="1.2.404",
+ org.eclipse.wst.dtd.ui;bundle-version="1.0.600",
+ org.junit;bundle-version="3.8.2",
+ org.jboss.tools.tests,
+ org.jboss.tools.common.text.xml,
+ org.jboss.tools.common.text.ext,
+ org.eclipse.ui.ide;bundle-version="3.7.0"
+Bundle-Version: 3.3.0.qualifier
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ClassPath: .
Property changes on:
trunk/common/plugins/org.jboss.tools.common.base.test/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.base.test/about.html
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/about.html
(rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/about.html 2011-05-24 18:25:13
UTC (rev 31453)
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+
+<BODY lang="EN-US">
+
+<H3>About This Content</H3>
+
+<P>©2007 Red Hat, Inc. All rights reserved</P>
+
+<H3>License</H3>
+
+<P>Red Hat Inc., through its JBoss division, makes available all content in this
plug-in
+("Content"). Unless otherwise indicated below, the Content is provided to you
+under the terms and conditions of the Eclipse Public License Version 1.0
+("EPL"). A copy of the EPL is available at
+<A
href="http://www.eclipse.org/org/documents/epl-v10.php">http...;.
+For purposes of the EPL, "Program" will mean the Content.</P>
+
+<P>If you did not receive this Content directly from Red Hat Inc., the
+Content is being redistributed by another party ("Redistributor") and different
+terms and conditions may apply to your use of any object code in the Content.
+Check the Redistributor's license that was provided with the Content. If no such
+license exists, contact the Redistributor. Unless otherwise indicated below, the
+terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at
+ <A
href="http://www.jboss.org/tools">http://www.jboss.org/tools...
+
+</BODY>
+</HTML>
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common.base.test/about.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.base.test/build.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/build.properties
(rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/build.properties 2011-05-24
18:25:13 UTC (rev 31453)
@@ -0,0 +1,13 @@
+source.. = src/
+bin.includes = plugin.xml,\
+ plugin.properties,\
+ about.html,\
+ META-INF/,\
+ .
+src.includes = src/,\
+ plugin.xml,\
+ plugin.properties,\
+ build.properties,\
+ about.html,\
+ META-INF/,\
+ .project
Property changes on:
trunk/common/plugins/org.jboss.tools.common.base.test/build.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.base.test/plugin.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/plugin.properties
(rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/plugin.properties 2011-05-24
18:25:13 UTC (rev 31453)
@@ -0,0 +1,16 @@
+providerName=JBoss by Red Hat
+
+xml.page.name=XML Syntax Colors
+
+XML_Occurrences.name= XML Occurrences
+
+#--- folding
+foldingStructureProvidersExtensionPoint= Folding Structure Providers
+defaultFoldingStructureProviderName= Default Structured Text Folding
+Folding.label=F&olding
+
+occurrenceStructureProvidersExtensionPoint= Occurrence Structure Providers
+defaultOccurrenceStructureProviderName= Default Occurrence Provider
+
+OccurrenceAnnotation.label =Occurences (JSP,XML)
+Bundle-Name.0 = Xml Editor Plug-in
\ No newline at end of file
Property changes on:
trunk/common/plugins/org.jboss.tools.common.base.test/plugin.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.base.test/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/plugin.xml
(rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/plugin.xml 2011-05-24 18:25:13
UTC (rev 31453)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension-point id="contentAssistProcessor" name="Content Assist
Processor Extension Point Extension"
schema="schema/contentAssistProcessor.exsd"/>
+
+<!--
+ <extension-point id="foldingStructureProviders"
name="%foldingStructureProvidersExtensionPoint"
schema="schema/foldingStructureProviders.exsd"/>
+
+ <extension-point id="openOnPartitioner" name="Open On
Partitioner"/>
+
+ <extension point="org.eclipse.ui.editors.annotationTypes">
+ <type name="org.jboss.tools.jst.jsp.occurrences"/>
+ </extension>
+-->
+
+ <extension-point id="occurrenceStructureProviders"
+ name="%occurrenceStructureProvidersExtensionPoint"
+ schema="schema/occurrenceStructureProviders.exsd" />
+
+ <extension
+ point="org.eclipse.wst.sse.ui.editorConfiguration">
+ <sourceViewerConfiguration
+ class="org.jboss.tools.common.text.xml.XMLTextViewerConfiguration"
+ target="org.eclipse.core.runtime.xml"/>
+ <contentOutlineConfiguration
+
class="org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration"
+ target="org.eclipse.core.runtime.xml"/>
+ <propertySheetConfiguration
+
class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
+ target="org.eclipse.core.runtime.xml"/>
+ <provisionalConfiguration
+ type="sourceeditingtexttools"
+
class="org.eclipse.wst.xml.ui.internal.provisional.XMLSourceEditingTextTools"
+ target="org.eclipse.core.runtime.xml"/>
+ <provisionalConfiguration
+ type="characterpairmatcher"
+
class="org.eclipse.wst.xml.ui.internal.text.XMLDocumentRegionEdgeMatcher"
+ target="org.eclipse.core.runtime.xml"/>
+ <provisionalConfiguration
+ type="structuredtextfoldingprovider"
+
class="org.eclipse.wst.xml.ui.internal.projection.StructuredTextFoldingProviderXML"
+ target="org.eclipse.core.runtime.xml"/>
+ <provisionalDefinition
+ type="preferencepages"
+ value="org.eclipse.wst.sse.ui.preferences.xml"
+ target="org.eclipse.core.runtime.xml"/>
+ <provisionalDefinition
+ type="preferencepages"
+ value="org.eclipse.wst.sse.ui.preferences.xml.source"
+ target="org.eclipse.core.runtime.xml"/>
+ <provisionalDefinition
+ type="preferencepages"
+ value="org.eclipse.wst.sse.ui.preferences.xml.templates"
+ target="org.eclipse.core.runtime.xml"/>
+ <provisionalDefinition
+ type="preferencepages"
+ value="org.eclipse.wst.sse.ui.preferences.xml.colors"
+ target="org.eclipse.core.runtime.xml"/>
+ <provisionalDefinition
+ type="preferencepages"
+ value="org.eclipse.wst.sse.ui.preferences.xml.occurrences"
+ target="org.eclipse.core.runtime.xml"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.wst.sse.ui.editorConfiguration">
+ <sourceViewerConfiguration
+ class="org.jboss.tools.common.text.xml.XMLTextViewerConfiguration"
+ target="org.jboss.tools.common.model.ui.xml"/>
+ <contentOutlineConfiguration
+
class="org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration"
+ target="org.jboss.tools.common.model.ui.xml"/>
+ <propertySheetConfiguration
+
class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
+ target="org.jboss.tools.common.model.ui.xml"/>
+ <provisionalConfiguration
+ type="sourceeditingtexttools"
+
class="org.eclipse.wst.xml.ui.internal.provisional.XMLSourceEditingTextTools"
+ target="org.jboss.tools.common.model.ui.xml"/>
+ <provisionalConfiguration
+ type="characterpairmatcher"
+
class="org.eclipse.wst.xml.ui.internal.text.XMLDocumentRegionEdgeMatcher"
+ target="org.jboss.tools.common.model.ui.xml"/>
+ <provisionalConfiguration
+ type="structuredtextfoldingprovider"
+
class="org.eclipse.wst.xml.ui.internal.projection.StructuredTextFoldingProviderXML"
+ target="org.jboss.tools.common.model.ui.xml"/>
+ <provisionalDefinition
+ type="preferencepages"
+ value="org.eclipse.wst.sse.ui.preferences.xml"
+ target="org.jboss.tools.common.model.ui.xml"/>
+ <provisionalDefinition
+ type="preferencepages"
+ value="org.eclipse.wst.sse.ui.preferences.xml.source"
+ target="org.jboss.tools.common.model.ui.xml"/>
+ <provisionalDefinition
+ type="preferencepages"
+ value="org.eclipse.wst.sse.ui.preferences.xml.templates"
+ target="org.jboss.tools.common.model.ui.xml"/>
+ <provisionalDefinition
+ type="preferencepages"
+ value="org.eclipse.wst.sse.ui.preferences.xml.colors"
+ target="org.jboss.tools.common.model.ui.xml"/>
+ <provisionalDefinition
+ type="preferencepages"
+ value="org.eclipse.wst.sse.ui.preferences.xml.occurrences"
+ target="org.jboss.tools.common.model.ui.xml"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.preferencePages">
+ <!-- Additional XML PREFERENCE PAGES -->
+ <page
+ name="%XML_Occurrences.name"
+ category="org.eclipse.wst.xml.ui.preferences.xml.xml"
+ class="org.jboss.tools.jst.jsp.preferences.xpl.XMLOccurrencesPreferencePage"
+ id="org.eclipse.wst.sse.ui.preferences.xml.occurrences">
+ </page>
+ </extension>
+
+ <extension
point="org.jboss.tools.common.text.xml.occurrenceStructureProviders">
+ <provider
+ class="org.jboss.tools.jst.jsp.text.xpl.XMLOccurrenceProvider"
+ editorId="org.jboss.tools.common.text.xml"
+ name="%defaultOccurrenceStructureProviderName" />
+ </extension>
+
+ <extension point="org.eclipse.ui.editors.annotationTypes">
+ <type markerSeverity="0"
+ markerType="org.eclipse.search.searchmarker"
+ name="org.jboss.tools.jst.jsp.occurrences" />
+ </extension>
+
+<extension point="org.eclipse.ui.editors.markerAnnotationSpecification">
+ <specification annotationType="org.jboss.tools.jst.jsp.occurrences"
+ colorPreferenceKey="redhatTextOccurrenceIndicationColor"
+ colorPreferenceValue="63,175,0"
+ contributesToHeader="false"
+ highlightPreferenceKey="redhatTextOccurrenceHighlighting"
+ highlightPreferenceValue="true"
+ icon="$nl$/icons/full/obj16/xpl/searchm_obj.gif"
+ isGoToNextNavigationTarget="false"
+
isGoToNextNavigationTargetKey="isRedHatTextOccurrenceGoToNextNavigationTarget"
+ isGoToPreviousNavigationTarget="false"
+
isGoToPreviousNavigationTargetKey="isRedHatTextOccurrenceGoToPreviousNavigationTarget"
+ label="%OccurrenceAnnotation.label"
+ overviewRulerPreferenceKey="redhatTextOccurrenceIndicationInOverviewRuler"
+ overviewRulerPreferenceValue="true"
+ presentationLayer="4"
+ showInNextPrevDropdownToolbarAction="true"
+
showInNextPrevDropdownToolbarActionKey="redhatTextShowOccurrenceInNextPrevDropdownToolbarAction"
+ textPreferenceKey="redhatTextOccurrenceIndication"
+ textPreferenceValue="true"
+ verticalRulerPreferenceKey="redhatTextOccurrenceIndicationInVerticalRuler"
+ verticalRulerPreferenceValue="true"/>
+ </extension>
+
+</plugin>
Property changes on: trunk/common/plugins/org.jboss.tools.common.base.test/plugin.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.base.test/plugin_ja.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/plugin_ja.properties
(rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/plugin_ja.properties 2011-05-24
18:25:13 UTC (rev 31453)
@@ -0,0 +1,10 @@
+providerName=JBoss by Red Hat
+xml.page.name=XML \u69CB\u6587\u306E\u8272
+XML_Occurrences.name=XML \u30AA\u30AB\u30EC\u30F3\u30B9
+foldingStructureProvidersExtensionPoint=\u6298\u308A\u305F\u305F\u307F\u69CB\u9020\u30D7\u30ED\u30D0\u30A4\u30C0\u30FC
+defaultFoldingStructureProviderName=\u30C7\u30D5\u30A9\u30EB\u30C8\u69CB\u9020\u5316\u30C6\u30AD\u30B9\u30C8\u6298\u308A\u305F\u305F\u307F
+Folding.label=\u6298\u308A\u305F\u305F\u307F(&O)
+occurrenceStructureProvidersExtensionPoint=\u30AA\u30AB\u30EC\u30F3\u30B9\u69CB\u9020\u30D7\u30ED\u30D0\u30A4\u30C0\u30FC
+defaultOccurrenceStructureProviderName=\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30AA\u30AB\u30EC\u30F3\u30B9\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0\u30FC
+OccurrenceAnnotation.label=\u30AA\u30AB\u30EC\u30F3\u30B9 (JSP,XML)
+Bundle-Name.0=XML \u30A8\u30C7\u30A3\u30BF\u30FC\u30FB\u30D7\u30E9\u30B0\u30A4\u30F3
Property changes on:
trunk/common/plugins/org.jboss.tools.common.base.test/plugin_ja.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.base.test/pom.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/pom.xml
(rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/pom.xml 2011-05-24 18:25:13 UTC
(rev 31453)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.common</groupId>
+ <artifactId>plugins</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.common.plugins</groupId>
+ <artifactId>org.jboss.tools.common.base.test</artifactId>
+ <version>3.3.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
Property changes on: trunk/common/plugins/org.jboss.tools.common.base.test/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/BaseTestPlugin.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/BaseTestPlugin.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/BaseTestPlugin.java 2011-05-24
18:25:13 UTC (rev 31453)
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.base.test;
+
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.jboss.tools.common.log.BaseUIPlugin;
+import org.jboss.tools.common.log.IPluginLog;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class BaseTestPlugin extends BaseUIPlugin {
+ //The shared instance.
+ private static BaseTestPlugin plugin;
+
+ public static final String PLUGIN_ID = "org.jboss.tools.common.base.test";
//$NON-NLS-1$
+
+
+ /**
+ * The constructor.
+ */
+ public BaseTestPlugin() {
+ plugin = this;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static BaseTestPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns the workspace instance.
+ */
+ public static IWorkspace getWorkspace() {
+ return ResourcesPlugin.getWorkspace();
+ }
+
+ /**
+ * @return IPluginLog object
+ */
+ public static IPluginLog getPluginLog() {
+ return getDefault();
+ }
+}
Property changes on:
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/BaseTestPlugin.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java 2011-05-24
18:25:13 UTC (rev 31453)
@@ -0,0 +1,243 @@
+/*******************************************************************************
+ * Copyright (c) 2007-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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.common.base.test.contentassist;
+
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
+import org.jboss.tools.common.text.ext.util.Utils;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
+public abstract class AbstractContentAssistantTestCase extends TestCase {
+ protected String fileName;
+ protected IProject project = null;
+ protected IEditorPart editorPart = null;
+ protected StructuredTextEditor textEditor = null;
+ protected ISourceViewer viewer = null;
+ protected IContentAssistant contentAssistant = null;
+ protected IDocument document = null;
+
+ public void openEditor(String fileName) {
+ this.fileName = fileName;
+ editorPart = WorkbenchUtils.openEditor(project.getName()+"/"+ fileName);
//$NON-NLS-1$
+
+ obtainTextEditor(editorPart);
+
+ viewer = textEditor.getTextViewer();
+ document = viewer.getDocument();
+ SourceViewerConfiguration config = CATestUtil
+ .getSourceViewerConfiguration(textEditor);
+ contentAssistant = (config == null ? null : config
+ .getContentAssistant(viewer));
+
+ assertTrue(
+ "Cannot get the Content Assistant instance for the editor for page \""
//$NON-NLS-1$
+ + fileName + "\"", (contentAssistant != null)); //$NON-NLS-1$
+
+ assertTrue("The IDocument is not instance of IStructuredDocument for page
\"" //$NON-NLS-1$
+ + fileName + "\"", //$NON-NLS-1$
+ (document instanceof IStructuredDocument));
+
+ }
+
+ /**
+ * Looks into editorPart for the test editor to apply content assist to.
+ *
+ * @param editorPart
+ */
+ protected void obtainTextEditor(IEditorPart editorPart) {
+ }
+
+ public ICompletionProposal[] checkProposals(String fileName, int offset, String[]
proposals, boolean exactly) {
+ return checkProposals(fileName, null, offset, proposals, exactly, true);
+ }
+
+ public ICompletionProposal[] checkProposals(String fileName, String substring, int
offset, String[] proposals, boolean exactly) {
+ return checkProposals(fileName, substring, offset, proposals, exactly, false);
+ }
+ public ICompletionProposal[] checkProposals(String fileName, String substring, int
offset, String[] proposals, boolean exactly, boolean excludeELProposalsFromExactTest){
+ openEditor(fileName);
+
+ int position = 0;
+ if (substring != null) {
+ String documentContent = document.get();
+ position = documentContent.indexOf(substring);
+ }
+
+ List<ICompletionProposal> res = CATestUtil.collectProposals(contentAssistant,
viewer, position+offset);
+
+ assertTrue("Content Assistant returned no proposals", (res != null
&& res.size() > 0)); //$NON-NLS-1$
+
+ // for (int i = 0; i < result.length; i++) {
+ // System.out.println("proposal - "+result[i].getDisplayString());
+ // }
+
+ ICompletionProposal[] result = res.toArray(new ICompletionProposal[res.size()]);
+ int foundCounter = 0;
+ for (int i = 0; i < proposals.length; i++) {
+ boolean found = compareProposal(proposals[i], result);
+ if (found)
+ foundCounter++;
+ assertTrue("Proposal " + proposals[i] + " not found!",
found ); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ if (exactly) {
+ if (excludeELProposalsFromExactTest) {
+ assertTrue("Some other proposals were found!", foundCounter ==
proposals.length); //$NON-NLS-1$
+ } else {
+ assertTrue("Some other proposals were found!", result.length ==
proposals.length); //$NON-NLS-1$
+ }
+ }
+
+// System.out.println("checkProposals <<< Exiting");
+ return result;
+ }
+
+ /**
+ * Returns true if proposal is created by the content assistant being tested.
+ *
+ * @param proposal
+ * @return
+ */
+ protected boolean isRelevantProposal(ICompletionProposal proposal) {
+ return false;
+ }
+
+ public boolean compareProposal(String proposalName, ICompletionProposal[] proposals){
+ for (int i = 0; i < proposals.length; i++) {
+ if (isRelevantProposal(proposals[i])) {
+ CustomCompletionProposal ap = (CustomCompletionProposal)proposals[i];
+ String replacementString = ap.getReplacementString().toLowerCase();
+ if (replacementString.equalsIgnoreCase(proposalName)) return true;
+
+ // For a tag proposal there will be not only the the tag name but all others
characters like default attributes, tag ending characters and so on
+ if (replacementString.indexOf("/>") != -1) {
+ replacementString = replacementString.substring(0,
replacementString.indexOf("/>"));
+ }
+ if (replacementString.indexOf('>') != -1) {
+ replacementString = replacementString.substring(0,
replacementString.indexOf('>'));
+ }
+ if (replacementString.equalsIgnoreCase(proposalName)) return true;
+
+ String[] replacementStringParts = replacementString.split(" ");
//$NON-NLS-1$
+ if (replacementStringParts != null && replacementStringParts.length > 0)
{
+ if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return true;
+ }
+
+ // for an attribute proposal there will be a pare of attribute-value (i.e.
attrName="attrValue")
+ replacementStringParts = replacementString.split("="); //$NON-NLS-1$
+ if (replacementStringParts != null && replacementStringParts.length > 0)
{
+ if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return true;
+ }
+
+ // for an Unclosed EL the closing character is appended to the proposal string (i.e.
person} )
+ // perform case sensitive compare operation
+ replacementStringParts = replacementString.split("}"); //$NON-NLS-1$
+ if (replacementStringParts != null && replacementStringParts.length > 0)
{
+ if (replacementStringParts[0].equals(proposalName)) return true;
+ }
+
+ // For an attribute value proposal there will be the quote characters
+ replacementString = Utils.trimQuotes(replacementString);
+ if (replacementString.equalsIgnoreCase(proposalName)) return true;
+
+ } else {
+ if(proposals[i].getDisplayString().toLowerCase().equals(proposalName.toLowerCase()))
return true;
+ }
+ }
+ return false;
+ }
+
+ public void closeEditor() {
+ if (editorPart != null) {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getActivePage().closeEditor(editorPart, false);
+ editorPart = null;
+ }
+ }
+
+ /**
+ * @return the project
+ */
+ public IProject getProject() {
+ return project;
+ }
+
+ /**
+ * @param project the project to set
+ */
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+ /**
+ * @return the jspTextEditor
+ */
+ public StructuredTextEditor getTextEditor() {
+ return textEditor;
+ }
+
+ /**
+ * @return the viewer
+ */
+ public ISourceViewer getViewer() {
+ return viewer;
+ }
+
+ /**
+ * @param viewer the viewer to set
+ */
+ public void setViewer(ISourceViewer viewer) {
+ this.viewer = viewer;
+ }
+
+ /**
+ * @return the contentAssistant
+ */
+ public IContentAssistant getContentAssistant() {
+ return contentAssistant;
+ }
+
+ /**
+ * @param contentAssistant the contentAssistant to set
+ */
+ public void setContentAssistant(IContentAssistant contentAssistant) {
+ this.contentAssistant = contentAssistant;
+ }
+
+ /**
+ * @return the document
+ */
+ public IDocument getDocument() {
+ return document;
+ }
+
+ /**
+ * @param document the document to set
+ */
+ public void setDocument(IDocument document) {
+ this.document = document;
+ }
+
+}
Property changes on:
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/CATestUtil.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/CATestUtil.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/CATestUtil.java 2011-05-24
18:25:13 UTC (rev 31453)
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.common.base.test.contentassist;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+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.ICompletionProposal;
+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.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.AbstractTextEditor;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.jboss.tools.common.text.xml.contentassist.ProposalSorter;
+
+public class CATestUtil {
+
+ /** The Constant MAX_IDLE. */
+ public static final long MAX_IDLE = 5*60*1000L;
+
+ /**
+ * Returns the CA Processor from content assistant for the given offset in the
document.
+ *
+ *
+ * @param viewer
+ * @param offset
+ * @param ca
+ */
+
+ public static IContentAssistProcessor getProcessor(ITextViewer viewer, int offset,
IContentAssistant ca) {
+ try {
+ IDocument document= viewer.getDocument();
+ String type= TextUtilities.getContentType(document,
((IContentAssistantExtension)ca).getDocumentPartitioning(), offset, true);
+ return ca.getContentAssistProcessor(type);
+ } catch (BadLocationException x) {
+ }
+
+ return null;
+ }
+
+ /**
+ * Process UI input but do not return for the specified time interval.
+ *
+ * @param waitTimeMillis
+ * the number of milliseconds
+ */
+ public static void delay(long waitTimeMillis) {
+ Display display = Display.getCurrent();
+
+ // If this is the UI thread,
+ // then process input.
+ if (display != null) {
+ long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
+ while (System.currentTimeMillis() < endTimeMillis) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.update();
+ }
+ // Otherwise, perform a simple sleep.
+ else {
+ try {
+ Thread.sleep(waitTimeMillis);
+ } catch (InterruptedException e) {
+ // Ignored.
+ }
+ }
+ }
+
+ /**
+ * 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(ITextEditor editor)
{
+ Class editorClass = editor.getClass();
+ while (editorClass != null) {
+ try {
+ Method m = editorClass.getDeclaredMethod("getSourceViewerConfiguration",
new Class[] {});
+
+ if(m != null) {
+ m.setAccessible(true);
+ Object result = m.invoke(editor, new Object[]{});
+ return (result instanceof SourceViewerConfiguration ?
(SourceViewerConfiguration)result : null);
+ }
+ } catch (NoSuchMethodException ne) {
+ } catch (Exception e) {
+ }
+ editorClass = editorClass.getSuperclass();
+ }
+ return null;
+
+ }
+
+ public static void prepareCAInvokation(IContentAssistant ca, ITextViewer viewer, int
offset) {
+ if (ca == null || viewer == null)
+ return;
+
+ // sets cursor position
+ viewer.getTextWidget().setCaretOffset(offset);
+
+ CATestUtil.waitForIdle(CATestUtil.MAX_IDLE);
+ CATestUtil.delay(1000);
+
+ ca.showPossibleCompletions();
+ }
+
+ public static int MAX_CATEGORIES_COUNT = 10;
+ public static List<ICompletionProposal> collectProposals(IContentAssistant ca,
ITextViewer viewer, int offset) {
+ prepareCAInvokation(ca, viewer, offset);
+
+ final IContentAssistProcessor p= CATestUtil.getProcessor(viewer, offset, ca);
+ List<ICompletionProposal> res= new ArrayList<ICompletionProposal>();
+ // Try to acquire all the proposal categories assuming that there are less than 10 or
equal
+ for (int i = 0; i < MAX_CATEGORIES_COUNT && p != null; i++) {
+ ICompletionProposal[] result= p.computeCompletionProposals(viewer, offset);
+ for (int j = 0; result != null && j < result.length; j++) {
+ res.add(result[j]);
+ }
+ }
+ return ProposalSorter.filterAndSortProposals(res, null, null);
+ }
+ /**
+ * Close all opened editors
+ * @author mareshkau
+ */
+ public static final void closeAllEditors(){
+ IWorkbenchPage page = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage();
+ IWorkbenchPart part = page.getViewReferences()[0].getPart(false);
+ page.activate(part);
+ // close
+ page.closeAllEditors(false);
+ }
+}
Property changes on:
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/CATestUtil.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain