SWTBot DI: QAI-11330, increase waiting time for retrieving schema and modified test ChangeDbConnectionForCDCTest for reset property value

git-svn-id: http://talendforge.org/svn/tis_shared/branches/branch-5_0@86590 f6f1c999-d317-4740-80b0-e6d1abc6f99e
This commit is contained in:
fzhong
2012-07-02 08:50:03 +00:00
parent 513e529193
commit 2ca0dd05cb
10 changed files with 18 additions and 81 deletions

View File

@@ -264,7 +264,7 @@ public class TalendDBItem extends TalendMetadataItem {
gefBot.button("Next >").click();
List<String> schemaList = new ArrayList<String>(Arrays.asList(schemas));
gefBot.waitUntil(Conditions.waitForWidget(widgetOfType(Tree.class)), 50000);
gefBot.waitUntil(Conditions.waitForWidget(widgetOfType(Tree.class)), 30000);
SWTBotTree root = gefBot.treeInGroup("Select Schema to create");
SWTBotTreeItem treeNode = null;
if (getCatalog() != null && getSchema() == null)

View File

@@ -57,7 +57,7 @@ public class GenerateAllDocTest extends TalendSwtBotForTos {
public void generateAllDoc() {
docNode = Utilities.getTalendItemNode(Utilities.TalendItemType.DOCUMENTATION);
docNode.getNode("generated").contextMenu("Generate all projects documentation").click();
gefBot.waitUntil(Conditions.shellIsActive("Progress Information"));
gefBot.waitUntil(Conditions.shellIsActive("Progress Information"), 10000);
gefBot.waitUntil(Conditions.shellCloses(gefBot.shell("Progress Information")), 30000);
gefBot.waitUntil(Conditions.shellIsActive("Talend Open Studio"));
gefBot.button("OK").click();

View File

@@ -53,17 +53,20 @@ public class ChangeDbConnectionForCDCTest extends TalendSwtBotForTos {
dbItem1 = new TalendDBItem(DB_NAME1, DbConnectionType.MYSQL);
dbItem1.create();
dbItem2 = (TalendDBItem) dbItem1.duplicate(DB_NAME2);
dbItem1.executeSQL("create table " + TABLE_NAME + "(id int, name varchar(20));");
isTableCreated = true;
dbItem1.executeSQL("create database " + DATABASE);
isDatabaseCreated = true;
isTableCreated = dbItem1.executeSQL("create table " + TABLE_NAME + "(id int, name varchar(20));");
isDatabaseCreated = dbItem1.executeSQL("create database " + DATABASE);
dbItem1.retrieveDbSchema(TABLE_NAME);
String defaultProperty = System.getProperty("mysql.dataBase");
System.setProperty("mysql.dataBase", DATABASE);
dbItem3 = new TalendDBItem(DB_NAME3, DbConnectionType.MYSQL);
dbItem3.create();
System.setProperty("mysql.dataBase", defaultProperty);
try {
dbItem3 = new TalendDBItem(DB_NAME3, DbConnectionType.MYSQL);
dbItem3.create();
} catch (Exception e) {
Assert.fail(e.getMessage());
} finally {
System.setProperty("mysql.dataBase", defaultProperty);
}
}
@Test

View File

@@ -1,67 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2011 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package tisstudio.metadata.useinjob;
import java.io.IOException;
import java.net.URISyntaxException;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.talend.swtbot.TalendSwtBotForTos;
import org.talend.swtbot.Utilities;
import org.talend.swtbot.helpers.MetadataHelper;
import org.talend.swtbot.items.TalendJobItem;
import org.talend.swtbot.items.TalendLdapItem;
/**
* DOC fzhong class global comment. Detailled comment
*/
@RunWith(SWTBotJunit4ClassRunner.class)
public class UseLdapTest extends TalendSwtBotForTos {
private TalendJobItem jobItem;
private TalendLdapItem ldapItem;
private static final String JOBNAME = "jobTest"; // $NON-NLS-1$
private static final String METADATA_NAME = "ldapTest"; // $NON-NLS-1$
@Before
public void createJobAndMetadata() throws IOException, URISyntaxException {
jobItem = new TalendJobItem(JOBNAME);
jobItem.create();
ldapItem = new TalendLdapItem(METADATA_NAME);
ldapItem.create();
}
@Test
public void useMetadataInJob() throws IOException, URISyntaxException {
ldapItem.setComponentType("tLDAPInput");
ldapItem.setExpectResultFromFile("ldap.result");
MetadataHelper.output2Console(jobItem.getEditor(), ldapItem);
String result = gefBot.styledText().getText();
MetadataHelper.assertResult(result, ldapItem);
}
@After
public void removePreviousCreateItems() {
jobItem.getEditor().saveAndClose();
Utilities.cleanUpRepository(jobItem.getParentNode());
Utilities.emptyRecycleBin();
}
}

View File

@@ -117,6 +117,7 @@ public class TAggregateRowTest extends TalendSwtBotForTos {
gefBot.button("OK").click();
gefBot.waitUntil(Conditions.shellCloses(shell));
gefBot.viewByTitle("Component").setFocus();
// define the columns in Group By
gefBot.buttonWithTooltip("Add", 0).click();
// define the columns in Operations

View File

@@ -59,7 +59,7 @@ public class CtrlSpaceToUseContextTest extends TalendSwtBotForTos {
}
@Test
public void ctrlSpaceToUseContext() {
public void ctrlSpaceToUseContextTest() {
SWTBotGefEditor jobEditor = jobItem.getEditor();
// use context in job

View File

@@ -77,7 +77,7 @@ public class ChangeDatabaseAndRetrieveSchemaTest extends TalendSwtBotForTos {
dbItem.getItem().contextMenu("Retrieve Schema").click();
gefBot.shell("Schema").activate();
gefBot.button("Next >").click();
gefBot.waitUntil(Conditions.waitForWidget(widgetOfType(Tree.class)), 10000);
gefBot.waitUntil(Conditions.waitForWidget(widgetOfType(Tree.class)), 30000);
SWTBotTreeItem catalog = gefBot.treeInGroup("Select Schema to create").expandNode(DATABASE_NAME);
catalog.getNode(TABLE2).check();
gefBot.button("Next >").click();

View File

@@ -71,7 +71,7 @@ public class ChangeDatabaseTest extends TalendSwtBotForTos {
dbItem.getItem().contextMenu("Retrieve Schema").click();
schemaShell = gefBot.shell("Schema").activate();
gefBot.button("Next >").click();
gefBot.waitUntil(Conditions.waitForWidget(widgetOfType(Tree.class)), 10000);
gefBot.waitUntil(Conditions.waitForWidget(widgetOfType(Tree.class)), 30000);
treeItem = gefBot.treeInGroup("Select Schema to create").getTreeItem(DATABASE_NAME);
schemaShell.close();

View File

@@ -58,7 +58,7 @@ public class RetrieveSchemaWizardTest extends TalendSwtBotForTos {
dbItem.getItem().contextMenu("Retrieve Schema").click();
tempShell = gefBot.shell("Schema").activate();
gefBot.button("Next >").click();
gefBot.waitUntil(Conditions.waitForWidget(widgetOfType(Tree.class)), 10000);
gefBot.waitUntil(Conditions.waitForWidget(widgetOfType(Tree.class)), 30000);
gefBot.treeInGroup("Select Schema to create").expandNode(System.getProperty("mysql.dataBase")).getNode(TABLENAME)
.check();
gefBot.button("Next >").click();

View File

@@ -59,7 +59,7 @@ public class SchemaConsistenceTest extends TalendSwtBotForTos {
dbItem.getItem().contextMenu("Retrieve Schema").click();
tempShell = gefBot.shell("Schema").activate();
gefBot.button("Next >").click();
gefBot.waitUntil(Conditions.waitForWidget(widgetOfType(Tree.class)), 10000);
gefBot.waitUntil(Conditions.waitForWidget(widgetOfType(Tree.class)), 30000);
SWTBotTreeItem catalog = gefBot.treeInGroup("Select Schema to create").expandNode(System.getProperty("mysql.dataBase"));
catalog.getNode(TABLE1).check();
catalog.getNode(TABLE2).check();