package model;

import org.junit.Test;

import model.architecture.Architecture;
import model.architecture.link.LogicalLink;
import model.architecture.node.ComputationalNode;
import model.architecture.node.ComputationalOffer;

public class TestArchitecture {

	@Test 
	public void normal() {
		Architecture arc = new Architecture("Sample Grid Architecture");
		
		ComputationalNode node1 = new ComputationalNode(1, "sensor1", new ComputationalOffer(1, 1, 1.0));
		ComputationalNode node2 = new ComputationalNode(2, "station2", new ComputationalOffer(1, 1, 1.0));
		ComputationalNode node3 = new ComputationalNode(3, "station3", new ComputationalOffer(1, 1, 1.0));
		ComputationalNode node4 = new ComputationalNode(4, "datacenter", new ComputationalOffer(1, 1, 1.0));

		arc.addVertex(node1);
		arc.addVertex(node2);
		arc.addVertex(node3);
		arc.addVertex(node4);		
		
		arc.addEdge(new LogicalLink(1.0, 1.0, 1.0), node1, node2);
		arc.addEdge(new LogicalLink(1.0, 1.0, 1.0), node1, node3);
		arc.addEdge(new LogicalLink(1.0, 1.0, 1.0), node2, node4);
		arc.addEdge(new LogicalLink(1.0, 1.0, 1.0), node3, node4);
		
		System.out.println(arc);
	}
	
}

@@ -165,65 +165,10 @@
 onal
-Node;%0Aimport model.architecture.node.ComputationalOffer
 ;%0A
+
 %0Apub
@@ -310,28 +310,24 @@
 omputational
-Node
  node1 = new
@@ -340,20 +340,16 @@
 tational
-Node
 (1, %22sen
@@ -355,39 +355,16 @@
 nsor1%22, 
-new ComputationalOffer(
 1, 1, 1.
@@ -357,33 +357,32 @@
 or1%22, 1, 1, 1.0)
-)
 ;%0A%09%09Computationa
@@ -378,28 +378,24 @@
 omputational
-Node
  node2 = new
@@ -408,20 +408,16 @@
 tational
-Node
 (2, %22sta
@@ -424,39 +424,16 @@
 tion2%22, 
-new ComputationalOffer(
 1, 1, 1.
@@ -426,33 +426,32 @@
 on2%22, 1, 1, 1.0)
-)
 ;%0A%09%09Computationa
@@ -447,28 +447,24 @@
 omputational
-Node
  node3 = new
@@ -477,20 +477,16 @@
 tational
-Node
 (3, %22sta
@@ -493,39 +493,16 @@
 tion3%22, 
-new ComputationalOffer(
 1, 1, 1.
@@ -503,17 +503,16 @@
  1, 1.0)
-)
 ;%0A%09%09Comp
@@ -520,20 +520,16 @@
 tational
-Node
  node4 =
@@ -550,12 +550,8 @@
 onal
-Node
 (4, 
@@ -568,31 +568,8 @@
 r%22, 
-new ComputationalOffer(
 1, 1
@@ -574,17 +574,16 @@
  1, 1.0)
-)
 ;%0A%0A%09%09arc

Test architecture creation