Commit 80e4323f authored by Rita Sousa's avatar Rita Sousa

Added some tests for the integration with nfrtool-comms

parent 8923a65b
......@@ -117,11 +117,29 @@ public class NFRTool {
ElasticSystem system = new ElasticSystem();
// App A definition:
String name = "AppA";
String uuid = "A";
final int monitoringPeriod = 1;
String infoNature = "delaySensitive";
COMPSsApplication appA = new COMPSsApplication(name, uuid, monitoringPeriod);
appA.setInfoNature(infoNature);
// App B definition:
name = "AppB";
uuid = "B";
infoNature = "TCPservices";
COMPSsApplication appB = new COMPSsApplication(name, uuid, monitoringPeriod);
appB.setInfoNature(infoNature);
// Create application
int monitoringPeriod = 5000;
/*int monitoringPeriod = 5000;
COMPSsApplication app = new COMPSsApplication(applicationName, "1.0", monitoringPeriod);
system.addApplication(app);
*/
// Create node1 and persist it
String nodeName = "xavier-rit";
float signalWifi = (float) 0.0;
......@@ -130,6 +148,59 @@ public class NFRTool {
node1.makePersistent(nodeName);
system.addNode(node1);
//
// Node 2 definition:
nodeName = "xavier-ric";
ipWifi = "182.168.137.179";
ipLte = "172.10.0.4";
ipEth = "192.168.60.65"; // TODO: check value
cpuThreshold = 0;
energyThreshold = 0;
signalWifi = -30;
numCores = 8;
Node node2 = new Node(ipWifi, ipEth, ipLte, cpuThreshold, energyThreshold, signalWifi, numCores);
node2.makePersistent(nodeName);
// Worker 1A definition:
final int pid1A = 32145;
final boolean active1A = true;
final float cpuUsage1A = 0;
final float energyUsage1A = 0;
final int computingUnits1A = 4;
final float communicationCost1A = 0;
// Worker 2A definition:
final int pid2A = 32147;
final boolean active2A = true;
final float cpuUsage2A = 0;
final float energyUsage2A = 0;
final int computingUnits2A = 4;
final float communicationCost2A = 0;
Worker worker2A = new Worker(node2, pid2A, active2A, appA, cpuUsage2A, energyUsage2A, computingUnits2A, node2.getIpEth(),
communicationCost2A, new ArrayList<>());
// Attach worker to Node and COMPSsApplication
//node2.addWorker(worker2A);
appA.addWorker(worker2A);
// Worker 2B definition:
final int pid2B = 32148;
final boolean active2B = true;
final float cpuUsage2B = 0;
final float energyUsage2B = 0;
final int computingUnits2B = 4;
final float communicationCost2B = 0;
Worker worker2B = new Worker(node2, pid2B, active2B, appB, cpuUsage2B, energyUsage2B, computingUnits2B, node2.getIpEth(),
communicationCost2B, new ArrayList<>());
// Attach worker to Node and COMPSsApplication
//node2.addWorker(worker2B);
appB.addWorker(worker2B);
// Get node by alias
Node node = Node.getByAlias(nodeName);
......@@ -141,7 +212,7 @@ public class NFRTool {
// Set master of application
app.setMaster(master);
addWorkersToSystem(node, app, localIP);
addWorkersToSystem(node, appA, localIP);
// TODO: After finalizing the system, insert the Workers creation here including
// adding them to the application
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment