Ver Fonte

Make serializable classes flyweight classes

- add setter methods to all serialization classes
- add getter methods to all serialization classes
- extend tests for all serialization classes
Patrick-Christopher Mattulat há 4 anos atrás
pai
commit
ef9aca6f85
27 ficheiros alterados com 297 adições e 27 exclusões
  1. 7 0
      include/ls_std/serialization/boxing/SerializableJSONBoolean.hpp
  2. 7 0
      include/ls_std/serialization/boxing/SerializableJSONDouble.hpp
  3. 7 0
      include/ls_std/serialization/boxing/SerializableJSONFloat.hpp
  4. 7 0
      include/ls_std/serialization/boxing/SerializableJSONInteger.hpp
  5. 7 0
      include/ls_std/serialization/boxing/SerializableJSONLong.hpp
  6. 7 0
      include/ls_std/serialization/boxing/SerializableJSONString.hpp
  7. 4 3
      include/ls_std/serialization/logic/SerializableJSONState.hpp
  8. 1 0
      include/ls_std/serialization/logic/SerializableJSONStateConnection.hpp
  9. 9 2
      include/ls_std/serialization/logic/SerializableJSONStateMachine.hpp
  10. 11 1
      source/ls_std/serialization/json/boxing/SerializableJSONBoolean.cpp
  11. 11 1
      source/ls_std/serialization/json/boxing/SerializableJSONDouble.cpp
  12. 11 1
      source/ls_std/serialization/json/boxing/SerializableJSONFloat.cpp
  13. 11 1
      source/ls_std/serialization/json/boxing/SerializableJSONInteger.cpp
  14. 11 1
      source/ls_std/serialization/json/boxing/SerializableJSONLong.cpp
  15. 11 1
      source/ls_std/serialization/json/boxing/SerializableJSONString.cpp
  16. 8 3
      source/ls_std/serialization/json/logic/SerializableJSONState.cpp
  17. 6 1
      source/ls_std/serialization/json/logic/SerializableJSONStateConnection.cpp
  18. 13 3
      source/ls_std/serialization/json/logic/SerializableJSONStateMachine.cpp
  19. 18 1
      test/cases/serialization/json/boxing/SerializableJSONBooleanTest.cpp
  20. 19 1
      test/cases/serialization/json/boxing/SerializableJSONDoubleTest.cpp
  21. 19 1
      test/cases/serialization/json/boxing/SerializableJSONFloatTest.cpp
  22. 19 1
      test/cases/serialization/json/boxing/SerializableJSONIntegerTest.cpp
  23. 19 1
      test/cases/serialization/json/boxing/SerializableJSONLongTest.cpp
  24. 19 1
      test/cases/serialization/json/boxing/SerializableJSONStringTest.cpp
  25. 8 1
      test/cases/serialization/json/logic/SerializableJSONStateConnectionTest.cpp
  26. 19 1
      test/cases/serialization/json/logic/SerializableJSONStateMachineTest.cpp
  27. 8 1
      test/cases/serialization/json/logic/SerializableJSONStateTest.cpp

+ 7 - 0
include/ls_std/serialization/boxing/SerializableJSONBoolean.hpp

