Common classes unit tests.
Change-Id: I2e7071fdfccf359615876469657ab1a5c69953a9
Signed-off-by: anjiaqi1234567 <454737320@qq.com>
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/ActionName.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ActionName.java
new file mode 100644
index 0000000..f188c3f
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ActionName.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A name for an action.
+ */
+public class ActionName extends Name implements Serializable {
+ private static final long serialVersionUID = -8113271547363610328L;
+
+ /**
+ * Creates a new instance from a given name.
+ *
+ * @param value name
+ */
+ @ConstructorProperties("value")
+ public ActionName(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from a given name object.
+ *
+ * @param source name object
+ */
+ public ActionName(Name source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConditionParameterName.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConditionParameterName.java
new file mode 100644
index 0000000..ebcb370
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConditionParameterName.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A name for a parameter of condition.
+ */
+public class ConditionParameterName extends Name implements Serializable {
+ private static final long serialVersionUID = -7024856711436959445L;
+
+ /**
+ * Creates a new instance from a given name.
+ *
+ * @param value name
+ */
+ @ConstructorProperties("value")
+ public ConditionParameterName(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from a given name object.
+ *
+ * @param source name object
+ */
+ public ConditionParameterName(Name source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConditionSegmentId.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConditionSegmentId.java
new file mode 100644
index 0000000..114f7d4
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConditionSegmentId.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A unique ID for a segment of the condition in an operation.
+ */
+public class ConditionSegmentId extends UniqueId implements Serializable {
+ private static final long serialVersionUID = 729651151678557840L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public ConditionSegmentId(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from unique id object
+ *
+ * @param source unique id object
+ */
+ public ConditionSegmentId(UniqueId source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConnectionId.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConnectionId.java
new file mode 100644
index 0000000..9eb3c60
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConnectionId.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A unique ID for a connection.
+ */
+public class ConnectionId extends ObjectId implements Serializable {
+ private static final long serialVersionUID = -3422573026026783750L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public ConnectionId(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from object id.
+ *
+ * @param source object id
+ */
+ public ConnectionId(ObjectId source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConnectionName.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConnectionName.java
new file mode 100644
index 0000000..6f5aaba
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConnectionName.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A name for a connection instance.
+ */
+public class ConnectionName extends ObjectName
+ implements Serializable {
+ private static final long serialVersionUID = 7484493113230980623L;
+
+ /**
+ * Creates a new instance from a value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public ConnectionName(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from object id.
+ *
+ * @param source object name
+ */
+ public ConnectionName(ObjectName source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConnectionType.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConnectionType.java
new file mode 100644
index 0000000..b9e5c36
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConnectionType.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * The type for a connection.
+ */
+public class ConnectionType extends Name implements Serializable {
+ private static final long serialVersionUID = -1633568961291764490L;
+
+ /**
+ * Creates a new instance from a given name.
+ *
+ * @param value name
+ */
+ @ConstructorProperties("value")
+ public ConnectionType(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from a given name object.
+ *
+ * @param source name object
+ */
+ public ConnectionType(Name source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConstraintParameterName.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConstraintParameterName.java
new file mode 100644
index 0000000..7ee271f
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConstraintParameterName.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A name for a parameter of constraint.
+ */
+public class ConstraintParameterName extends Name implements Serializable {
+ private static final long serialVersionUID = -3411701192703793928L;
+
+ /**
+ * Creates a new instance from a given name.
+ *
+ * @param value name
+ */
+ @ConstructorProperties("value")
+ public ConstraintParameterName(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from a given name object.
+ *
+ * @param source name object
+ */
+ public ConstraintParameterName(Name source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConstraintSegmentId.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConstraintSegmentId.java
new file mode 100644
index 0000000..d200d45
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ConstraintSegmentId.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A unique ID for a segment of the constraint in an operation.
+ */
+public class ConstraintSegmentId extends UniqueId implements Serializable {
+ private static final long serialVersionUID = 4718770940490631506L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public ConstraintSegmentId(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from unique id.
+ *
+ * @param source unique id
+ */
+ public ConstraintSegmentId(UniqueId source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/Description.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/Description.java
new file mode 100644
index 0000000..af8e4e6
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/Description.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+import java.util.Objects;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * A human-readable description for an object.
+ */
+public class Description implements Serializable {
+ private static final long serialVersionUID = -9180190277220190973L;
+
+ // package-private for unit test access
+ static final int MIN_LENGTH = 1;
+ static final int MAX_LENGTH = 4096;
+
+ static String E_BAD_LENGTH = "Invalid length: %d, expected: [[" +
+ MIN_LENGTH + "‥" + MAX_LENGTH + "]].";
+
+ private final String value;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public Description(String value) {
+ checkNotNull(value, "Supplied value may not be null");
+ checkvalueLength(value);
+ this.value = value;
+ }
+
+ /**
+ * Creates a copy of the given description.
+ *
+ * @param source description to copy
+ */
+ public Description(Description source) {
+ this.value = source.value;
+ }
+
+ /**
+ * Returns the value of this instance.
+ *
+ * @return value the value of this instance
+ */
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public int hashCode() {
+ return value.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Description other = (Description) obj;
+ return Objects.equals(value, other.value);
+ }
+
+ @Override
+ public String toString() {
+ return toStringHelper(this).add("value", value).toString();
+ }
+
+ private static void checkvalueLength(String value) {
+ int length = value.length();
+ if (length < MIN_LENGTH || length > MAX_LENGTH) {
+ throw new IllegalArgumentException(String.format(E_BAD_LENGTH, length));
+ }
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/FlowId.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/FlowId.java
new file mode 100644
index 0000000..e00ee2e
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/FlowId.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A unique ID for a flow.
+ */
+public class FlowId extends ObjectId implements Serializable {
+ private static final long serialVersionUID = 6318718481188171943L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public FlowId(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from object id.
+ *
+ * @param source object id
+ */
+ public FlowId(ObjectId source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/FlowName.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/FlowName.java
new file mode 100644
index 0000000..cf4f4ba
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/FlowName.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A name for a flow instance.
+ */
+public class FlowName extends ObjectName implements Serializable {
+ private static final long serialVersionUID = 8567250024305751275L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public FlowName(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from object name.
+ *
+ * @param source object name
+ */
+ public FlowName(ObjectName source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/FlowType.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/FlowType.java
new file mode 100644
index 0000000..b891f93
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/FlowType.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * The type for a flow.
+ */
+public class FlowType extends Name implements Serializable {
+ private static final long serialVersionUID = -7883133472864967183L;
+
+ /**
+ * Creates a new instance from a given name.
+ *
+ * @param value name
+ */
+ @ConstructorProperties("value")
+ public FlowType(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from name object.
+ *
+ * @param source name object
+ */
+ public FlowType(Name source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/IntentId.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/IntentId.java
new file mode 100644
index 0000000..27de433
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/IntentId.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A unique ID for an intent.
+ */
+public class IntentId extends UniqueId implements Serializable {
+ private static final long serialVersionUID = -2583336103863621041L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public IntentId(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from unique id.
+ *
+ * @param source unique id
+ */
+ public IntentId(UniqueId source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/MatchItemName.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/MatchItemName.java
new file mode 100644
index 0000000..4848908
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/MatchItemName.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A name for a match item.
+ */
+public class MatchItemName extends Name implements Serializable {
+ private static final long serialVersionUID = -1751105424030929383L;
+
+ /**
+ * Creates a new instance from a given name.
+ *
+ * @param value name
+ */
+ @ConstructorProperties("value")
+ public MatchItemName(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from name object.
+ *
+ * @param source name object
+ */
+ public MatchItemName(Name source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/Name.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/Name.java
new file mode 100644
index 0000000..4727a82
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/Name.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+import java.util.Objects;
+import java.util.regex.Pattern;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * A generic string name type. Names must start with a letter.
+ */
+public class Name implements Serializable {
+ private static final long serialVersionUID = -1664832583906649664L;
+
+ // package-private for unit test access
+ static final int MIN_LENGTH = 1;
+ static final int MAX_LENGTH = 256;
+
+ static final String E_NULL_VALUE = "Supplied value may not be null";
+ static final String E_BAD_FORMAT =
+ "Supplied value \"%s\" does not match required pattern \"%s\"";
+ static String E_BAD_LENGTH = "Invalid length: %d, expected: [[" +
+ MIN_LENGTH + "‥" + MAX_LENGTH + "]].";
+
+ static final String NAME_PATTERN = "^[a-zA-Z]([a-zA-Z0-9\\-_.])*$";
+
+ private static final Pattern RE_NAME = Pattern.compile(NAME_PATTERN);
+
+ private final String value;
+
+ /**
+ * Creates a new instance from a given name.
+ *
+ * @param value name
+ */
+ @ConstructorProperties("value")
+ public Name(String value) {
+ checkNotNull(value, E_NULL_VALUE);
+ checkValueLength(value);
+ checkArgument(RE_NAME.matcher(value).matches(),
+ E_BAD_FORMAT, value, NAME_PATTERN);
+ this.value = value;
+ }
+
+ /**
+ * Creates a copy from the given name object.
+ *
+ * @param source name object
+ */
+ public Name(Name source) {
+ this.value = source.value;
+ }
+
+ /**
+ * Returns the value of this instance.
+ *
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public int hashCode() {
+ return value.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Name other = (Name) obj;
+ return Objects.equals(value, other.value);
+ }
+
+ private static void checkValueLength(String value) {
+ int length = value.length();
+ if (length < MIN_LENGTH || length > MAX_LENGTH) {
+ throw new IllegalArgumentException(String.format(E_BAD_LENGTH, length));
+ }
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/NodeId.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/NodeId.java
new file mode 100644
index 0000000..b3cc279
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/NodeId.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A unique ID for a node.
+ */
+public class NodeId extends ObjectId implements Serializable {
+ private static final long serialVersionUID = 1905618053033346106L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public NodeId(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from object id.
+ *
+ * @param source object id
+ */
+ public NodeId(ObjectId source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/NodeName.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/NodeName.java
new file mode 100644
index 0000000..a6963e7
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/NodeName.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A name for a node instance.
+ */
+public class NodeName extends ObjectName implements Serializable {
+ private static final long serialVersionUID = -6179698948999651772L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public NodeName(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from object name.
+ *
+ * @param source object name
+ */
+ public NodeName(ObjectName source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/NodeType.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/NodeType.java
new file mode 100644
index 0000000..2eaef57
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/NodeType.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * The type for a node.
+ */
+public class NodeType extends Name implements Serializable {
+ private static final long serialVersionUID = -4834692648659489687L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public NodeType(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from name object.
+ *
+ * @param source name object
+ */
+ public NodeType(Name source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/ObjectId.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ObjectId.java
new file mode 100644
index 0000000..664fdd9
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ObjectId.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A unique ID for a parameterized object.
+ */
+public class ObjectId extends UniqueId implements Serializable {
+ private static final long serialVersionUID = -3348451476910517417L;
+
+ /**
+ * Creates a new instance from a given VALUE.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public ObjectId(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from a given unique id.
+ *
+ * @param source given unique id
+ */
+ public ObjectId(UniqueId source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/ObjectName.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ObjectName.java
new file mode 100644
index 0000000..f252c27
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ObjectName.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A name for a parameterized object
+ */
+public class ObjectName extends Name implements Serializable {
+ private static final long serialVersionUID = 1155594167838375452L;
+
+ /**
+ * Creates a new instance from a given name.
+ *
+ * @param value name
+ */
+ @ConstructorProperties("value")
+ public ObjectName(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from name object.
+ *
+ * @param source name object
+ */
+ public ObjectName(Name source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/OperationId.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/OperationId.java
new file mode 100644
index 0000000..9005b25
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/OperationId.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+
+/**
+ * A unique ID for an operation.
+ */
+public class OperationId extends UniqueId implements Serializable {
+ private static final long serialVersionUID = -8706161668186525977L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public OperationId(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from unique id.
+ *
+ * @param source unique id
+ */
+ public OperationId(UniqueId source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/OperationName.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/OperationName.java
new file mode 100644
index 0000000..9587c48
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/OperationName.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A name for an operation.
+ */
+public class OperationName extends Name implements Serializable {
+ private static final long serialVersionUID = 749648415346390830L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public OperationName(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from name object.
+ *
+ * @param source name object
+ */
+ public OperationName(Name source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/ParameterName.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ParameterName.java
new file mode 100644
index 0000000..0ec1212
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/ParameterName.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A name for a parameter.
+ */
+public class ParameterName extends Name implements Serializable {
+ private static final long serialVersionUID = -787280682246659993L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public ParameterName(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from name object.
+ *
+ * @param source name object
+ */
+ public ParameterName(Name source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/PropertyName.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/PropertyName.java
new file mode 100644
index 0000000..dbb3b13
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/PropertyName.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A name for a property.
+ */
+public class PropertyName extends Name implements Serializable {
+ private static final long serialVersionUID = 1540323919833101464L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public PropertyName(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from name object.
+ *
+ * @param source name object
+ */
+ public PropertyName(Name source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/UniqueId.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/UniqueId.java
new file mode 100644
index 0000000..47c3226
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/UniqueId.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A globally unique identifier.
+ */
+public class UniqueId extends Uuid implements Serializable {
+ private static final long serialVersionUID = 8559147438073776914L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public UniqueId(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from unique id.
+ *
+ * @param source unique id
+ */
+ public UniqueId(Uuid source) {
+ super(source);
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/UserId.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/UserId.java
new file mode 100644
index 0000000..bb0594b
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/UserId.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A unique ID for a user.
+ */
+public class UserId extends UniqueId implements Serializable {
+ private static final long serialVersionUID = -7751516509943191510L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public UserId(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from unique id.
+ *
+ * @param source unique id
+ */
+ public UserId(UniqueId source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/UserName.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/UserName.java
new file mode 100644
index 0000000..8066ee8
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/UserName.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A name for a user.
+ */
+public class UserName extends Name implements Serializable {
+ private static final long serialVersionUID = -147651729946234978L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public UserName(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from name object.
+ *
+ * @param source name object
+ */
+ public UserName(Name source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/UserPassword.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/UserPassword.java
new file mode 100644
index 0000000..0022cf3
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/UserPassword.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A password for a user.
+ */
+public class UserPassword extends Name implements Serializable {
+ private static final long serialVersionUID = 3000688972514429473L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public UserPassword(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from name object.
+ *
+ * @param source name object
+ */
+ public UserPassword(Name source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/UserRoleDescription.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/UserRoleDescription.java
new file mode 100644
index 0000000..b44c689
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/UserRoleDescription.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * Description of the role characteristic and responsibility range.
+ */
+public class UserRoleDescription extends Description implements Serializable {
+ private static final long serialVersionUID = -2660734679397346998L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public UserRoleDescription(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a copy from the given description object.
+ *
+ * @param source description object
+ */
+ public UserRoleDescription(Description source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/UserRoleName.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/UserRoleName.java
new file mode 100644
index 0000000..39348d7
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/UserRoleName.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+
+/**
+ * A role name for a user.
+ */
+public class UserRoleName extends Name implements Serializable {
+ private static final long serialVersionUID = 9218242620936394800L;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value the value
+ */
+ @ConstructorProperties("value")
+ public UserRoleName(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new instance from name object.
+ *
+ * @param source name object
+ */
+ public UserRoleName(Name source) {
+ super(source);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/Uuid.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/Uuid.java
new file mode 100644
index 0000000..69df13f
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/Uuid.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import java.beans.ConstructorProperties;
+import java.io.Serializable;
+import java.util.Objects;
+import java.util.regex.Pattern;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * A universally unique identifier (UUID).
+ * The string representation is as defined in RFC 4122.
+ * The canonical representation uses lower case characters.
+ * <p>
+ * The following is an example UUID:
+ * <pre>
+ * f81d4fae-7dec-11d0-a765-00a0c91e6bf6
+ * </pre>
+ */
+public class Uuid implements Serializable {
+ private static final long serialVersionUID = -6700962668564346825L;
+
+ // package private for unit test access
+ static final String E_BAD_FORMAT =
+ "Supplied value \"%s\" does not match required pattern \"%s\"";
+ static final String UUID_PATTERN = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-" +
+ "[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$";
+
+ private static final Pattern RE_UUID = Pattern.compile(UUID_PATTERN);
+
+
+ private final String value;
+
+ /**
+ * Creates a new instance from a given value.
+ *
+ * @param value value
+ */
+ @ConstructorProperties("value")
+ public Uuid(String value) {
+ checkNotNull(value, "Supplied value may not be null");
+ checkArgument(RE_UUID.matcher(value).matches(),
+ E_BAD_FORMAT, value, UUID_PATTERN);
+ this.value = value;
+ }
+
+ /**
+ * Creates a copy from the given universally unique identifier.
+ *
+ * @param source universally unique id
+ */
+ public Uuid(Uuid source) {
+ this.value = source.value;
+ }
+
+ /**
+ * Returns the value of this instance.
+ *
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public int hashCode() {
+ return value.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Uuid other = (Uuid) obj;
+ return Objects.equals(value, other.value);
+ }
+}
+
diff --git a/nemoengine/src/main/java/org/onosproject/nemo/model/common/package-info.java b/nemoengine/src/main/java/org/onosproject/nemo/model/common/package-info.java
new file mode 100644
index 0000000..bade066
--- /dev/null
+++ b/nemoengine/src/main/java/org/onosproject/nemo/model/common/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Common classes for NEMO model.
+ */
+package org.onosproject.nemo.model.common;
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/AbstractCommonTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/AbstractCommonTest.java
new file mode 100644
index 0000000..780c4cc
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/AbstractCommonTest.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+/**
+ * Base class for unit tests.
+ */
+abstract class AbstractCommonTest {
+
+ static final String E_NOEX = "no exception thrown";
+ static final String E_UNEX = "unexpected exception thrown";
+ static final String E_WREX = "wrong exception message";
+ static final String COLON = " : ";
+
+}
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/ActionNameTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ActionNameTest.java
new file mode 100644
index 0000000..1d09efa
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ActionNameTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link ActionName}.
+ */
+public class ActionNameTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private ActionName name;
+ private ActionName copy;
+ private ActionName diff;
+
+ @Test
+ public void fromString() {
+ name = new ActionName(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new ActionName(NAME);
+ copy = new ActionName(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new ActionName(NAME);
+ copy = new ActionName(NAME);
+ diff = new ActionName(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConditionParameterNameTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConditionParameterNameTest.java
new file mode 100644
index 0000000..2df9c5d
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConditionParameterNameTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link ConditionParameterName}.
+ */
+public class ConditionParameterNameTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private ConditionParameterName name;
+ private ConditionParameterName copy;
+ private ConditionParameterName diff;
+
+ @Test
+ public void fromString() {
+ name = new ConditionParameterName(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new ConditionParameterName(NAME);
+ copy = new ConditionParameterName(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new ConditionParameterName(NAME);
+ copy = new ConditionParameterName(NAME);
+ diff = new ConditionParameterName(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConditionSegmentIdTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConditionSegmentIdTest.java
new file mode 100644
index 0000000..b134f3a
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConditionSegmentIdTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link ConditionSegmentId}.
+ */
+public class ConditionSegmentIdTest {
+
+ private static final String ID =
+ "14ce424a-3e50-4a2a-ad5c-b29845158c8b";
+ private static final String OTHER_ID =
+ "a4ce424a-3e50-4a2a-ad5c-b29845158c8b";
+
+ private ConditionSegmentId id;
+ private ConditionSegmentId copy;
+ private ConditionSegmentId diff;
+
+ @Test
+ public void fromString() {
+ id = new ConditionSegmentId(ID);
+ assertEquals("id not set", ID, id.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ id = new ConditionSegmentId(ID);
+ copy = new ConditionSegmentId(id);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ id = new ConditionSegmentId(ID);
+ copy = new ConditionSegmentId(ID);
+ diff = new ConditionSegmentId(OTHER_ID);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConnectionIdTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConnectionIdTest.java
new file mode 100644
index 0000000..bc56fb7
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConnectionIdTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link ConnectionId}.
+ */
+public class ConnectionIdTest {
+
+ private static final String ID =
+ "14ce424a-3e50-4a2a-ad5c-b29845158c8b";
+ private static final String OTHER_ID =
+ "a4ce424a-3e50-4a2a-ad5c-b29845158c8b";
+
+ private ConnectionId id;
+ private ConnectionId copy;
+ private ConnectionId diff;
+
+ @Test
+ public void fromString() {
+ id = new ConnectionId(ID);
+ assertEquals("id not set", ID, id.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ id = new ConnectionId(ID);
+ copy = new ConnectionId(id);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ id = new ConnectionId(ID);
+ copy = new ConnectionId(ID);
+ diff = new ConnectionId(OTHER_ID);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConnectionNameTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConnectionNameTest.java
new file mode 100644
index 0000000..18c8f06
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConnectionNameTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link ConnectionName}.
+ */
+public class ConnectionNameTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private ConnectionName name;
+ private ConnectionName copy;
+ private ConnectionName diff;
+
+ @Test
+ public void fromString() {
+ name = new ConnectionName(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new ConnectionName(NAME);
+ copy = new ConnectionName(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new ConnectionName(NAME);
+ copy = new ConnectionName(NAME);
+ diff = new ConnectionName(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConnectionTypeTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConnectionTypeTest.java
new file mode 100644
index 0000000..7e4e0ee
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConnectionTypeTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link ConnectionType}.
+ */
+public class ConnectionTypeTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private ConnectionType name;
+ private ConnectionType copy;
+ private ConnectionType diff;
+
+ @Test
+ public void fromString() {
+ name = new ConnectionType(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new ConnectionType(NAME);
+ copy = new ConnectionType(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new ConnectionType(NAME);
+ copy = new ConnectionType(NAME);
+ diff = new ConnectionType(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConstraintParameterNameTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConstraintParameterNameTest.java
new file mode 100644
index 0000000..9fae39f
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConstraintParameterNameTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link ConstraintParameterName}.
+ */
+public class ConstraintParameterNameTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private ConstraintParameterName name;
+ private ConstraintParameterName copy;
+ private ConstraintParameterName diff;
+
+ @Test
+ public void fromString() {
+ name = new ConstraintParameterName(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new ConstraintParameterName(NAME);
+ copy = new ConstraintParameterName(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new ConstraintParameterName(NAME);
+ copy = new ConstraintParameterName(NAME);
+ diff = new ConstraintParameterName(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConstraintSegmentIdTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConstraintSegmentIdTest.java
new file mode 100644
index 0000000..d8ecf2c
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ConstraintSegmentIdTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link ConstraintSegmentId}.
+ */
+public class ConstraintSegmentIdTest {
+
+ private static final String ID =
+ "14ce424a-3e50-4a2a-ad5c-b29845158c8b";
+ private static final String OTHER_ID =
+ "a4ce424a-3e50-4a2a-ad5c-b29845158c8b";
+
+ private ConstraintSegmentId id;
+ private ConstraintSegmentId copy;
+ private ConstraintSegmentId diff;
+
+ @Test
+ public void fromString() {
+ id = new ConstraintSegmentId(ID);
+ assertEquals("id not set", ID, id.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ id = new ConstraintSegmentId(ID);
+ copy = new ConstraintSegmentId(id);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ id = new ConstraintSegmentId(ID);
+ copy = new ConstraintSegmentId(ID);
+ diff = new ConstraintSegmentId(OTHER_ID);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/DescriptionTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/DescriptionTest.java
new file mode 100644
index 0000000..50518cf
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/DescriptionTest.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import static org.onosproject.nemo.model.common.Description.E_BAD_LENGTH;
+import static org.onosproject.nemo.model.common.Description.MAX_LENGTH;
+import static org.onosproject.nemo.model.common.Description.MIN_LENGTH;
+
+/**
+ * Unit tests for {@link Description}.
+ */
+public class DescriptionTest extends AbstractCommonTest {
+
+ private static final String DESC = "SomeDescription";
+ private static final String OTHER = "OtherDescription";
+
+ private static final int TOO_FEW = MIN_LENGTH - 1;
+ private static final int TOO_MANY = MAX_LENGTH + 1;
+
+ private static final String EXP_TOO_SMALL = String.format(E_BAD_LENGTH, TOO_FEW);
+ private static final String EXP_TOO_LONG = String.format(E_BAD_LENGTH, TOO_MANY);
+
+ private Description desc;
+ private Description copy;
+ private Description diff;
+
+ @Test(expected = NullPointerException.class)
+ public void constructWithNullString() {
+ new Description((String) null);
+ }
+
+ @Test
+ public void fromString() {
+ desc = new Description(DESC);
+ assertEquals("description not set", DESC, desc.getValue());
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void copyConstructWithNull() {
+ new Description((Description) null);
+ }
+
+ @Test
+ public void copyConstructor() {
+ desc = new Description(DESC);
+ copy = new Description(desc);
+ new EqualsTester()
+ .addEqualityGroup(desc, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void nameTooSmall() {
+ try {
+ desc = new Description("");
+ fail(E_NOEX);
+ } catch (IllegalArgumentException e) {
+ assertEquals(E_WREX, EXP_TOO_SMALL, e.getMessage());
+ }
+ }
+
+ @Test
+ public void nameTooLong() {
+ try {
+ StringBuilder temp = new StringBuilder();
+ for (int i = 0; i < TOO_MANY; i++) {
+ temp.append("a");
+ }
+ desc = new Description(temp.toString());
+ fail(E_NOEX);
+ } catch (IllegalArgumentException e) {
+ assertEquals(E_WREX, EXP_TOO_LONG, e.getMessage());
+ }
+ }
+
+ @Test
+ public void equality() {
+ desc = new Description(DESC);
+ copy = new Description(DESC);
+ diff = new Description(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(desc, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/FlowIdTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/FlowIdTest.java
new file mode 100644
index 0000000..a430ab9
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/FlowIdTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link FlowId}.
+ */
+public class FlowIdTest {
+
+ private static final String ID = "14ce424a-3e50-4a2a-ad5c-b29845158c8b";
+ private static final String OTHER_ID = "a4ce424a-3e50-4a2a-ad5c-b29845158c8b";
+
+ private FlowId id;
+ private FlowId copy;
+ private FlowId diff;
+
+ @Test
+ public void fromString() {
+ id = new FlowId(ID);
+ assertEquals("id not set", ID, id.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ id = new FlowId(ID);
+ copy = new FlowId(id);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ id = new FlowId(ID);
+ copy = new FlowId(ID);
+ diff = new FlowId(OTHER_ID);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/FlowNameTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/FlowNameTest.java
new file mode 100644
index 0000000..6eff50c
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/FlowNameTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link FlowName}.
+ */
+public class FlowNameTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private FlowName name;
+ private FlowName copy;
+ private FlowName diff;
+
+ @Test
+ public void fromString() {
+ name = new FlowName(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new FlowName(NAME);
+ copy = new FlowName(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new FlowName(NAME);
+ copy = new FlowName(NAME);
+ diff = new FlowName(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/FlowTypeTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/FlowTypeTest.java
new file mode 100644
index 0000000..9100942
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/FlowTypeTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link FlowType}.
+ */
+public class FlowTypeTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private FlowType name;
+ private FlowType copy;
+ private FlowType diff;
+
+ @Test
+ public void fromString() {
+ name = new FlowType(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new FlowType(NAME);
+ copy = new FlowType(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new FlowType(NAME);
+ copy = new FlowType(NAME);
+ diff = new FlowType(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/IntentIdTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/IntentIdTest.java
new file mode 100644
index 0000000..d08e8f6
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/IntentIdTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link IntentId}.
+ */
+public class IntentIdTest {
+
+ private static final String ID =
+ "14ce424a-3e50-4a2a-ad5c-b29845158c8b";
+ private static final String OTHER_ID =
+ "a4ce424a-3e50-4a2a-ad5c-b29845158c8b";
+
+ private IntentId id;
+ private IntentId copy;
+ private IntentId diff;
+
+ @Test
+ public void fromString() {
+ id = new IntentId(ID);
+ assertEquals("id not set", ID, id.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ id = new IntentId(ID);
+ copy = new IntentId(id);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ id = new IntentId(ID);
+ copy = new IntentId(ID);
+ diff = new IntentId(OTHER_ID);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/MatchItemNameTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/MatchItemNameTest.java
new file mode 100644
index 0000000..cf9824c
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/MatchItemNameTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link MatchItemName}.
+ */
+public class MatchItemNameTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private MatchItemName name;
+ private MatchItemName copy;
+ private MatchItemName diff;
+
+ @Test
+ public void fromString() {
+ name = new MatchItemName(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new MatchItemName(NAME);
+ copy = new MatchItemName(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new MatchItemName(NAME);
+ copy = new MatchItemName(NAME);
+ diff = new MatchItemName(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/NameTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/NameTest.java
new file mode 100644
index 0000000..f4f0b72
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/NameTest.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import static org.onosproject.nemo.model.common.Name.E_BAD_FORMAT;
+import static org.onosproject.nemo.model.common.Name.E_BAD_LENGTH;
+import static org.onosproject.nemo.model.common.Name.MAX_LENGTH;
+import static org.onosproject.nemo.model.common.Name.MIN_LENGTH;
+import static org.onosproject.nemo.model.common.Name.NAME_PATTERN;
+
+/**
+ * Unit tests for {@link Name}.
+ */
+public class NameTest extends AbstractCommonTest {
+
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private static final String[] BAD_STRINGS = {
+ "%..",
+ "123"
+ };
+ private static final String[] GOOD_STRINGS = {
+ "test",
+ "test1",
+ "test123"
+ };
+
+ private static final int TOO_FEW = MIN_LENGTH - 1;
+ private static final int TOO_MANY = MAX_LENGTH + 1;
+
+ private static final String EXP_TOO_SMALL = String.format(E_BAD_LENGTH, TOO_FEW);
+ private static final String EXP_TOO_LONG = String.format(E_BAD_LENGTH, TOO_MANY);
+
+ private Name name;
+ private Name copy;
+ private Name diff;
+
+ @Test
+ public void fromString() {
+ name = new Name(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new Name(NAME);
+ copy = new Name(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void constructWithNullString() {
+ new Name((String) null);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void copyConstructWithNull() {
+ new Name((Name) null);
+ }
+
+ @Test
+ public void nameTooSmall() {
+ try {
+ name = new Name("");
+ fail(E_NOEX);
+ } catch (IllegalArgumentException e) {
+ assertEquals(E_WREX, EXP_TOO_SMALL, e.getMessage());
+ }
+ }
+
+ @Test
+ public void nameTooLong() {
+ try {
+ StringBuilder temp = new StringBuilder();
+ for (int i = 0; i < (MAX_LENGTH + 1); i++) {
+ temp.append("a");
+ }
+ name = new Name(temp.toString());
+ fail(E_NOEX);
+ } catch (IllegalArgumentException e) {
+ assertEquals(E_WREX, EXP_TOO_LONG, e.getMessage());
+ }
+ }
+
+ @Test
+ public void nameNotMatch() {
+ for (String s : BAD_STRINGS) {
+ try {
+ new Name(s);
+ fail(E_NOEX + COLON + s);
+ } catch (IllegalArgumentException e) {
+ assertEquals(E_WREX, String.format(E_BAD_FORMAT, s,
+ NAME_PATTERN), e.getMessage());
+ }
+ }
+ }
+
+ @Test
+ public void nameMatch() {
+ for (String s : GOOD_STRINGS) {
+ try {
+ new Name(s);
+ } catch (IllegalArgumentException e) {
+ fail(E_UNEX + COLON + s);
+ }
+ }
+ }
+
+ @Test
+ public void equality() {
+ name = new Name(NAME);
+ copy = new Name(NAME);
+ diff = new Name(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/NodeIdTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/NodeIdTest.java
new file mode 100644
index 0000000..8eaf2d9
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/NodeIdTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link NodeId}.
+ */
+public class NodeIdTest {
+
+ private static final String ID =
+ "14ce424a-3e50-4a2a-ad5c-b29845158c8b";
+ private static final String OTHER_ID =
+ "a4ce424a-3e50-4a2a-ad5c-b29845158c8b";
+
+ private NodeId id;
+ private NodeId copy;
+ private NodeId diff;
+
+ @Test
+ public void fromString() {
+ id = new NodeId(ID);
+ assertEquals("id not set", ID, id.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ id = new NodeId(ID);
+ copy = new NodeId(id);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ id = new NodeId(ID);
+ copy = new NodeId(ID);
+ diff = new NodeId(OTHER_ID);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/NodeNameTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/NodeNameTest.java
new file mode 100644
index 0000000..a19b911
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/NodeNameTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link NodeName}.
+ */
+public class NodeNameTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private NodeName name;
+ private NodeName copy;
+ private NodeName diff;
+
+ @Test
+ public void fromString() {
+ name = new NodeName(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new NodeName(NAME);
+ copy = new NodeName(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new NodeName(NAME);
+ copy = new NodeName(NAME);
+ diff = new NodeName(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/NodeTypeTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/NodeTypeTest.java
new file mode 100644
index 0000000..383260b
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/NodeTypeTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link NodeType}.
+ */
+public class NodeTypeTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private NodeType name;
+ private NodeType copy;
+ private NodeType diff;
+
+ @Test
+ public void fromString() {
+ name = new NodeType(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new NodeType(NAME);
+ copy = new NodeType(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new NodeType(NAME);
+ copy = new NodeType(NAME);
+ diff = new NodeType(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/ObjectIdTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ObjectIdTest.java
new file mode 100644
index 0000000..935d57a
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ObjectIdTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link ObjectId}.
+ */
+public class ObjectIdTest {
+
+ private static final String ID =
+ "14ce424a-3e50-4a2a-ad5c-b29845158c8b";
+ private static final String OTHERID =
+ "a4ce424a-3e50-4a2a-ad5c-b29845158c8b";
+
+ private ObjectId id;
+ private ObjectId copy;
+ private ObjectId diff;
+
+ @Test
+ public void fromString() {
+ id = new ObjectId(ID);
+ assertEquals("name not set", ID, id.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ id = new ObjectId(ID);
+ copy = new ObjectId(id);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ id = new ObjectId(ID);
+ copy = new ObjectId(ID);
+ diff = new ObjectId(OTHERID);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/ObjectNameTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ObjectNameTest.java
new file mode 100644
index 0000000..3873586
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ObjectNameTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link ObjectName}.
+ */
+public class ObjectNameTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private ObjectName name;
+ private ObjectName copy;
+ private ObjectName diff;
+
+ @Test
+ public void fromString() {
+ name = new ObjectName(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new ObjectName(NAME);
+ copy = new ObjectName(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new ObjectName(NAME);
+ copy = new ObjectName(NAME);
+ diff = new ObjectName(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/OperationIdTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/OperationIdTest.java
new file mode 100644
index 0000000..3382a84
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/OperationIdTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link OperationId}.
+ */
+public class OperationIdTest {
+
+ private static final String ID =
+ "14ce424a-3e50-4a2a-ad5c-b29845158c8b";
+ private static final String OTHER_ID =
+ "a4ce424a-3e50-4a2a-ad5c-b29845158c8b";
+
+ private OperationId id;
+ private OperationId copy;
+ private OperationId diff;
+
+ @Test
+ public void fromString() {
+ id = new OperationId(ID);
+ assertEquals("id not set", ID, id.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ id = new OperationId(ID);
+ copy = new OperationId(id);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ id = new OperationId(ID);
+ copy = new OperationId(ID);
+ diff = new OperationId(OTHER_ID);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/OperationNameTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/OperationNameTest.java
new file mode 100644
index 0000000..0364a9e
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/OperationNameTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link OperationName}.
+ */
+public class OperationNameTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private OperationName name;
+ private OperationName copy;
+ private OperationName diff;
+
+ @Test
+ public void fromString() {
+ name = new OperationName(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new OperationName(NAME);
+ copy = new OperationName(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new OperationName(NAME);
+ copy = new OperationName(NAME);
+ diff = new OperationName(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/ParameterNameTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ParameterNameTest.java
new file mode 100644
index 0000000..e24ff32
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/ParameterNameTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link ParameterName}.
+ */
+public class ParameterNameTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private ParameterName name;
+ private ParameterName copy;
+ private ParameterName diff;
+
+ @Test
+ public void fromString() {
+ name = new ParameterName(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new ParameterName(NAME);
+ copy = new ParameterName(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new ParameterName(NAME);
+ copy = new ParameterName(NAME);
+ diff = new ParameterName(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/PropertyNameTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/PropertyNameTest.java
new file mode 100644
index 0000000..56a3321
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/PropertyNameTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link PropertyName}.
+ */
+public class PropertyNameTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private PropertyName name;
+ private PropertyName copy;
+ private PropertyName diff;
+
+ @Test
+ public void fromString() {
+ name = new PropertyName(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new PropertyName(NAME);
+ copy = new PropertyName(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new PropertyName(NAME);
+ copy = new PropertyName(NAME);
+ diff = new PropertyName(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/UniqueIdTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/UniqueIdTest.java
new file mode 100644
index 0000000..df04489
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/UniqueIdTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link UniqueId}.
+ */
+public class UniqueIdTest {
+
+ private static final String ID =
+ "14ce424a-3e50-4a2a-ad5c-b29845158c8b";
+ private static final String OTHER_ID =
+ "a4ce424a-3e50-4a2a-ad5c-b29845158c8b";
+
+ private UniqueId id;
+ private UniqueId copy;
+ private UniqueId diff;
+
+ @Test
+ public void fromString() {
+ id = new UniqueId(ID);
+ assertEquals("id not set", ID, id.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ id = new UniqueId(ID);
+ copy = new UniqueId(id);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ id = new UniqueId(ID);
+ copy = new UniqueId(ID);
+ diff = new UniqueId(OTHER_ID);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/UserIdTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/UserIdTest.java
new file mode 100644
index 0000000..31ba234
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/UserIdTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link UserId}.
+ */
+public class UserIdTest {
+
+ private static final String ID =
+ "14ce424a-3e50-4a2a-ad5c-b29845158c8b";
+ private static final String OTHERID =
+ "a4ce424a-3e50-4a2a-ad5c-b29845158c8b";
+
+ private UserId id;
+ private UserId copy;
+ private UserId diff;
+
+ @Test
+ public void fromString() {
+ id = new UserId(ID);
+ assertEquals("name not set", ID, id.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ id = new UserId(ID);
+ copy = new UserId(id);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ id = new UserId(ID);
+ copy = new UserId(ID);
+ diff = new UserId(OTHERID);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/UserNameTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/UserNameTest.java
new file mode 100644
index 0000000..3815553
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/UserNameTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link UserName}.
+ */
+public class UserNameTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private UserName name;
+ private UserName copy;
+ private UserName diff;
+
+ @Test
+ public void fromString() {
+ name = new UserName(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new UserName(NAME);
+ copy = new UserName(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new UserName(NAME);
+ copy = new UserName(NAME);
+ diff = new UserName(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/UserPasswordTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/UserPasswordTest.java
new file mode 100644
index 0000000..990633d
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/UserPasswordTest.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link UserPassword}.
+ */
+public class UserPasswordTest {
+
+ private static final String PASS = "SomePass";
+ private static final String OTHER = "OtherPass";
+
+ private UserPassword password;
+ private UserPassword copy;
+ private UserPassword diff;
+
+ @Test
+ public void fromString() {
+ password = new UserPassword(PASS);
+ assertEquals("name not set", PASS,
+ password.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ password = new UserPassword(PASS);
+ copy = new UserPassword(password);
+ new EqualsTester()
+ .addEqualityGroup(password, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ password = new UserPassword(PASS);
+ copy = new UserPassword(PASS);
+ diff = new UserPassword(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(password, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/UserRoleDescriptionTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/UserRoleDescriptionTest.java
new file mode 100644
index 0000000..2045440
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/UserRoleDescriptionTest.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link UserRoleDescription}.
+ */
+public class UserRoleDescriptionTest {
+
+ private static final String Description =
+ "SomeDescription";
+ private static final String OTHER =
+ "OtherDescription";
+
+ private UserRoleDescription description;
+ private UserRoleDescription copy;
+ private UserRoleDescription diff;
+
+ @Test
+ public void fromString() {
+ description = new UserRoleDescription(Description);
+ assertEquals("description not set", Description,
+ description.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ description = new UserRoleDescription(Description);
+ copy = new UserRoleDescription(description);
+ new EqualsTester()
+ .addEqualityGroup(description, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ description = new UserRoleDescription(Description);
+ copy = new UserRoleDescription(Description);
+ diff = new UserRoleDescription(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(description, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/UserRoleNameTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/UserRoleNameTest.java
new file mode 100644
index 0000000..f01a7d1
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/UserRoleNameTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Unit tests for {@link UserRoleName}.
+ */
+public class UserRoleNameTest {
+
+ private static final String NAME = "SomeName";
+ private static final String OTHER = "OtherName";
+
+ private UserRoleName name;
+ private UserRoleName copy;
+ private UserRoleName diff;
+
+ @Test
+ public void fromString() {
+ name = new UserRoleName(NAME);
+ assertEquals("name not set", NAME, name.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ name = new UserRoleName(NAME);
+ copy = new UserRoleName(name);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .testEquals();
+ }
+
+ @Test
+ public void equality() {
+ name = new UserRoleName(NAME);
+ copy = new UserRoleName(NAME);
+ diff = new UserRoleName(OTHER);
+ new EqualsTester()
+ .addEqualityGroup(name, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file
diff --git a/nemoengine/src/test/java/org/onosproject/nemo/model/common/UuidTest.java b/nemoengine/src/test/java/org/onosproject/nemo/model/common/UuidTest.java
new file mode 100644
index 0000000..434f235
--- /dev/null
+++ b/nemoengine/src/test/java/org/onosproject/nemo/model/common/UuidTest.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.nemo.model.common;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Test;
+
+import java.util.regex.Pattern;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import static org.onosproject.nemo.model.common.Uuid.E_BAD_FORMAT;
+import static org.onosproject.nemo.model.common.Uuid.UUID_PATTERN;
+
+/**
+ * Unit tests for {@link Uuid}.
+ */
+public class UuidTest extends AbstractCommonTest {
+
+ private static final String ID = "14ce424a-3e50-4a2a-ad5c-b29845158c8b";
+ private static final String OTHER_ID = "a4ce424a-3e50-4a2a-ad5c-b29845158c8b";
+
+ private static final String[] BAD_STRINGS = {
+ "%..",
+ "123",
+ "s4ce424a-3e50-4a2a-ad5c-b29845158c8b",
+ "s4ce424a-3e50-4a2a-ad5c-b29845158c8basdf----"
+ };
+ private static final String[] GOOD_STRINGS = {
+ "14ce424a-3e50-4a2a-ad5c-b29845158c8b",
+ "a4ce424a-3e50-4a2a-bd5c-b29845158c8c",
+ "F3AC116A-4E82-4A2A-AD5C-B29845158C8B"
+ };
+
+ private static final Pattern RE_UUID = Pattern.compile(UUID_PATTERN);
+
+ private Uuid id;
+ private Uuid copy;
+ private Uuid diff;
+
+ @Test
+ public void fromString() {
+ id = new Uuid(ID);
+ assertEquals("id not set", ID, id.getValue());
+ }
+
+ @Test
+ public void copyConstructor() {
+ id = new Uuid(ID);
+ copy = new Uuid(id);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .testEquals();
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void constructWithNullString() {
+ new Uuid((String) null);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void copyConstructWithNull() {
+ new Uuid((Uuid) null);
+ }
+
+ @Test
+ public void idNotMatch() {
+ for (String s : BAD_STRINGS) {
+ try {
+ new Uuid(s);
+ fail(E_NOEX + COLON + s);
+ } catch (IllegalArgumentException e) {
+ assertEquals(E_WREX, String.format(E_BAD_FORMAT, s, UUID_PATTERN),
+ e.getMessage());
+ }
+ }
+ }
+
+ @Test
+ public void idMatch() {
+ for (String s : GOOD_STRINGS) {
+ try {
+ new Uuid(s);
+ } catch (IllegalArgumentException e) {
+ fail(E_UNEX + COLON + s);
+ }
+ }
+ }
+
+ @Test
+ public void equality() {
+ id = new Uuid(ID);
+ copy = new Uuid(ID);
+ diff = new Uuid(OTHER_ID);
+ new EqualsTester()
+ .addEqualityGroup(id, copy)
+ .addEqualityGroup(diff)
+ .testEquals();
+ }
+}
\ No newline at end of file