From a1d9f108cf87cc1164343d79bd982ac89cdb59fc Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 24 Nov 2019 13:29:42 +0100 Subject: Fill out hierarchy (#31) --- .../pl/edu/mimuw/cloudatlas/interpreter/Main.java | 81 ++++++++-------------- 1 file changed, 27 insertions(+), 54 deletions(-) (limited to 'src/main/java/pl/edu') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/interpreter/Main.java b/src/main/java/pl/edu/mimuw/cloudatlas/interpreter/Main.java index 4d54bb3..f91f25e 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/interpreter/Main.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/interpreter/Main.java @@ -97,6 +97,7 @@ public class Main { })); } + /* Hierarchy for file tests */ public static ZMI createTestHierarchy() throws ParseException, UnknownHostException { ValueContact violet07Contact = createContact("/uw/violet07", (byte)10, (byte)1, (byte)1, (byte)10); ValueContact khaki13Contact = createContact("/uw/khaki13", (byte)10, (byte)1, (byte)1, (byte)38); @@ -252,40 +253,40 @@ public class Main { return root; } + /* Hierarchy for assignemnt */ public static ZMI createTestHierarchy2() throws ParseException, UnknownHostException { + // UW1A ValueContact violet07Contact = createContact("/uw/violet07", (byte)10, (byte)1, (byte)1, (byte)10); + // UW1B ValueContact khaki13Contact = createContact("/uw/khaki13", (byte)10, (byte)1, (byte)1, (byte)38); + // UW1C ValueContact khaki31Contact = createContact("/uw/khaki31", (byte)10, (byte)1, (byte)1, (byte)39); - ValueContact whatever01Contact = createContact("/uw/whatever01", (byte)82, (byte)111, (byte)52, (byte)56); - ValueContact whatever02Contact = createContact("/uw/whatever02", (byte)82, (byte)111, (byte)52, (byte)57); + // UW2A + ValueContact violet08Contact = createContact("/uw/violet08", (byte)10, (byte)1, (byte)2, (byte)10); + // UW3A + ValueContact khaki14Contact = createContact("/uw/khaki14", (byte)10, (byte)1, (byte)2, (byte)38); + // UW3B + ValueContact khaki32Contact = createContact("/uw/khaki32", (byte)10, (byte)1, (byte)2, (byte)39); + // PJ2 + ValueContact whatever01Contact = createContact("/pjwstk/whatever01", (byte)82, (byte)111, (byte)52, (byte)56); + // PJ1 + ValueContact whatever02Contact = createContact("/pjwstk/whatever02", (byte)82, (byte)111, (byte)52, (byte)57); List list; ZMI root = new ZMI(); root.getAttributes().add("level", new ValueInt(0l)); root.getAttributes().add("name", new ValueString(null)); - // root.getAttributes().add("owner", new ValueString("/uw/violet07")); - // root.getAttributes().add("timestamp", new ValueTime("2012/11/09 20:10:17.342")); - // root.getAttributes().add("contacts", new ValueSet(TypePrimitive.CONTACT)); - // root.getAttributes().add("cardinality", new ValueInt(0l)); ZMI uw = new ZMI(root); root.addSon(uw); uw.getAttributes().add("level", new ValueInt(1l)); uw.getAttributes().add("name", new ValueString("uw")); - // uw.getAttributes().add("owner", new ValueString("/uw/violet07")); - // uw.getAttributes().add("timestamp", new ValueTime("2012/11/09 20:8:13.123")); - // uw.getAttributes().add("contacts", new ValueSet(TypePrimitive.CONTACT)); - // uw.getAttributes().add("cardinality", new ValueInt(0l)); ZMI pjwstk = new ZMI(root); root.addSon(pjwstk); pjwstk.getAttributes().add("level", new ValueInt(1l)); pjwstk.getAttributes().add("name", new ValueString("pjwstk")); - // pjwstk.getAttributes().add("owner", new ValueString("/pjwstk/whatever01")); - // pjwstk.getAttributes().add("timestamp", new ValueTime("2012/11/09 20:8:13.123")); - // pjwstk.getAttributes().add("contacts", new ValueSet(TypePrimitive.CONTACT)); - // pjwstk.getAttributes().add("cardinality", new ValueInt(0l)); ZMI violet07 = new ZMI(uw); uw.addSon(violet07); @@ -293,21 +294,15 @@ public class Main { violet07.getAttributes().add("name", new ValueString("violet07")); violet07.getAttributes().add("owner", new ValueString("/uw/violet07")); violet07.getAttributes().add("timestamp", new ValueTime("2012/11/09 18:00:00.000")); - // TODO: ogarnąć co tu powinno być - /* list = Arrays.asList(new Value[] { - khaki31Contact, whatever01Contact + violet07Contact, khaki31Contact, khaki13Contact }); violet07.getAttributes().add("contacts", new ValueSet(new HashSet(list), TypePrimitive.CONTACT)); - */ violet07.getAttributes().add("cardinality", new ValueInt(1l)); - // TODO: ogarnąć co tu powinno być - /* list = Arrays.asList(new Value[] { - violet07Contact, + violet07Contact, khaki13Contact, khaki31Contact }); violet07.getAttributes().add("members", new ValueSet(new HashSet(list), TypePrimitive.CONTACT)); - */ violet07.getAttributes().add("creation", new ValueTime("2011/11/09 20:8:13.123")); violet07.getAttributes().add("cpu_usage", new ValueDouble(0.9)); violet07.getAttributes().add("num_cores", new ValueInt(3l)); @@ -325,21 +320,15 @@ public class Main { khaki31.getAttributes().add("name", new ValueString("khaki31")); khaki31.getAttributes().add("owner", new ValueString("/uw/khaki31")); khaki31.getAttributes().add("timestamp", new ValueTime("2012/11/09 20:03:00.000")); - // TODO: ogarnąć co tu powinno być - /* list = Arrays.asList(new Value[] { - violet07Contact, whatever02Contact, + violet08Contact }); khaki31.getAttributes().add("contacts", new ValueSet(new HashSet(list), TypePrimitive.CONTACT)); - */ khaki31.getAttributes().add("cardinality", new ValueInt(1l)); - // TODO: ogarnąć co tu powinno być - /* list = Arrays.asList(new Value[] { - khaki31Contact + violet08Contact }); khaki31.getAttributes().add("members", new ValueSet(new HashSet(list), TypePrimitive.CONTACT)); - */ khaki31.getAttributes().add("creation", new ValueTime("2011/11/09 20:12:13.123")); khaki31.getAttributes().add("cpu_usage", new ValueDouble(null)); khaki31.getAttributes().add("num_cores", new ValueInt(3l)); @@ -357,19 +346,15 @@ public class Main { khaki13.getAttributes().add("name", new ValueString("khaki13")); khaki13.getAttributes().add("owner", new ValueString("/uw/khaki13")); khaki13.getAttributes().add("timestamp", new ValueTime("2012/11/09 21:03:00.000")); - // TODO: ogarnąć co tu powinno być - /* - list = Arrays.asList(new Value[] {}); + list = Arrays.asList(new Value[] { + khaki14Contact, khaki32Contact + }); khaki13.getAttributes().add("contacts", new ValueSet(new HashSet(list), TypePrimitive.CONTACT)); - */ khaki13.getAttributes().add("cardinality", new ValueInt(1l)); - // TODO: ogarnąć co tu powinno być - /* list = Arrays.asList(new Value[] { - khaki13Contact, + khaki32Contact, }); khaki13.getAttributes().add("members", new ValueSet(new HashSet(list), TypePrimitive.CONTACT)); - */ khaki13.getAttributes().add("creation", new ValueTime((Long)null)); khaki13.getAttributes().add("cpu_usage", new ValueDouble(0.1)); khaki13.getAttributes().add("num_cores", new ValueInt(null)); @@ -385,21 +370,15 @@ public class Main { whatever01.getAttributes().add("name", new ValueString("whatever01")); whatever01.getAttributes().add("owner", new ValueString("/pjwstk/whatever01")); whatever01.getAttributes().add("timestamp", new ValueTime("2012/11/09 21:12:00.000")); - // TODO: ogarnąć co tu powinno być - /* list = Arrays.asList(new Value[] { - violet07Contact, whatever02Contact, + whatever02Contact, }); whatever01.getAttributes().add("contacts", new ValueSet(new HashSet(list), TypePrimitive.CONTACT)); - */ whatever01.getAttributes().add("cardinality", new ValueInt(1l)); - // TODO: ogarnąć co tu powinno być - /* list = Arrays.asList(new Value[] { - whatever01Contact, + whatever02Contact, }); whatever01.getAttributes().add("members", new ValueSet(new HashSet(list), TypePrimitive.CONTACT)); - */ whatever01.getAttributes().add("creation", new ValueTime("2012/10/18 07:03:00.000")); whatever01.getAttributes().add("cpu_usage", new ValueDouble(0.1)); whatever01.getAttributes().add("num_cores", new ValueInt(7l)); @@ -415,21 +394,15 @@ public class Main { whatever02.getAttributes().add("name", new ValueString("whatever02")); whatever02.getAttributes().add("owner", new ValueString("/pjwstk/whatever02")); whatever02.getAttributes().add("timestamp", new ValueTime("2012/11/09 21:13:00.000")); - // TODO: ogarnąć co tu powinno być - /* list = Arrays.asList(new Value[] { - khaki31Contact, whatever01Contact, + whatever01Contact, }); whatever02.getAttributes().add("contacts", new ValueSet(new HashSet(list), TypePrimitive.CONTACT)); - */ whatever02.getAttributes().add("cardinality", new ValueInt(1l)); - // TODO: ogarnąć co tu powinno być - /* list = Arrays.asList(new Value[] { - whatever02Contact, + whatever01Contact, }); whatever02.getAttributes().add("members", new ValueSet(new HashSet(list), TypePrimitive.CONTACT)); - */ whatever02.getAttributes().add("creation", new ValueTime("2012/10/18 07:04:00.000")); whatever02.getAttributes().add("cpu_usage", new ValueDouble(0.4)); whatever02.getAttributes().add("num_cores", new ValueInt(13l)); -- cgit v1.2.3