Merge "(Vector) Change event processing" into devel/master
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-Alignment.cpp
index 879dbb3..6e262eb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/events/touch-event-integ.h>
+#include <dali-toolkit/devel-api/controls/alignment/alignment.h>
 #include <dali-toolkit/dali-toolkit.h>
 
 using namespace Dali;
@@ -39,9 +40,14 @@ void utc_dali_toolkit_alignment_cleanup(void)
   test_return_value = TET_PASS;
 }
 
-
 namespace
 {
+/// Compare an int (Or'd Alignment::Type) with an Alignment::Type value
+void DALI_TEST_EQUALS( int value1, Alignment::Type value2, const char* location )
+{
+  ::DALI_TEST_EQUALS< Alignment::Type >( static_cast< Alignment::Type >( value1 ), value2, location );
+}
+
 static bool gObjectCreatedCallBackCalled;
 
 static void TestCallback(BaseHandle handle)
@@ -63,12 +69,9 @@ int UtcDaliAlignmentConstructorNegative(void)
     alignment.SetPadding(padding);
     tet_result(TET_FAIL);
   }
-  catch (DaliException& exception)
+  catch (DaliException& e)
   {
-    if (exception.mCondition == "alignment")
-    {
-      tet_result(TET_PASS);
-    }
+    DALI_TEST_ASSERT(e, "alignment", TEST_LOCATION );
   }
   END_TEST;
 }
@@ -101,8 +104,8 @@ int UtcDaliAlignmentConstructorRegister(void)
 {
   ToolkitTestApplication application;
 
-  //Te ensure the object is registered after creation
-  ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+  //To ensure the object is registered after creation
+  ObjectRegistry registry = application.GetCore().GetObjectRegistry();
   DALI_TEST_CHECK( registry );
 
   gObjectCreatedCallBackCalled = false;
@@ -235,8 +238,8 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // Default, HorizontalCenter, VerticalCenter - Ensure they do not change!
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -247,7 +250,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -255,8 +258,8 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalLeft, VerticalCenter
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -267,7 +270,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -275,8 +278,8 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalRight, VerticalCenter
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -287,7 +290,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -295,8 +298,8 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalLeft, VerticalTop
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -307,7 +310,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -315,8 +318,8 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalCenter, VerticalTop
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -327,7 +330,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -335,8 +338,8 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalRight, VerticalTop
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -347,7 +350,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -355,8 +358,8 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalLeft, VerticalBottom
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -367,7 +370,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -375,8 +378,8 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalCenter, VerticalBottom
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -387,7 +390,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -395,8 +398,8 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   // HorizontalRight, VerticalBottom
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -407,7 +410,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -422,19 +425,10 @@ int UtcDaliAlignmentSetAlignmentTypeNegative(void)
   {
     Alignment alignment = Alignment::New();
     Alignment::Type type(Alignment::Type(Alignment::HorizontalLeft | Alignment::HorizontalCenter));
-
-    try
-    {
-      alignment.SetAlignmentType(type);
-      tet_result(TET_FAIL);
-    }
-    catch (DaliException& exception)
-    {
-      if (exception.mCondition == "!horizontalSet")
-      {
-        tet_result(TET_PASS);
-      }
-    }
+    alignment.SetAlignmentType(type);
+    // center will prevail in conflict
+    DALI_TEST_CHECK( Alignment::HorizontalCenter & alignment.GetAlignmentType() );
+    DALI_TEST_CHECK( !(Alignment::HorizontalLeft & alignment.GetAlignmentType()) );
   }
 
   // Setting HorizontalCenter, HorizontalRight
@@ -442,56 +436,30 @@ int UtcDaliAlignmentSetAlignmentTypeNegative(void)
     Alignment alignment = Alignment::New();
     Alignment::Type type(Alignment::Type(Alignment::HorizontalCenter | Alignment::HorizontalRight));
 
-    try
-    {
-      alignment.SetAlignmentType(type);
-      tet_result(TET_FAIL);
-    }
-    catch (DaliException& exception)
-    {
-      if (exception.mCondition == "!horizontalSet")
-      {
-        tet_result(TET_PASS);
-      }
-    }
+    alignment.SetAlignmentType(type);
+    // center will prevail in conflict
+    DALI_TEST_CHECK( Alignment::HorizontalCenter & alignment.GetAlignmentType() );
+    DALI_TEST_CHECK( !(Alignment::HorizontalRight & alignment.GetAlignmentType()) );
   }
 
   // Setting VerticalTop, VerticalCenter
   {
     Alignment alignment = Alignment::New();
     Alignment::Type type(Alignment::Type(Alignment::VerticalTop | Alignment::VerticalCenter));
-
-    try
-    {
-      alignment.SetAlignmentType(type);
-      tet_result(TET_FAIL);
-    }
-    catch (DaliException& exception)
-    {
-      if (exception.mCondition == "!verticalSet")
-      {
-        tet_result(TET_PASS);
-      }
-    }
+    alignment.SetAlignmentType(type);
+    // center will prevail in conflict
+    DALI_TEST_CHECK( Alignment::VerticalCenter & alignment.GetAlignmentType() );
+    DALI_TEST_CHECK( !(Alignment::VerticalTop & alignment.GetAlignmentType()) );
   }
 
   // Setting VerticalCenter, VerticalBottom
   {
     Alignment alignment = Alignment::New();
     Alignment::Type type(Alignment::Type(Alignment::VerticalTop | Alignment::VerticalBottom));
-
-    try
-    {
-      alignment.SetAlignmentType(type);
-      tet_result(TET_FAIL);
-    }
-    catch (DaliException& exception)
-    {
-      if (exception.mCondition == "!veritcalSet")
-      {
-        tet_result(TET_PASS);
-      }
-    }
+    alignment.SetAlignmentType(type);
+    // top will prevail in conflict
+    DALI_TEST_CHECK( Alignment::VerticalTop & alignment.GetAlignmentType() );
+    DALI_TEST_CHECK( !(Alignment::VerticalBottom & alignment.GetAlignmentType()) );
   }
   END_TEST;
 }
