Revert "[Tizen] Move DevelHandle::GetCurrentProperty to public"
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-TypeRegistry.cpp
index d38de86..41ba9b9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -19,7 +19,9 @@
 #include <stdlib.h>
 #include <limits>
 #include <dali/public-api/dali-core.h>
+#include <dali/devel-api/object/handle-devel.h>
 #include <dali-test-suite-utils.h>
+#include <dali/internal/event/common/type-info-impl.h>
 #include <dali/integration-api/events/long-press-gesture-event.h>
 #include <dali/integration-api/events/pan-gesture-event.h>
 #include <dali/integration-api/events/pinch-gesture-event.h>
@@ -843,7 +845,6 @@ int UtcDaliTypeRegistryTypeRegistrationForNamedTypeP(void)
   END_TEST;
 }
 
-// Note: No negative test case for UtcDaliTypeRegistryRegisteredName can be implemented.
 int UtcDaliTypeRegistryRegisteredNameP(void)
 {
   TestApplication application;
@@ -861,6 +862,32 @@ int UtcDaliTypeRegistryRegisteredNameP(void)
   END_TEST;
 }
 
+
+int UtcDaliTypeRegistryRegisteredNameN(void)
+{
+  TestApplication application;
+
+  DALI_TEST_CHECK( scriptedName == scriptedType.RegisteredName() );
+
+  TypeInfo baseType = TypeRegistry::Get().GetTypeInfo( scriptedName );
+  DALI_TEST_CHECK( baseType );
+
+  // should cause an assert because we're registering same type twice
+  // once statically at the start of this file, then again now
+  try
+  {
+    TypeRegistration scriptedType( scriptedName, typeid(Dali::CustomActor), CreateCustomNamedInit );
+    tet_result( TET_FAIL );
+  }
+  catch ( DaliException& e )
+  {
+    DALI_TEST_ASSERT( e, "Duplicate type name for Type Registation", TEST_LOCATION );
+  }
+
+  END_TEST;
+}
+
+
 int UtcDaliTypeRegistrySignalConnectorTypeP(void)
 {
   ResetFunctorCounts();
@@ -1027,6 +1054,12 @@ int UtcDaliTypeRegistryPropertyRegistrationP(void)
   (void)customActor.GetProperty< bool >( propertyIndex );
   DALI_TEST_CHECK( getPropertyCalled );
 
+  // Get the property using DevelHandle::GetCurrentProperty and ensure GetProperty is called
+  getPropertyCalled = false;
+  DALI_TEST_CHECK( !getPropertyCalled );
+  (void)DevelHandle::GetCurrentProperty< bool >( customActor, propertyIndex );
+  DALI_TEST_CHECK( getPropertyCalled );
+
   // Check the property name
   DALI_TEST_EQUALS( customActor.GetPropertyName( propertyIndex ), propertyName, TEST_LOCATION );
   DALI_TEST_EQUALS( typeInfo.GetPropertyName( propertyIndex ), propertyName, TEST_LOCATION );
@@ -1146,16 +1179,21 @@ int UtcDaliTypeRegistryAnimatablePropertyRegistrationP(void)
   Animation animation = Animation::New(0.2f);
   animation.AnimateTo( Property( customActor, animatablePropertyIndex ), 15.f, AlphaFunction::LINEAR );
   animation.Play();
+
+  // Target value should change straight away
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 15.0f, TEST_LOCATION );
+
   // Render and notify, animation play for 0.05 seconds
   application.SendNotification();
   application.Render(50);
   DALI_TEST_EQUALS( 0.25f, animation.GetCurrentProgress(), TEST_LOCATION );
-  DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 22.5f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, animatablePropertyIndex ), 22.5f, TEST_LOCATION );
+
   // Render and notify, animation play for another 0.1 seconds
   application.SendNotification();
   application.Render(100);
   DALI_TEST_EQUALS( 0.75f, animation.GetCurrentProgress(), TEST_LOCATION );
