Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bonita
bonita-studio
Commits
e8f4566f
Commit
e8f4566f
authored
Sep 17, 2015
by
Aurelien Pupier
Browse files
BS-11890: use the SWTBot JUnit 4 Runner
parent
abff0c6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/org.bonitasoft.studio.diagram.test/src/org/bonitasoft/studio/diagram/test/TestConvertToMessage.java
View file @
e8f4566f
...
...
@@ -28,22 +28,26 @@ import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import
org.eclipse.swtbot.eclipse.gef.finder.SWTBotGefTestCase
;
import
org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart
;
import
org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditor
;
import
org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner
;
import
org.eclipse.swtbot.swt.finder.waits.DefaultCondition
;
import
org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo
;
import
org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
/**
* @author Baptiste Mesta
*
*/
@RunWith
(
SWTBotJunit4ClassRunner
.
class
)
public
class
TestConvertToMessage
extends
SWTBotGefTestCase
{
@Test
public
void
testConvertToMessage
()
throws
InterruptedException
{
//bug 1983
/*Create a new form*/
SWTBotMenu
menu
=
bot
.
menu
(
"Diagram"
);
final
SWTBotMenu
menu
=
bot
.
menu
(
"Diagram"
);
SWTBotTestUtil
.
createNewDiagram
(
bot
);
SWTBotEditor
botEditor
=
bot
.
activeEditor
();
SWTBotGefEditor
gmfEditor
=
bot
.
gefEditor
(
botEditor
.
getTitle
());
...
...
@@ -64,29 +68,31 @@ public class TestConvertToMessage extends SWTBotGefTestCase {
/*Search the Combo for switch type*/
bot
.
viewById
(
SWTBotTestUtil
.
VIEWS_PROPERTIES_FORM_GENERAL
).
show
();
SWTBotTestUtil
.
selectTabbedPropertyView
(
bot
,
"General"
);
SWTBotView
generalProperties
=
bot
.
viewById
(
SWTBotTestUtil
.
VIEWS_PROPERTIES_FORM_GENERAL
);
final
SWTBotView
generalProperties
=
bot
.
viewById
(
SWTBotTestUtil
.
VIEWS_PROPERTIES_FORM_GENERAL
);
generalProperties
.
bot
().
textWithLabel
(
"Show label"
).
setText
(
"testDisplayLabel"
);
final
SWTBotGefEditor
gefEditor
=
gmfEditor
;
bot
.
waitUntil
(
new
DefaultCondition
()
{
public
boolean
test
()
throws
Exception
{
Expression
displayLabel
=
((
Widget
)(((
IGraphicalEditPart
)
gefEditor
.
getEditPart
(
"testDisplayLabel"
).
parent
().
part
()).
resolveSemanticElement
())).
getDisplayLabel
();
@Override
public
boolean
test
()
throws
Exception
{
final
Expression
displayLabel
=
((
Widget
)(((
IGraphicalEditPart
)
gefEditor
.
getEditPart
(
"testDisplayLabel"
).
parent
().
part
()).
resolveSemanticElement
())).
getDisplayLabel
();
return
displayLabel
.
getContent
().
equals
(
"testDisplayLabel"
);
}
public
String
getFailureMessage
()
{
@Override
public
String
getFailureMessage
()
{
return
"no display label set"
;
}
});
SWTBotCombo
combo
=
generalProperties
.
bot
().
comboBox
(
"Checkbox"
)
;
final
SWTBotCombo
combo
=
generalProperties
.
bot
().
comboBox
(
"Checkbox"
)
;
/*Change type to duration*/
combo
.
setSelection
(
"Message"
);
/*Search the duration Editpart*/
//TODO : search directly the Editpart
SWTBotGefEditPart
mainPart
=
gmfEditor
.
mainEditPart
();
final
SWTBotGefEditPart
mainPart
=
gmfEditor
.
mainEditPart
();
boolean
found
=
false
;
EditPart
part
=
null
;
for
(
SWTBotGefEditPart
p
:
mainPart
.
children
()){
for
(
final
SWTBotGefEditPart
p
:
mainPart
.
children
()){
if
(
p
.
part
()
instanceof
MessageInfoEditPart
){
found
=
true
;
part
=
p
.
part
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment