From 8bcdb6bff6e685b930a24080338b95b949153143 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 25 Mar 2014 11:18:10 +0000 Subject: [PATCH] add some toString for debugging purpose and avoid hard coded values to prevent test failures git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1581292 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva/metadata/model/CiManagement.java | 9 +++++++++ .../metadata/model/IssueManagement.java | 8 ++++++++ .../archiva/metadata/model/MailingList.java | 13 ++++++++++++ .../archiva/metadata/model/Organization.java | 9 +++++++++ .../model/ProjectVersionMetadata.java | 19 ++++++++++++++++++ .../apache/archiva/metadata/model/Scm.java | 10 ++++++++++ .../DefaultCassandraArchivaManager.java | 4 ++-- .../CassandraMetadataRepositoryTest.java | 20 +++++++------------ 8 files changed, 77 insertions(+), 15 deletions(-) diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/CiManagement.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/CiManagement.java index 27f87c860..18705d209 100644 --- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/CiManagement.java +++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/CiManagement.java @@ -72,4 +72,13 @@ public class CiManagement { this.system = system; } + + @Override + public String toString() + { + return "CiManagement{" + + "system='" + system + '\'' + + ", url='" + url + '\'' + + '}'; + } } diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/IssueManagement.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/IssueManagement.java index 214b1c666..c84af362a 100644 --- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/IssueManagement.java +++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/IssueManagement.java @@ -72,4 +72,12 @@ public class IssueManagement this.system = system; } + @Override + public String toString() + { + return "IssueManagement{" + + "system='" + system + '\'' + + ", url='" + url + '\'' + + '}'; + } } diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/MailingList.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/MailingList.java index 1e56af847..0297ebf8b 100644 --- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/MailingList.java +++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/MailingList.java @@ -121,4 +121,17 @@ public class MailingList { return name; } + + @Override + public String toString() + { + return "MailingList{" + + "mainArchiveUrl='" + mainArchiveUrl + '\'' + + ", otherArchives=" + otherArchives + + ", name='" + name + '\'' + + ", postAddress='" + postAddress + '\'' + + ", subscribeAddress='" + subscribeAddress + '\'' + + ", unsubscribeAddress='" + unsubscribeAddress + '\'' + + '}'; + } } diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/Organization.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/Organization.java index 932c2f667..d59cc8491 100644 --- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/Organization.java +++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/Organization.java @@ -60,4 +60,13 @@ public class Organization { this.name = name; } + + @Override + public String toString() + { + return "Organization{" + + "name='" + name + '\'' + + ", url='" + url + '\'' + + '}'; + } } diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java index 015c10d05..9fad3857e 100644 --- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java +++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java @@ -193,4 +193,23 @@ public class ProjectVersionMetadata { this.incomplete = incomplete; } + + @Override + public String toString() + { + return "ProjectVersionMetadata{" + + "id='" + id + '\'' + + ", url='" + url + '\'' + + ", name='" + name + '\'' + + ", description='" + description + '\'' + + ", organization=" + organization + + ", issueManagement=" + issueManagement + + ", scm=" + scm + + ", ciManagement=" + ciManagement + + ", licenses=" + licenses + + ", mailingLists=" + mailingLists + + ", dependencies=" + dependencies + + ", incomplete=" + incomplete + + '}'; + } } diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/Scm.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/Scm.java index 9751d89e0..a091860c7 100644 --- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/Scm.java +++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/Scm.java @@ -73,4 +73,14 @@ public class Scm { this.connection = connection; } + + @Override + public String toString() + { + return "Scm{" + + "connection='" + connection + '\'' + + ", developerConnection='" + developerConnection + '\'' + + ", url='" + url + '\'' + + '}'; + } } diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java index c18885c6f..b8eedac79 100644 --- a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java +++ b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java @@ -77,9 +77,9 @@ public class DefaultCassandraArchivaManager private String projectVersionMetadataFamilyName = "projectversionmetadata"; - private String artifactMetadataFamilyName = "artifactmetadatamodel"; + private String artifactMetadataFamilyName = "artifactmetadata"; - private String metadataFacetFamilyName = "metadatafacetmodel"; + private String metadataFacetFamilyName = "metadatafacet"; private String mailingListFamilyName = "mailinglist"; diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java b/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java index 275c09545..2e96177d6 100644 --- a/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java +++ b/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java @@ -30,9 +30,6 @@ import org.slf4j.LoggerFactory; import javax.inject.Inject; import javax.inject.Named; import java.io.File; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; import java.util.Map; /** @@ -82,26 +79,23 @@ public class CassandraMetadataRepositoryTest throws Exception { cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(), - "project" ); + cassandraArchivaManager.getProjectFamilyName() ); cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(), - "namespace" ); + cassandraArchivaManager.getNamespaceFamilyName() ); cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(), - "repository" ); + cassandraArchivaManager.getRepositoryFamilyName() ); cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(), - "projectversionmetadatamodel" ); + cassandraArchivaManager.getProjectVersionMetadataFamilyName() ); cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(), - "artifactmetadatamodel" ); + cassandraArchivaManager.getArtifactMetadataFamilyName() ); cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(), - "metadatafacetmodel" ); + cassandraArchivaManager.getMetadataFacetFamilyName() ); cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(), - "metadatafacetmodel" ); - - cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(), - "mailinglist" ); + cassandraArchivaManager.getMailingListFamilyName() ); } -- 2.39.5