-  DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 17.5f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, animatablePropertyIndex ), 17.5f, TEST_LOCATION );
 
   END_TEST;
 }
@@ -1247,16 +1285,21 @@ int UtcDaliTypeRegistryAnimatablePropertyRegistrationWithDefaultP(void)
   Animation animation = Animation::New(0.2f);
   animation.AnimateTo( Property( customActor, animatablePropertyIndex ), 20.f, AlphaFunction::LINEAR );
   animation.Play();
+
+  // Target value should change straight away
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 20.0f, TEST_LOCATION );
+
   // Render and notify, animation play for 0.05 seconds
   application.SendNotification();
   application.Render(50);
   DALI_TEST_EQUALS( 0.25f, animation.GetCurrentProgress(), TEST_LOCATION );
-  DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 12.5f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, animatablePropertyIndex ), 12.5f, TEST_LOCATION );
+
   // Render and notify, animation play for another 0.1 seconds
   application.SendNotification();
   application.Render(100);
   DALI_TEST_EQUALS( 0.75f, animation.GetCurrentProgress(), TEST_LOCATION );
-  DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 17.5f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, animatablePropertyIndex ), 17.5f, TEST_LOCATION );
 
   END_TEST;
 }
@@ -1352,8 +1395,8 @@ int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationP(void)
   DALI_TEST_EQUALS( customPropertyCount + 3u, customActor.GetPropertyCount(), TEST_LOCATION );
 
   // Check the animatable property component value
-  DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyComponentIndex1 ), 25.0f, TEST_LOCATION );
-  DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyComponentIndex2 ), 50.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, animatablePropertyComponentIndex1 ), 25.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, animatablePropertyComponentIndex2 ), 50.0f, TEST_LOCATION );
 
   // Set the animatable property component value
   customActor.SetProperty( animatablePropertyComponentIndex1, 150.0f );
@@ -1363,9 +1406,9 @@ int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationP(void)
   application.Render();
 
   // Check the animatable property value
-  DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( animatablePropertyIndex ), Vector2(150.0f, 50.0f), TEST_LOCATION );
-  DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyComponentIndex1 ), 150.0f, TEST_LOCATION );
-  DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyComponentIndex2 ), 50.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( customActor, animatablePropertyIndex ), Vector2(150.0f, 50.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, animatablePropertyComponentIndex1 ), 150.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, animatablePropertyComponentIndex2 ), 50.0f, TEST_LOCATION );
 
   // Set the animatable property component value
   customActor.SetProperty( animatablePropertyComponentIndex2, 225.0f );
@@ -1375,9 +1418,9 @@ int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationP(void)
   application.Render();
 
   // Check the animatable property value
-  DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( animatablePropertyIndex ), Vector2(150.0f, 225.0f), TEST_LOCATION );
-  DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyComponentIndex1 ), 150.0f, TEST_LOCATION );
-  DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyComponentIndex2 ), 225.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( customActor, animatablePropertyIndex ), Vector2(150.0f, 225.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, animatablePropertyComponentIndex1 ), 150.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, animatablePropertyComponentIndex2 ), 225.0f, TEST_LOCATION );
 
   // Ensure indices returned from actor and customActor differ by three
   Actor actor = Actor::New();
@@ -1491,6 +1534,12 @@ int UtcDaliTypeRegistryChildPropertyRegistrationP(void)
   // Check property count are not changed because the child properties will not be created for the parent
   DALI_TEST_EQUALS( initialPropertyCount, customActor.GetPropertyCount(), TEST_LOCATION );
 
+  // check the child property type
+  Internal::TypeInfo& typeInfoImpl = GetImplementation( typeInfo );
+  Property::Type type = typeInfoImpl.GetChildPropertyType( typeInfoImpl.GetChildPropertyIndex("childProp4") );
+  DALI_TEST_EQUALS( type, Property::INTEGER, TEST_LOCATION );
+
+
   // Create a child actor
   Actor childActor = Actor::New();
   DALI_TEST_CHECK( childActor );