@@ -504,11 +472,11 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New();
     DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -517,11 +485,11 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalLeft);
     DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -530,11 +498,11 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalRight);
     DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -543,11 +511,11 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalLeft, Alignment::VerticalTop);
     DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -556,11 +524,11 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalCenter, Alignment::VerticalTop);
     DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -569,11 +537,11 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalRight, Alignment::VerticalTop);
     DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -582,11 +550,11 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalLeft, Alignment::VerticalBottom);
     DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -595,11 +563,11 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalCenter, Alignment::VerticalBottom);
     DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -608,11 +576,11 @@ int UtcDaliAlignmentGetAlignmentType(void)
   {
     Alignment alignment = Alignment::New(Alignment::HorizontalRight, Alignment::VerticalBottom);
     DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -626,8 +594,8 @@ int UtcDaliAlignmentSetScaling(void)
   // ScaleToFill
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -651,7 +619,7 @@ int UtcDaliAlignmentSetScaling(void)
     application.Render();
     application.SendNotification();
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -659,8 +627,8 @@ int UtcDaliAlignmentSetScaling(void)
   // ScaleToFitKeepAspect
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -684,7 +652,7 @@ int UtcDaliAlignmentSetScaling(void)
     application.Render();
     application.SendNotification();
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -692,8 +660,8 @@ int UtcDaliAlignmentSetScaling(void)
   // ScaleToFillKeepAspect
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -717,7 +685,7 @@ int UtcDaliAlignmentSetScaling(void)
     application.Render();
     application.SendNotification();
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -725,8 +693,8 @@ int UtcDaliAlignmentSetScaling(void)
   // ShrinkToFit
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -750,7 +718,7 @@ int UtcDaliAlignmentSetScaling(void)
     application.Render();
     application.SendNotification();
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -758,8 +726,8 @@ int UtcDaliAlignmentSetScaling(void)
   // ShrinkToFitKeepAspect
   {
     Alignment alignment = Alignment::New();
-    alignment.Add(RenderableActor::New());
-    Stage::GetCurrent().Add(alignment);
+    alignment.Add(Actor::New());
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -783,7 +751,7 @@ int UtcDaliAlignmentSetScaling(void)
     application.Render();
     application.SendNotification();
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -874,12 +842,9 @@ int UtcDaliAlignmentSetPaddingNegative(void)
     alignment.SetPadding(padding);
     tet_result(TET_FAIL);
   }
-  catch (DaliException& exception)
+  catch (DaliException& e)
   {
-    if (exception.mCondition == "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )")
-    {
-      tet_result(TET_PASS);
-    }
+    DALI_TEST_ASSERT(e, "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )", TEST_LOCATION );
   }
 
   try
@@ -888,12 +853,9 @@ int UtcDaliAlignmentSetPaddingNegative(void)
     alignment.SetPadding(padding);
     tet_result(TET_FAIL);
   }
-  catch (DaliException& exception)
+  catch (DaliException& e)
   {
-    if (exception.mCondition == "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )")
-    {
-      tet_result(TET_PASS);
-    }
+    DALI_TEST_ASSERT(e, "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )", TEST_LOCATION );
   }
 
   try
@@ -902,12 +864,9 @@ int UtcDaliAlignmentSetPaddingNegative(void)
     alignment.SetPadding(padding);
     tet_result(TET_FAIL);
   }
