org.eclipse.emf.ecp.view.internal.control.multireference
Class MultiReferenceRenderer_PTest

java.lang.Object
  extended by org.eclipse.emf.ecp.view.internal.control.multireference.MultiReferenceRenderer_PTest

public class MultiReferenceRenderer_PTest
extends Object

JUnit plugin tests for MultiReferenceSWTRenderer.

Author:
Lucas Koehler

Nested Class Summary
static interface MultiReferenceRenderer_PTest.TestObservableValue
          Helper Interface for mocking.
 
Constructor Summary
MultiReferenceRenderer_PTest()
           
 
Method Summary
 void setUp()
          Set up executed before every test.
static void setUpBeforeClass()
          Get Realm for the tests.
 void tearDown()
          Unregister databinding and label service after every test.
 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 testLabelServiceUsage()
          Tests whether a EMFFormsLabelProvider is used to get labels.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiReferenceRenderer_PTest

public MultiReferenceRenderer_PTest()
Method Detail

setUpBeforeClass

public static void setUpBeforeClass()
Get Realm 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 new MultiReferenceSWTRenderer to be tested. Mocks needed parameters and contents (e.g. VControl, ViewModelContext).

Throws:
DatabindingFailedException - if the databinding failed
NoLabelFoundException

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 found
NoPropertyDescriptorFoundExeption - Property descriptor could not be found
DatabindingFailedException - 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 found
NoPropertyDescriptorFoundExeption - Property descriptor could not be found
DatabindingFailedException - 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 found
NoPropertyDescriptorFoundExeption - Property descriptor could not be found
DatabindingFailedException - 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 found
NoPropertyDescriptorFoundExeption - Property descriptor could not be found
DatabindingFailedException - if the databinding failed

testLabelServiceUsage

public void testLabelServiceUsage()
                           throws NoRendererFoundException,
                                  NoPropertyDescriptorFoundExeption,
                                  DatabindingFailedException
Tests whether a EMFFormsLabelProvider is used to get labels.

Throws:
NoRendererFoundException - Renderer could not be found
NoPropertyDescriptorFoundExeption - Property descriptor could not be found
DatabindingFailedException - if the databinding failed


Copyright © 2015. All Rights Reserved.