@@ -23,9 +23,16 @@ namespace ls_std {
       explicit SerializableJSONBoolean(const std::shared_ptr<ls_std::Boolean>& _value);
       ~SerializableJSONBoolean() override = default;
 
+      // implementation
+
       ls_std::byte_field marshal() override;
       void unmarshal(const ls_std::byte_field& _data) override;
 
+      // additional functionality
+
+      std::shared_ptr<ls_std::Boolean> getValue();
+      void setValue(const std::shared_ptr<ls_std::Boolean>& _value);
+
     private:
 
       std::shared_ptr<ls_std::Boolean> value {};

+ 7 - 0
include/ls_std/serialization/boxing/SerializableJSONDouble.hpp

@@ -23,9 +23,16 @@ namespace ls_std {
       explicit SerializableJSONDouble(const std::shared_ptr<ls_std::Double>& _value);
       ~SerializableJSONDouble() override = default;
 
+      // implementation
+
       ls_std::byte_field marshal() override;
       void unmarshal(const ls_std::byte_field& _data) override;
 
+      // additional functionality
+
+      std::shared_ptr<ls_std::Double> getValue();
+      void setValue(const std::shared_ptr<ls_std::Double>& _value);
+
     private:
 
       std::shared_ptr<ls_std::Double> value {};

+ 7 - 0
include/ls_std/serialization/boxing/SerializableJSONFloat.hpp

@@ -23,9 +23,16 @@ namespace ls_std {
       explicit SerializableJSONFloat(const std::shared_ptr<ls_std::Float>& _value);
       ~SerializableJSONFloat() override = default;
 
+      // implementation
+
       ls_std::byte_field marshal() override;
       void unmarshal(const ls_std::byte_field& _data) override;
 
+      // additional functionality
+
+      std::shared_ptr<ls_std::Float> getValue();
+      void setValue(const std::shared_ptr<ls_std::Float>& _value);
+
     private:
 
       std::shared_ptr<ls_std::Float> value {};

+ 7 - 0
include/ls_std/serialization/boxing/SerializableJSONInteger.hpp

@@ -22,9 +22,16 @@ namespace ls_std {
       explicit SerializableJSONInteger(const std::shared_ptr<ls_std::Integer>& _value);
       ~SerializableJSONInteger() override = default;
 
+      // implementation
+
       ls_std::byte_field marshal() override;
       void unmarshal(const ls_std::byte_field& _data) override;
 
+      // additional functionality
+
+      std::shared_ptr<ls_std::Integer> getValue();
+      void setValue(const std::shared_ptr<ls_std::Integer>& _value);
+
     private:
 
       std::shared_ptr<ls_std::Integer> value {};

+ 7 - 0
include/ls_std/serialization/boxing/SerializableJSONLong.hpp

@@ -22,9 +22,16 @@ namespace ls_std {
       explicit SerializableJSONLong(const std::shared_ptr<ls_std::Long>& _value);
       ~SerializableJSONLong() override = default;
 
+      // implementation
+
       ls_std::byte_field marshal() override;
       void unmarshal(const ls_std::byte_field& _data) override;
 
+      // additional functionality
+
+      std::shared_ptr<ls_std::Long> getValue();
+      void setValue(const std::shared_ptr<ls_std::Long>& _value);
+
     private:
 
       nlohmann::json jsonObject {};

+ 7 - 0
include/ls_std/serialization/boxing/SerializableJSONString.hpp

@@ -22,9 +22,16 @@ namespace ls_std {
       explicit SerializableJSONString(const std::shared_ptr<ls_std::String>& _value);
       ~SerializableJSONString() override = default;
 
+      // implementation
+
       ls_std::byte_field marshal() override;
       void unmarshal(const ls_std::byte_field& _data) override;
 
+      // additional functionality
+
+      std::shared_ptr<ls_std::String> getValue();
+      void setValue(const std::shared_ptr<ls_std::String>& _value);
+
     private:
 
       nlohmann::json jsonObject {};

+ 4 - 3
include/ls_std/serialization/logic/SerializableJSONState.hpp

@@ -20,7 +20,7 @@ namespace ls_std {
   class SerializableJSONState : public Class, public ISerializable {
     public:
 
-      explicit SerializableJSONState(const std::shared_ptr<State>& _value);
+      explicit SerializableJSONState(const std::shared_ptr<ls_std::State>& _value);
       ~SerializableJSONState() override = default;
 
       // implementation
@@ -30,14 +30,15 @@ namespace ls_std {
 
       // additional functionality
 
-      void setValue(const std::shared_ptr<State>& _value);
+      std::shared_ptr<ls_std::State> getValue();
+      void setValue(const std::shared_ptr<ls_std::State>& _value);
 
     private:
 
       nlohmann::json jsonObject {};
       std::shared_ptr<ls_std::State> value {};
 
-      void _assignValue(const std::shared_ptr<State>& _value);
+      void _assignValue(const std::shared_ptr<ls_std::State>& _value);
       void _clear();
       void _unmarshalStateConnections();
       void _update();

+ 1 - 0
include/ls_std/serialization/logic/SerializableJSONStateConnection.hpp

@@ -30,6 +30,7 @@ namespace ls_std {
 
       // additional functionality
 
+      std::shared_ptr<ls_std::StateConnection> getValue();
       void setValue(const std::shared_ptr<ls_std::StateConnection>& _value);
 
     private:

+ 9 - 2
include/ls_std/serialization/logic/SerializableJSONStateMachine.hpp

@@ -20,18 +20,25 @@ namespace ls_std {
   class SerializableJSONStateMachine : public Class, public ISerializable {
     public:
 
-      explicit SerializableJSONStateMachine(const std::shared_ptr<StateMachine>& _value);
+      explicit SerializableJSONStateMachine(const std::shared_ptr<ls_std::StateMachine>& _value);
       ~SerializableJSONStateMachine() override = default;
 
+      // implementation
+
       ls_std::byte_field marshal() override;
       void unmarshal(const ls_std::byte_field& _data) override;
 
+      // additional functionality
+
+      std::shared_ptr<ls_std::StateMachine> getValue();
+      void setValue(const std::shared_ptr<ls_std::StateMachine>& _value);
+
     private:
 
       nlohmann::json jsonObject {};
       std::shared_ptr<ls_std::StateMachine> value {};
 
-      void _assignValue(const std::shared_ptr<StateMachine>& _value);
+      void _assignValue(const std::shared_ptr<ls_std::StateMachine>& _value);
       void _unmarshalCurrentState();
       void _unmarshalStates();
       void _update();

+ 11 - 1
source/ls_std/serialization/json/boxing/SerializableJSONBoolean.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-04
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -31,6 +31,16 @@ void ls_std::SerializableJSONBoolean::unmarshal(const ls_std::byte_field& _data)
   }
 }
 
+std::shared_ptr<ls_std::Boolean> ls_std::SerializableJSONBoolean::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONBoolean::setValue(const std::shared_ptr<ls_std::Boolean> &_value)
+{
+  this->_assignValue(_value);
+}
+
 void ls_std::SerializableJSONBoolean::_assignValue(const std::shared_ptr<ls_std::Boolean> &_value)
 {
   if(_value == nullptr) {

+ 11 - 1
source/ls_std/serialization/json/boxing/SerializableJSONDouble.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-04
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -32,6 +32,16 @@ void ls_std::SerializableJSONDouble::unmarshal(const ls_std::byte_field& _data)
   }
 }
 
+std::shared_ptr<ls_std::Double> ls_std::SerializableJSONDouble::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONDouble::setValue(const std::shared_ptr<ls_std::Double> &_value)
+{
+  this->_assignValue(_value);
+}
+
 void ls_std::SerializableJSONDouble::_assignValue(const std::shared_ptr<ls_std::Double> &_value)
 {
   if(_value == nullptr) {

+ 11 - 1
source/ls_std/serialization/json/boxing/SerializableJSONFloat.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-04
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -32,6 +32,16 @@ void ls_std::SerializableJSONFloat::unmarshal(const ls_std::byte_field& _data)
   }
 }
 
+std::shared_ptr<ls_std::Float> ls_std::SerializableJSONFloat::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONFloat::setValue(const std::shared_ptr<ls_std::Float> &_value)
+{
+  this->_assignValue(_value);
+}
+
 void ls_std::SerializableJSONFloat::_assignValue(const std::shared_ptr<ls_std::Float> &_value)
 {
   if(_value == nullptr) {

+ 11 - 1
source/ls_std/serialization/json/boxing/SerializableJSONInteger.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-21
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -32,6 +32,16 @@ void ls_std::SerializableJSONInteger::unmarshal(const ls_std::byte_field& _data)
   }
 }
 
+std::shared_ptr<ls_std::Integer> ls_std::SerializableJSONInteger::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONInteger::setValue(const std::shared_ptr<ls_std::Integer> &_value)
+{
+  this->_assignValue(_value);
+}
+
 void ls_std::SerializableJSONInteger::_assignValue(const std::shared_ptr<ls_std::Integer> &_value)
 {
   if(_value == nullptr) {

+ 11 - 1
source/ls_std/serialization/json/boxing/SerializableJSONLong.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-25
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -32,6 +32,16 @@ void ls_std::SerializableJSONLong::unmarshal(const ls_std::byte_field& _data)
   }
 }
 
+std::shared_ptr<ls_std::Long> ls_std::SerializableJSONLong::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONLong::setValue(const std::shared_ptr<ls_std::Long> &_value)
+{
+  this->_assignValue(_value);
+}
+
 void ls_std::SerializableJSONLong::_assignValue(const std::shared_ptr<ls_std::Long> &_value)
 {
   if(_value == nullptr) {

+ 11 - 1
source/ls_std/serialization/json/boxing/SerializableJSONString.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-30
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -32,6 +32,16 @@ void ls_std::SerializableJSONString::unmarshal(const ls_std::byte_field& _data)
   }
 }
 
+std::shared_ptr<ls_std::String> ls_std::SerializableJSONString::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONString::setValue(const std::shared_ptr<ls_std::String> &_value)
+{
+  this->_assignValue(_value);
+}
+
 void ls_std::SerializableJSONString::_assignValue(const std::shared_ptr<ls_std::String> &_value)
 {
   if(_value == nullptr) {

+ 8 - 3
source/ls_std/serialization/json/logic/SerializableJSONState.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-15
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -31,13 +31,18 @@ void ls_std::SerializableJSONState::unmarshal(const ls_std::byte_field &_data)
   this->value->setId(this->jsonObject["id"]);
 }
 
-void ls_std::SerializableJSONState::setValue(const std::shared_ptr<State>& _value)
+std::shared_ptr<ls_std::State> ls_std::SerializableJSONState::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONState::setValue(const std::shared_ptr<ls_std::State>& _value)
 {
   this->_assignValue(_value);
   this->_clear();
 }
 
-void ls_std::SerializableJSONState::_assignValue(const std::shared_ptr<State> &_value)
+void ls_std::SerializableJSONState::_assignValue(const std::shared_ptr<ls_std::State> &_value)
 {
   if(_value == nullptr) {
     throw ls_std::IllegalArgumentException {};

+ 6 - 1
source/ls_std/serialization/json/logic/SerializableJSONStateConnection.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-14
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -32,6 +32,11 @@ void ls_std::SerializableJSONStateConnection::unmarshal(const ls_std::byte_field
   this->value->updatePassCondition(this->jsonObject["condition"]);
 }
 
+std::shared_ptr<ls_std::StateConnection> ls_std::SerializableJSONStateConnection::getValue()
+{
+  return this->value;
+}
+
 void ls_std::SerializableJSONStateConnection::setValue(const std::shared_ptr<ls_std::StateConnection>& _value)
 {
   this->_assignValue(_value);

+ 13 - 3
source/ls_std/serialization/json/logic/SerializableJSONStateMachine.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-17
- * Changed:         2020-11-25
+ * Changed:         2020-11-26
  *
  * */
 
@@ -11,7 +11,7 @@
 #include <ls_std/serialization/logic/SerializableJSONState.hpp>
 #include <ls_std/exception/IllegalArgumentException.hpp>
 
-ls_std::SerializableJSONStateMachine::SerializableJSONStateMachine(const std::shared_ptr<StateMachine>& _value) :
+ls_std::SerializableJSONStateMachine::SerializableJSONStateMachine(const std::shared_ptr<ls_std::StateMachine>& _value) :
 Class("SerializableJSONStateMachine")
 {
   this->_assignValue(_value);
@@ -33,7 +33,17 @@ void ls_std::SerializableJSONStateMachine::unmarshal(const ls_std::byte_field &_
   this->value->setName(this->jsonObject["name"]);
 }
 
-void ls_std::SerializableJSONStateMachine::_assignValue(const std::shared_ptr<StateMachine> &_value)
+std::shared_ptr<ls_std::StateMachine> ls_std::SerializableJSONStateMachine::getValue()
+{
+  return this->value;
+}
+
+void ls_std::SerializableJSONStateMachine::setValue(const std::shared_ptr<ls_std::StateMachine> &_value)
+{
+  this->_assignValue(_value);
+}
+
+void ls_std::SerializableJSONStateMachine::_assignValue(const std::shared_ptr<ls_std::StateMachine> &_value)
 {
   if(_value == nullptr) {
     throw ls_std::IllegalArgumentException {};

+ 18 - 1
test/cases/serialization/json/boxing/SerializableJSONBooleanTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-04
- * Changed:         2020-10-29
+ * Changed:         2020-11-26
  *
  * */
 
@@ -41,4 +41,21 @@ namespace {
 
     ASSERT_TRUE(*x);
   }
+
+  TEST_F(SerializableJSONBooleanTest, getValue) {
+    std::shared_ptr<ls_std::Boolean> x = std::make_shared<ls_std::Boolean>(false);
+    ls_std::SerializableJSONBoolean serializable {x};
+
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
+
+  TEST_F(SerializableJSONBooleanTest, setValue) {
+    std::shared_ptr<ls_std::Boolean> x = std::make_shared<ls_std::Boolean>(false);
+    ls_std::SerializableJSONBoolean serializable {x};
+    ASSERT_TRUE(serializable.getValue() == x);
+
+    x = std::make_shared<ls_std::Boolean>(true);
+    serializable.setValue(x);
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
 }

+ 19 - 1
test/cases/serialization/json/boxing/SerializableJSONDoubleTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-04
- * Changed:         2020-10-29
+ * Changed:         2020-11-26
  *
  * */
 
@@ -41,4 +41,22 @@ namespace {
 
     ASSERT_DOUBLE_EQ(3.14159, *x);
   }
+
+  TEST_F(SerializableJSONDoubleTest, getValue)
+  {
+    std::shared_ptr<ls_std::Double> x = std::make_shared<ls_std::Double>(14.2234);
+    ls_std::SerializableJSONDouble serializable {x};
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
+
+  TEST_F(SerializableJSONDoubleTest, setValue)
+  {
+    std::shared_ptr<ls_std::Double> x = std::make_shared<ls_std::Double>(14.2234);
+    ls_std::SerializableJSONDouble serializable {x};
+    ASSERT_TRUE(serializable.getValue() == x);
+
+    x = std::make_shared<ls_std::Double>(3.145);
+    serializable.setValue(x);
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
 }

+ 19 - 1
test/cases/serialization/json/boxing/SerializableJSONFloatTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-04
- * Changed:         2020-10-29
+ * Changed:         2020-11-26
  *
  * */
 
@@ -40,4 +40,22 @@ namespace {
 
     ASSERT_FLOAT_EQ(3.14159f, *x);
   }
+
+  TEST_F(SerializableJSONFloatTest, getValue)
+  {
+    std::shared_ptr<ls_std::Float> x = std::make_shared<ls_std::Float>(14.2234f);
+    ls_std::SerializableJSONFloat serializable {x};
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
+
+  TEST_F(SerializableJSONFloatTest, setValue)
+  {
+    std::shared_ptr<ls_std::Float> x = std::make_shared<ls_std::Float>(14.2234f);
+    ls_std::SerializableJSONFloat serializable {x};
+    ASSERT_TRUE(serializable.getValue() == x);
+
+    x = std::make_shared<ls_std::Float>(3.134f);
+    serializable.setValue(x);
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
 }

+ 19 - 1
test/cases/serialization/json/boxing/SerializableJSONIntegerTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-21
- * Changed:         2020-10-29
+ * Changed:         2020-11-26
  *
  * */
 
@@ -40,4 +40,22 @@ namespace {
 
     ASSERT_EQ(1989, *x);
   }
+
+  TEST_F(SerializableJSONIntegerTest, getValue)
+  {
+    std::shared_ptr<ls_std::Integer> x = std::make_shared<ls_std::Integer>(13);
+    ls_std::SerializableJSONInteger serializable {x};
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
+
+  TEST_F(SerializableJSONIntegerTest, setValue)
+  {
+    std::shared_ptr<ls_std::Integer> x = std::make_shared<ls_std::Integer>(13);
+    ls_std::SerializableJSONInteger serializable {x};
+    ASSERT_TRUE(serializable.getValue() == x);
+
+    x = std::make_shared<ls_std::Integer>(25);
+    serializable.setValue(x);
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
 }

+ 19 - 1
test/cases/serialization/json/boxing/SerializableJSONLongTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-26
- * Changed:         2020-10-29
+ * Changed:         2020-11-26
  *
  * */
 
@@ -40,4 +40,22 @@ namespace {
 
     ASSERT_EQ(1989, *x);
   }
+
+  TEST_F(SerializableJSONLongTest, getValue)
+  {
+    std::shared_ptr<ls_std::Long> x = std::make_shared<ls_std::Long>(31983771009271);
+    ls_std::SerializableJSONLong serializable {x};
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
+
+  TEST_F(SerializableJSONLongTest, setValue)
+  {
+    std::shared_ptr<ls_std::Long> x = std::make_shared<ls_std::Long>(31983771009271);
+    ls_std::SerializableJSONLong serializable {x};
+    ASSERT_TRUE(serializable.getValue() == x);
+
+    x = std::make_shared<ls_std::Long>(31983771009221);
+    serializable.setValue(x);
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
 }

+ 19 - 1
test/cases/serialization/json/boxing/SerializableJSONStringTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-30
- * Changed:         2020-10-29
+ * Changed:         2020-11-26
  *
  * */
 
@@ -40,4 +40,22 @@ namespace {
 
     ASSERT_STREQ("Ups!", *x);
   }
+
+  TEST_F(SerializableJSONStringTest, getValue)
+  {
+    std::shared_ptr<ls_std::String> x = std::make_shared<ls_std::String>("Hello!");
+    ls_std::SerializableJSONString serializable {x};
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
+
+  TEST_F(SerializableJSONStringTest, setValue)
+  {
+    std::shared_ptr<ls_std::String> x = std::make_shared<ls_std::String>("Hello!");
+    ls_std::SerializableJSONString serializable {x};
+    ASSERT_TRUE(serializable.getValue() == x);
+
+    x = std::make_shared<ls_std::String>("Hello again!");
+    serializable.setValue(x);
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
 }

+ 8 - 1
test/cases/serialization/json/logic/SerializableJSONStateConnectionTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-14
- * Changed:         2020-10-29
+ * Changed:         2020-11-26
  *
  * */
 
@@ -47,6 +47,13 @@ namespace {
     ASSERT_TRUE(x->isPassable());
   }
 
+  TEST_F(SerializableJSONStateConnectionTest, getValue)
+  {
+    std::shared_ptr<ls_std::StateConnection> x = std::make_shared<ls_std::StateConnection>("AB", "B");
+    ls_std::SerializableJSONStateConnection serializable {x};
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
+
   TEST_F(SerializableJSONStateConnectionTest, setValue)
   {
     ls_std::StateConnection x {"AB", "B"};

+ 19 - 1
test/cases/serialization/json/logic/SerializableJSONStateMachineTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-17
- * Changed:         2020-10-29
+ * Changed:         2020-11-26
  *
  * */
 
@@ -97,4 +97,22 @@ namespace {
     ASSERT_STREQ("E", state->getId().c_str());
     ASSERT_TRUE(state->getConnectedStates().empty());
   }
+
+  TEST_F(SerializableJSONStateMachineTest, getValue)
+  {
+    std::shared_ptr<ls_std::StateMachine> x = std::make_shared<ls_std::StateMachine>("bla");
+    ls_std::SerializableJSONStateMachine serializable {x};
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
+
+  TEST_F(SerializableJSONStateMachineTest, setValue)
+  {
+    std::shared_ptr<ls_std::StateMachine> x = std::make_shared<ls_std::StateMachine>("bla");
+    ls_std::SerializableJSONStateMachine serializable {x};
+    ASSERT_TRUE(serializable.getValue() == x);
+
+    x = std::make_shared<ls_std::StateMachine>("bla2");
+    serializable.setValue(x);
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
 }

+ 8 - 1
test/cases/serialization/json/logic/SerializableJSONStateTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-15
- * Changed:         2020-10-29
+ * Changed:         2020-11-26
  *
  * */
 
@@ -57,6 +57,13 @@ namespace {
     ASSERT_STREQ("B", x->getConnectedStates().at("AB")->getStateId().c_str());
   }
 
+  TEST_F(SerializableJSONStateTest, getValue)
+  {
+    std::shared_ptr<ls_std::State> x = std::make_shared<ls_std::State>("A");
+    ls_std::SerializableJSONState serializable {x};
+    ASSERT_TRUE(serializable.getValue() == x);
+  }
+
   TEST_F(SerializableJSONStateTest, setValue)
   {
     std::shared_ptr<ls_std::State> x = std::make_shared<ls_std::State>("A");