-  catch (DaliException& exception)
+  catch (DaliException& e)
   {
-    if (exception.mCondition == "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )")
-    {
-      tet_result(TET_PASS);
-    }
+    DALI_TEST_ASSERT(e, "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )", TEST_LOCATION );
   }
 
   try
@@ -916,12 +875,9 @@ int UtcDaliAlignmentSetPaddingNegative(void)
     alignment.SetPadding(padding);
     tet_result(TET_FAIL);
   }
-  catch (DaliException& exception)
+  catch (DaliException& e)
   {
-    if (exception.mCondition == "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )")
-    {
-      tet_result(TET_PASS);
-    }
+    DALI_TEST_ASSERT(e, "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )", TEST_LOCATION );
   }
   END_TEST;
 }
@@ -950,12 +906,12 @@ int UtcDaliAlignmentChildAddAndRemove(void)
   ToolkitTestApplication application;
 
   Alignment alignment = Alignment::New();
-  Stage::GetCurrent().Add(alignment);
+  application.GetScene().Add(alignment);
 
   application.Render();
   application.SendNotification();
 
-  Actor actor = RenderableActor::New();
+  Actor actor = Actor::New();
   alignment.Add(actor);
 
   DALI_TEST_EQUALS(alignment.GetChildCount(), 1u, TEST_LOCATION);
@@ -970,36 +926,36 @@ int UtcDaliAlignmentChildAddAndRemove(void)
   application.Render();
   application.SendNotification();
 
-  Stage::GetCurrent().Remove(alignment);
+  application.GetScene().Remove(alignment);
   END_TEST;
 }
 
-int UtcDaliAlignmentOnSizeSet(void)
+int UtcDaliAlignmentSizeSetP(void)
 {
   ToolkitTestApplication application;
 
   Alignment alignment = Alignment::New();
-  Stage::GetCurrent().Add(alignment);
+  application.GetScene().Add(alignment);
 
   application.Render();
   application.SendNotification();
 
-  Vector3 size(100.0f, 200.0f, 0.0f);
-  alignment.SetSize(size);
+  Vector2 size( 100.0f, 200.0f );
+  alignment.SetProperty( Actor::Property::SIZE, size);
 
   application.Render();
   application.SendNotification();
   application.Render();
   application.SendNotification();
 
-  DALI_TEST_EQUALS(size, alignment.GetImplementation().GetControlSize(), TEST_LOCATION);
+  DALI_TEST_EQUALS(size, alignment.GetTargetSize().GetVectorXY(), TEST_LOCATION);
 
-  Stage::GetCurrent().Remove(alignment);
+  application.GetScene().Remove(alignment);
   END_TEST;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-static bool TouchEventCallback(Actor actor, const TouchEvent& event)
+static bool TouchCallback(Actor actor, const TouchEvent& event)
 {
   return false;
 }
@@ -1011,11 +967,11 @@ int UtcDaliAlignmentOnTouchEvent(void)
   ToolkitTestApplication application;
 
   Alignment alignment = Alignment::New();
-  alignment.SetSize(100.0f, 100.0f);
-  alignment.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(alignment);
+  alignment.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  alignment.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(alignment);
 
-  alignment.TouchedSignal().Connect(&TouchEventCallback);
+  alignment.TouchSignal().Connect(&TouchCallback);
 
   application.Render();
   application.SendNotification();
@@ -1023,7 +979,10 @@ int UtcDaliAlignmentOnTouchEvent(void)
   application.SendNotification();
 
   Integration::TouchEvent touchEvent(1);
-  TouchPoint point(1, TouchPoint::Down, 20.0f, 20.0f);
+  Integration::Point point;
+  point.SetDeviceId( 1 );
+  point.SetState( PointState::DOWN);
+  point.SetScreenPosition( Vector2( 20.0f, 20.0f ) );
   touchEvent.AddPoint(point);
   application.ProcessEvent(touchEvent);
 
@@ -1036,7 +995,7 @@ int UtcDaliAlignmentOnKeyEvent(void)
   ToolkitTestApplication application;
 
   Alignment alignment = Alignment::New();
-  Stage::GetCurrent().Add(alignment);
+  application.GetScene().Add(alignment);
 
   alignment.SetKeyInputFocus();
 
@@ -1057,10 +1016,10 @@ int UtcDaliAlignmentOnSizeAnimation(void)
   ToolkitTestApplication application;
 
   Alignment alignment = Alignment::New();
-  Stage::GetCurrent().Add(alignment);
+  application.GetScene().Add(alignment);
 
   Animation animation = Animation::New(100.0f);
-  animation.Resize(alignment, Vector3(100.0f, 150.0f, 200.0f));
+  animation.AnimateTo( Property( alignment, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) );
   animation.Play();
 
   application.Render();