JBoss Tools SVN: r27518 - in trunk: tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-12-15 12:10:29 -0500 (Wed, 15 Dec 2010)
New Revision: 27518
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/IncludedCssFilesTest.java
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/gen/ActionItem.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
Log:
Added IncludedCssFilesTest.
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/gen/ActionItem.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/gen/ActionItem.java 2010-12-15 17:01:31 UTC (rev 27517)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/gen/ActionItem.java 2010-12-15 17:10:29 UTC (rev 27518)
@@ -4533,7 +4533,7 @@
* represents item : Web->HTML Page
*/
public static final INewObject LABEL = new INewObject() {
- public String getName() { return "HTML Page";}
+ public String getName() { return "HTML File";}
public List<String> getGroupPath() {
List<String> l = new Vector<String>();
l.add("Web");
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-12-15 17:01:31 UTC (rev 27517)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-12-15 17:10:29 UTC (rev 27518)
@@ -155,6 +155,9 @@
public static final String PAGE_DESIGN_OPTIONS = "Page Design Options";
public static final String ADD_TAGLIB_REFRENCE = "Add Taglib Reference";
public static final String ADD_EL_REFERENCE = "Add EL Reference";
+ public static final String ADD_CSS_REFERENCE = "Add CSS Reference";
+ public static final String NEW_CSS_FILE = "New CSS File";
+ public static final String NEW_HTML_FILE = "New HTML File";
}
public class EntityGroup {
@@ -617,6 +620,9 @@
public static final String SUBSTITUTED_EL_EXPRESSIONS_SCOPE_PROJECT = "Project: Any Page at the Same Project";
public static final String SUBSTITUTED_EL_EXPRESSIONS_FOLDER_SCOPE_TABLE_LABEL = "Folder";
+ public static final String INCLUDED_CSS_FILES_TAB = "Included css files";
+ public static final String INCLUDED_CSS_FILES_CSS_FILE_PATH = "CSS File Path*";
+
}
public static class AddTaglibReferenceDialog{
@@ -631,4 +637,13 @@
public static final String PASSWORD = "Password: ";
}
+
+ public class NewHTMLWizard {
+ public static final String FILE_NAME = "File name:";
+ }
+
+ public class NewCSSWizard {
+ public static final String FILE_NAME = "File name:";
+ }
+
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-12-15 17:01:31 UTC (rev 27517)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-12-15 17:10:29 UTC (rev 27518)
@@ -16,6 +16,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.XhtmlFilePerformanceTest;
import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.AddSubstitutedELExpressionFolderScopeTest;
import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.EditingELValueTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.IncludedCssFilesTest;
import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.IncludedTagLibsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.ManipulatingELValueTest;
import org.jboss.tools.vpe.ui.bot.test.editor.pagedesign.SubstitutedELExressionsTest;
@@ -86,7 +87,8 @@
suite.addTestSuite(EditingELValueTest.class);
suite.addTestSuite(ManipulatingELValueTest.class);
suite.addTestSuite(SelectionBarTest.class);
-
+ suite.addTestSuite(IncludedCssFilesTest.class);
+
return new TestSetup(suite);
}
}
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/IncludedCssFilesTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/IncludedCssFilesTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/IncludedCssFilesTest.java 2010-12-15 17:10:29 UTC (rev 27518)
@@ -0,0 +1,153 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2010 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.pagedesign;
+
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.allOf;
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotBrowser;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.hamcrest.Matcher;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.SWTUtilExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.types.JobName;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+
+/**
+ * Tests functionality of Included CSS Files tab page of Page Design Options Dialog
+ * @author vlado pakan
+ *
+ */
+public class IncludedCssFilesTest extends PageDesignTestCase {
+
+ private static final String CSS_FILE_NAME = "includedCssFileTest.css";
+ private static final String HTML_FILE_NAME = "includedCssFileTest.html";
+
+ private SWTBot addCssReferenceDialogBot = null;
+ private SWTBot optionsDialogBot = null;
+
+ public void testIncludedCssFiles() throws IOException{
+ SWTBotTree tree = packageExplorer.show().bot().tree();
+ tree.expandNode(VPEAutoTestCase.JBT_TEST_PROJECT_NAME)
+ .expandNode("WebContent")
+ .getNode("pages")
+ .select();
+ // add CSS File
+ open.newObject(ActionItem.NewObject.WebCSS.LABEL);
+ bot.shell(IDELabel.Shell.NEW_CSS_FILE).activate(); //$NON-NLS-1$
+ bot.textWithLabel(IDELabel.NewCSSWizard.FILE_NAME).setText(IncludedCssFilesTest.CSS_FILE_NAME); //$NON-NLS-1$
+ bot.button(IDELabel.Button.FINISH).click(); //$NON-NLS-1$
+ bot.sleep(Timing.time3S());
+ util.waitForJobs(JobName.BUILDING_WS);
+ SWTBotEditor cssEditor = bot.editorByTitle(IncludedCssFilesTest.CSS_FILE_NAME);
+ cssEditor.toTextEditor().setText("h1 {\n" +
+ "color: Red\n" +
+ "}");
+ cssEditor.saveAndClose();
+ // add HTML File
+ open.newObject(ActionItem.NewObject.WebHTMLPage.LABEL);
+ bot.shell(IDELabel.Shell.NEW_HTML_FILE).activate(); //$NON-NLS-1$
+ bot.textWithLabel(IDELabel.NewHTMLWizard.FILE_NAME).setText(IncludedCssFilesTest.HTML_FILE_NAME); //$NON-NLS-1$
+ bot.button(IDELabel.Button.FINISH).click(); //$NON-NLS-1$
+ bot.sleep(Timing.time3S());
+ util.waitForJobs(JobName.BUILDING_WS);
+ SWTBotEditor htmlEditor = bot.editorByTitle(IncludedCssFilesTest.HTML_FILE_NAME);
+ htmlEditor.toTextEditor().setText("<html>\n" +
+ " <body>\n" +
+ " <h1>Title</h1>\n" +
+ " </body>\n" +
+ "</html>");
+ htmlEditor.save();
+ bot.sleep(Timing.time3S());
+ util.waitForJobs(JobName.BUILDING_WS);
+ // add CSS File Reference
+ bot.toolbarButtonWithTooltip(PAGE_DESIGN).click();
+ optionsDialogBot = bot.shell(IDELabel.Shell.PAGE_DESIGN_OPTIONS).activate().bot();
+ optionsDialogBot.tabItem(IDELabel.PageDesignOptionsDialog.INCLUDED_CSS_FILES_TAB).activate();
+ optionsDialogBot.button(IDELabel.Button.ADD_WITHOUT_DOTS).click();
+ addCssReferenceDialogBot = optionsDialogBot.shell(IDELabel.Shell.ADD_CSS_REFERENCE).activate().bot();
+ addCssReferenceDialogBot.textWithLabel(IDELabel.PageDesignOptionsDialog.INCLUDED_CSS_FILES_CSS_FILE_PATH)
+ .setText(SWTUtilExt.getPathToProject(VPEAutoTestCase.JBT_TEST_PROJECT_NAME) + File.separator +
+ "WebContent" + File.separator +
+ "pages" + File.separator +
+ IncludedCssFilesTest.CSS_FILE_NAME);
+ addCssReferenceDialogBot.button(IDELabel.Button.FINISH).click();
+ addCssReferenceDialogBot = null;
+ optionsDialogBot.button(IDELabel.Button.OK).click();
+ optionsDialogBot = null;
+ SWTBotEditorExt botEditorExt = new SWTBotExt().swtBotEditorExtByTitle(IncludedCssFilesTest.HTML_FILE_NAME);
+ botEditorExt.selectPage(IDELabel.VisualPageEditor.PREVIEW_TAB_LABEL);
+ Matcher<Browser> matcher = widgetOfType(Browser.class);
+ List<Browser> browsers = ((List<Browser>)botEditorExt.bot().widgets(matcher));
+ Browser browser0 = browsers.get(0);
+ Browser browser1 = browsers.get(1);
+ String browser0Text = SWTUtilExt.invokeMethod(browser0, "getText");
+ final String textToContain = "h1 {color: Red}";
+ // browser0 is editable browser displayed on page Visual/Source
+ boolean firstBrowserIsEditable = browser0Text.contains("dragIcon");
+ if (firstBrowserIsEditable) {
+ assertTrue("Preview Browser displayed Web Page Incorretly. There is no H1 tag with Red Color",
+ SWTUtilExt.invokeMethod(browser1, "getText").contains(textToContain));
+ } else {
+ assertTrue("Preview Browser displayed Web Page Incorretly. There is no H1 tag with Red Color",
+ browser0Text.contains(textToContain));
+ }
+ // Test Visual Interpretation of CSS in Visual/Source Pane
+ botEditorExt.selectPage(IDELabel.VisualPageEditor.VISUAL_SOURCE_TAB_LABEL);
+ if (firstBrowserIsEditable) {
+ assertTrue("Preview Browser displayed Web Page Incorretly. There is no H1 tag with Red Color",
+ SWTUtilExt.invokeMethod(browser1, "getText").contains(textToContain));
+ } else {
+ assertTrue("Preview Browser displayed Web Page Incorretly. There is no H1 tag with Red Color",
+ SWTUtilExt.invokeMethod(browser0, "getText").contains(textToContain));
+ }
+ bot.toolbarButtonWithTooltip(PAGE_DESIGN).click();
+ optionsDialogBot = bot.shell(IDELabel.Shell.PAGE_DESIGN_OPTIONS).activate().bot();
+ optionsDialogBot.tabItem(IDELabel.PageDesignOptionsDialog.INCLUDED_CSS_FILES_TAB).activate();
+ optionsDialogBot.table().select(0);
+ optionsDialogBot.button(IDELabel.Button.REMOVE).click();
+ optionsDialogBot.button(IDELabel.Button.OK).click();
+ optionsDialogBot = null;
+ htmlEditor.close();
+ }
+
+ @Override
+ protected void closeUnuseDialogs() {
+ if (addCssReferenceDialogBot != null){
+ addCssReferenceDialogBot.button(IDELabel.Button.CANCEL).click();
+ addCssReferenceDialogBot = null;
+ }
+ if (optionsDialogBot != null){
+ optionsDialogBot.button(IDELabel.Button.OK).click();
+ optionsDialogBot = null;
+ }
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return optionsDialogBot != null
+ || addCssReferenceDialogBot != null;
+ }
+
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/IncludedCssFilesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years
JBoss Tools SVN: r27517 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-12-15 12:01:31 -0500 (Wed, 15 Dec 2010)
New Revision: 27517
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
Log:
https://issues.jboss.org/browse/JBIDE-7894
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2010-12-15 16:47:33 UTC (rev 27516)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2010-12-15 17:01:31 UTC (rev 27517)
@@ -38,6 +38,7 @@
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.ILocalVariable;
+import org.eclipse.jdt.core.IMemberValuePair;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
@@ -992,4 +993,79 @@
}
return result;
}
+
+ /**
+ * Check all the values of @Target declaration of the annotation.
+ * Returns null if there is no @Target at all. Returns true if any of the variants presents.
+ * For example this method will return true for {{TYPE, FIELD, METHOD}, {TYPE}} for @Target(TYPE)
+ * @param annotationType
+ * @param variants
+ * @return
+ * @throws JavaModelException
+ */
+ public static Boolean checkTargetAnnotation(ICDIAnnotation annotationType, String[][] variants) throws JavaModelException {
+ IAnnotationDeclaration target = annotationType.getAnnotationDeclaration(CDIConstants.TARGET_ANNOTATION_TYPE_NAME);
+ return target == null?null:checkTargetAnnotation(target, variants);
+ }
+
+ /**
+ * Check all the values of @Target declaration
+ * Returns true if any of the variants presents.
+ * For example this method will return true for {{TYPE, FIELD, METHOD}, {TYPE}} for @Target(TYPE)
+ * @param target
+ * @param variants
+ * @return
+ * @throws JavaModelException
+ */
+ public static boolean checkTargetAnnotation(IAnnotationDeclaration target, String[][] variants) throws JavaModelException {
+ Set<String> vs = getTargetAnnotationValues(target);
+ boolean ok = false;
+ for (int i = 0; i < variants.length; i++) {
+ if(vs.size() == variants[i].length) {
+ boolean ok2 = true;
+ String[] values = variants[i];
+ for (String s: values) {
+ if(!vs.contains(s)) {
+ ok2 = false;
+ break;
+ }
+ }
+ if(ok2) {
+ ok = true;
+ break;
+ }
+ }
+ }
+ return ok;
+ }
+
+ /**
+ * Returns values of @Tagret declaration of the annotation type.
+ * @param target
+ * @return
+ * @throws JavaModelException
+ */
+ public static Set<String> getTargetAnnotationValues(IAnnotationDeclaration target) throws JavaModelException {
+ Set<String> result = new HashSet<String>();
+ IMemberValuePair[] ps = target.getDeclaration().getMemberValuePairs();
+ for (IMemberValuePair p: ps) {
+ if(!"value".equals(p.getMemberName())) continue;
+ Object o = p.getValue();
+ if(o instanceof Object[]) {
+ Object[] os = (Object[])o;
+ for (Object q: os) {
+ String s = q.toString();
+ int i = s.lastIndexOf('.');
+ if(i >= 0) s = s.substring(i + 1);
+ result.add(s);
+ }
+ } else if(o != null) {
+ String s = o.toString();
+ int i = s.lastIndexOf('.');
+ if(i >= 0) s = s.substring(i + 1);
+ result.add(s);
+ }
+ }
+ return result;
+ }
}
\ No newline at end of file
14 years
JBoss Tools SVN: r27516 - in trunk/build: hudson-jobs and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-12-15 11:47:33 -0500 (Wed, 15 Dec 2010)
New Revision: 27516
Added:
trunk/build/hudson-jobs/
trunk/build/hudson-jobs/config.xml
trunk/build/hudson-jobs/pom.xml
Log:
add template config.xml and pom.xml for creating jobs on the fly
Added: trunk/build/hudson-jobs/config.xml
===================================================================
--- trunk/build/hudson-jobs/config.xml (rev 0)
+++ trunk/build/hudson-jobs/config.xml 2010-12-15 16:47:33 UTC (rev 27516)
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <actions/>
+ <description>Nightly build using Tycho, monitoring SVN every 6 hrs for changes.
+
+<h3>REQUIRES JDK6</h3>
+
+<p>Results:
+<ul>
+
+<li>Aggregate update sites: <a href="http://download.jboss.org/jbosstools/updates/nightly/">http://download.jboss.org/jbosstools/updates/nightly/</a> :: <a href="http://download.jboss.org/jbosstools/updates/nightly/trunk/">latest from trunk</a>
+<li>Aggregate builds: <a href="http://download.jboss.org/jbosstools/builds/nightly/">http://download.jboss.org/jbosstools/builds/nightly/</a> :: <a href="http://download.jboss.org/jbosstools/builds/nightly/latestBuild.html">latest from trunk</a>
+
+<ul><li>Component builds: <a href="http://download.jboss.org/jbosstools/builds/staging/">http://download.jboss.org/jbosstools/builds/staging/</a></ul>
+</ul>
+
+</description>
+ <logRotator>
+ <daysToKeep>5</daysToKeep>
+
+ <numToKeep>5</numToKeep>
+ <artifactDaysToKeep>-1</artifactDaysToKeep>
+ <artifactNumToKeep>-1</artifactNumToKeep>
+ </logRotator>
+ <keepDependencies>false</keepDependencies>
+ <properties>
+ <hudson.model.ParametersDefinitionProperty>
+
+ <parameterDefinitions>
+ <hudson.model.StringParameterDefinition>
+ <name>MAVEN_FLAGS</name>
+ <description>Pass in lifecycle phase and extra flags to Maven, such as:
+<pre>
+clean :: clean before building *
+integration-test :: build and test *
+install :: build, test, and install into m2 repo *
+osgi-test:test :: just (re-)run test(s)
+
+-P helios-no-target :: don't use .target file to provision target; instead generate on the fly from MANIFEST.MF and feature.xml files
+-P galileo :: enable galileo dependencies
+-P hudson :: enable hudson build ID in feature/plugin qualifiers
+-P !helios :: disable helios target (not available)
+
+-Dmaven.test.skip :: skip compiling and running tests
+-Dmaven.test.skip.exec :: to compile but not run tests in conjunction with integration-test or install phase
+
+-Dmaven.repo.local=${WORKSPACE}/m2-repository :: path to local m2 repo
+
+-fae :: fail at end
+-fn :: fail never
+
+-o :: offline
+-B :: batch (non-interactive) mode
+-U :: check for updates
+-e :: if error occurs, dump stack into console
+
+-q :: quieter output</pre>
+</description>
+ <defaultValue>clean install -B -U -fae -e -Dmaven.repo.local=${WORKSPACE}/m2-repository -P helios-local-target,jbosstools-nightly-trunk,hudson</defaultValue>
+
+ </hudson.model.StringParameterDefinition>
+ </parameterDefinitions>
+ </hudson.model.ParametersDefinitionProperty>
+ <hudson.plugins.disk__usage.DiskUsageProperty/>
+ <hudson.plugins.descriptionsetter.JobByDescription/>
+ <hudson.plugins.jira.JiraProjectProperty>
+ <siteName>http://opensource.atlassian.com/projects/hibernate/</siteName>
+ </hudson.plugins.jira.JiraProjectProperty>
+
+ </properties>
+ <scm class="hudson.scm.SubversionSCM">
+ <locations>
+ <hudson.scm.SubversionSCM_-ModuleLocation>
+ <remote>https://svn.jboss.org/repos/jbosstools/trunk/TESTING</remote>
+ <local>sources</local>
+ </hudson.scm.SubversionSCM_-ModuleLocation>
+ <hudson.scm.SubversionSCM_-ModuleLocation>
+
+ <remote>https://svn.jboss.org/repos/jbosstools/trunk/build</remote>
+ </hudson.scm.SubversionSCM_-ModuleLocation>
+ </locations>
+ <useUpdate>true</useUpdate>
+ <doRevert>false</doRevert>
+ <browser class="hudson.scm.browsers.FishEyeSVN">
+ <url>http://fisheye.jboss.com/browse/JBossTools/</url>
+
+ <rootModule/>
+ </browser>
+ <excludedRegions/>
+ <includedRegions/>
+ <excludedUsers/>
+ <excludedRevprop/>
+ <excludedCommitMessages/>
+ </scm>
+ <assignedNode>RHEL_any</assignedNode>
+
+ <canRoam>false</canRoam>
+ <disabled>false</disabled>
+ <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
+ <jdk>java16_default</jdk>
+ <triggers class="vector">
+ <hudson.triggers.SCMTrigger>
+ <spec>20 3,9,15,21 * * * </spec>
+
+ </hudson.triggers.SCMTrigger>
+ </triggers>
+ <concurrentBuild>false</concurrentBuild>
+ <builders>
+ <hudson.tasks.Maven>
+ <targets>${MAVEN_FLAGS} -DJOB_NAME=${JOB_NAME} -DBUILD_ID=${BUILD_ID} -DBUILD_NUMBER=${BUILD_NUMBER}</targets>
+ <mavenName>maven-3.0</mavenName>
+
+ <jvmOptions>-Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m</jvmOptions>
+ <usePrivateRepository>true</usePrivateRepository>
+ </hudson.tasks.Maven>
+ <hudson.tasks.Shell>
+ <command># script here: http://anonsvn.jboss.org/repos/jbosstools/trunk/build/publish.sh
+. ${WORKSPACE}/build/publish.sh</command>
+ </hudson.tasks.Shell>
+ </builders>
+
+ <publishers>
+ <hudson.tasks.ArtifactArchiver>
+ <artifacts>**/*Update*.zip</artifacts>
+ <excludes>**/target/**</excludes>
+ <latestOnly>true</latestOnly>
+ <zip>false</zip>
+ </hudson.tasks.ArtifactArchiver>
+
+ <hudson.tasks.junit.JUnitResultArchiver>
+ <testResults>**/TEST-*.xml</testResults>
+ <keepLongStdio>false</keepLongStdio>
+ <testDataPublishers/>
+ </hudson.tasks.junit.JUnitResultArchiver>
+ <hudson.tasks.Mailer>
+ <recipients/>
+ <notifyEveryBuild>false</notifyEveryBuild>
+
+ <dontNotifyOnModules>false</dontNotifyOnModules>
+ <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
+ <sendToIndividuals>true</sendToIndividuals>
+ </hudson.tasks.Mailer>
+ </publishers>
+ <buildWrappers>
+
+ <hudson.plugins.build__timeout.BuildTimeoutWrapper>
+ <timeoutMinutes>120</timeoutMinutes>
+ <failBuild>false</failBuild>
+ </hudson.plugins.build__timeout.BuildTimeoutWrapper>
+ <hudson.plugins.xvnc.Xvnc>
+ <takeScreenshot>false</takeScreenshot>
+ </hudson.plugins.xvnc.Xvnc>
+
+ </buildWrappers>
+</project>
\ No newline at end of file
Added: trunk/build/hudson-jobs/pom.xml
===================================================================
--- trunk/build/hudson-jobs/pom.xml (rev 0)
+++ trunk/build/hudson-jobs/pom.xml 2010-12-15 16:47:33 UTC (rev 27516)
@@ -0,0 +1,84 @@
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.hudson.jobs.all</artifactId>
+ <name>org.jboss.tools.hudson.jobs.all</name>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugin</groupId>
+ <artifactId>hudson-job-publisher-plugin</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>install</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+<!--
+To be able to connect to server, must first import certificate or you may get this error:
+
+ javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
+
+AS USER (with Firefox):
+
+Browse to https://hudson.qa.jboss.com/hudson & accept the cert.
+
+ Edit > Preferences > Advanced > Encryption > View Certificates > find hudson cert > Export to file /tmp/hudson.qa.jboss.com.cert
+
+AS ROOT (default password is "changeit"):
+
+ # /opt/sun-java2-6.0/jre/bin/keytool -list -keystore /opt/sun-java2-6.0/jre/lib/security/cacerts | grep hudson
+ # /opt/sun-java2-6.0/jre/bin/keytool -import -alias hudson.qa -keystore /opt/sun-java2-6.0/jre/lib/security/cacerts -file /tmp/hudson.qa.jboss.com.cert
+ # /opt/sun-java2-6.0/jre/bin/keytool -list -keystore /opt/sun-java2-6.0/jre/lib/security/cacerts | grep hudson
+
+To run, make sure that JAVA_HOME is set to the path where you imported the cert, eg.:
+
+ $ export JAVA_HOME=/opt/sun-java2-6.0/; mvn clean install
+-->
+ <!-- more output w/ verbose; default false -->
+ <verbose>true</verbose>
+
+ <!-- server and connection details -->
+ <hudsonURL>http://localhost:8080/</hudsonURL>
+ <!-- <hudsonURL>https://hudson.qa.jboss.com/hudson/</hudsonURL> -->
+ <username>SET USERNAME HERE</username>
+ <password>SET PASSWORD HERE</password>
+
+ <!-- default true: existing jobs will be overwritten; set false to throw
+ an error if job exists -->
+ <replaceExistingJob>true</replaceExistingJob>
+
+ <!-- local file path to use as template when publishing jobs -->
+ <jobTemplateFile>config.xml</jobTemplateFile>
+
+ <!-- job configuration: one buildURL -->
+ <buildURL>https://svn.jboss.org/repos/jbosstools/trunk/build</buildURL>
+ <!-- then many identically configured components -->
+ <components>TESTING</components>
+ <!-- <components>archives, as, birt, bpel, bpmn, cdi, common, deltacloud,
+ esb, examples, flow, freemarker, gwt, hibernatetools, jbpm, jmx, jsf, jst,
+ maven, modeshape, portlet, profiler, runtime, seam, smooks, struts, tptp,
+ usage, vpe, ws</components> -->
+
+ <componentJobNameSuffix>-TESTTESTTEST</componentJobNameSuffix>
+ <!-- then some special-case components (not in JBT tree) -->
+ <!--<properties> <property> <name>jbosstools-pi4soa-stable-branch</name>
+ <value>https://pi4soa.svn.sourceforge.net/svnroot/pi4soa/branches/pi4soa-3.1.x</value>
+ </property> <property> <name>jbosstools-teiid-designer-stable-branch</name>
+ <value>http://anonsvn.jboss.org/repos/tdesigner/branches/7.1</value> </property>
+ <property> <name>jbosstools-savara-stable-branch</name> <value>http://anonsvn.jboss.org/repos/savara/branches/1.1.x</value>
+ </property> </properties> -->
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
14 years
JBoss Tools SVN: r27515 - in trunk/cdi/tests: org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-12-15 11:18:54 -0500 (Wed, 15 Dec 2010)
New Revision: 27515
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/LocalInt.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NotBusinessMethod_Broken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NotBusinessMethod_BrokenNoInterface.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Terrier.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TibetanTerrier_Broken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TibetanTerrier_BrokenNoInterface.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7673
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/LocalInt.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/LocalInt.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/LocalInt.java 2010-12-15 16:18:54 UTC (rev 27515)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Local;
+
+@Local
+public interface LocalInt {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/LocalInt.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NotBusinessMethod_Broken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NotBusinessMethod_Broken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NotBusinessMethod_Broken.java 2010-12-15 16:18:54 UTC (rev 27515)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Stateful;
+import javax.enterprise.inject.Disposes;
+import javax.persistence.EntityManager;
+
+@Stateful
+public class NotBusinessMethod_Broken implements LocalInt {
+
+ void disposeEntityManager(@Disposes EntityManager em) {
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NotBusinessMethod_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NotBusinessMethod_BrokenNoInterface.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NotBusinessMethod_BrokenNoInterface.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NotBusinessMethod_BrokenNoInterface.java 2010-12-15 16:18:54 UTC (rev 27515)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Stateful;
+import javax.enterprise.inject.Disposes;
+import javax.persistence.EntityManager;
+
+@Stateful
+public class NotBusinessMethod_BrokenNoInterface {
+
+ void disposeEntityManager(@Disposes EntityManager em) {
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/NotBusinessMethod_BrokenNoInterface.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Terrier.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Terrier.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Terrier.java 2010-12-15 16:18:54 UTC (rev 27515)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Local;
+
+@Local
+interface Terrier
+{
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/Terrier.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TibetanTerrier_Broken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TibetanTerrier_Broken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TibetanTerrier_Broken.java 2010-12-15 16:18:54 UTC (rev 27515)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Stateless;
+import javax.enterprise.event.Observes;
+
+@Stateless
+class TibetanTerrier_Broken implements Terrier
+{
+ void observeSomeEvent(@Observes String someEvent)
+ {
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TibetanTerrier_Broken.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TibetanTerrier_BrokenNoInterface.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TibetanTerrier_BrokenNoInterface.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TibetanTerrier_BrokenNoInterface.java 2010-12-15 16:18:54 UTC (rev 27515)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Stateless;
+import javax.enterprise.event.Observes;
+
+@Stateless
+class TibetanTerrier_BrokenNoInterface
+{
+ void observeSomeEvent(@Observes String someEvent)
+ {
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TibetanTerrier_BrokenNoInterface.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2010-12-15 16:10:03 UTC (rev 27514)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2010-12-15 16:18:54 UTC (rev 27515)
@@ -11,17 +11,25 @@
package org.jboss.tools.cdi.ui.test.marker;
+import java.io.IOException;
+import java.io.InputStream;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.ide.IDE;
import org.jboss.tools.cdi.core.test.tck.validation.ValidationTest;
+import org.jboss.tools.cdi.internal.core.validation.CDIValidationErrorManager;
import org.jboss.tools.cdi.ui.marker.AddLocalBeanMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeFieldStaticMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeMethodBusinessMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeMethodPublicMarkerResolution;
+import org.jboss.tools.test.util.JobUtils;
/**
* @author Daniel Azarov
@@ -30,137 +38,221 @@
public class CDIMarkerResolutionTest extends ValidationTest {
public static final String MARKER_TYPE = "org.jboss.tools.cdi.core.cdiproblem";
- public void testMakeFieldStaticResolution() throws CoreException {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NonStaticProducerOfSessionBeanBroken.java");
+ private void checkResolution(IProject project, String[] fileNames, String markerType, String idName, int id, Class<? extends IMarkerResolution> resolutionClass) throws CoreException {
+ IFile file = project.getFile(fileNames[0]);
assertTrue("File - "+file.getFullPath()+" must be exist",file.exists());
- IMarker[] markers = file.findMarkers(MARKER_TYPE, true, IResource.DEPTH_INFINITE);
+ copyFiles(project, fileNames);
- boolean found = false;
- for (int i = 0; i < markers.length; i++) {
- IMarker marker = markers[i];
- IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
- .getResolutions(marker);
- for (int j = 0; j < resolutions.length; j++) {
- IMarkerResolution resolution = resolutions[j];
- if (resolution instanceof MakeFieldStaticMarkerResolution) {
- found = true;
- break;
+ try{
+ IMarker[] markers = file.findMarkers(markerType, true, IResource.DEPTH_INFINITE);
+
+ for (int i = 0; i < markers.length; i++) {
+ IMarker marker = markers[i];
+ Integer attribute = ((Integer) marker
+ .getAttribute(CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME));
+ if (attribute != null){
+ int messageId = attribute.intValue();
+ if(messageId == id){
+ IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
+ .getResolutions(marker);
+ for (int j = 0; j < resolutions.length; j++) {
+ IMarkerResolution resolution = resolutions[j];
+ if (resolution.getClass().equals(resolutionClass)) {
+
+ resolution.run(marker);
+
+ refresh(project);
+
+ IMarker[] newMarkers = file.findMarkers(markerType, true, IResource.DEPTH_INFINITE);
+
+ assertTrue("Marker resolution did not decrease number of problems. was: "+markers.length+" now: "+newMarkers.length, newMarkers.length < markers.length);
+
+ return;
+ }
+ }
+ fail("Marker resolution: "+resolutionClass+" not found");
+ }
}
}
- if (found) {
- break;
- }
+ fail("Problem marker with id: "+id+" not found");
+ }finally{
+ restoreFiles(project, fileNames);
+
+ refresh(project);
}
- assertTrue("Quick fix: \"Make field static\" doesn't exist.", found);
}
- public void testMakeMethodBusinessResolution() throws CoreException {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/FooProducer.java");
+ private void refresh(IProject project) throws CoreException{
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ JobUtils.waitForIdle();
+ project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
+ JobUtils.waitForIdle();
- assertTrue("File - "+file.getFullPath()+" must be exist",file.exists());
-
- IMarker[] markers = file.findMarkers(MARKER_TYPE, true, IResource.DEPTH_INFINITE);
-
- boolean found1 = false;
- boolean found2 = false;
- for (int i = 0; i < markers.length; i++) {
- IMarker marker = markers[i];
- IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
- .getResolutions(marker);
- for (int j = 0; j < resolutions.length; j++) {
- IMarkerResolution resolution = resolutions[j];
- if (resolution instanceof MakeMethodBusinessMarkerResolution) {
- found1 = true;
- }
- if (resolution instanceof AddLocalBeanMarkerResolution) {
- found2 = true;
- }
- }
- }
- assertTrue("Quick fix: \"Make method business\" doesn't exist.", found1);
- assertTrue("Quick fix: \"Add @LocalBean annotation\" doesn't exist.", found2);
}
-
- public void testMakeMethodPublicResolution() throws CoreException {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/FooProducerNoInterface.java");
-
- assertTrue("File - "+file.getFullPath()+" must be exist",file.exists());
-
- IMarker[] markers = file.findMarkers(MARKER_TYPE, true, IResource.DEPTH_INFINITE);
-
- boolean found = false;
- for (int i = 0; i < markers.length; i++) {
- IMarker marker = markers[i];
- IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
- .getResolutions(marker);
- for (int j = 0; j < resolutions.length; j++) {
- IMarkerResolution resolution = resolutions[j];
- if (resolution instanceof MakeMethodPublicMarkerResolution) {
- found = true;
- break;
+
+ private void copyFiles(IProject project, String[] fileNames) throws CoreException{
+ for(String fileName : fileNames){
+ IFile file = project.getFile(fileName);
+ IFile copyFile = project.getFile(fileName+".copy");
+
+ if(copyFile.exists())
+ copyFile.delete(true, null);
+
+ InputStream is = null;
+ try{
+ is = file.getContents();
+ copyFile.create(is, true, null);
+ } finally {
+ if(is!=null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
}
}
- if (found) {
- break;
- }
}
- assertTrue("Quick fix: \"Make method public\" doesn't exist.", found);
}
- public void testMakeMethodBusinessResolution2() throws CoreException {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier_Broken.java");
-
- assertTrue("File - "+file.getFullPath()+" must be exist",file.exists());
-
- IMarker[] markers = file.findMarkers(MARKER_TYPE, true, IResource.DEPTH_INFINITE);
-
- boolean found1 = false;
- boolean found2 = false;
- for (int i = 0; i < markers.length; i++) {
- IMarker marker = markers[i];
- IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
- .getResolutions(marker);
- for (int j = 0; j < resolutions.length; j++) {
- IMarkerResolution resolution = resolutions[j];
- if (resolution instanceof MakeMethodBusinessMarkerResolution) {
- found1 = true;
+ private void restoreFiles(IProject project, String[] fileNames) throws CoreException {
+ for(String fileName : fileNames){
+ IFile file = project.getFile(fileName);
+ IFile copyFile = project.getFile(fileName+".copy");
+ InputStream is = null;
+ try{
+ is = copyFile.getContents();
+ file.setContents(is, true, false, null);
+ } finally {
+ if(is!=null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
}
- if (resolution instanceof AddLocalBeanMarkerResolution) {
- found2 = true;
- }
}
+ copyFile.delete(true, null);
}
- assertTrue("Quick fix: \"Make method business\" doesn't exist.", found1);
- assertTrue("Quick fix: \"Add @LocalBean annotation\" doesn't exist.", found2);
}
+
+ public void testMakeProducerFieldStaticResolution() throws CoreException {
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NonStaticProducerOfSessionBeanBroken.java"
+ },
+ MARKER_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN_ID,
+ MakeFieldStaticMarkerResolution.class);
+ }
+
+ public void testMakeProducerMethodBusinessResolution() throws CoreException {
+ checkResolution(
+ tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/FooProducer.java",
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/FooProducerLocal.java"
+ },
+ MARKER_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN_ID,
+ MakeMethodBusinessMarkerResolution.class);
+ }
+
+ public void testAddLocalBeanResolution() throws CoreException {
+ checkResolution(
+ tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/FooProducer.java",
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/FooProducerLocal.java"
+ },
+ MARKER_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN_ID,
+ AddLocalBeanMarkerResolution.class);
+ }
- public void testMakeMethodBusinessResolution3() throws CoreException {
- IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/NotBusinessMethod_Broken.java");
-
- assertTrue("File - "+file.getFullPath()+" must be exist",file.exists());
-
- IMarker[] markers = file.findMarkers(MARKER_TYPE, true, IResource.DEPTH_INFINITE);
-
- boolean found1 = false;
- boolean found2 = false;
- for (int i = 0; i < markers.length; i++) {
- IMarker marker = markers[i];
- IMarkerResolution[] resolutions = IDE.getMarkerHelpRegistry()
- .getResolutions(marker);
- for (int j = 0; j < resolutions.length; j++) {
- IMarkerResolution resolution = resolutions[j];
- if (resolution instanceof MakeMethodBusinessMarkerResolution) {
- found1 = true;
- }
- if (resolution instanceof AddLocalBeanMarkerResolution) {
- found2 = true;
- }
- }
- }
- assertTrue("Quick fix: \"Make method business\" doesn't exist.", found1);
- assertTrue("Quick fix: \"Add @LocalBean annotation\" doesn't exist.", found2);
+ public void testMakeProducerMethodPublicResolution() throws CoreException {
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/FooProducerNoInterface.java"
+ },
+ MARKER_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN_ID,
+ MakeMethodPublicMarkerResolution.class);
}
+
+ public void testMakeObserverParamMethodBusinessResolution() throws CoreException {
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TibetanTerrier_Broken.java",
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Terrier.java"
+ },
+ MARKER_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.ILLEGAL_OBSERVER_IN_SESSION_BEAN_ID,
+ MakeMethodBusinessMarkerResolution.class);
+ }
+ public void testAddLocalBeanResolution2() throws CoreException {
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TibetanTerrier_Broken.java",
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/Terrier.java"
+ },
+ MARKER_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.ILLEGAL_OBSERVER_IN_SESSION_BEAN_ID,
+ AddLocalBeanMarkerResolution.class);
+ }
+
+ public void testMakeObserverParamMethodPublicResolution() throws CoreException {
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TibetanTerrier_BrokenNoInterface.java"
+ },
+ MARKER_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.ILLEGAL_OBSERVER_IN_SESSION_BEAN_ID,
+ MakeMethodPublicMarkerResolution.class);
+ }
+
+ public void testMakeDisposerParamMethodBusinessResolution() throws CoreException {
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NotBusinessMethod_Broken.java",
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/LocalInt.java"
+ },
+ MARKER_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.ILLEGAL_DISPOSER_IN_SESSION_BEAN_ID,
+ MakeMethodBusinessMarkerResolution.class);
+ }
+
+ public void testAddLocalBeanResolution3() throws CoreException {
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NotBusinessMethod_Broken.java",
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/LocalInt.java"
+ },
+ MARKER_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.ILLEGAL_DISPOSER_IN_SESSION_BEAN_ID,
+ AddLocalBeanMarkerResolution.class);
+ }
+
+ public void testMakeDisposerParamMethodPublicResolution() throws CoreException {
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/NotBusinessMethod_BrokenNoInterface.java"
+ },
+ MARKER_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.ILLEGAL_DISPOSER_IN_SESSION_BEAN_ID,
+ MakeMethodPublicMarkerResolution.class);
+ }
+
}
14 years, 1 month
JBoss Tools SVN: r27514 - in trunk/deltacloud/plugins: org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-15 11:10:03 -0500 (Wed, 15 Dec 2010)
New Revision: 27514
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
Log:
[JBIDE-7912]
* replaced custom WatchCreateJob and replaced with InstanceStateJob to have consistent scheduling across jobs in the client
* removed job related methods in DeltaCloud since job concurrency is dealt with job scheduling rules now
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-12-15 15:39:02 UTC (rev 27513)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-12-15 16:10:03 UTC (rev 27514)
@@ -1,5 +1,10 @@
2010-12-15 André Dietisheim <adietish(a)redhat.com>
+ * src/org/jboss/tools/deltacloud/core/DeltaCloud.java
+ (getInstanceJob):
+ (waitWhilePending):
+ (registerInstanceJob):
+ [JBIDE-7912] removed since job concurrency is dealt with job scheduling rules now
* src/org/jboss/tools/deltacloud/core/job/InstanceSchedulingRule.java (isConflicting):
* src/org/jboss/tools/deltacloud/core/job/CloudSchedulingRule.java (isConflicting):
* src/org/jboss/tools/deltacloud/core/job/CloudElementSchedulingRule.java (isConflicting):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-12-15 15:39:02 UTC (rev 27513)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-12-15 16:10:03 UTC (rev 27514)
@@ -13,14 +13,11 @@
import java.net.MalformedURLException;
import java.text.MessageFormat;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.regex.PatternSyntaxException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.jobs.Job;
import org.jboss.tools.deltacloud.core.client.DeltaCloudAuthException;
import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
import org.jboss.tools.deltacloud.core.client.DeltaCloudClientImpl;
@@ -62,10 +59,6 @@
private IImageFilter imageFilter;
private IInstanceFilter instanceFilter;
- private Map<String, Job> actionJobs;
-
- private Object actionLock = new Object();
-
private SecurePasswordStore passwordStore;
public static interface IInstanceStateMatcher {
@@ -295,36 +288,6 @@
}
}
- public Job getInstanceJob(String id) {
- synchronized (actionLock) {
- Job j = null;
- if (actionJobs != null) {
- return actionJobs.get(id);
- }
- return j;
- }
- }
-
- public void registerInstanceJob(String id, Job j) {
- synchronized (actionLock) {
- if (actionJobs == null)
- actionJobs = new HashMap<String, Job>();
- actionJobs.put(id, j);
- }
- }
-
- public DeltaCloudInstance waitWhilePending(String instanceId, IProgressMonitor pm) throws InterruptedException,
- DeltaCloudException {
- IInstanceStateMatcher differsFromPending = new IInstanceStateMatcher() {
-
- @Override
- public boolean matchesState(DeltaCloudInstance instance, DeltaCloudInstance.State instanceState) {
- return !DeltaCloudInstance.State.PENDING.equals(instanceState);
- }
- };
- return waitForState(instanceId, differsFromPending, pm);
- }
-
public DeltaCloudInstance waitForState(String instanceId, final DeltaCloudInstance.State expectedState,
IProgressMonitor pm)
throws InterruptedException, DeltaCloudException {
@@ -354,13 +317,6 @@
return instance;
}
- public void removeInstanceJob(String id, Job j) {
- synchronized (actionLock) {
- if (actionJobs != null && actionJobs.get(id) == j)
- actionJobs.remove(id);
- }
- }
-
/**
* Loads the instanceRepo from the server and stores them in this instance.
* Furthermore listeners get informed.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-15 15:39:02 UTC (rev 27513)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-15 16:10:03 UTC (rev 27514)
@@ -1,3 +1,9 @@
+2010-12-15 André Dietisheim <adietish(a)redhat.com>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java (WatchCreateJob):
+ [JBIDE-7912] replaced custom WatchCreateJob and replaced with InstanceStateJob to have consistent scheduling across jobs
+ in the client
+
2010-12-14 André Dietisheim <adietish(a)redhat.com>
* src/org/jboss/tools/deltacloud/ui/views/cloud/property/InstancePropertySource.java (getKey):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2010-12-15 15:39:02 UTC (rev 27513)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2010-12-15 16:10:03 UTC (rev 27514)
@@ -14,9 +14,6 @@
import java.net.URLEncoder;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
@@ -27,6 +24,7 @@
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.core.DeltaCloudManager;
+import org.jboss.tools.deltacloud.core.job.InstanceStateJob;
import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.deltacloud.ui.DeltacloudUIExtensionManager;
import org.jboss.tools.deltacloud.ui.ErrorUtils;
@@ -41,7 +39,6 @@
private final static String CONFIRM_CREATE_TITLE = "ConfirmCreate.title"; //$NON-NLS-1$
private final static String CONFIRM_CREATE_MSG = "ConfirmCreate.msg"; //$NON-NLS-1$
private final static String DONT_SHOW_THIS_AGAIN_MSG = "DontShowThisAgain.msg"; //$NON-NLS-1$
- private final static String STARTING_INSTANCE_MSG = "StartingInstance.msg"; //$NON-NLS-1$
private final static String STARTING_INSTANCE_TITLE = "StartingInstance.title"; //$NON-NLS-1$
protected NewInstancePage mainPage;
@@ -77,47 +74,6 @@
return mainPage.isPageComplete();
}
- private class WatchCreateJob extends ChainedJob {
-
- private DeltaCloud cloud;
- private String instanceId;
- private String instanceName;
-
- public WatchCreateJob(String title, DeltaCloud cloud,
- String instanceId, String instanceName) {
- super(title, INewInstanceWizardPage.NEW_INSTANCE_FAMILY);
- this.cloud = cloud;
- this.instanceId = instanceId;
- this.instanceName = instanceName;
- }
-
- public IStatus run(IProgressMonitor pm) {
- if (!pm.isCanceled()) {
- DeltaCloudInstance instance = null;
- try {
- pm.beginTask(
- WizardMessages.getFormattedString(STARTING_INSTANCE_MSG, new String[] { instanceName }),
- IProgressMonitor.UNKNOWN);
- pm.worked(1);
- cloud.registerInstanceJob(instanceId, this);
- instance = cloud.waitWhilePending(instanceId, pm);
-
- } catch (Exception e) {
- // do nothing
- } finally {
- // cloud.replaceInstance(instance);
- cloud.removeInstanceJob(instanceId, this);
- System.out.println(instance.getHostName());
- pm.done();
- }
- return Status.OK_STATUS;
- } else {
- pm.done();
- return Status.CANCEL_STATUS;
- }
- }
- };
-
@Override
public boolean performFinish() {
NewInstanceModel model = mainPage.getModel();
@@ -168,12 +124,12 @@
result = true;
}
if (instance != null && instance.getState().equals(DeltaCloudInstance.State.PENDING)) {
- final String instanceId = instance.getId();
- final String instanceName = name;
-
// TODO use chained job? Maybe. But chainedJob needs to be moved
- ChainedJob first = new WatchCreateJob(WizardMessages.getString(STARTING_INSTANCE_TITLE),
- cloud, instanceId, instanceName);
+ ChainedJob first =
+ new InstanceStateJob(
+ WizardMessages.getFormattedString(STARTING_INSTANCE_TITLE, instance.getName()),
+ instance,
+ DeltaCloudInstance.State.RUNNING);
first.setUser(true);
ChainedJob last = first;
ChainedJob temp;
14 years, 1 month
JBoss Tools SVN: r27513 - trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-15 10:39:02 -0500 (Wed, 15 Dec 2010)
New Revision: 27513
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/META-INF/MANIFEST.MF
Log:
corrected missing dependency
Modified: trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/META-INF/MANIFEST.MF 2010-12-15 15:35:32 UTC (rev 27512)
+++ trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/META-INF/MANIFEST.MF 2010-12-15 15:39:02 UTC (rev 27513)
@@ -6,6 +6,7 @@
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.jboss.tools.deltacloud.core;bundle-version="0.0.1",
org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)",
- org.junit;bundle-version="4.8.1"
+ org.junit;bundle-version="[4.8.0,5.0.0)",
+ org.jboss.tools.common;bundle-version="[3.2.0,4.0.0)"
Bundle-ClassPath: jruby-complete-1.5.3.jar,
.
14 years, 1 month
JBoss Tools SVN: r27512 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-15 10:35:32 -0500 (Wed, 15 Dec 2010)
New Revision: 27512
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
Log:
[JBIDE-7594] corrected bad realm binding
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-12-15 15:19:13 UTC (rev 27511)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-12-15 15:35:32 UTC (rev 27512)
@@ -174,18 +174,14 @@
setImageDescriptor(SWTImagesFactory.DESC_DELTA_LARGE);
}
-// public String getHardwareProfile() {
-// return hardwareCombo.getText();
-// }
-//
-// public String getRealmId() {
-// if (realmCombo instanceof Combo) {
-// int index = ((Combo) realmCombo).getSelectionIndex();
-// return realms.get(index).getId();
-// } else {
-// return null;
-// }
-// }
+ // public String getRealmId() {
+ // if (realmCombo instanceof Combo) {
+ // int index = ((Combo) realmCombo).getSelectionIndex();
+ // return realms.get(index).getId();
+ // } else {
+ // return null;
+ // }
+ // }
public String getCpuProperty() {
return currProfilePage.getCPU();
@@ -199,18 +195,6 @@
return currProfilePage.getMemory();
}
-// public String getInstanceName() {
-// return nameText.getText();
-// }
-
-// public String getKeyName() {
-// return keyText.getText();
-// }
-//
-// public String getImageId() {
-// return imageText.getText();
-// }
-
private void clearProfiles() {
hardwareCombo.removeModifyListener(hardwareComboListener);
hardwareCombo.removeAll();
@@ -320,7 +304,7 @@
groupLayout.marginHeight = 0;
groupLayout.marginWidth = 0;
groupContainer.setLayout(groupLayout);
-// hardwareCombo.setEnabled(false);
+ // hardwareCombo.setEnabled(false);
// add invisible dummy widget to guarantee a min size
dummyLabel = new Label(groupContainer, SWT.NONE);
@@ -430,9 +414,20 @@
// realms
// TODO: internationalize strings
- UpdateValueStrategy realmComboStrategy = new UpdateValueStrategy().setBeforeSetValidator(new MandatoryStringValidator("You must select a realm."));
+ UpdateValueStrategy realmComboStrategy = new UpdateValueStrategy();
+ realmComboStrategy.setConverter(new Converter(Integer.class, String.class)
+ {
+ @Override
+ public Object convert(Object fromObject) {
+ int selectedRealmIndex = (Integer) fromObject;
+ if (realms == null || selectedRealmIndex >= realms.size()) {
+ return "";
+ }
+ return realms.get(selectedRealmIndex);
+ }
+ });
dbc.bindValue(
- WidgetProperties.text().observe(realmCombo),
+ WidgetProperties.singleSelectionIndex().observe(realmCombo),
BeanProperties.value(
NewInstanceModel.class, NewInstanceModel.PROPERTY_REALM).observe(model),
realmComboStrategy,
@@ -440,7 +435,8 @@
// hardwareCombo
// TODO: internationalize strings
- UpdateValueStrategy hardwareComboStrategy = new UpdateValueStrategy().setBeforeSetValidator(new MandatoryStringValidator("You must select a hardware profile."));
+ UpdateValueStrategy hardwareComboStrategy = new UpdateValueStrategy()
+ .setBeforeSetValidator(new MandatoryStringValidator("You must select a hardware profile."));
dbc.bindValue(
WidgetProperties.text().observe(hardwareCombo),
BeanProperties.value(
@@ -538,7 +534,7 @@
// TODO: internationalize strings
new AbstractCloudElementJob("Get realms", cloud, CLOUDELEMENT.REALMS) {
protected IStatus doRun(IProgressMonitor monitor) throws Exception {
- realms = getRealms();
+ realms = loadRealms();
Display.getDefault().asyncExec(new Runnable() {
public void run() {
updateRealmCombo(getRealmNames(realms));
@@ -623,7 +619,7 @@
return realmNames;
}
- private List<DeltaCloudRealm> getRealms() {
+ private List<DeltaCloudRealm> loadRealms() {
List<DeltaCloudRealm> realms = new ArrayList<DeltaCloudRealm>();
try {
realms = Arrays.asList(cloud.getRealms());
14 years, 1 month
JBoss Tools SVN: r27511 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-15 10:19:13 -0500 (Wed, 15 Dec 2010)
New Revision: 27511
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java
Log:
[JBIDE-7594]
* corrected missing storage and cpu values in "launch instance" wizard
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java 2010-12-15 15:17:08 UTC (rev 27510)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java 2010-12-15 15:19:13 UTC (rev 27511)
@@ -33,8 +33,9 @@
private String keyname;
private String profile;
- protected NewInstanceModel(String keyname) {
+ protected NewInstanceModel(String keyname, DeltaCloudImage image) {
this.keyname = keyname;
+ this.image = image;
}
public String getName() {
@@ -52,7 +53,7 @@
public void setImage(DeltaCloudImage image) {
getPropertyChangeSupport().firePropertyChange(PROPERTY_IMAGE, this.image, this.image = image);
}
-
+
public String getRealm() {
return realm;
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-12-15 15:17:08 UTC (rev 27510)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-12-15 15:19:13 UTC (rev 27511)
@@ -72,6 +72,7 @@
/**
* @author Jeff Jonston
+ * @author André Dietisheim
*/
public class NewInstancePage extends WizardPage {
@@ -105,26 +106,27 @@
private Text nameText;
private Text imageText;
private Text keyText;
- private Combo hardware;
+ private Combo hardwareCombo;
private Combo realmCombo;
- private ProfileComposite currPage;
+ private ProfileComposite currProfilePage;
private Map<String, ProfileComposite> profilePages;
private DeltaCloudHardwareProfile[] allProfiles;
private List<DeltaCloudRealm> realms;
private Group groupContainer;
- private ModifyListener comboListener = new ModifyListener() {
+ private ModifyListener hardwareComboListener = new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
- int index = hardware.getSelectionIndex();
- String id = index > -1 ? hardware.getItem(hardware.getSelectionIndex()) : null;
- if (currPage != null)
- currPage.setVisible(false);
+ int index = hardwareCombo.getSelectionIndex();
+ String id = index > -1 ? hardwareCombo.getItem(hardwareCombo.getSelectionIndex()) : null;
+ if (currProfilePage != null) {
+ currProfilePage.setVisible(false);
+ }
if (id != null) {
- currPage = profilePages.get(id);
- currPage.setVisible(true);
+ currProfilePage = profilePages.get(id);
+ currProfilePage.setVisible(true);
}
}
};
@@ -161,66 +163,62 @@
};
- public NewInstancePage(DeltaCloud cloud) {
+ public NewInstancePage(DeltaCloud cloud, DeltaCloudImage image) {
super(WizardMessages.getString(NAME));
this.cloud = cloud;
+ this.image = image;
String defaultKeyname = cloud.getLastKeyname();
- model = new NewInstanceModel(defaultKeyname); //$NON-NLS-1$
+ model = new NewInstanceModel(defaultKeyname, image); //$NON-NLS-1$
setDescription(WizardMessages.getString(DESCRIPTION));
setTitle(WizardMessages.getString(TITLE));
setImageDescriptor(SWTImagesFactory.DESC_DELTA_LARGE);
- setPageComplete(false);
}
- public String getHardwareProfile() {
- return hardware.getText();
- }
+// public String getHardwareProfile() {
+// return hardwareCombo.getText();
+// }
+//
+// public String getRealmId() {
+// if (realmCombo instanceof Combo) {
+// int index = ((Combo) realmCombo).getSelectionIndex();
+// return realms.get(index).getId();
+// } else {
+// return null;
+// }
+// }
- public String getRealmId() {
- if (realmCombo instanceof Combo) {
- int index = ((Combo) realmCombo).getSelectionIndex();
- return realms.get(index).getId();
- } else {
- return null;
- }
- }
-
public String getCpuProperty() {
- return currPage.getCPU();
+ return currProfilePage.getCPU();
}
public String getStorageProperty() {
- return currPage.getStorage();
+ return currProfilePage.getStorage();
}
public String getMemoryProperty() {
- return currPage.getMemory();
+ return currProfilePage.getMemory();
}
- public String getInstanceName() {
- return nameText.getText();
- }
+// public String getInstanceName() {
+// return nameText.getText();
+// }
- public String getKeyName() {
- return keyText.getText();
- }
+// public String getKeyName() {
+// return keyText.getText();
+// }
+//
+// public String getImageId() {
+// return imageText.getText();
+// }
- public String getImageId() {
- return imageText.getText();
- }
-
- public void setImage(DeltaCloudImage image) {
- this.image = image;
- }
-
- public void clearProfiles() {
- hardware.removeModifyListener(comboListener);
- hardware.removeAll();
- if (currPage != null) {
- currPage.setVisible(false);
+ private void clearProfiles() {
+ hardwareCombo.removeModifyListener(hardwareComboListener);
+ hardwareCombo.removeAll();
+ if (currProfilePage != null) {
+ currProfilePage.setVisible(false);
}
- hardware.setEnabled(false);
- hardware.addModifyListener(comboListener);
+ hardwareCombo.setEnabled(false);
+ hardwareCombo.addModifyListener(hardwareComboListener);
}
private List<DeltaCloudHardwareProfile> filterProfiles(DeltaCloudHardwareProfile[] profiles) {
@@ -230,13 +228,13 @@
List<DeltaCloudHardwareProfile> filteredProfiles = new ArrayList<DeltaCloudHardwareProfile>();
for (DeltaCloudHardwareProfile p : profiles) {
- if (p.getArchitecture() == null
- || image == null
+ if (p.getArchitecture() == null
+ || image == null
|| image.getArchitecture().equals(p.getArchitecture())) {
filteredProfiles.add(p);
}
}
-
+
return filteredProfiles;
}
@@ -252,19 +250,22 @@
// We have to set the imageObservable id here instead of in the
// constructor of the model because the imageObservable id triggers
- // other items to fill in their values such as the architecture
- // and hardware profiles.
- try {
- model.setImage(cloud.getLastImage());
- } catch (DeltaCloudException e) {
- // ignore
- }
+ // other items to fill in their values such as the architecture
+ // and hardwareCombo profiles.
+ // try {
+ // model.setImage(cloud.getLastImage());
+ // } catch (DeltaCloudException e) {
+ // // ignore
+ // }
setControl(control);
// lastly, if there's already an image set, use it
if (image != null) {
imageText.setText(image.getId());
+ } else {
+ imageText.setText(cloud.getLastImageId());
}
+ setPageComplete(false);
}
private Composite createWidgets(Composite parent) {
@@ -308,10 +309,10 @@
Label hardwareLabel = new Label(container, SWT.NULL);
hardwareLabel.setText(WizardMessages.getString(HARDWARE_LABEL));
- hardware = new Combo(container, SWT.READ_ONLY);
- hardware.setEnabled(false);
- hardware.setItems(new String[] { WizardMessages.getString(LOADING_VALUE) });
- hardware.select(0);
+ hardwareCombo = new Combo(container, SWT.READ_ONLY);
+ hardwareCombo.setEnabled(false);
+ hardwareCombo.setItems(new String[] { WizardMessages.getString(LOADING_VALUE) });
+ hardwareCombo.select(0);
groupContainer = new Group(container, SWT.BORDER);
groupContainer.setText(WizardMessages.getString(PROPERTIES_LABEL));
@@ -319,7 +320,7 @@
groupLayout.marginHeight = 0;
groupLayout.marginWidth = 0;
groupContainer.setLayout(groupLayout);
- hardware.setEnabled(false);
+// hardwareCombo.setEnabled(false);
// add invisible dummy widget to guarantee a min size
dummyLabel = new Label(groupContainer, SWT.NONE);
@@ -393,9 +394,9 @@
hardwareLabel.setLayoutData(f);
f = UIUtils.createFormData(control, 8, null, 0, hardwareLabel, 5, 100, 0);
- hardware.setLayoutData(f);
+ hardwareCombo.setLayoutData(f);
- f = UIUtils.createFormData(hardware, 10, 100, 0, 0, 0, 100, 0);
+ f = UIUtils.createFormData(hardwareCombo, 10, 100, 0, 0, 0, 100, 0);
groupContainer.setLayoutData(f);
return container;
}
@@ -428,18 +429,24 @@
});
// realms
- IObservableValue realmObservable = WidgetProperties.text().observe(realmCombo);
+ // TODO: internationalize strings
+ UpdateValueStrategy realmComboStrategy = new UpdateValueStrategy().setBeforeSetValidator(new MandatoryStringValidator("You must select a realm."));
dbc.bindValue(
- realmObservable,
+ WidgetProperties.text().observe(realmCombo),
BeanProperties.value(
- NewInstanceModel.class, NewInstanceModel.PROPERTY_REALM).observe(model));
+ NewInstanceModel.class, NewInstanceModel.PROPERTY_REALM).observe(model),
+ realmComboStrategy,
+ null);
- // hardware
- IObservableValue hardwareObservable = WidgetProperties.text().observe(hardware);
+ // hardwareCombo
+ // TODO: internationalize strings
+ UpdateValueStrategy hardwareComboStrategy = new UpdateValueStrategy().setBeforeSetValidator(new MandatoryStringValidator("You must select a hardware profile."));
dbc.bindValue(
- hardwareObservable,
+ WidgetProperties.text().observe(hardwareCombo),
BeanProperties.value(
- NewInstanceModel.class, NewInstanceModel.PROPERTY_PROFILE).observe(model));
+ NewInstanceModel.class, NewInstanceModel.PROPERTY_PROFILE).observe(model),
+ hardwareComboStrategy,
+ null);
// key
bindText(keyText, NewInstanceModel.PROPERTY_KEYNAME, WizardMessages.getString(MUST_ENTER_A_KEYNAME), dbc);
@@ -464,7 +471,7 @@
widgetToModelUpdateStrategy.setAfterConvertValidator(new ImageValidator());
UpdateValueStrategy modelToTextUpdateStrategy = new UpdateValueStrategy();
- modelToTextUpdateStrategy.setConverter(new Converter(DeltaCloudImage.class, String.class) {
+ modelToTextUpdateStrategy.setConverter(new Converter(DeltaCloudImage.class, String.class) {
@Override
public Object convert(Object fromObject) {
if (fromObject instanceof DeltaCloudImage) {
@@ -474,7 +481,7 @@
}
}
});
-
+
Binding imageBinding = dbc.bindValue(
WidgetProperties.text(SWT.Modify).observeDelayed(IMAGE_CHECK_DELAY, imageText),
BeanProperties.value(NewInstanceModel.class, NewInstanceModel.PROPERTY_IMAGE).observe(model),
@@ -534,12 +541,12 @@
realms = getRealms();
Display.getDefault().asyncExec(new Runnable() {
public void run() {
- updateRealmCombo();
+ updateRealmCombo(getRealmNames(realms));
}
});
return Status.OK_STATUS;
}
- }.schedule();
+ }.schedule();
}
private void asyncGetProfiles() {
@@ -553,7 +560,9 @@
createProfileComposites();
clearProfiles();
if (allProfiles.length > 0) {
- hardware.setEnabled(true);
+ hardwareCombo.setEnabled(true);
+ hardwareCombo.select(0);
+ setPageComplete(true);
}
List<DeltaCloudHardwareProfile> filteredProfiles = filterProfiles(allProfiles);
updateWidgets(getProfileIds(filteredProfiles));
@@ -581,13 +590,13 @@
private void updateWidgets(String[] ids) {
if (ids.length > 0) {
- hardware.removeModifyListener(comboListener);
- hardware.setItems(ids);
- hardware.setText(ids[0]);
- currPage = profilePages.get(ids[0]);
- currPage.setVisible(true);
- hardware.setEnabled(true);
- hardware.addModifyListener(comboListener);
+ hardwareCombo.removeModifyListener(hardwareComboListener);
+ hardwareCombo.setItems(ids);
+ hardwareCombo.setText(ids[0]);
+ currProfilePage = profilePages.get(ids[0]);
+ currProfilePage.setVisible(true);
+ hardwareCombo.setEnabled(true);
+ hardwareCombo.addModifyListener(hardwareComboListener);
}
}
@@ -599,7 +608,7 @@
}
return ids;
}
-
+
private List<String> getRealmNames(List<DeltaCloudRealm> realms) {
List<String> realmNames = new ArrayList<String>();
for (DeltaCloudRealm realm : realms) {
@@ -644,15 +653,18 @@
combo.select(0);
}
- private void updateRealmCombo() {
- List<String> names = getRealmNames(realms != null ? realms : new ArrayList<DeltaCloudRealm>());
- if (names.size() > 0) {
- realmCombo.setItems(names.toArray(new String[names.size()]));
+ private void updateRealmCombo(List<String> realms) {
+ if (realms != null && realms.size() > 0) {
+ realmCombo.setItems(realms.toArray(new String[realms.size()]));
realmCombo.setEnabled(true);
- realmCombo.select(0);
} else {
realmCombo.setItems(new String[] { WizardMessages.getString(NONE_RESPONSE) });
- realmCombo.select(0);
+ realmCombo.setEnabled(false);
}
+ realmCombo.select(0);
}
+
+ public NewInstanceModel getModel() {
+ return model;
+ }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2010-12-15 15:17:08 UTC (rev 27510)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2010-12-15 15:19:13 UTC (rev 27511)
@@ -13,6 +13,7 @@
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -63,12 +64,10 @@
@Override
public void addPages() {
- mainPage = new NewInstancePage(cloud);
- if( image != null )
- mainPage.setImage(image);
+ mainPage = new NewInstancePage(cloud, image);
addPage(mainPage);
additionalPages = DeltacloudUIExtensionManager.getDefault().loadNewInstanceWizardPages();
- for( int i = 0; i < additionalPages.length; i++ ) {
+ for (int i = 0; i < additionalPages.length; i++) {
addPage(additionalPages[i]);
}
}
@@ -102,11 +101,11 @@
pm.worked(1);
cloud.registerInstanceJob(instanceId, this);
instance = cloud.waitWhilePending(instanceId, pm);
-
+
} catch (Exception e) {
// do nothing
} finally {
-// cloud.replaceInstance(instance);
+ // cloud.replaceInstance(instance);
cloud.removeInstanceJob(instanceId, this);
System.out.println(instance.getHostName());
pm.done();
@@ -121,14 +120,20 @@
@Override
public boolean performFinish() {
- String imageId = mainPage.getImageId().trim();
- String profileId = mainPage.getHardwareProfile();
- String realmId = mainPage.getRealmId();
+ NewInstanceModel model = mainPage.getModel();
+
+ DeltaCloudImage image = model.getImage();
+ Assert.isTrue(image != null);
+ String imageId = image.getId();
+
+ String profileId = model.getProfile();
+ String realmId = model.getRealm();
String memory = mainPage.getMemoryProperty();
String storage = mainPage.getStorageProperty();
- String keyname = mainPage.getKeyName();
- String name = getName();
+ String keyname = model.getKeyname();
+ String name = utf8Encode(model.getName());
+
// Save persistent settings for this particular cloud
cloud.setLastImageId(imageId);
cloud.setLastKeyname(keyname);
@@ -165,16 +170,16 @@
if (instance != null && instance.getState().equals(DeltaCloudInstance.State.PENDING)) {
final String instanceId = instance.getId();
final String instanceName = name;
-
+
// TODO use chained job? Maybe. But chainedJob needs to be moved
ChainedJob first = new WatchCreateJob(WizardMessages.getString(STARTING_INSTANCE_TITLE),
cloud, instanceId, instanceName);
first.setUser(true);
ChainedJob last = first;
ChainedJob temp;
- for( int i = 0; i < additionalPages.length; i++ ) {
+ for (int i = 0; i < additionalPages.length; i++) {
temp = additionalPages[i].getPerformFinishJob(instance);
- if( temp != null ) {
+ if (temp != null) {
last.setNextJob(temp);
last = temp;
}
@@ -186,16 +191,17 @@
}
if (!result) {
ErrorUtils.handleError(
- WizardMessages.getString(CREATE_INSTANCE_FAILURE_TITLE),
- WizardMessages.getFormattedString(CREATE_INSTANCE_FAILURE_MSG, new String[] { name, imageId, realmId, profileId }),
+ WizardMessages.getString(CREATE_INSTANCE_FAILURE_TITLE),
+ WizardMessages.getFormattedString(CREATE_INSTANCE_FAILURE_MSG, new String[] { name, imageId,
+ realmId, profileId }),
e, getShell());
}
return result;
}
- private String getName() {
+ private String utf8Encode(String string) {
try {
- return URLEncoder.encode(mainPage.getInstanceName(), "UTF-8");
+ return URLEncoder.encode(string, "UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO: implement proper handling
return "";
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java 2010-12-15 15:17:08 UTC (rev 27510)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java 2010-12-15 15:19:13 UTC (rev 27511)
@@ -28,6 +28,7 @@
/**
* @author Jeff Johnston
+ * @author André Dietisheim
*/
public class ProfileComposite {
14 years, 1 month
JBoss Tools SVN: r27510 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-15 10:17:08 -0500 (Wed, 15 Dec 2010)
New Revision: 27510
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java
Log:
cleanup
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java 2010-12-15 15:11:00 UTC (rev 27509)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java 2010-12-15 15:17:08 UTC (rev 27510)
@@ -107,6 +107,7 @@
fd.top = new FormAttachment(0, 0);
cpuLabel.setLayoutData(fd);
DeltaCloudHardwareProperty cpuProperty = profile.getNamedProperty("cpu"); //$NON-NLS-1$
+ setCPU(cpuProperty.getValue());
Control cpuControl = createCpuControls(cpuProperty, storageLabel, container);
fd = new FormData();
@@ -114,6 +115,7 @@
fd.top = new FormAttachment(cpuLabel, 8);
memoryLabel.setLayoutData(fd);
DeltaCloudHardwareProperty memoryProperty = profile.getNamedProperty("memory"); //$NON-NLS-1$
+ setMemody(memoryProperty.getValue());
Control memoryControl = createMemoyControl(cpuControl, memoryProperty, storageLabel, container);
fd = new FormData();
@@ -121,6 +123,7 @@
fd.top = new FormAttachment(memoryControl, 8);
storageLabel.setLayoutData(fd);
DeltaCloudHardwareProperty storageProperty = profile.getNamedProperty("storage"); //$NON-NLS-1$
+ setStorage(storageProperty.getValue());
createStorageControls(memoryControl, memoryProperty, storageProperty, storageLabel, container);
}
@@ -129,14 +132,14 @@
Control storageControl = null;
if (storageProperty != null) {
if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.FIXED) {
- Label storage = new Label(container, SWT.NULL);
- storage.setText(storageProperty.getValue());
+ Label storageValueLabel = new Label(container, SWT.NULL);
+ storageValueLabel.setText(storageProperty.getValue());
FormData f = new FormData();
f.left = new FormAttachment(storageLabel, 50);
f.top = new FormAttachment(memoryControl, 8);
- storage.setLayoutData(f);
- storage.setVisible(true);
- storageControl = storage;
+ storageValueLabel.setLayoutData(f);
+ storageValueLabel.setVisible(true);
+ storageControl = storageValueLabel;
} else if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.RANGE) {
storageDefaultValue = storageProperty.getValue();
int indexDefault = storageDefaultValue.indexOf('.');
@@ -328,13 +331,13 @@
Control cpuControl = null;
if (cpuProperty != null) {
if (cpuProperty.getKind() == DeltaCloudHardwareProperty.Kind.FIXED) {
- Label cpu = new Label(container, SWT.NULL);
- cpu.setText(cpuProperty.getValue());
+ Label cpuLabel = new Label(container, SWT.NULL);
+ cpuLabel.setText(cpuProperty.getValue());
FormData f = new FormData();
f.left = new FormAttachment(storageLabel, 50);
f.right = new FormAttachment(100, 0);
- cpu.setLayoutData(f);
- cpuControl = cpu;
+ cpuLabel.setLayoutData(f);
+ cpuControl = cpuLabel;
} else if (cpuProperty.getKind() == DeltaCloudHardwareProperty.Kind.RANGE) {
cpuDefaultValue = cpuProperty.getValue();
cpuSpinner = new Spinner(container, SWT.READ_ONLY);
@@ -387,12 +390,21 @@
container.setVisible(visible);
}
+ private void setCPU(String value) {
+ this.cpu = value;
+ }
+
public String getCPU() {
- if (cpu != null && !cpu.equals(cpuDefaultValue))
+ if (cpu != null && !cpu.equals(cpuDefaultValue)) {
return cpu;
+ }
return null;
}
+ private void setMemody(String value) {
+ this.memory = value;
+ }
+
public String getMemory() {
if (memory != null && !memory.equals(memoryDefaultValue)) {
return memory;
@@ -400,6 +412,10 @@
return null;
}
+ private void setStorage(String value) {
+ this.storage = value;
+ }
+
public String getStorage() {
if (storage != null && !storage.equals(storageDefaultValue)) {
return storage;
14 years, 1 month
JBoss Tools SVN: r27509 - trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-15 10:11:00 -0500 (Wed, 15 Dec 2010)
New Revision: 27509
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java
Log:
JBIDE-7875
https://issues.jboss.org/browse/JBIDE-7875
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java 2010-12-15 15:10:21 UTC (rev 27508)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java 2010-12-15 15:11:00 UTC (rev 27509)
@@ -300,9 +300,7 @@
try {
NewAnnotationLiteralWizardPage page = (NewAnnotationLiteralWizardPage)context.page;
-
- List<String> interfacesNames = new ArrayList<String>();
- interfacesNames.add("java.util.Map<K,V>");
+
page.setQualifier(PACK_NAME + "." + QUALIFIER_NAME);
context.wizard.performFinish();
@@ -316,6 +314,30 @@
}
}
+ public void testNewAnnotationLiteralWizardWithMembers() {
+ WizardContext context = new WizardContext();
+ context.init("org.jboss.tools.cdi.ui.wizard.NewAnnotationLiteralCreationWizard",
+ PACK_NAME, "NewLiteral");JobUtils.waitForIdle(2000);
+ JobUtils.waitForIdle(2000);
+ ICDIProject cdi = CDICorePlugin.getCDIProject(context.tck, true);
+
+ try {
+ NewAnnotationLiteralWizardPage page = (NewAnnotationLiteralWizardPage)context.page;
+
+ page.setQualifier("javax.enterprise.inject.New");
+
+ context.wizard.performFinish();
+
+ String text = context.getNewTypeContent();
+ System.out.println(text);
+
+ assertTrue(text.contains("AnnotationLiteral<New>"));
+ assertTrue(text.contains("private final Class<?> value;"));
+ } finally {
+ context.close();
+ }
+ }
+
public void testNewBeansXMLWizard() throws CoreException {
NewBeansXMLWizardContext context = new NewBeansXMLWizardContext();
context.init("org.jboss.tools.cdi.ui.wizard.NewBeansXMLCreationWizard");
14 years, 1 month