@@ -1650,6 +1699,7 @@ int UtcDaliTypeRegistryChildPropertyRegistrationP(void)
   // Should return the child property index by given its name
   DALI_TEST_EQUALS( childActor.GetPropertyIndex( newPropertyName ), newPropertyIndex, TEST_LOCATION );
 
+
   END_TEST;
 }
 
@@ -1786,7 +1836,7 @@ int UtcDaliPropertyRegistrationAddSameIndex(void)
   END_TEST;
 }
 
-int UtcDaliPropertyRegistrationPropertyWritable(void)
+int UtcDaliPropertyRegistrationPropertyWritableP(void)
 {
   TestApplication application;
   int propertyIndex1 = PROPERTY_REGISTRATION_START_INDEX + 200;
@@ -1807,9 +1857,36 @@ int UtcDaliPropertyRegistrationPropertyWritable(void)
   // Check whether properties are writable
   DALI_TEST_CHECK(   customActor.IsPropertyWritable( propertyIndex1 ) );
   DALI_TEST_CHECK( ! customActor.IsPropertyWritable( propertyIndex2 ) );
+
+
+  // Check the property is writable in the type registry
+  Internal::TypeInfo& typeInfoImpl = GetImplementation( typeInfo );
+
+  DALI_TEST_EQUALS( typeInfoImpl.IsPropertyWritable( propertyIndex1 ), true, TEST_LOCATION );
+
   END_TEST;
 }
 
+int UtcDaliPropertyRegistrationPropertyWritableN(void)
+{
+  // Currently Actors don't register properties with the type registry
+
+  TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( typeid(MyTestCustomActor) );
+  Internal::TypeInfo& typeInfoImpl = GetImplementation( typeInfo );
+
+  try
+  {
+    typeInfoImpl.IsPropertyWritable( Actor::Property::COLOR);
+    tet_result( TET_FAIL );
+
+  }
+  catch ( DaliException& e )
+  {
+     DALI_TEST_ASSERT( e, "Cannot find property index", TEST_LOCATION );
+  }
+  END_TEST;
+
+}
 int UtcDaliPropertyRegistrationPropertyAnimatable(void)
 {
   TestApplication application;
@@ -2091,6 +2168,25 @@ int UtcDaliTypeInfoGetActionNameP(void)
 
   DALI_TEST_EQUALS( name, "show", TEST_LOCATION );
 
+
+  TypeInfo typeInfo2 = typeRegistry.GetTypeInfo( "MyTestCustomActor" );
+
+  //  search for show action in base class, given a derived class
+  bool foundChildAction = false;
+  for( std::size_t i = 0; i < typeInfo2.GetActionCount(); i++ )
+  {
+
+       std::string name = typeInfo2.GetActionName( i );
+       if( name == "show")
+       {
+         foundChildAction = true;
+       }
+
+  }
+
+  DALI_TEST_EQUALS( foundChildAction, true, TEST_LOCATION );
+
+
   END_TEST;
 }
 
@@ -2125,6 +2221,23 @@ int UtcDaliTypeInfoGetSignalNameP(void)
 
   DALI_TEST_EQUALS( name, "touched", TEST_LOCATION );
 
+  TypeInfo typeInfo2 = typeRegistry.GetTypeInfo( "MyTestCustomActor" );
+
+  //  search for signal in base class, given a derived class
+  bool foundSignal = false;
+  for( std::size_t i = 0; i < typeInfo2.GetSignalCount(); i++ )
+  {
+
+       std::string name = typeInfo2.GetSignalName( i );
+       if( name == "touched")
+       {
+         foundSignal = true;
+       }
+
+  }
+
+  DALI_TEST_EQUALS( foundSignal, true, TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -2209,3 +2322,271 @@ int UtcDaliTypeInfoGetPropertyCountP2(void)
 
   END_TEST;
 }
