JBoss Tools SVN: r43048 - trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2012-08-15 15:47:46 -0400 (Wed, 15 Aug 2012)
New Revision: 43048
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
Log:
JBIDE-6135
EL validation failes for valid JSF-EL
Issue is fixed
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2012-08-15 15:14:45 UTC (rev 43047)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2012-08-15 19:47:46 UTC (rev 43048)
@@ -117,7 +117,7 @@
e = e.getNextToken();
}
if(exp != null && ref.getStartPosition() + b.getStart() <= offset && ref.getStartPosition() + e.getStart() + e.getLength() >= offset) {
- return getProposals(context, "#{", offset);
+ return getProposals(context, "#{", offset); //$NON-NLS-1$
}
}
}
@@ -640,9 +640,50 @@
while(left != expr) {
left = (ELInvocationExpression)left.getParent();
if (left != expr) { // inside expression
+ JavaMemberELSegmentImpl lastSegment = segment;
segment = new JavaMemberELSegmentImpl(left.getLastToken());
- if(left instanceof ELArgumentInvocation) {
- List<TypeInfoCollector.MemberInfo> ms = members;
+ if(left instanceof ELArgumentInvocation) {
+ List<MemberInfo> ms = new ArrayList<MemberInfo>(members);
+ members.clear();
+
+ // The segment could have a collection or a map data model (or probably both?)
+ MemberInfo lastSegmentMemberInfo = lastSegment == null ? null : lastSegment.getMemberInfo();
+ if (lastSegmentMemberInfo != null) {
+ if(!lastSegmentMemberInfo.getType().isArray()) {
+ IType type = lastSegmentMemberInfo.getMemberType();
+ if(type!=null) {
+ try {
+ if(TypeInfoCollector.isInstanceofType(type, "java.util.Map")) { //$NON-NLS-1$
+ String s = "#{" + left.getLeft().toString() + ".values().iterator().next()}"; //$NON-NLS-1$ //$NON-NLS-2$
+ if(getParserFactory()!=null) {
+ ELParser p = getParserFactory().createParser();
+ ELInvocationExpression expr1 = (ELInvocationExpression)p.parse(s).getInstances().get(0).getExpression();
+ members = resolveSegment(expr1.getLeft().getLeft(), ms, resolution, returnEqualedVariablesOnly, varIsUsed, segment);
+ members = resolveSegment(expr1.getLeft(), members, resolution, returnEqualedVariablesOnly, varIsUsed, segment);
+ members = resolveSegment(expr1, members, resolution, returnEqualedVariablesOnly, varIsUsed, segment);
+ if(resolution.getLastResolvedToken() == expr1) {
+ resolution.setLastResolvedToken(left);
+ }
+ }
+ } else if(TypeInfoCollector.isInstanceofType(type, "java.util.Collection")) { //$NON-NLS-1$
+ String s = "#{" + left.getLeft().toString() + collectionAdditionForCollectionDataModel + "}"; //$NON-NLS-1$ //$NON-NLS-2$
+ if(getParserFactory()!=null) {
+ ELParser p = getParserFactory().createParser();
+ ELInvocationExpression expr1 = (ELInvocationExpression)p.parse(s).getInstances().get(0).getExpression();
+ members = resolveSegment(expr1.getLeft(), ms, resolution, returnEqualedVariablesOnly, varIsUsed, segment);
+ members = resolveSegment(expr1, members, resolution, returnEqualedVariablesOnly, varIsUsed, segment);
+ if(resolution.getLastResolvedToken() == expr1) {
+ resolution.setLastResolvedToken(left);
+ }
+ }
+ }
+ } catch (JavaModelException e) {
+ log(e);
+ }
+ }
+ }
+ }
+/*
String s = "#{" + left.getLeft().toString() + collectionAdditionForCollectionDataModel + "}"; //$NON-NLS-1$ //$NON-NLS-2$
if(getParserFactory()!=null) {
ELParser p = getParserFactory().createParser();
@@ -653,6 +694,7 @@
resolution.setLastResolvedToken(left);
}
}
+*/
if(members.isEmpty()) {
members = resolveSegment(left, ms, resolution, returnEqualedVariablesOnly, varIsUsed, segment);
}
@@ -704,8 +746,8 @@
: null;
String name = lt != null ? lt.getText() : ""; // token.getText(); //$NON-NLS-1$
if(expr instanceof ELArgumentInvocation) {
- if(name.startsWith("'")) name = name.substring(1); else name = "";
- if(name.endsWith("'")) name = name.substring(0, name.length() - 1); else name = "";
+ if(name.startsWith("'")) name = name.substring(1); else name = ""; //$NON-NLS-1$ //$NON-NLS-2$
+ if(name.endsWith("'")) name = name.substring(0, name.length() - 1); else name = ""; //$NON-NLS-1$ //$NON-NLS-2$
}
segment.setToken(lt);
if (expr.getType() == ELObjectType.EL_PROPERTY_INVOCATION || expr.getType() == ELObjectType.EL_ARGUMENT_INVOCATION) {
@@ -1050,11 +1092,11 @@
} else {
if((filter.startsWith("'") || filter.startsWith("\"")) //$NON-NLS-1$ //$NON-NLS-2$
|| (filter.endsWith("'") || filter.endsWith("\""))) { //$NON-NLS-1$ //$NON-NLS-2$
- if (filter.startsWith("'") || filter.startsWith("\"")) {
+ if (filter.startsWith("'") || filter.startsWith("\"")) { //$NON-NLS-1$ //$NON-NLS-2$
filter = filter.length() == 1 ? "" : filter.substring(1); //$NON-NLS-1$
closeQuotes = true;
}
- if (filter.endsWith("'") || filter.endsWith("\"")) {
+ if (filter.endsWith("'") || filter.endsWith("\"")) { //$NON-NLS-1$ //$NON-NLS-2$
filter = filter.length() == 1 ? "" : filter.substring(0, filter.length() - 1); //$NON-NLS-1$
closeQuotes = false;
}
12 years, 5 months
JBoss Tools SVN: r43047 - trunk/forge/tests/org.jboss.tools.forge.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: psrna
Date: 2012-08-15 11:14:45 -0400 (Wed, 15 Aug 2012)
New Revision: 43047
Modified:
trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml
Log:
* debug profile
Modified: trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml
===================================================================
--- trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml 2012-08-15 13:49:07 UTC (rev 43046)
+++ trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml 2012-08-15 15:14:45 UTC (rev 43047)
@@ -13,8 +13,19 @@
<packaging>eclipse-test-plugin</packaging>
<properties>
<jbosstools.test.jboss-as.home>${requirementsDirectory}/jboss-as-7.1.1.Final</jbosstools.test.jboss-as.home>
- <systemProperties>-Dtest.configurations.dir=resources/properties -Djbosstools.test.jboss-as.home=${jbosstools.test.jboss-as.home}</systemProperties>
+ <additionalSystemProperties></additionalSystemProperties>
+ <systemProperties>${additionalSystemProperties} -Dtest.configurations.dir=resources/properties -Djbosstools.test.jboss-as.home=${jbosstools.test.jboss-as.home}</systemProperties>
</properties>
+
+ <profiles>
+ <profile>
+ <id>debug</id>
+ <properties>
+ <additionalSystemProperties>-Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=y </additionalSystemProperties>
+ </properties>
+ </profile>
+ </profiles>
+
<build>
<plugins>
<plugin>
@@ -63,6 +74,47 @@
</dependencies>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tychoVersion}</version>
+ <configuration>
+ <resolver>p2</resolver>
+ <ignoreTychoRepositories>true</ignoreTychoRepositories>
+ <environments>
+ <environment>
+ <os>macosx</os>
+ <ws>cocoa</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>macosx</os>
+ <ws>cocoa</ws>
+ <arch>x86_64</arch>
+ </environment>
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86_64</arch>
+ </environment>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86_64</arch>
+ </environment>
+ </environments>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
12 years, 5 months
JBoss Tools SVN: r43046 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2012-08-15 09:49:07 -0400 (Wed, 15 Aug 2012)
New Revision: 43046
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java
Log:
https://issues.jboss.org/browse/JBIDE-12429
Update ui in persistent.xml editor General tab for adding package-infos
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java 2012-08-15 13:47:16 UTC (rev 43045)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java 2012-08-15 13:49:07 UTC (rev 43046)
@@ -19,7 +19,7 @@
// Hibernate package
String PACKAGE = "org.hibernate.annotations"; //$NON-NLS-1$
String PACKAGE_ = PACKAGE + "."; //$NON-NLS-1$
- String PACKAGE_INFO_JAVA = "pacakge-info.java"; //$NON-NLS-1$
+ String PACKAGE_INFO_JAVA = "package-info.java"; //$NON-NLS-1$
// ********** API **********
12 years, 5 months
JBoss Tools SVN: r43045 - in trunk/hibernatetools/plugins: org.jboss.tools.hibernate.jpt.core/META-INF and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2012-08-15 09:47:16 -0400 (Wed, 15 Aug 2012)
New Revision: 43045
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/AddMappingListPane.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/messages.properties
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/.settings/org.eclipse.jdt.core.prefs
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitClassesComposite.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitGeneralComposite.java
Log:
https://issues.jboss.org/browse/JBIDE-12429
Update ui in persistent.xml editor General tab for adding package-infos
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/.settings/org.eclipse.jdt.core.prefs 2012-08-15 12:28:15 UTC (rev 43044)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/.settings/org.eclipse.jdt.core.prefs 2012-08-15 13:47:16 UTC (rev 43045)
@@ -1,5 +1,9 @@
-#Fri Apr 01 10:54:34 EEST 2011
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
@@ -9,6 +13,7 @@
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -16,33 +21,48 @@
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
@@ -55,6 +75,7 @@
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF 2012-08-15 12:28:15 UTC (rev 43044)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF 2012-08-15 13:47:16 UTC (rev 43045)
@@ -32,7 +32,8 @@
org.jboss.tools.hibernate.jpt.core.internal.context,
org.jboss.tools.hibernate.jpt.core.internal.context.basic,
org.jboss.tools.hibernate.jpt.core.internal.context.java,
- org.jboss.tools.hibernate.jpt.core.internal.context.orm
+ org.jboss.tools.hibernate.jpt.core.internal.context.orm,
+ org.jboss.tools.hibernate.jpt.core.internal.context.persistence
Bundle-Localization: plugin
Bundle-Activator: org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin
Bundle-ActivationPolicy: lazy
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java 2012-08-15 12:28:15 UTC (rev 43044)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java 2012-08-15 13:47:16 UTC (rev 43045)
@@ -19,6 +19,7 @@
// Hibernate package
String PACKAGE = "org.hibernate.annotations"; //$NON-NLS-1$
String PACKAGE_ = PACKAGE + "."; //$NON-NLS-1$
+ String PACKAGE_INFO_JAVA = "pacakge-info.java"; //$NON-NLS-1$
// ********** API **********
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java 2012-08-15 12:28:15 UTC (rev 43044)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java 2012-08-15 13:47:16 UTC (rev 43045)
@@ -27,7 +27,6 @@
import org.jboss.tools.hibernate.jpt.core.internal.HibernateAbstractJpaFactory;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernatePackageInfo;
-import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernatePackageInfoImpl;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaPackageInfo;
@@ -51,6 +50,10 @@
*/
public HibernateClassRef(PersistenceUnit parent, XmlJavaClassRef xmlJavaClassRef) {
super(parent, xmlJavaClassRef, xmlJavaClassRef.getJavaClass());
+ JavaResourcePackage resourcePackage = this.resolveJavaResourcePackage();
+ if (resourcePackage != null){
+ this.javaPackageInfo = this.buildJavaPackageInfo(resourcePackage);
+ }
}
/**
@@ -59,6 +62,10 @@
*/
public HibernateClassRef(PersistenceUnit parent, String className) {
super(parent, null, className);
+ JavaResourcePackage resourcePackage = this.resolveJavaResourcePackage();
+ if (resourcePackage != null){
+ this.javaPackageInfo = this.buildJavaPackageInfo(resourcePackage);
+ }
}
@Override
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/AddMappingListPane.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/AddMappingListPane.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/AddMappingListPane.java 2012-08-15 13:47:16 UTC (rev 43045)
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.hibernate.jpt.ui.internal.persistence.details;
+
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
+import org.eclipse.jpt.common.ui.internal.widgets.Pane;
+import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
+import org.eclipse.jpt.common.utility.model.value.ListValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
+import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
+import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ *
+ *
+ * @author Dmitry Geraskov (geraskov(a)gmail.com)
+ *
+ */
+public class AddMappingListPane extends AddRemoveListPane<PersistenceUnit> {
+
+ private Button addButton;
+
+ private ExtendedAdapter adapter;
+
+ public AddMappingListPane(Pane<? extends PersistenceUnit> parentPane,
+ Composite parent,
+ ExtendedAdapter adapter,
+ ListValueModel<?> listHolder,
+ ModifiablePropertyValueModel<?> selectedItemHolder,
+ ILabelProvider labelProvider,
+ String helpId) {
+ super(parentPane, parent, adapter, listHolder, selectedItemHolder, labelProvider, helpId);
+ }
+
+ @Override
+ protected void initialize(
+ org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter adapter,
+ ListValueModel<?> listHolder,
+ ModifiablePropertyValueModel<?> selectedItemHolder,
+ IBaseLabelProvider labelProvider) {
+ super.initialize(adapter, listHolder, selectedItemHolder, labelProvider);
+ this.adapter = (ExtendedAdapter) adapter;
+ }
+
+ @Override
+ protected void addCustomButtonAfterAddButton(Composite container,
+ String helpId) {
+ // Add package button
+ this.addButton = addUnmanagedButton(container,
+ adapter.addPackageButtonText(),
+ buildAddPackageItemAction()
+ );
+ addAlignRight(this.addButton);
+ }
+
+ private Runnable buildAddPackageItemAction() {
+ return new Runnable() {
+ public void run() {
+ adapter.addPackage(getSelectionModel());
+ }
+ };
+ }
+
+}
+
+abstract class ExtendedAdapter extends AddRemoveListPane.AbstractAdapter {
+
+ @Override
+ public String addButtonText() {
+ return Messages.AddMappingListPane_Add_Class;
+ }
+
+ public String addPackageButtonText() {
+ return Messages.AddMappingListPane_Add_Package;
+ }
+
+ @Override
+ public boolean hasOptionalButton() {
+ return true;
+ }
+
+ @Override
+ public String optionalButtonText() {
+ return JptUiPersistenceMessages.PersistenceUnitClassesComposite_open;
+ }
+
+ public abstract void addPackage(ObjectListSelectionModel listSelectionModel);
+
+}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitClassesComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitClassesComposite.java 2012-08-15 12:28:15 UTC (rev 43044)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitClassesComposite.java 2012-08-15 13:47:16 UTC (rev 43045)
@@ -14,18 +14,22 @@
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.internal.core.PackageFragment;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jdt.internal.ui.dialogs.PackageSelectionDialog;
+import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext;
import org.eclipse.jdt.ui.IJavaElementSearchConstants;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.window.Window;
import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
import org.eclipse.jpt.common.ui.internal.widgets.Pane;
import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
@@ -48,8 +52,11 @@
import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.FilteredList;
import org.eclipse.ui.dialogs.SelectionDialog;
import org.eclipse.ui.progress.IProgressService;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.PackageInfoRef;
/**
@@ -77,6 +84,18 @@
}
}
+ private void addMappedPackage(ObjectListSelectionModel listSelectionModel) {
+ IPackageFragment pack = choosePackage();
+
+ if (pack != null) {
+ if(classRefExists(pack.getElementName())) {
+ return;
+ }
+ ClassRef classRef = getSubject().addSpecifiedClassRef(pack.getElementName());
+ listSelectionModel.setSelectedValue(classRef);
+ }
+ }
+
private boolean classRefExists(String className) {
for ( ListIterator<ClassRef> i = getSubject().getSpecifiedClassRefs().iterator(); i.hasNext(); ) {
ClassRef classRef = i.next();
@@ -87,8 +106,8 @@
return false;
}
- private Adapter buildAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
+ private ExtendedAdapter buildAdapter() {
+ return new ExtendedAdapter() {
public void addNewItem(ObjectListSelectionModel listSelectionModel) {
addMappedClass(listSelectionModel);
}
@@ -103,16 +122,6 @@
}
@Override
- public boolean hasOptionalButton() {
- return true;
- }
-
- @Override
- public String optionalButtonText() {
- return JptUiPersistenceMessages.PersistenceUnitClassesComposite_open;
- }
-
- @Override
public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
openMappedClass((ClassRef) listSelectionModel.selectedValue());
}
@@ -122,6 +131,11 @@
getSubject().removeSpecifiedClassRef((ClassRef) item);
}
}
+
+ @Override
+ public void addPackage(ObjectListSelectionModel listSelectionModel) {
+ addMappedPackage(listSelectionModel);
+ }
};
}
@@ -157,6 +171,11 @@
if (persistentType != null) {
image = JpaMappingImageHelper.imageForTypeMapping(persistentType.getMappingKey());
+ } else if (classRef instanceof PackageInfoRef){
+ PackageInfoRef packageInfoRef = (PackageInfoRef)classRef;
+ if (packageInfoRef.getJavaPackageInfo() != null){
+ image = JavaPlugin.getImageDescriptorRegistry().get(JavaPluginImages.DESC_OBJS_PACKAGE);
+ }
}
if (image != null) {
@@ -226,7 +245,7 @@
scope,
IJavaElementSearchConstants.CONSIDER_CLASSES,
false,
- ""
+ "" //$NON-NLS-1$
);
}
catch (JavaModelException e) {
@@ -258,7 +277,55 @@
return null;
}
+
+ private IPackageFragment choosePackage() {
+ IJavaElement[] elements = new IJavaElement[] { getJavaProject() };
+ BusyIndicatorRunnableContext context = new BusyIndicatorRunnableContext();
+ IJavaSearchScope scope = SearchEngine
+ .createJavaSearchScope(elements, IJavaSearchScope.SOURCES
+ | IJavaSearchScope.REFERENCED_PROJECTS);
+ PackageSelectionDialog packageSelectionDialog = new PackageSelectionDialog(
+ getShell(), context,
+ PackageSelectionDialog.F_HIDE_DEFAULT_PACKAGE
+ | PackageSelectionDialog.F_HIDE_EMPTY_INNER, scope) {
+
+ @Override
+ protected FilteredList createFilteredList(Composite parent) {
+ FilteredList list = super.createFilteredList(parent);
+ //filter out packages without package-ifo.java
+ list.setFilterMatcher(new FilteredList.FilterMatcher() {
+
+ @Override
+ public void setFilter(String pattern, boolean ignoreCase,
+ boolean ignoreWildCards) {
+ }
+
+ @Override
+ public boolean match(Object element) {
+ if (element instanceof PackageFragment) {
+ PackageFragment pf = (PackageFragment) element;
+ return pf.getCompilationUnit(Hibernate.PACKAGE_INFO_JAVA).exists();
+
+ }
+ return false;
+ }
+ });
+ return list;
+ }
+ };
+
+ packageSelectionDialog.setTitle(Messages.HibernatePersistenceUnitClassesComposite_PackageSelectionDialog_title);
+ packageSelectionDialog
+ .setMessage(JptCommonUiMessages.ClassChooserPane_dialogMessage);
+
+ if (packageSelectionDialog.open() == Window.OK) {
+ return (IPackageFragment) packageSelectionDialog.getResult()[0];
+ }
+
+ return null;
+ }
+
/*
* (non-Javadoc)
*/
@@ -268,11 +335,11 @@
// Description
addMultiLineLabel(
container,
- JptUiPersistenceMessages.PersistenceUnitClassesComposite_description
+ Messages.HibernatePersistenceUnitClassesComposite_ClassesComposite_message
);
// List pane
- new AddRemoveListPane<PersistenceUnit>(
+ new AddMappingListPane(
this,
container,
this.buildAdapter(),
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitGeneralComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitGeneralComposite.java 2012-08-15 12:28:15 UTC (rev 43044)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitGeneralComposite.java 2012-08-15 13:47:16 UTC (rev 43045)
@@ -13,9 +13,7 @@
import org.eclipse.jpt.common.ui.WidgetFactory;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
import org.eclipse.jpt.jpa.ui.internal.persistence.details.GenericPersistenceUnitGeneralComposite;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceUnitClassesComposite;
import org.eclipse.swt.widgets.Composite;
/**
@@ -36,7 +34,7 @@
container = addCollapsibleSection(
container,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_mappedClasses
+ Messages.HibernatePersistenceUnitGeneralComposite_Section_title
);
updateGridData(container);
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/Messages.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/Messages.java 2012-08-15 13:47:16 UTC (rev 43045)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.hibernate.jpt.ui.internal.persistence.details;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ * @author Dmitry Geraskov (geraskov(a)gmail.com)
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.hibernate.jpt.ui.internal.persistence.details.messages"; //$NON-NLS-1$
+ public static String AddMappingListPane_Add_Class;
+ public static String AddMappingListPane_Add_Package;
+ public static String HibernatePersistenceUnitClassesComposite_ClassesComposite_message;
+ public static String HibernatePersistenceUnitClassesComposite_PackageSelectionDialog_title;
+ public static String HibernatePersistenceUnitGeneralComposite_Section_title;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/messages.properties (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/messages.properties 2012-08-15 13:47:16 UTC (rev 43045)
@@ -0,0 +1,5 @@
+AddMappingListPane_Add_Class=Add Class
+AddMappingListPane_Add_Package=Add Package
+HibernatePersistenceUnitClassesComposite_ClassesComposite_message=Specify the list of classes/packages to be managed in this persistence unit.
+HibernatePersistenceUnitClassesComposite_PackageSelectionDialog_title=Package selection
+HibernatePersistenceUnitGeneralComposite_Section_title=Managed Classes and Packages
12 years, 5 months
JBoss Tools SVN: r43044 - branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: sbunciak
Date: 2012-08-15 08:28:15 -0400 (Wed, 15 Aug 2012)
New Revision: 43044
Modified:
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTestsMaven.launch
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/pom.xml
Log:
OpenShift SWTBot: maven launch fix
Modified: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTestsMaven.launch
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTestsMaven.launch 2012-08-15 11:48:31 UTC (rev 43043)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTestsMaven.launch 2012-08-15 12:28:15 UTC (rev 43044)
@@ -4,10 +4,13 @@
<stringAttribute key="M2_GOALS" value="clean install"/>
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
<booleanAttribute key="M2_OFFLINE" value="false"/>
-<stringAttribute key="M2_PROFILES" value="default"/>
+<stringAttribute key="M2_PROFILES" value="default, jbosstools-staging-aggregate"/>
<listAttribute key="M2_PROPERTIES">
<listEntry value="swtbot.test.skip=false"/>
<listEntry value="configurations.dir=${project_loc}/resources"/>
+<listEntry value="jbosstools-nightly=http://rewok.brq.redhat.com:8081/nexus/content/repositories/jbosstools-nightly-core-3.3/"/>
+<listEntry value="jbosstools-nightly-tests=http://rewok.brq.redhat.com:8081/nexus/content/repositories/jbosstools-nightly-tests-3.3/"/>
+<listEntry value="jbosstools-target-site=http://rewok.brq.redhat.com:8081/nexus/content/repositories/jbosstools-target-site-3.3/"/>
</listAttribute>
<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
Modified: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/pom.xml
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/pom.xml 2012-08-15 11:48:31 UTC (rev 43043)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/pom.xml 2012-08-15 12:28:15 UTC (rev 43044)
@@ -6,11 +6,11 @@
<parent>
<groupId>org.jboss.tools.openshift</groupId>
<artifactId>tests</artifactId>
- <version>2.3.0-SNAPSHOT</version>
+ <version>2.3.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.openshift.tests</groupId>
<artifactId>org.jboss.tools.openshift.ui.bot.test</artifactId>
- <version>2.3.0-SNAPSHOT</version>
+ <version>2.3.1-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
@@ -34,7 +34,7 @@
<dependency>
<type>p2-installable-unit</type>
<artifactId>org.jboss.tools.openshift.express.feature.feature.group</artifactId>
- <version>2.3.0</version>
+ <version>2.3.1</version>
</dependency>
</dependencies>
</configuration>
12 years, 5 months
JBoss Tools SVN: r43043 - in branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test: src/org/jboss/tools/openshift/ui/bot/test/explorer and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sbunciak
Date: 2012-08-15 07:48:31 -0400 (Wed, 15 Aug 2012)
New Revision: 43043
Modified:
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTests.launch
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java
Log:
OpenShift SWTBot tests: added creation of ssh keys.
Modified: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTests.launch
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTests.launch 2012-08-15 11:20:01 UTC (rev 43042)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/OpenShiftBotTests.launch 2012-08-15 11:48:31 UTC (rev 43043)
@@ -31,7 +31,7 @@
<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.openshift.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="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m -Xmx512m -Dswtbot.test.properties.file=${env_var:HOME}/swtbot.properties -Dusage_reporting_enabled=false"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m -Xmx512m -Dswtbot.test.properties.file=${project_loc}/resources/swtbot.properties -Dusage_reporting_enabled=false"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<booleanAttribute key="show_selected_only" value="false"/>
Modified: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java 2012-08-15 11:20:01 UTC (rev 43042)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java 2012-08-15 11:48:31 UTC (rev 43043)
@@ -72,17 +72,22 @@
log.info("*** OpenShift SWTBot Tests: Application creation started. ***");
- // only for the 1st time
- // bot.waitForShell("Question", 500);
- // bot.button(IDELabel.Button.YES).click();
+ // only for the 1st time - with known_hosts deleting it will appear every time
+ // add to known_hosts
+ bot.waitForShell("Question", TIME_60S * 3);
+ bot.button(IDELabel.Button.YES).click();
+ // create known_hosts since it does not exists any more
+ bot.waitForShell("Question", TIME_60S * 3);
+ bot.button(IDELabel.Button.YES).click();
+
- bot.waitForShell("Information", 500);
+ bot.waitForShell("Information", TIME_60S * 3);
bot.text(0).setText(TestProperties.get("openshift.user.pwd"));
bot.button(IDELabel.Button.OK).click();
log.info("*** OpenShift SWTBot Tests: SSH passphrase given. ***");
- bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_60S);
+ bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_60S, TIME_1S);
log.info("*** OpenShift SWTBot Tests: New Application wizard closed. ***");
Modified: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java 2012-08-15 11:20:01 UTC (rev 43042)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java 2012-08-15 11:48:31 UTC (rev 43043)
@@ -4,6 +4,7 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.waits.Conditions;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
import org.jboss.tools.openshift.ui.bot.util.TestProperties;
@@ -25,15 +26,16 @@
@Before
public void prepareSSHPrefs() {
- // clear dir from libra stuff
-
+ // clear dir from libra stuff so wizard can create new
File sshDir = new File(System.getProperty("user.home") + "/.ssh");
if (sshDir.exists() && sshDir.isDirectory()
&& sshDir.listFiles().length > 0) {
for (File file : sshDir.listFiles()) {
if (file.getName().contains("id_rsa"))
- keyAvailable = true;
+ file.delete();
+ if (file.getName().contains("known_hosts"))
+ file.delete();
}
}
@@ -60,25 +62,26 @@
domainText.setText(TestProperties.get("openshift.domain"));
log.info("*** OpenShift SWTBot Tests: Domain name set. ***");
+ SWTBotButton finishBtn = bot.button(IDELabel.Button.FINISH);
+
if (keyAvailable) {
- assertTrue("SSH key should be set!",bot.text(1).getText().contains("id_rsa"));
-
+ assertTrue("SSH key should be set!", bot.text(1).getText()
+ .contains("id_rsa"));
+
} else {
- throw new UnsupportedOperationException(
- "Creation of ssh key not implemented yet.");
- /*
- * bot.button(IDELabel.Shell.NEW).click();
- * bot.waitForShell(OpenShiftUI.Shell.NEW_SSH);
- * bot.text(0).setText(TestProperties.getPassphrase());
- * bot.button(IDELabel.Button.OK).click();
- * bot.waitForShell(OpenShiftUI.Shell.DOMAIN);
- *
- * log.info("*** OpenShift SWTBot Tests: SSH Keys created. ***");
- */
+
+ bot.button(IDELabel.Shell.NEW).click();
+ bot.waitForShell(OpenShiftUI.Shell.NEW_SSH);
+ bot.text(0).setText(TestProperties.get("openshift.user.pwd"));
+ bot.button(IDELabel.Button.OK).click();
+ bot.waitForShell(OpenShiftUI.Shell.DOMAIN);
+
+ log.info("*** OpenShift SWTBot Tests: SSH Keys created. ***");
}
- bot.button(IDELabel.Button.FINISH).click();
+ bot.waitUntil(Conditions.widgetIsEnabled(finishBtn));
+ finishBtn.click();
// wait while the domain is being created
bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_60S);
Modified: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java 2012-08-15 11:20:01 UTC (rev 43042)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java 2012-08-15 11:48:31 UTC (rev 43043)
@@ -19,7 +19,7 @@
.getTreeItem(TestProperties.get("openshift.user.name"))
.contextMenu(OpenShiftUI.Labels.REFRESH).click();
- bot.waitWhile(new NonSystemJobRunsCondition(), TIME_UNLIMITED);
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S * 3, TIME_1S);
// delete
explorer.bot().tree()
@@ -29,6 +29,6 @@
bot.checkBox().select();
bot.button("OK").click();
- bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S + TIME_30S);
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S * 3, TIME_1S);
}
}
12 years, 5 months
JBoss Tools SVN: r43042 - trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer.
by jbosstools-commits@lists.jboss.org
Author: sbunciak
Date: 2012-08-15 07:20:01 -0400 (Wed, 15 Aug 2012)
New Revision: 43042
Modified:
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java
Log:
OpenShift SWTBot tests: added creation of ssh keys.
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java 2012-08-15 10:42:34 UTC (rev 43041)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java 2012-08-15 11:20:01 UTC (rev 43042)
@@ -72,17 +72,22 @@
log.info("*** OpenShift SWTBot Tests: Application creation started. ***");
- // only for the 1st time
- // bot.waitForShell("Question", 500);
- // bot.button(IDELabel.Button.YES).click();
+ // only for the 1st time - with known_hosts deleting it will appear every time
+ // add to known_hosts
+ bot.waitForShell("Question", TIME_60S * 3);
+ bot.button(IDELabel.Button.YES).click();
+ // create known_hosts since it does not exists any more
+ bot.waitForShell("Question", TIME_60S * 3);
+ bot.button(IDELabel.Button.YES).click();
+
- bot.waitForShell("Information", 500);
+ bot.waitForShell("Information", TIME_60S * 3);
bot.text(0).setText(TestProperties.get("openshift.user.pwd"));
bot.button(IDELabel.Button.OK).click();
log.info("*** OpenShift SWTBot Tests: SSH passphrase given. ***");
- bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_60S);
+ bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_60S, TIME_1S);
log.info("*** OpenShift SWTBot Tests: New Application wizard closed. ***");
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java 2012-08-15 10:42:34 UTC (rev 43041)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateDomain.java 2012-08-15 11:20:01 UTC (rev 43042)
@@ -4,6 +4,7 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.waits.Conditions;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
import org.jboss.tools.openshift.ui.bot.util.OpenShiftUI;
import org.jboss.tools.openshift.ui.bot.util.TestProperties;
@@ -25,15 +26,16 @@
@Before
public void prepareSSHPrefs() {
- // clear dir from libra stuff
-
+ // clear dir from libra stuff so wizard can create new
File sshDir = new File(System.getProperty("user.home") + "/.ssh");
if (sshDir.exists() && sshDir.isDirectory()
&& sshDir.listFiles().length > 0) {
for (File file : sshDir.listFiles()) {
if (file.getName().contains("id_rsa"))
- keyAvailable = true;
+ file.delete();
+ if (file.getName().contains("known_hosts"))
+ file.delete();
}
}
@@ -60,25 +62,26 @@
domainText.setText(TestProperties.get("openshift.domain"));
log.info("*** OpenShift SWTBot Tests: Domain name set. ***");
+ SWTBotButton finishBtn = bot.button(IDELabel.Button.FINISH);
+
if (keyAvailable) {
- assertTrue("SSH key should be set!",bot.text(1).getText().contains("id_rsa"));
-
+ assertTrue("SSH key should be set!", bot.text(1).getText()
+ .contains("id_rsa"));
+
} else {
- throw new UnsupportedOperationException(
- "Creation of ssh key not implemented yet.");
- /*
- * bot.button(IDELabel.Shell.NEW).click();
- * bot.waitForShell(OpenShiftUI.Shell.NEW_SSH);
- * bot.text(0).setText(TestProperties.getPassphrase());
- * bot.button(IDELabel.Button.OK).click();
- * bot.waitForShell(OpenShiftUI.Shell.DOMAIN);
- *
- * log.info("*** OpenShift SWTBot Tests: SSH Keys created. ***");
- */
+
+ bot.button(IDELabel.Shell.NEW).click();
+ bot.waitForShell(OpenShiftUI.Shell.NEW_SSH);
+ bot.text(0).setText(TestProperties.get("openshift.user.pwd"));
+ bot.button(IDELabel.Button.OK).click();
+ bot.waitForShell(OpenShiftUI.Shell.DOMAIN);
+
+ log.info("*** OpenShift SWTBot Tests: SSH Keys created. ***");
}
- bot.button(IDELabel.Button.FINISH).click();
+ bot.waitUntil(Conditions.widgetIsEnabled(finishBtn));
+ finishBtn.click();
// wait while the domain is being created
bot.waitUntil(Conditions.shellCloses(bot.activeShell()), TIME_60S);
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java 2012-08-15 10:42:34 UTC (rev 43041)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/DeleteDomain.java 2012-08-15 11:20:01 UTC (rev 43042)
@@ -19,7 +19,7 @@
.getTreeItem(TestProperties.get("openshift.user.name"))
.contextMenu(OpenShiftUI.Labels.REFRESH).click();
- bot.waitWhile(new NonSystemJobRunsCondition(), TIME_UNLIMITED);
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S * 3, TIME_1S);
// delete
explorer.bot().tree()
@@ -29,6 +29,6 @@
bot.checkBox().select();
bot.button("OK").click();
- bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S + TIME_30S);
+ bot.waitWhile(new NonSystemJobRunsCondition(), TIME_60S * 3, TIME_1S);
}
}
12 years, 5 months
JBoss Tools SVN: r43041 - trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot.
by jbosstools-commits@lists.jboss.org
Author: rhopp
Date: 2012-08-15 06:42:34 -0400 (Wed, 15 Aug 2012)
New Revision: 43041
Modified:
trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/BaseFunctionalityTest.java
Log:
Jenkins debugging (windows slave)
Modified: trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/BaseFunctionalityTest.java
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/BaseFunctionalityTest.java 2012-08-15 10:37:57 UTC (rev 43040)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/BaseFunctionalityTest.java 2012-08-15 10:42:34 UTC (rev 43041)
@@ -1,18 +1,14 @@
package org.jboss.tools.central.test.ui.bot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.Perspective;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
-//(a)RunWith(RequirementAwareSuite.class)
@SuiteClasses({CentralAllBotTests.class})
-@Require(perspective="JBoss")
public class BaseFunctionalityTest extends SWTTestExt {
/**
@@ -20,8 +16,8 @@
*/
@BeforeClass
public static void setup(){
+ open.perspective(Perspective.JAVA.LABEL);
util.closeAllEditors(false);
- util.closeAllViews();
}
/**
* Tests whether JBoss central is accessible from Help menu
12 years, 5 months
JBoss Tools SVN: r43040 - trunk/forge/tests/org.jboss.tools.forge.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: psrna
Date: 2012-08-15 06:37:57 -0400 (Wed, 15 Aug 2012)
New Revision: 43040
Modified:
trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml
Log:
* forge ui bot tests mavenization
Modified: trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml
===================================================================
--- trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml 2012-08-15 09:37:59 UTC (rev 43039)
+++ trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml 2012-08-15 10:37:57 UTC (rev 43040)
@@ -11,10 +11,37 @@
<artifactId>org.jboss.tools.forge.ui.bot.test</artifactId>
<packaging>eclipse-test-plugin</packaging>
-
+ <properties>
+ <jbosstools.test.jboss-as.home>${requirementsDirectory}/jboss-as-7.1.1.Final</jbosstools.test.jboss-as.home>
+ <systemProperties>-Dtest.configurations.dir=resources/properties -Djbosstools.test.jboss-as.home=${jbosstools.test.jboss-as.home}</systemProperties>
+ </properties>
<build>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>install-as-7.1.1</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-dist</artifactId>
+ <version>7.1.1.Final</version>
+ <type>zip</type>
+ </artifactItem>
+ </artifactItems>
+ <skip>${skipRequirements}</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
@@ -28,6 +55,11 @@
<artifactId>org.jboss.tools.forge.feature.feature.group</artifactId>
<version>0.0.0</version>
</dependency>
+ <dependency>
+ <type>p2-installable-unit</type>
+ <artifactId>org.jboss.ide.eclipse.as.feature.feature.group</artifactId>
+ <version>0.0.0</version>
+ </dependency>
</dependencies>
</configuration>
</plugin>
12 years, 5 months
JBoss Tools SVN: r43039 - in trunk/forge/tests/org.jboss.tools.forge.ui.bot.test: resources and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: psrna
Date: 2012-08-15 05:37:59 -0400 (Wed, 15 Aug 2012)
New Revision: 43039
Added:
trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/resources/
trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/resources/properties/
trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/resources/properties/swtbot.properties
Modified:
trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml
Log:
* swtbot.properties
Modified: trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml
===================================================================
--- trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml 2012-08-15 09:12:49 UTC (rev 43038)
+++ trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/pom.xml 2012-08-15 09:37:59 UTC (rev 43039)
@@ -22,14 +22,13 @@
<skip>${swtbot.test.skip}</skip>
<testSuite>org.jboss.tools.forge.ui.bot.test</testSuite>
<testClass>org.jboss.tools.forge.ui.bot.test.suite.ForgeAllTest</testClass>
- <dependencies combine.children="append">
- <dependency>
- <type>p2-installable-unit</type>
- <artifactId>org.jboss.tools.forge.feature.feature.group</artifactId>
- <version>0.0.0</version>
- </dependency>
- </dependencies>
-
+ <dependencies combine.children="append">
+ <dependency>
+ <type>p2-installable-unit</type>
+ <artifactId>org.jboss.tools.forge.feature.feature.group</artifactId>
+ <version>0.0.0</version>
+ </dependency>
+ </dependencies>
</configuration>
</plugin>
</plugins>
Added: trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/resources/properties/swtbot.properties
===================================================================
--- trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/resources/properties/swtbot.properties (rev 0)
+++ trunk/forge/tests/org.jboss.tools.forge.ui.bot.test/resources/properties/swtbot.properties 2012-08-15 09:37:59 UTC (rev 43039)
@@ -0,0 +1,23 @@
+# SWTBotTest properties
+# all properties are optional, all defined paths should exist
+# <java version>,<jre/jdk home>
+# JAVA=1.6,/usr/java/jdk1.6.0_25/jre
+# JAVA=1.6,${JAVA_HOME}
+#EAP|JBOSS_AS|EPP|SOA,<server version>,<jre version to run with>|default,<server home>
+# note : when server is type of SOA, version is version of SOA (not the bundled EAP)
+SERVER=AS,7.0,default,${jbosstools.test.jboss-as.home}
+#<seam version>,<seam runtime home>
+#SEAM=2.2,/opt/jbdevstudio4.1.1.GA/jboss-eap/seam
+#<esb versoin>,<esb runtime home>
+# ESB=4.7,/data/jboss/esb-4.7
+# #DB Definition
+#DB=<db_type>,<version>,<driver_path>,<jdbc_string>,<username>,[<password>,<scriptpath>]
+#Supported types: hsqldb18, db2_97, mssql2005, mssql2008, mysql50, mysql51, oracle10g, oracle11gR1, oracle11gR1RAC, oracle11gR2, oracle11gR2RAC, postgresql82, postgresql83, postgresql84, sybase15
+#For internal: use "hsqldb18" as type and "internal" as a version
+#Internal DB example (driver,jdbc,user,password are ignored)
+#DB=hsqldb18,internal,driver,jdbc,user,,
+#External db example
+#DB=hsqldb18,1.8,/home/username/lib/hsqldb/lib/hsqldb.jar,jdbc:hsqldb:hsql://localhost:8001/xdb,sa,,
+#Connection profile named <db_type>_<version> will be created
+#Annotation usage for TestCase db=@DB
+# DB=hsqldb18,1.8,/home/user/lib/hsqldb/lib/hsqldb.jar,jdbc\:hsqldb\:hsql\://localhost\:8001/xdb,sa,,
12 years, 5 months