JBoss Tools SVN: r40341 - trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2012-04-19 09:53:42 -0400 (Thu, 19 Apr 2012)
New Revision: 40341
Modified:
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/Constants.java
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NamespaceMappingTest.java
Log:
JBIDE-11575 The ModeShape Tools JCR CND Preference Page Should Show Notation Type Preview. Add more to the CND that is previewed. Corrected some minor formatting problems. Added a CndImporter that imports the JackRabbit CND Reader *.cnd file.
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/Constants.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/Constants.java 2012-04-19 13:47:13 UTC (rev 40340)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/Constants.java 2012-04-19 13:53:42 UTC (rev 40341)
@@ -226,13 +226,13 @@
+ Utils.SINGLE_QUOTE + ITEM_THREE + Utils.SINGLE_QUOTE;
String REQUIRED_TYPES_SHORT_VARIANT = RequiredTypes.NOTATION_PREFIX + VARIANT + RequiredTypes.NOTATION_SUFFIX;
- String REQUIRED_TYPES_VARIANT = RequiredTypes.NOTATION_PREFIX + Utils.SPACE_STRING + VARIANT + RequiredTypes.NOTATION_SUFFIX;
- String REQUIRED_TYPES_ONE_ITEM_FORM = RequiredTypes.NOTATION_PREFIX + Utils.SPACE_STRING + QUALIFIED_NAME1 + RequiredTypes.NOTATION_SUFFIX;
+ String REQUIRED_TYPES_VARIANT = RequiredTypes.NOTATION_PREFIX + VARIANT + RequiredTypes.NOTATION_SUFFIX;
+ String REQUIRED_TYPES_ONE_ITEM_FORM = RequiredTypes.NOTATION_PREFIX + QUALIFIED_NAME1 + RequiredTypes.NOTATION_SUFFIX;
String REQUIRED_TYPES_ONE_ITEM_SHORT_FORM = RequiredTypes.NOTATION_PREFIX + QUALIFIED_NAME1 + RequiredTypes.NOTATION_SUFFIX;
String REQUIRED_TYPES_THREE_ITEM_SHORT_FORM = RequiredTypes.NOTATION_PREFIX + QUALIFIED_NAME1
+ ListAttributeState.ITEM_DELIM_NOTATION[NotationType.COMPACT_INDEX] + QUALIFIED_NAME2
+ ListAttributeState.ITEM_DELIM_NOTATION[NotationType.COMPACT_INDEX] + QUALIFIED_NAME3 + RequiredTypes.NOTATION_SUFFIX;
- String REQUIRED_TYPES_THREE_ITEM_FORM = RequiredTypes.NOTATION_PREFIX + Utils.SPACE_STRING + QUALIFIED_NAME1
+ String REQUIRED_TYPES_THREE_ITEM_FORM = RequiredTypes.NOTATION_PREFIX + QUALIFIED_NAME1
+ ListAttributeState.ITEM_DELIM_NOTATION[NotationType.LONG_INDEX] + QUALIFIED_NAME2
+ ListAttributeState.ITEM_DELIM_NOTATION[NotationType.LONG_INDEX] + QUALIFIED_NAME3 + RequiredTypes.NOTATION_SUFFIX;
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NamespaceMappingTest.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NamespaceMappingTest.java 2012-04-19 13:47:13 UTC (rev 40340)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/NamespaceMappingTest.java 2012-04-19 13:53:42 UTC (rev 40341)
@@ -70,8 +70,9 @@
final String PREFIX = "prefix"; //$NON-NLS-1$
final String URI = "uri"; //$NON-NLS-1$
this.namespaceMapping = new NamespaceMapping(PREFIX, URI);
- assertEquals(NamespaceMapping.NOTATION_PREFIX + PREFIX + NamespaceMapping.NOTATION_DELIMITER + '\'' + URI + '\''
- + NamespaceMapping.NOTATION_SUFFIX, this.namespaceMapping.toCndNotation(NotationType.LONG));
+ assertEquals(NamespaceMapping.NOTATION_PREFIX + PREFIX + Utils.SPACE_STRING + NamespaceMapping.NOTATION_DELIMITER
+ + Utils.SPACE_STRING + '\'' + URI + '\'' + NamespaceMapping.NOTATION_SUFFIX,
+ this.namespaceMapping.toCndNotation(NotationType.LONG));
}
@Test
13 years, 11 months
JBoss Tools SVN: r40340 - in trunk/modeshape: plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/attributes and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2012-04-19 09:47:13 -0400 (Thu, 19 Apr 2012)
New Revision: 40340
Added:
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/testdata/cnd-reader-test-input.cnd
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/preferences/CndPreferencePage.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/NodeTypeDefinition.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/attributes/RequiredTypes.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CompactNodeTypeDefinition.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/preference/JcrPreferenceConstants.java
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndImporterTest.java
Log:
JBIDE-11575 The ModeShape Tools JCR CND Preference Page Should Show Notation Type Preview. Add more to the CND that is previewed. Corrected some minor formatting problems. Added a CndImporter that imports the JackRabbit CND Reader *.cnd file.
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/NodeTypeDefinition.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/NodeTypeDefinition.java 2012-04-19 13:19:48 UTC (rev 40339)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/NodeTypeDefinition.java 2012-04-19 13:47:13 UTC (rev 40340)
@@ -831,10 +831,11 @@
final StringBuilder builder = new StringBuilder();
{ // name
- builder.append(NAME_NOTATION_PREFIX)
- .append(this.name.toCndNotation(notationType))
- .append(NAME_NOTATION_SUFFIX)
- .append(prefStore.get(JcrPreferenceConstants.CndPreference.NODE_TYPE_DEFINITION_NAME_END_DELIMITER));
+ builder.append(NAME_NOTATION_PREFIX).append(this.name.toCndNotation(notationType)).append(NAME_NOTATION_SUFFIX);
+
+ if (NotationType.LONG == notationType) {
+ builder.append(prefStore.get(JcrPreferenceConstants.CndPreference.NODE_TYPE_DEFINITION_NAME_END_DELIMITER));
+ }
}
{ // super types
@@ -863,12 +864,17 @@
final String elementDelimiter = prefStore.get(JcrPreferenceConstants.CndPreference.ELEMENT_DELIMITER);
for (final CndElement element : elements) {
- builder.append(elementStartDelimiter);
+ if (NotationType.LONG == notationType) {
+ builder.append(elementStartDelimiter);
+ }
+
builder.append(element.toCndNotation(notationType));
builder.append(elementDelimiter);
}
- builder.append(prefStore.get(JcrPreferenceConstants.CndPreference.ELEMENTS_END_DELIMITER));
+ if (NotationType.COMPACT != notationType) {
+ builder.append(prefStore.get(JcrPreferenceConstants.CndPreference.ELEMENTS_END_DELIMITER));
+ }
}
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/attributes/RequiredTypes.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/attributes/RequiredTypes.java 2012-04-19 13:19:48 UTC (rev 40339)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/attributes/RequiredTypes.java 2012-04-19 13:47:13 UTC (rev 40340)
@@ -48,6 +48,16 @@
}
/**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.jcr.attributes.ListAttributeState#getPrefixEndDelimiter(org.jboss.tools.modeshape.jcr.cnd.CndElement.NotationType)
+ */
+ @Override
+ protected String getPrefixEndDelimiter( NotationType notationType ) {
+ return Utils.EMPTY_STRING;
+ }
+
+ /**
* @return the collection of required types (never <code>null</code>)
*/
public String[] toArray() {
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CompactNodeTypeDefinition.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CompactNodeTypeDefinition.java 2012-04-19 13:19:48 UTC (rev 40339)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CompactNodeTypeDefinition.java 2012-04-19 13:47:13 UTC (rev 40340)
@@ -508,7 +508,9 @@
}
}
- builder.append(prefStore.get(JcrPreferenceConstants.CndPreference.NAMESPACE_MAPPING_SECTION_END_DELIMITER));
+ if (NotationType.COMPACT != notationType) {
+ builder.append(prefStore.get(JcrPreferenceConstants.CndPreference.NAMESPACE_MAPPING_SECTION_END_DELIMITER));
+ }
}
}
@@ -518,11 +520,13 @@
for (final NodeTypeDefinition nodeTypeDefinition : this.nodeTypeDefinitions) {
if (Utils.build(builder, addDelim, DELIM, nodeTypeDefinition.toCndNotation(notationType))) {
- addDelim = true;
+ addDelim = (NotationType.COMPACT != notationType);
}
}
- builder.append(prefStore.get(JcrPreferenceConstants.CndPreference.NODE_TYPE_DEFINITION_SECTION_END_DELIMITER));
+ if (NotationType.COMPACT != notationType) {
+ builder.append(prefStore.get(JcrPreferenceConstants.CndPreference.NODE_TYPE_DEFINITION_SECTION_END_DELIMITER));
+ }
}
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/preference/JcrPreferenceConstants.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/preference/JcrPreferenceConstants.java 2012-04-19 13:19:48 UTC (rev 40339)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/preference/JcrPreferenceConstants.java 2012-04-19 13:47:13 UTC (rev 40340)
@@ -65,7 +65,7 @@
ELEMENTS_END_DELIMITER,
/**
- * The delimiter before the first CND element.
+ * The delimiter before each node type definition's item definitions (properties, child nodes).
*/
ELEMENTS_START_DELIMITER,
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/preferences/CndPreferencePage.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/preferences/CndPreferencePage.java 2012-04-19 13:19:48 UTC (rev 40339)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/preferences/CndPreferencePage.java 2012-04-19 13:47:13 UTC (rev 40340)
@@ -61,17 +61,23 @@
if (_previewCnd == null) {
_previewCnd = new CompactNodeTypeDefinition();
- final String content = "<ex = 'http://namespace.com/ns'>\n" //$NON-NLS-1$
- + "[ex:NodeType] > ex:ParentType1, ex:ParentType2 abstract orderable mixin noquery primaryitem ex:property\n" //$NON-NLS-1$
- + "- ex:property (STRING) = 'default1', 'default2' mandatory autocreated protected multiple VERSION\n" //$NON-NLS-1$
+ final String content = "<abc = 'http://namespace.com/abc/1.0'>\n" //$NON-NLS-1$
+ + "<xyz = 'http://namespace.com/xyz/1.0'>\n" //$NON-NLS-1$
+ + "[abc:NodeType] > abc:ParentType1, abc:ParentType2 abstract orderable mixin noquery primaryitem abc:propertyABC\n" //$NON-NLS-1$
+ + "- abc:propertyABC (STRING) = 'default1', 'default2' mandatory autocreated protected multiple VERSION\n" //$NON-NLS-1$
+ " queryops '=, <>, <, <=, >, >=, LIKE' nofulltext noqueryorder < 'constraint1', 'constraint2'" //$NON-NLS-1$
- + "+ ex:node (ex:reqType1, ex:reqType2) = ex:defaultType mandatory autocreated protected sns version"; //$NON-NLS-1$
+ + "+ abc:node (abc:reqType1, abc:reqType2) = abc:defaultType mandatory autocreated protected sns version\n" //$NON-NLS-1$
+ + "[xyz:NodeTypeX]\n" //$NON-NLS-1$
+ + "- xyz:propertyX" //$NON-NLS-1$
+ + "[xyz:NodeTypeY]\n" //$NON-NLS-1$
+ + "- xyz:propertyY (LONG)" //$NON-NLS-1$
+ + "+ xyz:childNodeY"; //$NON-NLS-1$
CndImporter importer = new CndImporter(true);
Collection<Throwable> problems = new ArrayList<Throwable>();
_previewCnd = importer.importFrom(content, problems, "string"); //$NON-NLS-1$
-
+
if (_previewCnd == null) {
for (Throwable e : problems) {
Activator.getSharedInstance().getLog().log(new Status(IStatus.ERROR, JcrUiConstants.PLUGIN_ID, null, e));
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndImporterTest.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndImporterTest.java 2012-04-19 13:19:48 UTC (rev 40339)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndImporterTest.java 2012-04-19 13:47:13 UTC (rev 40340)
@@ -563,6 +563,17 @@
}
@Test
+ public void shouldImportJackRabbitCndReaderTestCnd() throws Exception {
+ this.importer.importFrom(openCndFile("cnd-reader-test-input.cnd"), this.problems); //$NON-NLS-1$
+
+ if (this.problems.size() != 0) {
+ printProblems();
+ }
+
+ assertEquals(0, this.problems.size());
+ }
+
+ @Test
public void shouldImportJcrBuiltinNodeTypesForJSR170() throws Exception {
this.cnd = this.importer.importFrom(openCndFile("jcr-builtins-170.cnd"), this.problems); //$NON-NLS-1$
Added: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/testdata/cnd-reader-test-input.cnd
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/testdata/cnd-reader-test-input.cnd (rev 0)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/testdata/cnd-reader-test-input.cnd 2012-04-19 13:47:13 UTC (rev 40340)
@@ -0,0 +1,231 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+<ex = "http://example.org/jackrabbit/example">
+<jcr='http://www.jcp.org/jcr/1.0'>
+<mix='http://www.jcp.org/jcr/mix/1.0'>
+<nt='http://www.jcp.org/jcr/nt/1.0'>
+
+// test remapping
+<REP='internal'>
+
+// omit this namespace to test auto-registering
+// <mix='http://www.jcp.org/jcr/mix/1.0'>
+
+//------------------------------------------------------------------------------
+// E X A M P L E T Y P E S
+//------------------------------------------------------------------------------
+
+[ex:NodeType] > ex:ParentNodeType1, ex:ParentNodeType2
+ orderable mixin
+ - ex:property (long) = '1', '2' primary mandatory autocreated protected multiple version < '[1,10]'
+ + ex:node (ex:RequiredNodeType1, ex:RequiredNodeType2) = ex:RequiredNodeType1 mandatory autocreated protected multiple version
+
+[ex:AnotherNodeType] > ex:NodeType
+ - * (string) = 'a residual property' multiple
+ + * (ex:RequiredNodeType1) multiple
+
+[ex:Empty]
+
+[NoPrefix]
+
+[ex:Reference]
+ - ex:ref (reference) mandatory protected < 'ex:ref'
+
+[ex:Name]
+ - ex:name (name) < 'ex:name'
+
+[ex:Path]
+ - ex:path (path) < 'ex:a/ex:b'
+
+[ex:Full] > ex:NodeType
+ orderable mixin abstract primaryitem ex:p1 noquery
+ - ex:p1 (STRING) mandatory protected autocreated multiple
+ - ex:p2 (BINARY) queryops '=, <>, <, <=, >, >=, LIKE'
+ - ex:p3 (LONG) nofulltext noqueryorder
+ - ex:p4 (DOUBLE)
+ - ex:p5 (BOOLEAN)
+ - ex:p6 (NAME)
+ - ex:p8 (PATH)
+ - ex:p9 (REFERENCE)
+ - ex:pa (WEAKREFERENCE)
+ - ex:pb (DECIMAL)
+ - ex:pc (URI)
+ - ex:pd (UNDEFINED)
+ - ex:pf (*)
+ + ex:n1 (ex:NodeType) COPY
+ + ex:n2 (ex:NodeType) VERSION
+ + ex:n3 (ex:NodeType) INITIALIZE
+ + ex:n4 (ex:NodeType) COMPUTE
+ + ex:n5 (ex:NodeType) IGNORE
+ + ex:n6 (ex:NodeType) ABORT
+
+[ex:Full1] > ex:NodeType
+ orderable mixin abstract primaryitem ex:p1 query
+ - ex:p1
+
+//------------------------------------------------------------------------------
+// B A S E T Y P E S
+//------------------------------------------------------------------------------
+
+[nt:base]
+ - jcr:primaryType (name) mandatory autocreated protected compute
+ - jcr:mixinTypes (name) protected multiple compute
+
+[nt:unstructured]
+ orderable
+ - * (undefined) multiple
+ - * (undefined)
+ + * (nt:base) = nt:unstructured multiple version
+
+[mix:referenceable]
+ mixin
+ - jcr:uuid (string) mandatory autocreated protected initialize
+
+[mix:lockable]
+ mixin
+ - jcr:lockOwner (string) protected ignore
+ - jcr:lockIsDeep (boolean) protected ignore
+
+//------------------------------------------------------------------------------
+// V E R S I O N I N G
+//------------------------------------------------------------------------------
+
+[mix:versionable] > mix:referenceable
+ mixin
+ - jcr:versionHistory (reference) mandatory protected
+ < 'nt:versionHistory'
+ - jcr:baseVersion (reference) mandatory protected ignore
+ < 'nt:version'
+ - jcr:isCheckedOut (boolean) = 'true' mandatory autocreated protected ignore
+ - jcr:predecessors (reference) mandatory protected multiple
+ < 'nt:version'
+ - jcr:mergeFailed (reference) protected multiple abort
+
+[nt:versionHistory] > mix:referenceable
+ - jcr:versionableUuid (string) mandatory autocreated protected abort
+ + jcr:rootVersion (nt:version) = nt:version mandatory autocreated protected abort
+ + jcr:versionLabels (nt:versionLabels) = nt:versionLabels mandatory autocreated protected abort
+ + * (nt:version) = nt:version protected abort
+
+[nt:versionLabels]
+ - * (reference) protected abort
+ < 'nt:version'
+
+[nt:version] > mix:referenceable
+ - jcr:created (date) mandatory autocreated protected abort
+ - jcr:predecessors (reference) protected multiple abort
+ < 'nt:version'
+ - jcr:successors (reference) protected multiple abort
+ < 'nt:version'
+ + jcr:frozenNode (nt:frozenNode) protected abort
+
+[nt:frozenNode] > mix:referenceable
+ orderable
+ - jcr:frozenPrimaryType (name) mandatory autocreated protected abort
+ - jcr:frozenMixinTypes (name) protected multiple abort
+ - jcr:frozenUuid (string) mandatory autocreated protected abort
+ - * (undefined) protected abort
+ - * (undefined) protected multiple abort
+ + * (nt:base) protected multiple abort
+
+[nt:versionedChild]
+ - jcr:childVersionHistory (reference) mandatory autocreated protected abort
+ < 'nt:versionHistory'
+
+//------------------------------------------------------------------------------
+// N O D E T Y P E S
+//------------------------------------------------------------------------------
+
+[nt:nodeType]
+ - jcr:nodeTypeName (name) mandatory
+ - jcr:supertypes (name) multiple
+ - jcr:isMixin (boolean) mandatory
+ - jcr:hasOrderableChildNodes (boolean) mandatory
+ - jcr:primaryItemName (name)
+ + jcr:propertyDefinition (nt:propertyDefinition) = nt:propertyDefinition multiple version
+ + jcr:childNodeDefinition (nt:childNodeDefinition) = nt:childNodeDefinition multiple version
+
+[nt:propertyDefinition]
+ - jcr:name (name)
+ - jcr:autoCreated (boolean) mandatory
+ - jcr:mandatory (boolean) mandatory
+ - jcr:onParentVersion (string) mandatory
+ < 'COPY', 'VERSION', 'INITIALIZE', 'COMPUTE', 'IGNORE', 'ABORT'
+ - jcr:protected (boolean) mandatory
+ - jcr:requiredType (string) mandatory
+ < 'STRING', 'BINARY', 'LONG', 'DOUBLE', 'BOOLEAN', 'DATE', 'NAME', 'PATH', 'REFERENCE', 'UNDEFINED'
+ - jcr:valueConstraints (string) multiple
+ - jcr:defaultValues (undefined) multiple
+ - jcr:multiple (boolean) mandatory
+
+[nt:childNodeDefinition]
+ - jcr:name (name)
+ - jcr:autoCreated (boolean) mandatory
+ - jcr:mandatory (boolean) mandatory
+ - jcr:onParentVersion (string) mandatory
+ < 'COPY', 'VERSION', 'INITIALIZE', 'COMPUTE', 'IGNORE', 'ABORT'
+ - jcr:protected (boolean) mandatory
+ - jcr:requiredPrimaryTypes (name) = 'nt:base' mandatory multiple
+ - jcr:defaultPrimaryType (name)
+ - jcr:sameNameSiblings (boolean) mandatory
+
+//------------------------------------------------------------------------------
+// M I S C
+//------------------------------------------------------------------------------
+
+[nt:hierarchyNode]
+ - jcr:created (date) autocreated protected initialize
+
+[nt:folder] > nt:hierarchyNode
+ + * (nt:hierarchyNode) version
+
+[nt:file] > nt:hierarchyNode
+ + jcr:content (nt:base) primary mandatory
+
+[nt:linkedFile] > nt:hierarchyNode
+ - jcr:content (reference) primary mandatory
+
+[nt:resource] > mix:referenceable
+ - jcr:encoding (string)
+ - jcr:mimeType (string) mandatory
+ - jcr:data (binary) primary mandatory
+ - jcr:lastModified (date) mandatory ignore
+
+[nt:query]
+ - jcr:statement (string)
+ - jcr:language (string)
+
+//------------------------------------------------------------------------------
+// J A C K R A B B I T I N T E R N A L S
+//------------------------------------------------------------------------------
+
+[REP:nodeTypes]
+ + * (nt:nodeType) = nt:nodeType protected abort
+
+[REP:root] > nt:unstructured
+ orderable
+ + jcr:system (REP:system) = REP:system mandatory ignore
+
+[REP:system]
+ orderable
+ + jcr:versionStorage (REP:versionStorage) = REP:versionStorage mandatory protected abort
+ + jcr:nodeTypes (REP:nodeTypes) = REP:nodeTypes mandatory protected abort
+ + * (nt:base) = nt:unstructured multiple ignore
+
+[REP:versionStorage]
+ + * (nt:versionHistory) = nt:versionHistory protected multiple abort
+ + * (REP:versionStorage) = REP:versionStorage protected multiple abort
\ No newline at end of file
13 years, 11 months
JBoss Tools SVN: r40339 - in trunk/jbpm/features: org.jboss.tools.jbpm4.test.feature and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-04-19 09:19:48 -0400 (Thu, 19 Apr 2012)
New Revision: 40339
Added:
trunk/jbpm/features/org.jboss.tools.jbpm3.test.feature/license.html
trunk/jbpm/features/org.jboss.tools.jbpm4.test.feature/license.html
Log:
add missing license.html files to test features
Added: trunk/jbpm/features/org.jboss.tools.jbpm3.test.feature/license.html
===================================================================
--- trunk/jbpm/features/org.jboss.tools.jbpm3.test.feature/license.html (rev 0)
+++ trunk/jbpm/features/org.jboss.tools.jbpm3.test.feature/license.html 2012-04-19 13:19:48 UTC (rev 40339)
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+
+<body>
+<p>Red Hat, Inc. licenses these features and plugins to you under
+certain open source licenses (or aggregations of such licenses), which
+in a particular case may include the Eclipse Public License, the GNU
+Lesser General Public License, and/or certain other open source
+licenses. For precise licensing details, consult the corresponding
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive,
+Raleigh NC 27606 USA.
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/jbpm/features/org.jboss.tools.jbpm4.test.feature/license.html
===================================================================
--- trunk/jbpm/features/org.jboss.tools.jbpm4.test.feature/license.html (rev 0)
+++ trunk/jbpm/features/org.jboss.tools.jbpm4.test.feature/license.html 2012-04-19 13:19:48 UTC (rev 40339)
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+
+<body>
+<p>Red Hat, Inc. licenses these features and plugins to you under
+certain open source licenses (or aggregations of such licenses), which
+in a particular case may include the Eclipse Public License, the GNU
+Lesser General Public License, and/or certain other open source
+licenses. For precise licensing details, consult the corresponding
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive,
+Raleigh NC 27606 USA.
+</p>
+</body>
+</html>
\ No newline at end of file
13 years, 11 months
JBoss Tools SVN: r40338 - trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2012-04-19 09:19:44 -0400 (Thu, 19 Apr 2012)
New Revision: 40338
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/pom.xml
Log:
Added parameter xulrunner.plugin.name.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/pom.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/pom.xml 2012-04-19 13:15:06 UTC (rev 40337)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/pom.xml 2012-04-19 13:19:44 UTC (rev 40338)
@@ -13,7 +13,7 @@
<packaging>eclipse-test-plugin</packaging>
<properties>
<jbosstools.test.jboss-as.home>${requirement.build.root}/jboss-as-web-7.0.2.Final</jbosstools.test.jboss-as.home>
- <systemProperties>-Dswtbot.test.skip=false -Dtest.configurations.dir=resources/properties/ -Djbosstools.test.jboss-as.home=${jbosstools.test.jboss-as.home} -Dorg.eclipse.swt.browser.XULRunnerPath=${project.build.outputDirectory}/../work/plugins/org.mozilla.xulrunner.gtk.linux.x86_1.9.2.16b/xulrunner</systemProperties>
+ <systemProperties>-Dswtbot.test.skip=false -Dtest.configurations.dir=resources/properties/ -Djbosstools.test.jboss-as.home=${jbosstools.test.jboss-as.home} -Dorg.eclipse.swt.browser.XULRunnerPath=${project.build.outputDirectory}/../work/plugins/${xulrunner.plugin.name}/xulrunner</systemProperties>
<test.suite.class>org.jboss.tools.jsf.ui.bot.test.JSFAllBotTests</test.suite.class>
</properties>
<build>
13 years, 11 months
JBoss Tools SVN: r40337 - trunk/jbpm.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-04-19 09:15:06 -0400 (Thu, 19 Apr 2012)
New Revision: 40337
Removed:
trunk/jbpm/test/
Log:
remove empty folder
13 years, 11 months
JBoss Tools SVN: r40336 - trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/launchers/prepare_workspace.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-04-19 08:15:49 -0400 (Thu, 19 Apr 2012)
New Revision: 40336
Modified:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/launchers/prepare_workspace/RT_prepare_workspace.launch
Log:
Changed the base directory path.
Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/launchers/prepare_workspace/RT_prepare_workspace.launch
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/launchers/prepare_workspace/RT_prepare_workspace.launch 2012-04-19 12:08:40 UTC (rev 40335)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/launchers/prepare_workspace/RT_prepare_workspace.launch 2012-04-19 12:15:49 UTC (rev 40336)
@@ -12,5 +12,5 @@
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
-<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="/home/ljelinko/work/workspaces/jboss-tools/org.jboss.tools.runtime.as.ui.bot.test/launchers/prepare_workspace"/>
+<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}/org.jboss.tools.runtime.as.ui.bot.test/launchers/prepare_workspace"/>
</launchConfiguration>
13 years, 11 months
JBoss Tools SVN: r40335 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-04-19 08:08:40 -0400 (Thu, 19 Apr 2012)
New Revision: 40335
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java
Log:
Added methods restart and getServerStatus
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java 2012-04-19 11:27:07 UTC (rev 40334)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java 2012-04-19 12:08:40 UTC (rev 40335)
@@ -2,6 +2,7 @@
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.waits.ICondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
@@ -9,6 +10,8 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
import org.jboss.tools.ui.bot.ext.gen.ActionItem.View.ServerServers;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
@@ -30,24 +33,24 @@
SWTBotTreeItem server = findServerByName(tree,serverName);
if (server!=null) {
ContextMenuHelper.prepareTreeItemForContextMenu(tree, server);
- new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.ADD_AND_REMOVE, false)).click();
- try {
- SWTBotShell shell = bot.shell(IDELabel.Menu.ADD_AND_REMOVE);
- shell.activate();
- SWTBotButton btRemoveAll=shell.bot().button("<< Remove All");
- if (btRemoveAll.isEnabled()) {
- btRemoveAll.click();
- log.info("Removing all projects from server '"+serverName+"'");
- }
- open.finish(shell.bot(), IDELabel.Button.FINISH);
- util.waitForNonIgnoredJobs();
- util.waitForAll(Timing.time3S());
- } catch (WidgetNotFoundException ex) {
- ex.printStackTrace();
- bot.shell("Server").activate();
- bot.button(IDELabel.Button.OK).click();
- }
-
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.ADD_AND_REMOVE, false)).click();
+ try {
+ SWTBotShell shell = bot.shell(IDELabel.Menu.ADD_AND_REMOVE);
+ shell.activate();
+ SWTBotButton btRemoveAll=shell.bot().button("<< Remove All");
+ if (btRemoveAll.isEnabled()) {
+ btRemoveAll.click();
+ log.info("Removing all projects from server '"+serverName+"'");
+ }
+ open.finish(shell.bot(), IDELabel.Button.FINISH);
+ util.waitForNonIgnoredJobs();
+ util.waitForAll(Timing.time3S());
+ } catch (WidgetNotFoundException ex) {
+ ex.printStackTrace();
+ bot.shell("Server").activate();
+ bot.button(IDELabel.Button.OK).click();
+ }
+
}
}
/**
@@ -60,10 +63,10 @@
SWTBotTreeItem server = findServerByName(tree,serverName);
if (server!=null) {
ContextMenuHelper.prepareTreeItemForContextMenu(tree, server);
- new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.STOP, false)).click();
- util.waitForNonIgnoredJobs();
- util.waitForAll(Timing.time10S());
-
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.STOP, false)).click();
+ util.waitForNonIgnoredJobs();
+ util.waitForAll(Timing.time10S());
+
}
}
/**
@@ -76,15 +79,47 @@
SWTBotTreeItem server = findServerByName(tree,serverName);
if (server!=null) {
ContextMenuHelper.prepareTreeItemForContextMenu(tree, server);
- new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.DELETE, false)).click();
- SWTBotShell shell = bot.shell("Delete Server");
- shell.activate();
- open.finish(shell.bot(), IDELabel.Button.OK);
- log.info("Removed server: " + serverName);
-
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.DELETE, false)).click();
+ SWTBotShell shell = bot.shell("Delete Server");
+ shell.activate();
+ open.finish(shell.bot(), IDELabel.Button.OK);
+ log.info("Removed server: " + serverName);
+
}
}
+
/**
+ * restarts server with given name
+ * @param serverName
+ */
+ public void restartServer(final String serverName) {
+ SWTBot bot = show().bot();
+ SWTBotTree tree = bot.tree();
+ SWTBotTreeItem server = findServerByName(tree,serverName);
+
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree, server);
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, "Restart", false)).click();
+
+ bot.waitWhile(new NonSystemJobRunsCondition(), TaskDuration.NORMAL.getTimeout());
+ bot.waitUntil(new ICondition() {
+
+ @Override
+ public boolean test() throws Exception {
+ return "Started".equals(getServerStatus(serverName));
+ }
+
+ @Override
+ public void init(SWTBot bot) {
+ }
+
+ @Override
+ public String getFailureMessage() {
+ return "The server does not have status 'Started'";
+ }
+ });
+ }
+
+ /**
* starts application server by given name
* @param serverName
*/
@@ -104,29 +139,29 @@
SWTBotTreeItem server = findServerByName(tree,serverName);
if (server!=null) {
ContextMenuHelper.prepareTreeItemForContextMenu(tree, server);
- new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.START, false)).click();
- if (username!=null) {
- try {
- SWTBot shell = bot.shell("Enter Password").bot();
- shell.textWithLabel("User ID:").setText(username);
- if (password!=null)
- shell.textWithLabel("Password (optional):").setText(password);
- shell.button(IDELabel.Button.OK).click();
- }
- catch (Exception ex){
- log.error(ex);
- }
- }
- util.waitForNonIgnoredJobs(Timing.time(600 * 1000));
- util.waitForAll(Timing.time3S());
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.START, false)).click();
+ if (username!=null) {
+ try {
+ SWTBot shell = bot.shell("Enter Password").bot();
+ shell.textWithLabel("User ID:").setText(username);
+ if (password!=null)
+ shell.textWithLabel("Password (optional):").setText(password);
+ shell.button(IDELabel.Button.OK).click();
+ }
+ catch (Exception ex){
+ log.error(ex);
+ }
+ }
+ util.waitForNonIgnoredJobs(Timing.time(600 * 1000));
+ util.waitForAll(Timing.time3S());
}
else{
- throw new RuntimeException("Unable to start server witn name: " + serverName +
- "\nThis server is not defined within Servers view");
+ throw new RuntimeException("Unable to start server witn name: " + serverName +
+ "\nThis server is not defined within Servers view");
}
}
public SWTBotTreeItem findServerByName(SWTBotTree tree, String name) {
-
+
for (SWTBotTreeItem i : tree.getAllItems()) {
if (i.getText().startsWith(name)) {
return i;
@@ -134,48 +169,74 @@
}
return null;
}
+
+ public boolean serverExists(String serverName){
+ SWTBot bot = show().bot();
+
+ try {
+ // if there are no servers the following text appears
+ bot.link("No servers available. Define a new server from the <a>new server wizard</a>...");
+ return false;
+ } catch (WidgetNotFoundException e){
+ // ok, there are some servers, let's check the name
+ }
+
+ SWTBotTreeItem server = findServerByName(bot.tree(), serverName);
+ return server != null;
+ }
+
+ public String getServerStatus(String serverName){
+ SWTBot bot = show().bot();
+ SWTBotTreeItem server = findServerByName(bot.tree(), serverName);
+
+ String label = server.getText();
+ int startIndex = label.indexOf('[') + 1;
+ int endIndex = label.indexOf(',');
+ return label.substring(startIndex, endIndex);
+ }
+
/**
* removes project with given name from all servers
* @param projectName
*/
public void removeProjectFromServers(String projectName){
-
- SWTBotTree serverTree = show().bot().tree();
- // Expand All
- for (SWTBotTreeItem serverTreeItem : serverTree.getAllItems()){
- serverTreeItem.expand();
- // if JSF Test Project is deployed to server remove it
- SWTBotTreeItem[] serverTreeItemChildren = serverTreeItem.getItems();
- if (serverTreeItemChildren != null && serverTreeItemChildren.length > 0){
- int itemIndex = 0;
- boolean found = false;
- do{
- String treeItemlabel = serverTreeItemChildren[itemIndex].getText();
- found = treeItemlabel.startsWith(projectName);
- } while (!found && ++itemIndex < serverTreeItemChildren.length);
- // Server Tree Item has Child with Text equal to JSF TEst Project
- if (found){
- log.info("Found project to be removed from server: " + serverTreeItemChildren[itemIndex].getText());
- ContextMenuHelper.prepareTreeItemForContextMenu(serverTree,serverTreeItemChildren[itemIndex]);
- new SWTBotMenu(ContextMenuHelper.getContextMenu(serverTree, IDELabel.Menu.REMOVE, false)).click();
- SWTBotShell shell = bot.shell("Server");
- shell.activate();
- open.finish(shell.bot(), IDELabel.Button.OK);
- log.info("Removed project from server: " + serverTreeItemChildren[itemIndex].getText());
- util.waitForNonIgnoredJobs();
- } else {
- log.info("Project '"+projectName+"' not found on any server");
- }
- }
- }
- }
+
+ SWTBotTree serverTree = show().bot().tree();
+ // Expand All
+ for (SWTBotTreeItem serverTreeItem : serverTree.getAllItems()){
+ serverTreeItem.expand();
+ // if JSF Test Project is deployed to server remove it
+ SWTBotTreeItem[] serverTreeItemChildren = serverTreeItem.getItems();
+ if (serverTreeItemChildren != null && serverTreeItemChildren.length > 0){
+ int itemIndex = 0;
+ boolean found = false;
+ do{
+ String treeItemlabel = serverTreeItemChildren[itemIndex].getText();
+ found = treeItemlabel.startsWith(projectName);
+ } while (!found && ++itemIndex < serverTreeItemChildren.length);
+ // Server Tree Item has Child with Text equal to JSF TEst Project
+ if (found){
+ log.info("Found project to be removed from server: " + serverTreeItemChildren[itemIndex].getText());
+ ContextMenuHelper.prepareTreeItemForContextMenu(serverTree,serverTreeItemChildren[itemIndex]);
+ new SWTBotMenu(ContextMenuHelper.getContextMenu(serverTree, IDELabel.Menu.REMOVE, false)).click();
+ SWTBotShell shell = bot.shell("Server");
+ shell.activate();
+ open.finish(shell.bot(), IDELabel.Button.OK);
+ log.info("Removed project from server: " + serverTreeItemChildren[itemIndex].getText());
+ util.waitForNonIgnoredJobs();
+ } else {
+ log.info("Project '"+projectName+"' not found on any server");
+ }
+ }
+ }
+ }
/**
* removes projects from pre-configured server
* @param projectName
*/
public void removeAllProjectsFromServer() {
removeAllProjectsFromServer(SWTTestExt.configuredState.getServer().name);
-
+
}
}
13 years, 11 months
JBoss Tools SVN: r40334 - in trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test: jboss71 and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-04-19 07:27:07 -0400 (Thu, 19 Apr 2012)
New Revision: 40334
Added:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/DetectServerTemplate.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/OperateServerTemplate.java
Modified:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/jboss71/DetectJBoss71.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/jboss71/OperateJBoss71.java
Log:
Extracted templates from the JBoss71 tests.
Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/jboss71/DetectJBoss71.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/jboss71/DetectJBoss71.java 2012-04-19 11:26:36 UTC (rev 40333)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/jboss71/DetectJBoss71.java 2012-04-19 11:27:07 UTC (rev 40334)
@@ -1,37 +1,20 @@
package org.jboss.tools.runtime.as.ui.bot.test.jboss71;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-
import org.jboss.tools.runtime.as.ui.bot.test.RuntimeProperties;
-import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.RuntimeDetectionPreferencesDialog;
-import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.SearchingForRuntimesDialog;
import org.jboss.tools.runtime.as.ui.bot.test.entity.Server;
-import org.jboss.tools.runtime.as.ui.bot.test.matcher.ServerMatcher;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.junit.After;
-import org.junit.Test;
+import org.jboss.tools.runtime.as.ui.bot.test.template.DetectServerTemplate;
-public class DetectJBoss71 extends SWTTestExt {
+public class DetectJBoss71 extends DetectServerTemplate {
public static final String JBOSS_7_1 = "jboss-as-7.1.0.Final";
- private RuntimeDetectionPreferencesDialog preferences;
-
- private SearchingForRuntimesDialog searchingForRuntimesDialog;
-
- @Test
- public void detectJBoss71(){
- preferences = new RuntimeDetectionPreferencesDialog();
- preferences.open();
- preferences.addPath(RuntimeProperties.getInstance().getRuntimePath(JBOSS_7_1));
- searchingForRuntimesDialog = preferences.search();
-
- assertThat(searchingForRuntimesDialog.getServers().size(), is(1));
- assertThat(searchingForRuntimesDialog.getServers().get(0), new ServerMatcher(getExpectedServer()));
+ @Override
+ protected String getServerID() {
+ return JBOSS_7_1;
}
- private Server getExpectedServer() {
+ @Override
+ protected Server getExpectedServer() {
Server expectedServer = new Server();
expectedServer.setName(JBOSS_7_1);
expectedServer.setVersion("7.1");
@@ -39,10 +22,4 @@
expectedServer.setLocation(RuntimeProperties.getInstance().getRuntimePath(JBOSS_7_1));
return expectedServer;
}
-
- @After
- public void closePreferences(){
- searchingForRuntimesDialog.ok();
- preferences.ok();
- }
}
Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/jboss71/OperateJBoss71.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/jboss71/OperateJBoss71.java 2012-04-19 11:26:36 UTC (rev 40333)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/jboss71/OperateJBoss71.java 2012-04-19 11:27:07 UTC (rev 40334)
@@ -1,54 +1,11 @@
package org.jboss.tools.runtime.as.ui.bot.test.jboss71;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.not;
+import org.jboss.tools.runtime.as.ui.bot.test.template.OperateServerTemplate;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.matcher.console.ConsoleOutputMatcher;
-import org.jboss.tools.ui.bot.ext.view.ServersView;
-import org.junit.Test;
+public class OperateJBoss71 extends OperateServerTemplate {
-public class OperateJBoss71 extends SWTTestExt {
-
- private ServersView serversView = new ServersView();
-
- @Test
- public void startJBoss71(){
- serversView.startServer(DetectJBoss71.JBOSS_7_1);
-
- assertNoException();
- assertServerState("Started");
+ @Override
+ protected String getServerName() {
+ return DetectJBoss71.JBOSS_7_1;
}
-
- @Test
- public void restartJBoss71(){
- serversView.restartServer(DetectJBoss71.JBOSS_7_1);
-
- assertNoException();
- assertServerState("Started");
- }
-
- @Test
- public void stopJBoss71(){
- serversView.stopServer(DetectJBoss71.JBOSS_7_1);
-
- assertNoException();
- assertServerState("Stopped");
- }
-
- @Test
- public void deleteJBoss71(){
- serversView.deleteServer(DetectJBoss71.JBOSS_7_1);
-
- assertFalse(serversView.serverExists(DetectJBoss71.JBOSS_7_1));
- }
-
- private void assertNoException() {
- assertThat("Exception:", not(new ConsoleOutputMatcher()));
- }
-
- private void assertServerState(String state) {
- assertThat(serversView.getServerStatus(DetectJBoss71.JBOSS_7_1), is(state));
- }
}
Added: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/DetectServerTemplate.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/DetectServerTemplate.java (rev 0)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/DetectServerTemplate.java 2012-04-19 11:27:07 UTC (rev 40334)
@@ -0,0 +1,48 @@
+package org.jboss.tools.runtime.as.ui.bot.test.template;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+
+import org.jboss.tools.runtime.as.ui.bot.test.RuntimeProperties;
+import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.RuntimeDetectionPreferencesDialog;
+import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.SearchingForRuntimesDialog;
+import org.jboss.tools.runtime.as.ui.bot.test.entity.Server;
+import org.jboss.tools.runtime.as.ui.bot.test.matcher.ServerMatcher;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.junit.After;
+import org.junit.Test;
+
+/**
+ * Common scenario for server detection tests. It adds the server's installation
+ * folder to the runtime detection and checks if it is correctly recognized and created.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public abstract class DetectServerTemplate extends SWTTestExt {
+
+ private RuntimeDetectionPreferencesDialog preferences;
+
+ private SearchingForRuntimesDialog searchingForRuntimesDialog;
+
+ protected abstract String getServerID();
+
+ protected abstract Server getExpectedServer();
+
+ @Test
+ public void detectJBoss71(){
+ preferences = new RuntimeDetectionPreferencesDialog();
+ preferences.open();
+ preferences.addPath(RuntimeProperties.getInstance().getRuntimePath(getServerID()));
+ searchingForRuntimesDialog = preferences.search();
+
+ assertThat(searchingForRuntimesDialog.getServers().size(), is(1));
+ assertThat(searchingForRuntimesDialog.getServers().get(0), new ServerMatcher(getExpectedServer()));
+ }
+
+ @After
+ public void closePreferences(){
+ searchingForRuntimesDialog.ok();
+ preferences.ok();
+ }
+}
Added: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/OperateServerTemplate.java
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/OperateServerTemplate.java (rev 0)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/OperateServerTemplate.java 2012-04-19 11:27:07 UTC (rev 40334)
@@ -0,0 +1,63 @@
+package org.jboss.tools.runtime.as.ui.bot.test.template;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.not;
+
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.matcher.console.ConsoleOutputMatcher;
+import org.jboss.tools.ui.bot.ext.view.ServersView;
+import org.junit.Test;
+
+/**
+ * Checks if the given server can be started, restarted, stopped and deleted without
+ * error.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public abstract class OperateServerTemplate extends SWTTestExt{
+
+ private ServersView serversView = new ServersView();
+
+ protected abstract String getServerName();
+
+ @Test
+ public void startJBoss71(){
+ serversView.startServer(getServerName());
+
+ assertNoException();
+ assertServerState("Started");
+ }
+
+ @Test
+ public void restartJBoss71(){
+ serversView.restartServer(getServerName());
+
+ assertNoException();
+ assertServerState("Started");
+ }
+
+ @Test
+ public void stopJBoss71(){
+ serversView.stopServer(getServerName());
+
+ assertNoException();
+ assertServerState("Stopped");
+ }
+
+ @Test
+ public void deleteJBoss71(){
+ serversView.deleteServer(getServerName());
+
+ assertFalse(serversView.serverExists(getServerName()));
+ }
+
+ private void assertNoException() {
+ assertThat("Exception:", not(new ConsoleOutputMatcher()));
+ }
+
+ private void assertServerState(String state) {
+ assertThat(serversView.getServerStatus(getServerName()), is(state));
+ }
+}
13 years, 11 months
JBoss Tools SVN: r40333 - trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/launchers.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-04-19 07:26:36 -0400 (Thu, 19 Apr 2012)
New Revision: 40333
Added:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/launchers/RT_AllTestsSuite.launch
Removed:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/launchers/RT_detection_AllTestsSuite.launch
Log:
Renamed launcher.
Added: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/launchers/RT_AllTestsSuite.launch
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/launchers/RT_AllTestsSuite.launch (rev 0)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/launchers/RT_AllTestsSuite.launch 2012-04-19 11:26:36 UTC (rev 40333)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<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.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/AllTestsSuite.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="DISPLAY" value=":${string_prompt:display number:0}"/>
+</mapAttribute>
+<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.runtime.as.ui.bot.test.AllTestsSuite"/>
+<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.runtime.as.ui.bot.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="-Xmx1024m -XX:MaxPermSize=256m"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<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="true"/>
+</launchConfiguration>
Deleted: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/launchers/RT_detection_AllTestsSuite.launch
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/launchers/RT_detection_AllTestsSuite.launch 2012-04-19 10:46:34 UTC (rev 40332)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/launchers/RT_detection_AllTestsSuite.launch 2012-04-19 11:26:36 UTC (rev 40333)
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig">
-<booleanAttribute key="append.args" value="true"/>
-<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.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/AllTestsSuite.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<mapAttribute key="org.eclipse.debug.core.environmentVariables">
-<mapEntry key="DISPLAY" value=":${string_prompt:display number:0}"/>
-</mapAttribute>
-<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.runtime.as.ui.bot.test.AllTestsSuite"/>
-<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.runtime.as.ui.bot.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="-Xmx1024m -XX:MaxPermSize=256m"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.platform.ide"/>
-<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="true"/>
-</launchConfiguration>
13 years, 11 months
JBoss Tools SVN: r40332 - trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/resources.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-04-19 06:46:34 -0400 (Thu, 19 Apr 2012)
New Revision: 40332
Modified:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/resources/
Log:
Ignoring generated resource file.
Property changes on: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/resources
___________________________________________________________________
Added: svn:ignore
+ runtimes.properties
13 years, 11 months