+
+int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGet01(void)
+{
+  TestApplication application;
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+
+  tet_infoline( "Register a type registered animatable property and ensure set/get behaviour works synchronously" );
+
+  // Register animatable property
+  const int animatablePropertyIndex( ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX );
+  AnimatablePropertyRegistration animatableProperty( customType1, "animatableProp1", animatablePropertyIndex, Property::FLOAT );
+
+  // Check property count before property registration
+  TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+  DALI_TEST_CHECK( typeInfo );
+  BaseHandle handle = typeInfo.CreateInstance();
+  DALI_TEST_CHECK( handle );
+  Actor customActor = Actor::DownCast( handle );
+  DALI_TEST_CHECK( customActor );
+  Stage::GetCurrent().Add(customActor);
+
+  tet_infoline( "Set the value and ensure it changes straight away" );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 0.0f, TEST_LOCATION );
+  customActor.SetProperty( animatablePropertyIndex, 25.0f );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 25.0f, TEST_LOCATION );
+
+  tet_infoline( "Check latest scene-graph value is unchanged" );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, animatablePropertyIndex ), 0.0f, TEST_LOCATION );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  tet_infoline( "Check values after rendering and both retrieval methods should return the latest" );
+
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 25.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, animatablePropertyIndex ), 25.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGetWithComponentsVector2(void)
+{
+  TestApplication application;
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+
+  tet_infoline( "Register a type registered animatable property that has component indices and ensure set/get behaviour works synchronously and is the same regardless of how the property is set" );
+
+  // Register the animatable propeties
+  const int basePropertyIndex( ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX );
+  const int componentZeroPropertyIndex( basePropertyIndex + 1 );
+  const int componentOnePropertyIndex( componentZeroPropertyIndex + 1 );
+  AnimatablePropertyRegistration baseAnimatableProperty( customType1, "baseProp", basePropertyIndex, Vector2( 13.0f, 24.0f ) );
+  AnimatablePropertyComponentRegistration componentZeroAnimatableProperty( customType1, "componentZeroProp", componentZeroPropertyIndex, basePropertyIndex, 0 );
+  AnimatablePropertyComponentRegistration componentOneAnimatableProperty( customType1, "componentOneProp", componentOnePropertyIndex, basePropertyIndex, 1 );
+
+  // Check property count before property registration
+  TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+  DALI_TEST_CHECK( typeInfo );
+  BaseHandle handle = typeInfo.CreateInstance();
+  DALI_TEST_CHECK( handle );
+  Actor customActor = Actor::DownCast( handle );
+  DALI_TEST_CHECK( customActor );
+  Stage::GetCurrent().Add(customActor);
+
+  tet_infoline( "Get the component values, they should be the default value of the base-property" );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 24.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( basePropertyIndex ), Vector2( 13.0f, 24.0f ), TEST_LOCATION );
+
+  tet_infoline( "Set a component value and ensure it changes for the base property as well" );
+  customActor.SetProperty( componentZeroPropertyIndex, 125.0f );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( basePropertyIndex ), Vector2( 125.0f, 24.0f ), TEST_LOCATION );
+
+  customActor.SetProperty( componentOnePropertyIndex, 225.0f );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( basePropertyIndex ), Vector2( 125.0f, 225.0f ), TEST_LOCATION );
+
+  tet_infoline( "Check latest scene-graph value is unchanged" );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( customActor, basePropertyIndex ), Vector2( 13.0f, 24.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentOnePropertyIndex ), 24.0f, TEST_LOCATION );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  tet_infoline( "Check values after rendering and both retrieval methods should return the latest" );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( basePropertyIndex ), Vector2( 125.0f, 225.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( customActor, basePropertyIndex ), Vector2( 125.0f, 225.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+
+  tet_infoline( "Set the base property value and ensure the component values reflect the change" );
+  customActor.SetProperty( basePropertyIndex, Vector2( 1.0f, 2.0f ) );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 1.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 2.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( basePropertyIndex ), Vector2( 1.0f, 2.0f ), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGetWithComponentsVector3(void)
+{
+  TestApplication application;
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+
+  tet_infoline( "Register a type registered animatable property that has component indices and ensure set/get behaviour works synchronously and is the same regardless of how the property is set" );
+
+  // Register the animatable propeties
+  const int basePropertyIndex( ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX );
+  const int componentZeroPropertyIndex( basePropertyIndex + 1 );
+  const int componentOnePropertyIndex( componentZeroPropertyIndex + 1 );
+  const int componentTwoPropertyIndex( componentOnePropertyIndex + 1 );
+  AnimatablePropertyRegistration baseAnimatableProperty( customType1, "baseProp", basePropertyIndex, Vector3( 13.0f, 24.0f, 35.0 ) );
+  AnimatablePropertyComponentRegistration componentZeroAnimatableProperty( customType1, "componentZeroProp", componentZeroPropertyIndex, basePropertyIndex, 0 );
+  AnimatablePropertyComponentRegistration componentOneAnimatableProperty( customType1, "componentOneProp", componentOnePropertyIndex, basePropertyIndex, 1 );
+  AnimatablePropertyComponentRegistration componentTwoAnimatableProperty( customType1, "componentTwoProp", componentTwoPropertyIndex, basePropertyIndex, 2 );
+
+  // Check property count before property registration
+  TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+  DALI_TEST_CHECK( typeInfo );
+  BaseHandle handle = typeInfo.CreateInstance();
+  DALI_TEST_CHECK( handle );
+  Actor customActor = Actor::DownCast( handle );
+  DALI_TEST_CHECK( customActor );
+  Stage::GetCurrent().Add(customActor);
+
+  tet_infoline( "Get the component values, they should be the default value of the base-property" );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 24.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 35.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( basePropertyIndex ), Vector3( 13.0f, 24.0f, 35.0f ), TEST_LOCATION );
+
+  tet_infoline( "Set a component value and ensure it changes for the base property as well" );
+  customActor.SetProperty( componentZeroPropertyIndex, 125.0f );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( basePropertyIndex ), Vector3( 125.0f, 24.0f, 35.0f ), TEST_LOCATION );
+
+  customActor.SetProperty( componentOnePropertyIndex, 225.0f );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( basePropertyIndex ), Vector3( 125.0f, 225.0f, 35.0f ), TEST_LOCATION );
+
+  customActor.SetProperty( componentTwoPropertyIndex, 325.0f );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 325.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( basePropertyIndex ), Vector3( 125.0f, 225.0f, 325.0f ), TEST_LOCATION );
+
+  tet_infoline( "Check latest scene-graph value is unchanged" );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector3 >( customActor, basePropertyIndex ), Vector3( 13.0f, 24.0f, 35.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentOnePropertyIndex ), 24.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentTwoPropertyIndex ), 35.0f, TEST_LOCATION );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  tet_infoline( "Check values after rendering and both retrieval methods should return the latest" );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( basePropertyIndex ), Vector3( 125.0f, 225.0f, 325.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 325.0f, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector3 >( customActor, basePropertyIndex ), Vector3( 125.0f, 225.0f, 325.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentTwoPropertyIndex ), 325.0f, TEST_LOCATION );
+
+  tet_infoline( "Set the base property value and ensure the component values reflect the change" );
+  customActor.SetProperty( basePropertyIndex, Vector3( 1.0f, 2.0f, 3.0f ) );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 1.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 2.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 3.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( basePropertyIndex ), Vector3( 1.0f, 2.0f, 3.0f ), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGetWithComponentsVector4(void)
+{
+  TestApplication application;
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+
+  tet_infoline( "Register a type registered animatable property that has component indices and ensure set/get behaviour works synchronously and is the same regardless of how the property is set" );
+
+  // Register the animatable propeties
+  const int basePropertyIndex( ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX );
+  const int componentZeroPropertyIndex( basePropertyIndex + 1 );
+  const int componentOnePropertyIndex( componentZeroPropertyIndex + 1 );
+  const int componentTwoPropertyIndex( componentOnePropertyIndex + 1 );
+  const int componentThreePropertyIndex( componentTwoPropertyIndex + 1 );
+  AnimatablePropertyRegistration baseAnimatableProperty( customType1, "baseProp", basePropertyIndex, Vector4( 13.0f, 24.0f, 35.0, 47.0f ) );
+  AnimatablePropertyComponentRegistration componentZeroAnimatableProperty( customType1, "componentZeroProp", componentZeroPropertyIndex, basePropertyIndex, 0 );
+  AnimatablePropertyComponentRegistration componentOneAnimatableProperty( customType1, "componentOneProp", componentOnePropertyIndex, basePropertyIndex, 1 );
+  AnimatablePropertyComponentRegistration componentTwoAnimatableProperty( customType1, "componentTwoProp", componentTwoPropertyIndex, basePropertyIndex, 2 );
+  AnimatablePropertyComponentRegistration componentThreeAnimatableProperty( customType1, "componentThreeProp", componentThreePropertyIndex, basePropertyIndex, 3 );
+
+  // Check property count before property registration
+  TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+  DALI_TEST_CHECK( typeInfo );
+  BaseHandle handle = typeInfo.CreateInstance();
+  DALI_TEST_CHECK( handle );
+  Actor customActor = Actor::DownCast( handle );
+  DALI_TEST_CHECK( customActor );
+  Stage::GetCurrent().Add(customActor);
+
+  tet_infoline( "Get the component values, they should be the default value of the base-property" );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 24.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 35.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentThreePropertyIndex ), 47.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( basePropertyIndex ), Vector4( 13.0f, 24.0f, 35.0f, 47.0f ), TEST_LOCATION );
+
+  tet_infoline( "Set a component value and ensure it changes for the base property as well" );
+  customActor.SetProperty( componentZeroPropertyIndex, 125.0f );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( basePropertyIndex ), Vector4( 125.0f, 24.0f, 35.0f, 47.0f ), TEST_LOCATION );
+
+  customActor.SetProperty( componentOnePropertyIndex, 225.0f );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( basePropertyIndex ), Vector4( 125.0f, 225.0f, 35.0f, 47.0f ), TEST_LOCATION );
+
+  customActor.SetProperty( componentTwoPropertyIndex, 325.0f );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 325.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( basePropertyIndex ), Vector4( 125.0f, 225.0f, 325.0f, 47.0f ), TEST_LOCATION );
+
+  customActor.SetProperty( componentThreePropertyIndex, 435.0f );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentThreePropertyIndex ), 435.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( basePropertyIndex ), Vector4( 125.0f, 225.0f, 325.0f, 435.0f ), TEST_LOCATION );
+
+  tet_infoline( "Check latest scene-graph value is unchanged" );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector4 >( customActor, basePropertyIndex ), Vector4( 13.0f, 24.0f, 35.0f, 47.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentOnePropertyIndex ), 24.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentTwoPropertyIndex ), 35.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentThreePropertyIndex ), 47.0f, TEST_LOCATION );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  tet_infoline( "Check values after rendering and both retrieval methods should return the latest" );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( basePropertyIndex ), Vector4( 125.0f, 225.0f, 325.0f, 435.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 325.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentThreePropertyIndex ), 435.0f, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector4 >( customActor, basePropertyIndex ), Vector4( 125.0f, 225.0f, 325.0f, 435.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentTwoPropertyIndex ), 325.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, componentThreePropertyIndex ), 435.0f, TEST_LOCATION );
+
+  tet_infoline( "Set the base property value and ensure the component values reflect the change" );
+  customActor.SetProperty( basePropertyIndex, Vector4( 1.0f, 2.0f, 3.0f, 4.0f ) );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 1.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 2.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 3.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( componentThreePropertyIndex ), 4.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( basePropertyIndex ), Vector4( 1.0f, 2.0f, 3.0f, 4.0f ), TEST_LOCATION );
+
+  END_TEST;
+}