summaryrefslogtreecommitdiffstats
path: root/archiva-modules/metadata/metadata-model/src
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2014-03-26 12:16:02 +0000
committerOlivier Lamy <olamy@apache.org>2014-03-26 12:16:02 +0000
commitacc72428047d54ba43f802d457afb4f5d10f9c88 (patch)
tree3f6ecac23c8122f989ea695136fb845fdb4d21c1 /archiva-modules/metadata/metadata-model/src
parent24a6d8419c45178a9d2d8ca959f8fd120bcadfd5 (diff)
downloadarchiva-acc72428047d54ba43f802d457afb4f5d10f9c88.tar.gz
archiva-acc72428047d54ba43f802d457afb4f5d10f9c88.zip
add unit test for method getProjectReferences
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1581807 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/metadata/metadata-model/src')
-rw-r--r--archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionReference.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionReference.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionReference.java
index 5dd4b902b..f5a491c78 100644
--- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionReference.java
+++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionReference.java
@@ -29,6 +29,20 @@ public class ProjectVersionReference
private String projectVersion;
+ public ProjectVersionReference()
+ {
+ // no op
+ }
+
+ public ProjectVersionReference( ReferenceType referenceType, String projectId, String namespace,
+ String projectVersion )
+ {
+ this.referenceType = referenceType;
+ this.projectId = projectId;
+ this.namespace = namespace;
+ this.projectVersion = projectVersion;
+ }
+
public void setReferenceType( ReferenceType referenceType )
{
this.referenceType = referenceType;
@@ -74,4 +88,48 @@ public class ProjectVersionReference
DEPENDENCY,
PARENT
}
+
+ @Override
+ public boolean equals( Object o )
+ {
+ if ( this == o )
+ {
+ return true;
+ }
+ if ( o == null || getClass() != o.getClass() )
+ {
+ return false;
+ }
+
+ ProjectVersionReference that = (ProjectVersionReference) o;
+
+ if ( !namespace.equals( that.namespace ) )
+ {
+ return false;
+ }
+ if ( !projectId.equals( that.projectId ) )
+ {
+ return false;
+ }
+ if ( !projectVersion.equals( that.projectVersion ) )
+ {
+ return false;
+ }
+ if ( referenceType != that.referenceType )
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = referenceType.hashCode();
+ result = 31 * result + projectId.hashCode();
+ result = 31 * result + namespace.hashCode();
+ result = 31 * result + projectVersion.hashCode();
+ return result;
+ }
}