package gseproject.serialization.robot.test;

import gseproject.serialization.robot.test.RobotStateContract;
import gseproject.infrastructure.serialization.SerializationController;
import gseproject.robot.domain.TransportSkillBusinessObject;
import gseproject.robot.interaction.AbstractActuator;
import gseproject.robot.interaction.AbstractSensor;
import gseproject.serialization.robot.test.RobotStateReader;
import gseproject.serialization.robot.test.RobotStateWriter;
import jade.core.Agent;

public class RobotAgent extends Agent {

    private AbstractActuator _actuator;
    private AbstractSensor _sensor;
    private final SerializationController serializationController;

    public RobotAgent() {
	serializationController = SerializationController.Instance;
	SerializatorsInitialization();
	robotStateContract_Serialization_Test();
	transportSkillBO_Serialization_Test();
    }

    private void robotStateContract_Serialization_Test() {
	RobotStateContract rtcA = new RobotStateContract();
	rtcA.isCarryingBlock = true;
	rtcA.position = 65f;
	rtcA.by = 127;
	rtcA.sh = 1000;
	rtcA.intt = 13999;
	rtcA.lng = 789456;
	rtcA.dbl = 10.001;
	rtcA.ch = 'G';
	String str = serializationController.Serialize(rtcA);
	RobotStateContract rtcB = serializationController.Deserialize(RobotStateContract.class, str);
	System.out.println("_____________________________");
	System.out.println(rtcB.isCarryingBlock);
	System.out.println(rtcB.position);
	System.out.println(rtcB.by);
	System.out.println(rtcB.sh);
	System.out.println(rtcB.intt);
	System.out.println(rtcB.lng);
	System.out.println(rtcB.dbl);
	System.out.println(rtcB.ch);
    }

    private void transportSkillBO_Serialization_Test() {
	TransportSkillBusinessObject tsbo = new TransportSkillBusinessObject();
	System.out.println("Expected: " + tsbo.toString());
	String str = serializationController.Serialize(tsbo);
	System.out.println("serialized: " + str);
	TransportSkillBusinessObject tsbo2 =  serializationController.Deserialize(TransportSkillBusinessObject.class, str);
	System.out.println("Actual: " + tsbo2.toString());
    }

    private void SerializatorsInitialization() {

	// RobotStateWriter
	RobotStateWriter writer = new RobotStateWriter();
	RobotStateReader reader = new RobotStateReader();
	serializationController.RegisterSerializator(RobotStateContract.class, writer, reader);

    }

    public void setup() {

    }
}

@@ -43,71 +43,8 @@
 t;%0A%0A
-import gseproject.serialization.robot.test.RobotStateContract;%0A
 impo
@@ -115,69 +115,8 @@
 er;%0A
-import gseproject.robot.domain.TransportSkillBusinessObject;%0A
 impo
@@ -221,130 +221,8 @@
 or;%0A
-import gseproject.serialization.robot.test.RobotStateReader;%0Aimport gseproject.serialization.robot.test.RobotStateWriter;%0A
 impo
@@ -592,48 +592,8 @@
 ();%0A
-%09transportSkillBO_Serialization_Test();%0A
     
@@ -1346,465 +1346,8 @@
  %7D%0A%0A
-    private void transportSkillBO_Serialization_Test() %7B%0A%09TransportSkillBusinessObject tsbo = new TransportSkillBusinessObject();%0A%09System.out.println(%22Expected: %22 + tsbo.toString());%0A%09String str = serializationController.Serialize(tsbo);%0A%09System.out.println(%22serialized: %22 + str);%0A%09TransportSkillBusinessObject tsbo2 =  serializationController.Deserialize(TransportSkillBusinessObject.class, str);%0A%09System.out.println(%22Actual: %22 + tsbo2.toString());%0A    %7D%0A%0A
     

Test files: imports fixes