JBoss Tools SVN: r26497 - trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-11-12 04:55:55 -0500 (Fri, 12 Nov 2010)
New Revision: 26497
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssClassNewWizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/FacesConfigNewWizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/PropertiesNewWizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/WizardTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7560
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssClassNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssClassNewWizardTest.java 2010-11-12 09:53:22 UTC (rev 26496)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssClassNewWizardTest.java 2010-11-12 09:55:55 UTC (rev 26497)
@@ -5,7 +5,6 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IEditorPart;
@@ -25,21 +24,19 @@
}
public void testCssClassNewWizardTestIsCreated() {
- needClose = false;
wizardIsCreated();
}
public void testCssClassNewWizardValidation() {
- IWizard wizard = getWizard();
+ wizard = getWizard();
boolean canFinish = wizard.canFinish();
assertFalse("Finish button is enabled at first wizard page.", canFinish); //$NON-NLS-1$
- wizard.performCancel();
}
public void testCssClassNewWizardValidation2() {
- IWizard wizard = getWizardOnProject();
+ wizard = getWizardOnProject();
boolean canFinish = wizard.canFinish();
@@ -65,17 +62,15 @@
// Assert Finish button is disabled and error is present if
// Folder field is correct
// Name field contains file name that already exists
- wizard.performCancel();
}
public void testCssClassEditing() {
-
ArrayList<IResource> list = new ArrayList<IResource>();
IResource cssFile = project.findMember(CSS_FILE_PATH);
assertNotNull(cssFile);
list.add(cssFile);
StructuredSelection selection = new StructuredSelection(list);
- IWizard wizard = WorkbenchUtils.findWizardByDefId(id);
+ wizard = WorkbenchUtils.findWizardByDefId(id);
((IWorkbenchWizard) wizard).init(PlatformUI.getWorkbench(), selection);
@@ -122,7 +117,6 @@
assertFalse("Finish button is not disabled.", wizard.canFinish()); //$NON-NLS-1$
wizard.getContainer().showPage(wizard.getNextPage(wizard.getContainer().getCurrentPage()));
assertTrue("Finish button is disabled.", wizard.canFinish()); //$NON-NLS-1$
- wizard.performCancel();
}
public void testCssClassWithEditor() {
@@ -139,7 +133,7 @@
// assertNotNull(cssFile);
// list.add(cssFile);
// StructuredSelection selection = new StructuredSelection(list);
- IWizard wizard = WorkbenchUtils.findWizardByDefId(id);
+ wizard = WorkbenchUtils.findWizardByDefId(id);
//
// ((IWorkbenchWizard) wizard).init(PlatformUI.getWorkbench(), selection);
@@ -147,9 +141,6 @@
.getActiveWorkbenchWindow().getShell(), wizard);
dialog.setBlockOnOpen(false);
dialog.open();
-
- wizard.performCancel();
-
}
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/FacesConfigNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/FacesConfigNewWizardTest.java 2010-11-12 09:53:22 UTC (rev 26496)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/FacesConfigNewWizardTest.java 2010-11-12 09:55:55 UTC (rev 26497)
@@ -7,7 +7,6 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.IWorkbenchWizard;
import org.eclipse.ui.PlatformUI;
@@ -29,12 +28,11 @@
}
public void _testFacesConfigNewWizardValidation() {
- IWizard wizard = getWizard();
+ wizard = getWizard();
boolean canFinish = wizard.canFinish();
assertFalse("Finish button is enabled at first wizard page.", canFinish);
- wizard.performCancel();
}
public void testFacesConfigNewWizardValidation2() {
@@ -46,7 +44,7 @@
StructuredSelection selection = new StructuredSelection(list);
- IWizard wizard = WorkbenchUtils.findWizardByDefId(id);
+ wizard = WorkbenchUtils.findWizardByDefId(id);
NewFileWizardEx wiz = (NewFileWizardEx)wizard;
@@ -68,13 +66,11 @@
// Assert file with name from Name field created in folder with name form Folder field
-
boolean canFinish = wizard.canFinish();
assertTrue("Finish button is disabled.", canFinish);
wizard.performFinish();
- dialog.close();
JobUtils.waitForIdle();
@@ -103,7 +99,7 @@
StructuredSelection selection = new StructuredSelection(list);
- IWizard wizard = WorkbenchUtils.findWizardByDefId(id);
+ wizard = WorkbenchUtils.findWizardByDefId(id);
NewFileWizardEx wiz = (NewFileWizardEx)wizard;
@@ -148,6 +144,5 @@
int p = webXmlContent.indexOf("faces-config22.xml");
assertTrue("File faces-config22.xml is not registered in web.xml", p >= 0);
- dialog.close();
}
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/PropertiesNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/PropertiesNewWizardTest.java 2010-11-12 09:53:22 UTC (rev 26496)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/PropertiesNewWizardTest.java 2010-11-12 09:55:55 UTC (rev 26497)
@@ -1,7 +1,6 @@
package org.jboss.tools.jsf.ui.test;
import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.wizard.IWizard;
import org.jboss.tools.test.util.JobUtils;
@@ -15,7 +14,7 @@
}
public void testPropertiesFileNewWizardValidation() {
- IWizard wizard = getWizard();
+ wizard = getWizard();
boolean canFinish = wizard.canFinish();
@@ -28,7 +27,7 @@
public void testPropertiesFileNewWizardResults() {
// Assert file with name from Name field created in folder with name form Folder field
- IWizard wizard = getWizardOnProject("aaa");
+ wizard = getWizardOnProject("aaa");
boolean canFinish = wizard.canFinish();
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/WizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/WizardTest.java 2010-11-12 09:53:22 UTC (rev 26496)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/WizardTest.java 2010-11-12 09:55:55 UTC (rev 26497)
@@ -14,17 +14,16 @@
import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
import org.jboss.tools.common.model.ui.wizard.newfile.NewFileContextEx;
import org.jboss.tools.common.model.ui.wizard.newfile.NewFileWizardEx;
-import org.jboss.tools.jst.jsp.outline.cssdialog.CSSClassDialog;
import org.jboss.tools.test.util.WorkbenchUtils;
public abstract class WizardTest extends TestCase {
protected String id;
protected IProject project;
protected boolean projectRemovalRequired = false;
+
+ protected IWizard wizard;
protected WizardDialog dialog;
- protected boolean needClose = true;
-
public WizardTest(String id){
this.id = id;
}
@@ -37,8 +36,13 @@
}
+ protected void tearDown() throws Exception {
+ close();
+ }
+
+
public void wizardIsCreated() {
- IWizard wizard = WorkbenchUtils.findWizardByDefId(id);
+ wizard = WorkbenchUtils.findWizardByDefId(id);
ArrayList<IProject> list = new ArrayList<IProject>();
@@ -61,14 +65,11 @@
}catch(Exception ex){
ex.printStackTrace();
fail(ex.getMessage());
- }finally{
- if(needClose)
- dialog.close();
}
}
public IWizard getWizard(){
- IWizard wizard = WorkbenchUtils.findWizardByDefId(id);
+ wizard = WorkbenchUtils.findWizardByDefId(id);
ArrayList<IProject> list = new ArrayList<IProject>();
@@ -86,7 +87,7 @@
}
public IWizard getWizard(String folder, String name){
- IWizard wizard = WorkbenchUtils.findWizardByDefId(id);
+ wizard = WorkbenchUtils.findWizardByDefId(id);
NewFileWizardEx wiz = (NewFileWizardEx)wizard;
@@ -119,7 +120,7 @@
StructuredSelection selection = new StructuredSelection(list);
- IWizard wizard = WorkbenchUtils.findWizardByDefId(id);
+ wizard = WorkbenchUtils.findWizardByDefId(id);
((IWorkbenchWizard)wizard).init(PlatformUI.getWorkbench(), selection);
@@ -139,7 +140,7 @@
StructuredSelection selection = new StructuredSelection(list);
- IWizard wizard = WorkbenchUtils.findWizardByDefId(id);
+ wizard = WorkbenchUtils.findWizardByDefId(id);
NewFileWizardEx wiz = (NewFileWizardEx)wizard;
@@ -161,7 +162,7 @@
}
protected void validateFolderAndName(){
- IWizard wizard = getWizardOnProject("aaa");
+ wizard = getWizardOnProject("aaa");
boolean canFinish = wizard.canFinish();
@@ -169,7 +170,7 @@
// Assert Finish button is enabled by default if wizard is called on Project
assertTrue("Finish button is disabled at first wizard page.", canFinish);
- wizard.performCancel();
+ close();
// Assert Finish button is disabled and error is present if
// Folder field is empty
@@ -179,7 +180,7 @@
canFinish = wizard.canFinish();
assertFalse("Finish button is enabled when folder field is empty.", canFinish);
- wizard.performCancel();
+ close();
// Assert Finish button is disabled and error is present if
@@ -190,7 +191,7 @@
canFinish = wizard.canFinish();
assertFalse("Finish button is enabled when folders field points to folder that does not exist", canFinish);
- wizard.performCancel();
+ close();
// Assert Finish button is disabled and error is present if
// Folder field is correct
@@ -200,7 +201,7 @@
canFinish = wizard.canFinish();
assertFalse("Finish button is enabled when name field is empty.", canFinish);
- wizard.performCancel();
+ close();
// Assert Finish button is disabled and error is present if
// Folder field is correct
@@ -210,7 +211,7 @@
canFinish = wizard.canFinish();
assertFalse("Finish button is enabled when name field contains forbiden characters.", canFinish);
- wizard.performCancel();
+ close();
// Assert Finish button is disabled and error is present if
// Folder field is correct
@@ -220,6 +221,17 @@
canFinish = wizard.canFinish();
assertFalse("Finish button is enabled when name field contains file name that already exists.", canFinish);
- wizard.performCancel();
+ close();
}
+
+ private void close(){
+ if(wizard != null){
+ wizard.performCancel();
+ wizard = null;
+ }
+ if(dialog != null){
+ dialog.close();
+ dialog = null;
+ }
+ }
}
15 years, 5 months
JBoss Tools SVN: r26496 - in trunk/tests/plugins/org.jboss.tools.ui.bot.ext: META-INF and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2010-11-12 04:53:22 -0500 (Fri, 12 Nov 2010)
New Revision: 26496
Added:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/conf/
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/conf/db-multi.properties
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/conf/db-sample.properties
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/resources/drv/
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/resources/drv/hsqldb.jar
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StopDBServer.java
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/DBBean.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/PrepareDB.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/DatabaseHelper.java
Log:
DB requirement support for internal hsqldb added
Database requirements updated
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2010-11-12 09:52:06 UTC (rev 26495)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2010-11-12 09:53:22 UTC (rev 26496)
@@ -27,7 +27,8 @@
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-RegisterBuddy: org.apache.log4j
-Export-Package: org.jboss.tools.ui.bot.ext,
+Export-Package: org.hsqldb,
+ org.jboss.tools.ui.bot.ext,
org.jboss.tools.ui.bot.ext.config,
org.jboss.tools.ui.bot.ext.config.requirement,
org.jboss.tools.ui.bot.ext.entity,
@@ -40,5 +41,6 @@
org.jboss.tools.ui.bot.ext.widgets,
org.jboss.tools.ui.bot.ext.zest
Bundle-Vendor: JBoss by Red Hat
-Bundle-ClassPath: .
+Bundle-ClassPath: .,
+ resources/drv/hsqldb.jar
Import-Package: org.eclipse.gef
Added: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/conf/db-multi.properties
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/conf/db-multi.properties (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/conf/db-multi.properties 2010-11-12 09:53:22 UTC (rev 26496)
@@ -0,0 +1,4 @@
+# multi-properties file sample
+# <property name - configuration name>=<config properties file>
+HSQLDB=/home/user/etc/hsql-bot.properties
+HSQLDBINT=/home/user/etc/hsql-int-bot.properties
\ No newline at end of file
Property changes on: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/conf/db-multi.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/conf/db-sample.properties
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/conf/db-sample.properties (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/conf/db-sample.properties 2010-11-12 09:53:22 UTC (rev 26496)
@@ -0,0 +1,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: hsqldb18
+DB=hsqldb18,internal,driver,jdbc,user,,
+#For external
+DB=hsqldb18,1.8,/home/user/lib/hsqldb/lib/hsqldb.jar,jdbc:hsqldb:hsql://localhost:8001/xdb,sa,,
Property changes on: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/conf/db-sample.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/resources/drv/hsqldb.jar
===================================================================
(Binary files differ)
Property changes on: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/resources/drv/hsqldb.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java 2010-11-12 09:52:06 UTC (rev 26495)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java 2010-11-12 09:53:22 UTC (rev 26496)
@@ -274,6 +274,7 @@
.info("All tests finished, performing cleanup requirements ");
try {
RequirementBase.createStopServer().fulfill();
+ RequirementBase.createStopDBServer().fulfill();
log.info("All cleanup requirements performed");
} catch (Exception ex) {
@@ -356,5 +357,4 @@
ExcludeCategory annotation= klass.getAnnotation(ExcludeCategory.class);
return annotation == null ? null : annotation.value();
}
-
}
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/DBBean.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/DBBean.java 2010-11-12 09:52:06 UTC (rev 26495)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/DBBean.java 2010-11-12 09:53:22 UTC (rev 26496)
@@ -2,6 +2,9 @@
import static org.junit.Assert.fail;
+import java.io.File;
+
+import org.eclipse.core.runtime.Platform;
import org.jboss.tools.ui.bot.ext.helper.DatabaseHelper.DBType;
/**
@@ -12,9 +15,13 @@
public class DBBean {
public String version;
public String jdbcString;
+ public String username;
+ public String password;
public String driverPath;
public String scriptPath;
public DBType dbType;
+ public String name;
+ public boolean internal = true;
public static DBBean fromString(String propValue) throws Exception{
try {
@@ -27,9 +34,33 @@
bean.version = dbParams[1];
bean.driverPath=dbParams[2];
bean.jdbcString=dbParams[3];
- bean.scriptPath=dbParams[4];
-
+ bean.username=dbParams[4];
+ // optional
+ try {
+ bean.password=dbParams[5];
+ } catch (Exception ex) {
+ bean.password = "";
+ }
+ try {
+ bean.scriptPath=dbParams[6];
+ } catch (Exception ex) {
+ bean.scriptPath= "";
+ }
+ bean.name=bean.dbType.toString() + "_" + bean.version;
+ // Internal version
+ if (bean.version.equalsIgnoreCase("internal")) {
+ bean.internal = true;
+ bean.version="1.8";
+ bean.internal = true;
+ bean.driverPath = Platform.getLocation() + File.separator + "hsqldb.jar";
+ bean.jdbcString = "jdbc:hsqldb:hsql://localhost/xdb";
+ bean.username = "sa";
+ bean.password = "";
+ } else {
+ bean.internal = false;
+ }
+
return bean;
}
catch (Exception ex) {
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java 2010-11-12 09:52:06 UTC (rev 26495)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java 2010-11-12 09:53:22 UTC (rev 26496)
@@ -85,8 +85,10 @@
if (jbpm != null)
checkDirExists(jbpm.jbpmHome);
if (db != null) {
- checkFileExists(db.driverPath);
- checkFileExists(db.scriptPath);
+ if (!db.internal)
+ checkFileExists(db.driverPath);
+ if (!db.scriptPath.isEmpty())
+ checkFileExists(db.scriptPath);
}
// special checks capturing dependency of server on java
if (java == null
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/PrepareDB.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/PrepareDB.java 2010-11-12 09:52:06 UTC (rev 26495)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/PrepareDB.java 2010-11-12 09:53:22 UTC (rev 26496)
@@ -1,5 +1,7 @@
package org.jboss.tools.ui.bot.ext.config.requirement;
+import static org.junit.Assert.fail;
+
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
@@ -18,37 +20,70 @@
@Override
public boolean checkFulfilled() {
- return SWTTestExt.configuredState.getDB().isConfigured;
+ return SWTTestExt.configuredState.getDB().isConfigured
+ && SWTTestExt.configuredState.getDB().name.equals(TestConfigurator.currentConfig.getDB().name);
}
@Override
public void handle() {
TestConfiguration configuration = TestConfigurator.currentConfig;
- // Define Driver Entity
+ // For internal hsqldb
+ if (configuration.getDB().internal) {
+ try {
+ DatabaseHelper.addDriverIntoWorkspace();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ Assert.fail("DB driver not found" + e);
+ } catch (IOException e) {
+ e.printStackTrace();
+ Assert.fail("Unable to copy driver" + e);
+ }
+ DatabaseHelper.startHSQLDBServer("mydb", "xdb");
+ }
+
+ // Define Driver Entity and create driver
DriverEntity entity = new DriverEntity();
entity.setDrvPath(configuration.getDB().driverPath);
entity.setJdbcString(configuration.getDB().jdbcString);
- entity.setProfileName(configuration.getDB().dbType.toString());
- entity.setUser("sa");
- entity.setPassword("");
+ entity.setProfileName(configuration.getDB().name);
+ entity.setUser(configuration.getDB().username);
+ entity.setPassword(configuration.getDB().password);
entity.setDriverTemplateDescId(DatabaseHelper.getDriverTemplate(configuration.getDB().dbType));
try {
DatabaseHelper.createDriver(entity);
} catch (ConnectionProfileException e) {
log.error("Unable to create HSQL Driver" + e);
- Assert.fail();
+ Assert.fail("Unable to create HSQL Driver");
}
- File file = new File(configuration.getDB().scriptPath);
+ if (!configuration.getDB().scriptPath.isEmpty()) {
+ // Read script
+ StringBuilder builder = readScript(configuration.getDB().scriptPath);
+
+ // Open editor and run script
+ DatabaseHelper.openSQLEditor(configuration.getDB().dbType, configuration.getDB().name.toString(), "Default" );
+ DatabaseHelper.runSQLScript(builder.toString());
+ }
+
+ log.info("DB Prepared");
+
+ // Update Configured State
+ SWTTestExt.configuredState.getDB().isConfigured=true;
+ SWTTestExt.configuredState.getDB().name=TestConfigurator.currentConfig.getDB().name;
+ SWTTestExt.configuredState.getDB().version=TestConfigurator.currentConfig.getDB().version;
+ }
+
+ private StringBuilder readScript(String path) {
+ File file = new File(path);
StringBuilder builder = new StringBuilder();
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(file));
} catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
+ Assert.fail("Unable to read script " + file.getAbsolutePath());
}
while(true) {
String line = null;
@@ -56,17 +91,12 @@
line = reader.readLine();
if (line == null) break;
} catch (IOException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
+ fail("Can't read script" + file.getAbsolutePath());
}
builder.append(line);
- }
- DatabaseHelper.openSQLEditor(configuration.getDB().dbType, configuration.getDB().dbType.toString(), "Default" );
- DatabaseHelper.runSQLScript(builder.toString());
-
- if (configuration.getDB().dbType.equals("HSQLDB_1.8")) {
- // TODO
- }
+ }
+ return builder;
}
}
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java 2010-11-12 09:52:06 UTC (rev 26495)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java 2010-11-12 09:53:22 UTC (rev 26496)
@@ -168,4 +168,8 @@
return req;
}
+ public static RequirementBase createStopDBServer() {
+ RequirementBase req = new StopDBServer();
+ return req;
+ }
}
Added: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StopDBServer.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StopDBServer.java (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StopDBServer.java 2010-11-12 09:53:22 UTC (rev 26496)
@@ -0,0 +1,19 @@
+package org.jboss.tools.ui.bot.ext.config.requirement;
+
+import org.jboss.tools.ui.bot.ext.config.TestConfigurator;
+import org.jboss.tools.ui.bot.ext.helper.DatabaseHelper;
+
+public class StopDBServer extends RequirementBase {
+
+ @Override
+ public boolean checkFulfilled() {
+ if (TestConfigurator.currentConfig.getDB().internal && DatabaseHelper.isHSQLDBRunning())
+ return false;
+ return true;
+ }
+
+ @Override
+ public void handle() {
+ DatabaseHelper.stopHSQLDBServer();
+ }
+}
Property changes on: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StopDBServer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/DatabaseHelper.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/DatabaseHelper.java 2010-11-12 09:52:06 UTC (rev 26495)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/DatabaseHelper.java 2010-11-12 09:53:22 UTC (rev 26496)
@@ -4,11 +4,21 @@
import static org.junit.Assert.fail;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
import java.io.IOException;
+import java.nio.channels.FileChannel;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
import java.util.Properties;
+import org.apache.log4j.Logger;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.datatools.connectivity.ConnectionProfileConstants;
import org.eclipse.datatools.connectivity.ConnectionProfileException;
@@ -28,15 +38,19 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.eclipse.ui.IViewReference;
import org.hamcrest.Matcher;
+import org.hsqldb.Server;
import org.jboss.tools.ui.bot.ext.Activator;
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.SWTUtilExt;
import org.jboss.tools.ui.bot.ext.types.DriverEntity;
import org.jboss.tools.ui.bot.ext.types.PerspectiveType;
import org.jboss.tools.ui.bot.ext.types.ViewType;
public class DatabaseHelper {
-
+
public static int SLEEP = 1000;
+ public static Logger log = Logger.getLogger(DatabaseHelper.class);
+ private static boolean hsqlRunning;
/**
* Create HSQLDB Driver
@@ -49,7 +63,7 @@
driverPath = new File(entity.getDrvPath()).getCanonicalPath(); //$NON-NLS-1$
} catch (IOException e) {
Activator.getDefault().getLog().log(new Status(IStatus.ERROR,
- Activator.PLUGIN_ID, "Can't create driver", e));
+ Activator.PLUGIN_ID, "Can't get driver' path", e));
return;
}
@@ -157,8 +171,8 @@
editor.toTextEditor().setText(script);
// Execute Script and close
- bot.editorByTitle("SQL Scrapbook 0").toTextEditor()
- .contextMenu("Execute All").click();
+ editor.toTextEditor().contextMenu("Execute All").click();
+ editor.toTextEditor().setText("");
editor.close();
bot.sleep(SLEEP);
}
@@ -172,7 +186,7 @@
public enum DBType {
hsqldb18, db2_97, mssql2005, mssql2008, mysql50, mysql51, oracle10g, oracle11gR1, oracle11gR1RAC, oracle11gR2, oracle11gR2RAC, postgresql82, postgresql83, postgresql84, sybase15
}
-
+
/**
* Return driver template for creating new connection
*
@@ -272,4 +286,90 @@
}
return ret;
}
+
+ /**
+ * Run HSQLDB database in server mode
+ * @param file
+ * @param dbname
+ */
+ public static void startHSQLDBServer(final String file, final String dbname) {
+ Thread hsqlThread = null;
+ log.info("Starting HSQLDB...");
+ try {
+ Class.forName("org.hsqldb.jdbcDriver");
+ } catch (ClassNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ Runnable runable = new Runnable() {
+
+ public void run() {
+ Server.main(new String[] {"-database.0","file:" + file,"-dbname.0",dbname });
+ }
+ };
+
+ hsqlThread = new Thread(runable);
+ hsqlThread.start();
+ hsqlRunning = true;
+ log.info("HSQLDB started");
+ }
+
+ /**
+ * Stop HSQL Database by sending SHUTDOWN command
+ */
+ public static void stopHSQLDBServer() {
+ if (!hsqlRunning) return;
+
+ try {
+ Class.forName("org.hsqldb.jdbcDriver");
+
+ Connection connection = java.sql.DriverManager.getConnection("jdbc:hsqldb:hsql://localhost/xdb");
+
+ Statement statement = connection.createStatement();
+ ResultSet resultset = statement.executeQuery("SHUTDOWN");
+
+ resultset.close();
+ statement.close();
+ connection.close();
+
+ hsqlRunning = false;
+ log.error("Internal hql server stopped");
+
+
+ } catch (SQLException e) {
+
+ }
+ catch (ClassNotFoundException e) {
+ log.error("Unable to stop HSQLDB " + e);
+ }
+ }
+
+ /**
+ * Returns flag refering if HSQLDB is running
+ */
+ public static boolean isHSQLDBRunning() {
+ return hsqlRunning;
+ }
+
+ /**
+ * Add HSQLDB driver into project
+ * @throws FileNotFoundException
+ * @throws IOException
+ */
+ public static void addDriverIntoWorkspace() throws FileNotFoundException, IOException {
+ File in = SWTUtilExt.getResourceFile(Activator.PLUGIN_ID, "drv","hsqldb.jar");
+ File out = new File(Platform.getLocation() + File.separator + "hsqldb.jar");
+
+ FileChannel inChannel = null;
+ FileChannel outChannel = null;
+
+ inChannel = new FileInputStream(in).getChannel();
+ outChannel = new FileOutputStream(out).getChannel();
+
+ inChannel.transferTo(0, inChannel.size(), outChannel);
+
+ if (inChannel != null) inChannel.close();
+ if (outChannel != null) outChannel.close();
+ log.info("Driver hsqldb.jar copied");
+ }
}
15 years, 5 months
JBoss Tools SVN: r26495 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-12 04:52:06 -0500 (Fri, 12 Nov 2010)
New Revision: 26495
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
Log:
[JBIDE-7184] implemented refresh as command in the context menu in cloud view and in instance view
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-11-12 09:51:18 UTC (rev 26494)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-11-12 09:52:06 UTC (rev 26495)
@@ -137,17 +137,17 @@
</activeWhen>
</handler>
<handler
- class="org.jboss.tools.deltacloud.ui.commands.RefreshCloudHandler"
- commandId="org.eclipse.ui.file.refresh">
- <activeWhen>
- <with
- variable="selection">
+ class="org.jboss.tools.deltacloud.ui.commands.RefreshCloudHandler"
+ commandId="org.eclipse.ui.file.refresh">
+ <activeWhen>
+ <with
+ variable="selection">
<iterate>
<instanceof
- value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
+ value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
</instanceof>
</iterate>
- </with>
+ </with>
</activeWhen>
</handler>
<handler
@@ -156,9 +156,9 @@
<activeWhen>
<with
variable="selection">
- <iterate>
- <instanceof
- value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
+ <iterate>
+ <instanceof
+ value="org.jboss.tools.deltacloud.core.DeltaCloudInstance">
</instanceof>
</iterate>
</with>
15 years, 5 months
JBoss Tools SVN: r26494 - in trunk: vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-11-12 04:51:18 -0500 (Fri, 12 Nov 2010)
New Revision: 26494
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MinMaxPanesTest.java
Modified:
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
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELExressionsTest.java
Log:
Added Min Max Panes Test
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-11-12 09:41:44 UTC (rev 26493)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-11-12 09:51:18 UTC (rev 26494)
@@ -551,7 +551,7 @@
public static final String BOLD_TOOLBAR_BUTTON_LABEL = "Bold";
public static final String ITALIC_TOOLBAR_BUTTON_LABEL = "Italic";
public static final String UNDERLINE_TOOLBAR_BUTTON_LABEL = "Underline";
-
+
}
public static class JBossToolsPalette{
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-11-12 09:41:44 UTC (rev 26493)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2010-11-12 09:51:18 UTC (rev 26494)
@@ -7,6 +7,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.BlockCommentTest;
import org.jboss.tools.vpe.ui.bot.test.editor.EditingActionsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.InsertActionsTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.MinMaxPanesTest;
import org.jboss.tools.vpe.ui.bot.test.editor.TextEditingActionsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.ToggleCommentTest;
import org.jboss.tools.vpe.ui.bot.test.editor.VerificationOfNameSpacesTest;
@@ -78,6 +79,7 @@
suite.addTestSuite(PromptForTagAttributesDuringTagInsertTest.class);
suite.addTestSuite(IncludedTagLibsTest.class);
suite.addTestSuite(SubstitutedELExressionsTest.class);
+ suite.addTestSuite(MinMaxPanesTest.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/MinMaxPanesTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MinMaxPanesTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MinMaxPanesTest.java 2010-11-12 09:51:18 UTC (rev 26494)
@@ -0,0 +1,136 @@
+/*******************************************************************************
+
+ * 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;
+
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType;
+
+import java.awt.event.KeyEvent;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.results.Result;
+import org.eclipse.swtbot.swt.finder.results.VoidResult;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.vpe.editor.xpl.CustomSashForm;
+import org.jboss.tools.vpe.ui.bot.test.tools.SWTBotWebBrowser;
+/**
+ * Tests Minimize and maximize panes functionality
+ * @author vlado pakan
+ *
+ */
+public class MinMaxPanesTest extends VPEEditorTestCase {
+
+ private SWTBotExt botExt = null;
+
+ private static final String TEST_TEXT = "test text";
+
+ private static final String PAGE_TEXT = "<%@ taglib uri=\"http://java.sun.com/jsf/html\" prefix=\"h\" %>\n" +
+ "<html>\n" +
+ " <body>\n" +
+ " <h:inputText/>" +
+ " </body>\n" +
+ "</html>";
+
+ private static final String TEST_PAGE_NAME = "MinMaxPanesTest.jsp";
+
+ private SWTBotEclipseEditor jspTextEditor;
+ private SWTBotWebBrowser webBrowser;
+
+ public MinMaxPanesTest() {
+ super();
+ botExt = new SWTBotExt();
+ }
+
+ public void testMinMaxPanes(){
+ botExt.swtBotEditorExtByTitle(MinMaxPanesTest.TEST_PAGE_NAME)
+ .selectPage(IDELabel.VisualPageEditor.VISUAL_SOURCE_TAB_LABEL);
+ final CustomSashForm csf = botExt.widgets(widgetOfType(CustomSashForm.class)).get(0);
+ // Maximize Visual Pane
+ int sashWeight = UIThreadRunnable.syncExec(new Result<Integer>() {
+ @Override
+ public Integer run() {
+ csf.maxUp();
+ return csf.getWeights()[0];
+ }
+ });
+ assertTrue("Height of Source Pane has to be 0 but is " + sashWeight, 0 == sashWeight);
+ // Maximize Source Pane
+ sashWeight = UIThreadRunnable.syncExec(new Result<Integer>() {
+ @Override
+ public Integer run() {
+ csf.maxDown();
+ return csf.getWeights()[1];
+ }
+ });
+ assertTrue("Height of Visual Pane has to be 0 but is " + sashWeight, 0 == sashWeight);
+ // Make changes to Page Source and Restore Sash position check for changes reflected in Visual Pane
+ jspTextEditor.insertText(4, 0, " <h:outputText value=\""
+ + MinMaxPanesTest.TEST_TEXT + "\" />\n");
+ jspTextEditor.save();
+ UIThreadRunnable.syncExec(new VoidResult() {
+ @Override
+ public void run() {
+ csf.upClicked();
+ }
+ });
+ assertVisualEditorContains(webBrowser, "INPUT", null, null, MinMaxPanesTest.TEST_PAGE_NAME);
+ // Make changes to Visual Page and Restore Sash position check for changes reflected in Source Pane
+ UIThreadRunnable.syncExec(new VoidResult() {
+ @Override
+ public void run() {
+ csf.maxUp();
+ }
+ });
+ jspTextEditor.selectRange(4,18,0);
+ webBrowser.setFocus();
+ KeyboardHelper.typeKeyCodeUsingAWTRepeately(KeyEvent.VK_RIGHT, 1);
+ String insertTestString = "xxinsertedyy";
+ KeyboardHelper.typeBasicStringUsingAWT(insertTestString);
+ jspTextEditor.save();
+ UIThreadRunnable.syncExec(new VoidResult() {
+ @Override
+ public void run() {
+ csf.downClicked();
+ }
+ });
+ assertSourceEditorContains(jspTextEditor.getText(), insertTestString, MinMaxPanesTest.TEST_PAGE_NAME);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ eclipse.maximizeActiveShell();
+ createJspPage(MinMaxPanesTest.TEST_PAGE_NAME);
+ jspTextEditor = botExt.editorByTitle(MinMaxPanesTest.TEST_PAGE_NAME).toTextEditor();
+ jspTextEditor.setText(MinMaxPanesTest.PAGE_TEXT);
+ jspTextEditor.save();
+ webBrowser = new SWTBotWebBrowser(MinMaxPanesTest.TEST_PAGE_NAME,botExt);
+ }
+ @Override
+ protected void tearDown() throws Exception {
+ jspTextEditor.close();
+ super.tearDown();
+ }
+
+ @Override
+ protected void closeUnuseDialogs() {
+
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return false;
+ }
+
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MinMaxPanesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELExressionsTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELExressionsTest.java 2010-11-12 09:41:44 UTC (rev 26493)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/pagedesign/SubstitutedELExressionsTest.java 2010-11-12 09:51:18 UTC (rev 26494)
@@ -26,7 +26,7 @@
private SWTBot optionsDialogBot = null;
private SWTBot editELReferenceDialogBot = null;
- public void testIncludedTagLibs(){
+ public void testSubstitutedELExressions(){
openPage();
bot.toolbarButtonWithTooltip(PAGE_DESIGN).click();
optionsDialogBot = bot.shell(IDELabel.Shell.PAGE_DESIGN_OPTIONS).activate().bot();
15 years, 5 months
JBoss Tools SVN: r26493 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-12 04:41:44 -0500 (Fri, 12 Nov 2010)
New Revision: 26493
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/CloudViewElementAdapterFactory.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/DeltaCloudImageAdapterFactory.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/DeltaCloudInstanceAdapterFactory.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstanceElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java
Log:
[JBIDE-7558] implemented filter instances, filter images
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-11-12 09:39:49 UTC (rev 26492)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-11-12 09:41:44 UTC (rev 26493)
@@ -101,9 +101,9 @@
name="%Preferences.name">
</page>
</extension>
- <!-- connection command handlers -->
<extension
point="org.eclipse.ui.handlers">
+ <!-- connection command handlers -->
<handler
class="org.jboss.tools.deltacloud.ui.commands.NewConnectionHandler"
commandId="org.jboss.tools.deltacloud.ui.newconnection">
@@ -165,9 +165,9 @@
</activeWhen>
</handler>
</extension>
- <!-- instance command handlers -->
<extension
point="org.eclipse.ui.handlers">
+ <!-- instance command handlers -->
<handler
class="org.jboss.tools.deltacloud.ui.commands.StartInstanceHandler"
commandId="org.jboss.tools.deltacloud.ui.startinstance">
@@ -273,9 +273,9 @@
</activeWhen>
</handler>
</extension>
- <!-- Filter handlers -->
<extension
point="org.eclipse.ui.handlers">
+ <!-- Filter handlers -->
<handler
class="org.jboss.tools.deltacloud.ui.commands.FilterImagesHandler"
commandId="org.jboss.tools.deltacloud.ui.filterimages">
@@ -283,8 +283,9 @@
<with
variable="selection">
<iterate operator="and">
- <instanceof
- value="org.jboss.tools.deltacloud.ui.views.CloudViewElement" />
+ <adapt
+ type="org.jboss.tools.deltacloud.core.DeltaCloud">
+ </adapt>
</iterate>
</with>
</activeWhen>
@@ -295,11 +296,9 @@
<activeWhen>
<with
variable="selection">
- i <iterate operator="and">
+ <iterate operator="and">
<adapt
type="org.jboss.tools.deltacloud.core.DeltaCloud">
- <instanceof
- value="org.jboss.tools.deltacloud.core.DeltaCloud" />
</adapt>
</iterate>
</with>
@@ -345,16 +344,16 @@
locationURI="popup:org.jboss.tools.deltacloud.ui.views.InstanceView?after=instances">
<command
commandId="org.jboss.tools.deltacloud.ui.startinstance"
- disabledIcon="icons/runningd.gif"
- icon="icons/running.gif"
+ disabledIcon="icons/rund.gif"
+ icon="icons/run.gif"
label="%command.label"
style="push"
tooltip="%command.tooltip">
</command>
<command
commandId="org.jboss.tools.deltacloud.ui.stopinstance"
- disabledIcon="icons/stoppedd.gif"
- icon="icons/stopped.gif"
+ disabledIcon="icons/stopd.gif"
+ icon="icons/stop.gif"
label="%command.stopinstance.label"
style="push"
tooltip="%command.stopinstance.tooltip">
@@ -411,16 +410,16 @@
locationURI="toolbar:org.jboss.tools.deltacloud.ui.views.InstanceView?after=instances">
<command
commandId="org.jboss.tools.deltacloud.ui.startinstance"
- disabledIcon="icons/runningd.gif"
- icon="icons/running.gif"
+ disabledIcon="icons/rund.gif"
+ icon="icons/run.gif"
label="%command.label"
style="push"
tooltip="%command.tooltip">
</command>
<command
commandId="org.jboss.tools.deltacloud.ui.stopinstance"
- disabledIcon="icons/stoppedd.gif"
- icon="icons/stopped.gif"
+ disabledIcon="icons/stopd.gif"
+ icon="icons/stop.gif"
label="%command.stopinstance.label"
style="push"
tooltip="%command.stopinstance.tooltip">
@@ -447,7 +446,7 @@
icon="icons/cloud.gif"
label="%command.showInRemoteSysExplorer"
style="push"
- tooltip="%command.showInRemoteSysExplorer.tooltip.tooltip">
+ tooltip="%command.showInRemoteSysExplorer.tooltip">
</command>
</menuContribution>
</extension>
@@ -476,16 +475,16 @@
locationURI="popup:org.jboss.tools.deltacloud.ui.views.DeltaCloudView?after=instances">
<command
commandId="org.jboss.tools.deltacloud.ui.startinstance"
- disabledIcon="icons/runningd.gif"
- icon="icons/running.gif"
+ disabledIcon="icons/rund.gif"
+ icon="icons/run.gif"
label="%command.label"
style="push"
tooltip="%command.tooltip">
</command>
<command
commandId="org.jboss.tools.deltacloud.ui.stopinstance"
- disabledIcon="icons/stoppedd.gif"
- icon="icons/stopped.gif"
+ disabledIcon="icons/stopd.gif"
+ icon="icons/stop.gif"
label="%command.stopinstance.label"
style="push"
tooltip="%command.stopinstance.tooltip">
@@ -699,22 +698,28 @@
<extension
point="org.eclipse.core.runtime.adapters">
<factory
- adaptableType="org.jboss.tools.deltacloud.ui.views.CVInstanceElement"
- class="org.jboss.tools.deltacloud.ui.CVInstanceElementAdapterFactory">
+ adaptableType="org.jboss.tools.deltacloud.ui.views.CloudViewElement"
+ class="org.jboss.tools.deltacloud.ui.adapter.CloudViewElementAdapterFactory">
<adapter
type="org.jboss.tools.deltacloud.core.DeltaCloudInstance">
</adapter>
+ <adapter
+ type="org.jboss.tools.deltacloud.core.DeltaCloud">
+ </adapter>
+ <adapter
+ type="org.jboss.tools.deltacloud.ui.views.InstancePropertySource">
+ </adapter>
</factory>
<factory
adaptableType="org.jboss.tools.deltacloud.core.DeltaCloudInstance"
- class="org.jboss.tools.deltacloud.ui.DeltaCloudInstanceAdapterFactory">
+ class="org.jboss.tools.deltacloud.ui.adapter.DeltaCloudInstanceAdapterFactory">
<adapter
type="org.jboss.tools.deltacloud.core.DeltaCloud">
</adapter>
</factory>
<factory
adaptableType="org.jboss.tools.deltacloud.core.DeltaCloudImage"
- class="org.jboss.tools.deltacloud.ui.DeltaCloudImageAdapterFactory">
+ class="org.jboss.tools.deltacloud.ui.adapter.DeltaCloudImageAdapterFactory">
<adapter
type="org.jboss.tools.deltacloud.core.DeltaCloud">
</adapter>
Copied: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/CloudViewElementAdapterFactory.java (from rev 26472, trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/CVInstanceElementAdapterFactory.java)
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/CloudViewElementAdapterFactory.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/CloudViewElementAdapterFactory.java 2010-11-12 09:41:44 UTC (rev 26493)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.ui.adapter;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudImage;
+import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.ui.views.CVImageElement;
+import org.jboss.tools.deltacloud.ui.views.CVInstanceElement;
+import org.jboss.tools.deltacloud.ui.views.CloudViewElement;
+import org.jboss.tools.deltacloud.ui.views.CloudViewElementUtils;
+
+public class CloudViewElementAdapterFactory implements IAdapterFactory {
+
+ @SuppressWarnings("rawtypes")
+ private static final Class[] ADAPTERS = new Class[] {
+ IPropertySource.class,
+ DeltaCloudInstance.class,
+ DeltaCloud.class
+ };
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ Assert.isLegal(adaptableObject instanceof CloudViewElement);
+ CloudViewElement element = (CloudViewElement) adaptableObject;
+ if (adapterType == IPropertySource.class) {
+ return element.getPropertySource();
+ } else if (adapterType == DeltaCloudImage.class) {
+ return getDeltaCloudImage(element);
+ } else if (adapterType == DeltaCloudInstance.class) {
+ return getDeltaCloudInstance(element);
+ } else if (adapterType == DeltaCloud.class) {
+ return CloudViewElementUtils.getCloud(element);
+ } else {
+ return null;
+ }
+ }
+
+ private DeltaCloudInstance getDeltaCloudInstance(CloudViewElement element) {
+ if (element instanceof CVInstanceElement) {
+ return (DeltaCloudInstance) element.getElement();
+ } else {
+ return null;
+ }
+ }
+
+ private DeltaCloudImage getDeltaCloudImage(CloudViewElement element) {
+ if (element instanceof CVImageElement) {
+ return (DeltaCloudImage) element.getElement();
+ } else {
+ return null;
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Class[] getAdapterList() {
+ return ADAPTERS;
+ }
+
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/CloudViewElementAdapterFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/DeltaCloudImageAdapterFactory.java (from rev 26472, trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/DeltaCloudImageAdapterFactory.java)
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/DeltaCloudImageAdapterFactory.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/DeltaCloudImageAdapterFactory.java 2010-11-12 09:41:44 UTC (rev 26493)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.ui.adapter;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudImage;
+import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
+
+public class DeltaCloudImageAdapterFactory implements IAdapterFactory {
+
+ @SuppressWarnings("rawtypes")
+ private static final Class[] ADAPTERS = new Class[]{
+ DeltaCloud.class
+ };
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (adaptableObject instanceof DeltaCloudImage) {
+ System.err.println("DeltaCloudImageAdapterFactory#getAdapter for " + adapterType);
+ return ((DeltaCloudImage) adaptableObject).getDeltaCloud();
+ } else {
+ return UIUtils.adapt(adaptableObject, DeltaCloud.class);
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Class[] getAdapterList() {
+ return ADAPTERS;
+ }
+
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/DeltaCloudImageAdapterFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/DeltaCloudInstanceAdapterFactory.java (from rev 26472, trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/DeltaCloudInstanceAdapterFactory.java)
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/DeltaCloudInstanceAdapterFactory.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/DeltaCloudInstanceAdapterFactory.java 2010-11-12 09:41:44 UTC (rev 26493)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.ui.adapter;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
+
+public class DeltaCloudInstanceAdapterFactory implements IAdapterFactory {
+
+ @SuppressWarnings("rawtypes")
+ private static final Class[] ADAPTERS = new Class[]{
+ DeltaCloud.class
+ };
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (adaptableObject instanceof DeltaCloudInstance) {
+ System.err.println("DeltaCloudInstanceAdapterFactory#getAdapter for " + adapterType);
+ return ((DeltaCloudInstance) adaptableObject).getDeltaCloud();
+ } else {
+ return UIUtils.adapt(adaptableObject, DeltaCloud.class);
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Class[] getAdapterList() {
+ return ADAPTERS;
+ }
+
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/adapter/DeltaCloudInstanceAdapterFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java 2010-11-12 09:39:49 UTC (rev 26492)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java 2010-11-12 09:41:44 UTC (rev 26493)
@@ -23,8 +23,6 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.handlers.HandlerUtil;
import org.jboss.tools.deltacloud.core.DeltaCloud;
-import org.jboss.tools.deltacloud.ui.views.CVCloudElement;
-import org.jboss.tools.deltacloud.ui.views.CloudViewElement;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
import org.jboss.tools.internal.deltacloud.ui.wizards.ImageFilter;
@@ -37,21 +35,15 @@
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
- CloudViewElement cloudViewElement = UIUtils.getFirstAdaptedElement(selection, CloudViewElement.class);
- createImagesFilter(cloudViewElement, HandlerUtil.getActiveShell(event));
+ DeltaCloud cloud = UIUtils.getFirstAdaptedElement(selection, DeltaCloud.class);
+ createImagesFilter(cloud, HandlerUtil.getActiveShell(event));
}
return Status.OK_STATUS;
}
- private void createImagesFilter(CloudViewElement element, final Shell shell) {
- if (element != null) {
- while (element != null && !(element instanceof CVCloudElement)) {
- element = (CloudViewElement) element.getParent();
- }
- if (element != null) {
- CVCloudElement cve = (CVCloudElement) element;
- final DeltaCloud cloud = (DeltaCloud) cve.getElement();
+ private void createImagesFilter(final DeltaCloud cloud, final Shell shell) {
+ if (cloud != null) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
@@ -61,7 +53,6 @@
dialog.open();
}
});
- }
}
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstanceElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstanceElement.java 2010-11-12 09:39:49 UTC (rev 26492)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstanceElement.java 2010-11-12 09:41:44 UTC (rev 26493)
@@ -11,7 +11,6 @@
package org.jboss.tools.deltacloud.ui.views;
import org.eclipse.ui.views.properties.IPropertySource;
-import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
public class CVInstanceElement extends CloudViewElement {
@@ -23,14 +22,4 @@
public IPropertySource getPropertySource() {
return new InstancePropertySource(this, getElement());
}
-
- @SuppressWarnings("rawtypes")
- @Override
- public Object getAdapter(Class adapter) {
- if (adapter == DeltaCloudInstance.class) {
- return getElement();
- }
-
- return super.getAdapter(adapter);
- }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java 2010-11-12 09:39:49 UTC (rev 26492)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java 2010-11-12 09:41:44 UTC (rev 26493)
@@ -130,12 +130,19 @@
public static <T> T adapt(Object object, Class<T> expectedClass) {
if (object == null) {
return null;
- } else if (expectedClass.isAssignableFrom(object.getClass())) {
- return (T) object;
+ }
+
+ Object adaptedObject = null;
+ if (expectedClass.isAssignableFrom(object.getClass())) {
+ adaptedObject = object;
} else if (object instanceof IAdaptable) {
- return (T) ((IAdaptable) object).getAdapter(expectedClass);
+ adaptedObject = ((IAdaptable) object).getAdapter(expectedClass);
+ }
+
+ if (adaptedObject != null) {
+ return (T) adaptedObject;
} else {
- return (T) Platform.getAdapterManager().loadAdapter(object, expectedClass.getName());
+ return (T) Platform.getAdapterManager().loadAdapter(object, expectedClass.getName());
}
}
15 years, 5 months
JBoss Tools SVN: r26492 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-12 04:39:49 -0500 (Fri, 12 Nov 2010)
New Revision: 26492
Removed:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/runningd.gif
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/stoppedd.gif
Log:
[JBIDE-7566] renamed running.gif to run.gif, stopped to stop.gif, added running.gif and stopped.gif
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/runningd.gif
===================================================================
(Binary files differ)
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/stoppedd.gif
===================================================================
(Binary files differ)
15 years, 5 months
JBoss Tools SVN: r26491 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2010-11-12 04:31:44 -0500 (Fri, 12 Nov 2010)
New Revision: 26491
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java
Log:
Update getResourceFile to be accessible as static
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java 2010-11-12 09:30:23 UTC (rev 26490)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java 2010-11-12 09:31:44 UTC (rev 26491)
@@ -353,7 +353,7 @@
/**
* Get resource file
*/
- public File getResourceFile(String pluginId, String... path) {
+ public static File getResourceFile(String pluginId, String... path) {
// Construct path
StringBuilder builder = new StringBuilder();
@@ -374,7 +374,7 @@
}
} catch (IOException ex) {
String message = filePath + " resource file not found";
- log.error(message);
+ //log.error(message);
fail(message);
}
15 years, 5 months
JBoss Tools SVN: r26490 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2010-11-12 04:30:23 -0500 (Fri, 12 Nov 2010)
New Revision: 26490
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java
Log:
Logging for sleep() updated
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2010-11-12 09:04:58 UTC (rev 26489)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2010-11-12 09:30:23 UTC (rev 26490)
@@ -87,7 +87,11 @@
}
public void sleep(long ms, String msg) {
- log.info("Bot sleeps for " + ms + " ms " + msg);
+ StackTraceElement[] ste = Thread.currentThread().getStackTrace();
+ if ((ste != null) && (ste[3] != null))
+ log.info("Bot sleeps for " + ms + " ms " + msg + " " + ste[3].toString());
+ else
+ log.info("Bot sleeps for " + ms + " ms " + msg);
super.sleep(ms);
}
15 years, 5 months
JBoss Tools SVN: r26489 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common: propertieseditor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-11-12 04:04:58 -0500 (Fri, 12 Nov 2010)
New Revision: 26489
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/UIMessages.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/messages.properties
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/PropertiesEditor.java
Log:
JBIDE-7563
https://jira.jboss.org/browse/JBIDE-7563
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/UIMessages.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/UIMessages.java 2010-11-12 09:03:56 UTC (rev 26488)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/UIMessages.java 2010-11-12 09:04:58 UTC (rev 26489)
@@ -16,13 +16,13 @@
public class UIMessages extends NLS {
private static final String BUNDLE_NAME = "org.jboss.tools.common.model.ui.messages.messages";//$NON-NLS-1$
-
static {
// load message values from bundle file
NLS.initializeMessages(BUNDLE_NAME, UIMessages.class);
}
public static String CANNOT_DISPLAY_DOCUMENT_CONTENTS;
public static String PROPERTIES_EDITOR_FILTER;
+ public static String PROPERTIES_EDITOR_FILTER_SIMPLE;
public static String PROPERTIES_EDITOR_FILTER_MATCHES;
public static String PROPERTIES_EDITOR_EXPRESSION;
public static String PROPERTIES_EDITOR_ILLEGAL_NAME_EXPRESSION;
@@ -32,7 +32,4 @@
public static String REPORT_PROBLEM_NO_DESCRIPTION;
public static String REPORT_PROBLEM_RESULT;
public static String REPORT_PROBLEM_COPY_BUTTON;
- public static String PROPERTIES_EDITOR_FILTER_REGULAR = PROPERTIES_EDITOR_EXPRESSION;
- public static String PROPERTIES_EDITOR_FILTER_SIMPLE = PROPERTIES_EDITOR_FILTER;
-
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/messages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/messages.properties 2010-11-12 09:03:56 UTC (rev 26488)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages/messages.properties 2010-11-12 09:04:58 UTC (rev 26489)
@@ -1,9 +1,10 @@
CANNOT_DISPLAY_DOCUMENT_CONTENTS=Cannot display document contents.
PROPERTIES_EDITOR_FILTER=Filter
-PROPERTIES_EDITOR_EXPRESSION=Expression
+PROPERTIES_EDITOR_FILTER_SIMPLE=(* = any string, ? = any character, \\ = escape for literals * ? \\)
+PROPERTIES_EDITOR_EXPRESSION=Regular Expression
PROPERTIES_EDITOR_ILLEGAL_NAME_EXPRESSION=Illegal name expression: {0}
PROPERTIES_EDITOR_ILLEGAL_VALUE_EXPRESSION=Illegal value expression: {0}
-PROPERTIES_EDITOR_FILTER_MATCHES=Filter matched {0} out of {1} items.
+PROPERTIES_EDITOR_FILTER_MATCHES=(matches {0} out of {1} items)
REPORT_PROBLEM_DESCRIPTION=This wizard takes the description and info below and in addition collects various logs from eclipse and creates a zipped file which can be attached to issues or emails when reporting problems.
REPORT_PROBLEM_NO_DESCRIPTION=Description must be set.
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/PropertiesEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/PropertiesEditor.java 2010-11-12 09:03:56 UTC (rev 26488)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/PropertiesEditor.java 2010-11-12 09:04:58 UTC (rev 26489)
@@ -136,7 +136,7 @@
vsupport.getPropertyEditorAdapterByName(ATTR_VALUE).setValue(pHelper.valueFilter);
ExpandableComposite g = filterComposite = new ExpandableComposite(panel, SWT.NONE);
- g.setText(UIMessages.PROPERTIES_EDITOR_FILTER_REGULAR);
+ g.setText(UIMessages.PROPERTIES_EDITOR_FILTER);
g.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Composite g1 = new Composite(g, SWT.NONE);
GridLayout l1 = new GridLayout(3, false);
@@ -243,7 +243,7 @@
isFilterExpression = fake.getSelection();
pHelper.applyFilters();
// if(fake.getSelection()) {
-// g.setText(UIMessages.PROPERTIES_EDITOR_FILTER_REGULAR);
+// g.setText(UIMessages.PROPERTIES_EDITOR_FILTER);
// } else {
// g.setText(UIMessages.PROPERTIES_EDITOR_FILTER_SIMPLE);
// g.layout();
@@ -538,9 +538,9 @@
statistics.setText("");
}
if(filtered != total) {
- filterComposite.setText(UIMessages.PROPERTIES_EDITOR_FILTER_REGULAR + " " + NLS.bind(UIMessages.PROPERTIES_EDITOR_FILTER_MATCHES, filtered, total));
+ filterComposite.setText(UIMessages.PROPERTIES_EDITOR_FILTER + " " + NLS.bind(UIMessages.PROPERTIES_EDITOR_FILTER_MATCHES, filtered, total));
} else {
- filterComposite.setText(UIMessages.PROPERTIES_EDITOR_FILTER_REGULAR);
+ filterComposite.setText(UIMessages.PROPERTIES_EDITOR_FILTER);
}
filterComposite.layout();
statistics.update();
15 years, 5 months
JBoss Tools SVN: r26488 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-12 04:03:56 -0500 (Fri, 12 Nov 2010)
New Revision: 26488
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/newdelta.gif
Log:
[JBIDE-7567] added icon for new connections
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/newdelta.gif
===================================================================
(Binary files differ)
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/icons/newdelta.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 5 months