Class MultiReferenceRenderer_PTest
- java.lang.Object
-
- org.eclipse.emf.ecp.view.internal.control.multireference.MultiReferenceRenderer_PTest
-
public class MultiReferenceRenderer_PTest extends java.lang.Object
JUnit plugin tests forMultiReferenceSWTRenderer
.- Author:
- Lucas Koehler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MultiReferenceRenderer_PTest.TestObservableValue
Helper Interface for mocking.
-
Constructor Summary
Constructors Constructor Description MultiReferenceRenderer_PTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
compare()
void
createAndLinkButton_containmentRefReferenceStyleFalse()
For a containment ref the 'create and link' must still be shown even if the reference style property is set to false.void
createAndLinkButton_crossRefNoReferenceStyle()
By default, the 'create and link new' button should be shown for cross references (legacy behavior).void
createAndLinkButton_crossRefReferenceStyleFalse()
void
createAndLinkButton_crossRefReferenceStyleTrue()
protected org.eclipse.swt.widgets.Composite
createFanVisitedTournaments()
protected org.eclipse.swt.widgets.Table
createLeaguePlayersTable()
protected org.eclipse.swt.widgets.Table
createLeaguePlayersTable(org.eclipse.emf.emfstore.bowling.League league)
void
linkButton_containmentRefNoReferenceStyle()
By default, the 'link new' button must be shown for containment references (legacy behavior).void
linkButton_containmentRefReferenceStyleFalse()
void
linkButton_containmentRefReferenceStyleTrue()
void
linkButton_crossRefReferenceStyleFalse()
For a cross ref the 'link' button must still be shown even if the reference style property is set to false.void
setUp()
Set up executed before every test.static void
setUpBeforeClass()
GetRealm
for the tests.void
tearDown()
Unregister databinding and label service after every test.void
testActivateOnEnable()
void
testButtonData()
void
testButtonsNotVisibleOnReadOnly()
void
testControlDisabled()
Test that the control is disabled when VElement enablement is set to falsevoid
testControlEnabled()
Test that the control is enabled when VElement enablement is set to truevoid
testCreateAndLinkNewButtonTooltip()
Tests the tool-tip on the "Create and link new" button.void
testCreateAndLinkNewButtonTooltipReflective()
Tests the tool-tip on the "Link" button.void
testDatabindingServiceUsageAddToModel()
Tests whether adding values to the model is reflected in the control.void
testDatabindingServiceUsageChangeModel()
Tests whether changing values of the model is reflected in the control.void
testDatabindingServiceUsageInitialBinding()
Test if the initial data binding is working.void
testDatabindingServiceUsageRemoveFromModel()
Tests whether removing values to the model is reflected in the control.void
testEffectivelyReadOnlyDisablesControl()
Test that the control is disabled when it's effectively set to read only because a parent is read only.void
testLabelServiceUsage()
Tests whether aEMFFormsLabelProvider
is used to get labels.void
testLinkButtonTooltip()
Tests the tool-tip on the "Link" button.void
testLinkButtonTooltipReflective()
Tests the tool-tip on the "Link" button.void
testNotReadOnlyButtonsVisibility()
Test that the control and buttons are visible when it's not read only.void
testReadOnlyNotDisablesControl()
Test that the control is disabled when it's set to read only.void
testRenderModeCompactGridDescription()
void
testRenderModeCompactVerticallyGridDescription()
void
testRenderModeCompactVerticallyRenderButtons()
void
testRenderModeCompactVerticallyRenderTable()
void
testRenderModeCompactVerticallyRenderValidation()
void
testRenderModeDefaultGridDescription()
void
testVisibleOnWritable()
-
-
-
Method Detail
-
setUpBeforeClass
public static void setUpBeforeClass()
GetRealm
for the tests.
-
setUp
public void setUp() throws DatabindingFailedException, NoLabelFoundException
Set up executed before every test. Mocks and registers the databinding and label services. Creates a newMultiReferenceSWTRenderer
to be tested. Mocks needed parameters and contents (e.g. VControl, ViewModelContext).- Throws:
DatabindingFailedException
- if the databinding failedNoLabelFoundException
-
tearDown
public void tearDown()
Unregister databinding and label service after every test.
-
testDatabindingServiceUsageInitialBinding
public void testDatabindingServiceUsageInitialBinding() throws NoRendererFoundException, NoPropertyDescriptorFoundExeption, DatabindingFailedException
Test if the initial data binding is working.- Throws:
NoRendererFoundException
- Renderer could not be foundNoPropertyDescriptorFoundExeption
- Property descriptor could not be foundDatabindingFailedException
- if the databinding failed
-
testDatabindingServiceUsageAddToModel
public void testDatabindingServiceUsageAddToModel() throws NoRendererFoundException, NoPropertyDescriptorFoundExeption, DatabindingFailedException
Tests whether adding values to the model is reflected in the control.- Throws:
NoRendererFoundException
- Renderer could not be foundNoPropertyDescriptorFoundExeption
- Property descriptor could not be foundDatabindingFailedException
- if the databinding failed
-
testDatabindingServiceUsageRemoveFromModel
public void testDatabindingServiceUsageRemoveFromModel() throws NoRendererFoundException, NoPropertyDescriptorFoundExeption, DatabindingFailedException
Tests whether removing values to the model is reflected in the control.- Throws:
NoRendererFoundException
- Renderer could not be foundNoPropertyDescriptorFoundExeption
- Property descriptor could not be foundDatabindingFailedException
- if the databinding failed
-
testDatabindingServiceUsageChangeModel
public void testDatabindingServiceUsageChangeModel() throws NoRendererFoundException, NoPropertyDescriptorFoundExeption, DatabindingFailedException
Tests whether changing values of the model is reflected in the control.- Throws:
NoRendererFoundException
- Renderer could not be foundNoPropertyDescriptorFoundExeption
- Property descriptor could not be foundDatabindingFailedException
- if the databinding failed
-
testLabelServiceUsage
public void testLabelServiceUsage() throws NoRendererFoundException, NoPropertyDescriptorFoundExeption, DatabindingFailedException
Tests whether aEMFFormsLabelProvider
is used to get labels.- Throws:
NoRendererFoundException
- Renderer could not be foundNoPropertyDescriptorFoundExeption
- Property descriptor could not be foundDatabindingFailedException
- if the databinding failed
-
testRenderModeDefaultGridDescription
public void testRenderModeDefaultGridDescription()
-
testRenderModeCompactVerticallyGridDescription
public void testRenderModeCompactVerticallyGridDescription()
-
testRenderModeCompactVerticallyRenderValidation
public void testRenderModeCompactVerticallyRenderValidation() throws NoPropertyDescriptorFoundExeption, NoRendererFoundException
-
testRenderModeCompactVerticallyRenderTable
public void testRenderModeCompactVerticallyRenderTable() throws NoPropertyDescriptorFoundExeption, NoRendererFoundException, DatabindingFailedException
-
testRenderModeCompactVerticallyRenderButtons
public void testRenderModeCompactVerticallyRenderButtons() throws NoPropertyDescriptorFoundExeption, NoRendererFoundException, DatabindingFailedException
-
testRenderModeCompactGridDescription
public void testRenderModeCompactGridDescription()
-
testLinkButtonTooltip
public void testLinkButtonTooltip()
Tests the tool-tip on the "Link" button.- See Also:
- bug 527736
-
testLinkButtonTooltipReflective
public void testLinkButtonTooltipReflective()
Tests the tool-tip on the "Link" button.- See Also:
- bug 527736
-
testCreateAndLinkNewButtonTooltip
public void testCreateAndLinkNewButtonTooltip()
Tests the tool-tip on the "Create and link new" button.- See Also:
- bug 527736
-
testButtonData
public void testButtonData()
-
testCreateAndLinkNewButtonTooltipReflective
public void testCreateAndLinkNewButtonTooltipReflective()
Tests the tool-tip on the "Link" button.- See Also:
- bug 527736
-
createLeaguePlayersTable
protected org.eclipse.swt.widgets.Table createLeaguePlayersTable()
-
createLeaguePlayersTable
protected org.eclipse.swt.widgets.Table createLeaguePlayersTable(org.eclipse.emf.emfstore.bowling.League league)
-
createFanVisitedTournaments
protected org.eclipse.swt.widgets.Composite createFanVisitedTournaments()
-
testReadOnlyNotDisablesControl
public void testReadOnlyNotDisablesControl() throws DatabindingFailedException, NoRendererFoundException, NoPropertyDescriptorFoundExeption
Test that the control is disabled when it's set to read only.
-
testNotReadOnlyButtonsVisibility
public void testNotReadOnlyButtonsVisibility() throws DatabindingFailedException, NoRendererFoundException, NoPropertyDescriptorFoundExeption
Test that the control and buttons are visible when it's not read only.
-
testEffectivelyReadOnlyDisablesControl
public void testEffectivelyReadOnlyDisablesControl() throws DatabindingFailedException, NoRendererFoundException, NoPropertyDescriptorFoundExeption
Test that the control is disabled when it's effectively set to read only because a parent is read only. Test also buttons visibility
-
testControlDisabled
public void testControlDisabled() throws DatabindingFailedException, NoRendererFoundException, NoPropertyDescriptorFoundExeption
Test that the control is disabled when VElement enablement is set to false
-
testControlEnabled
public void testControlEnabled() throws DatabindingFailedException, NoRendererFoundException, NoPropertyDescriptorFoundExeption
Test that the control is enabled when VElement enablement is set to true
-
createAndLinkButton_crossRefNoReferenceStyle
public void createAndLinkButton_crossRefNoReferenceStyle()
By default, the 'create and link new' button should be shown for cross references (legacy behavior).
-
createAndLinkButton_crossRefReferenceStyleTrue
public void createAndLinkButton_crossRefReferenceStyleTrue()
-
createAndLinkButton_crossRefReferenceStyleFalse
public void createAndLinkButton_crossRefReferenceStyleFalse()
-
createAndLinkButton_containmentRefReferenceStyleFalse
public void createAndLinkButton_containmentRefReferenceStyleFalse()
For a containment ref the 'create and link' must still be shown even if the reference style property is set to false.
-
linkButton_crossRefReferenceStyleFalse
public void linkButton_crossRefReferenceStyleFalse()
For a cross ref the 'link' button must still be shown even if the reference style property is set to false.
-
linkButton_containmentRefNoReferenceStyle
public void linkButton_containmentRefNoReferenceStyle()
By default, the 'link new' button must be shown for containment references (legacy behavior).
-
linkButton_containmentRefReferenceStyleTrue
public void linkButton_containmentRefReferenceStyleTrue()
-
linkButton_containmentRefReferenceStyleFalse
public void linkButton_containmentRefReferenceStyleFalse()
-
compare
public void compare() throws NoRendererFoundException, NoPropertyDescriptorFoundExeption, DatabindingFailedException
-
testVisibleOnWritable
public void testVisibleOnWritable() throws NoRendererFoundException, NoPropertyDescriptorFoundExeption, DatabindingFailedException
-
testActivateOnEnable
public void testActivateOnEnable() throws NoRendererFoundException, NoPropertyDescriptorFoundExeption, DatabindingFailedException
-
testButtonsNotVisibleOnReadOnly
public void testButtonsNotVisibleOnReadOnly() throws NoRendererFoundException, NoPropertyDescriptorFoundExeption, DatabindingFailedException
-
-