aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2009-12-10 01:34:45 +0000
committerBrett Porter <brett@apache.org>2009-12-10 01:34:45 +0000
commitb8848967637d13de40292b620bfadb0c7f3aa17d (patch)
tree76eff442a3271891f1db6fcdeadff866dd19b4a0
parentdb5b5be329dcdf54553d16436dc7343fd49f3e6f (diff)
downloadarchiva-b8848967637d13de40292b620bfadb0c7f3aa17d.tar.gz
archiva-b8848967637d13de40292b620bfadb0c7f3aa17d.zip
[MRM-1025] remove constraint that is no longer used
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@889053 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsRelatedConstraint.java51
-rw-r--r--archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsRelatedConstraintTest.java90
2 files changed, 0 insertions, 141 deletions
diff --git a/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsRelatedConstraint.java b/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsRelatedConstraint.java
deleted file mode 100644
index 619c49c7b..000000000
--- a/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsRelatedConstraint.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.apache.maven.archiva.database.constraints;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-import org.apache.maven.archiva.database.Constraint;
-
-/**
- * ArtifactsRelatedConstraint
- *
- * @version $Id$
- */
-public class ArtifactsRelatedConstraint
- extends AbstractDeclarativeConstraint
- implements Constraint
-{
- private String whereClause;
-
- public ArtifactsRelatedConstraint( String groupId, String artifactId, String version )
- {
- whereClause = "groupId.equals(selectedGroupId) && artifactId.equals(selectedArtifactId) && version.equals(selectedVersion)";
- declParams = new String[] { "String selectedGroupId", "String selectedArtifactId", "String selectedVersion" };
- params = new Object[] { groupId, artifactId, version };
- }
-
- public String getSortColumn()
- {
- return "classifier";
- }
-
- public String getWhereCondition()
- {
- return whereClause;
- }
-}
diff --git a/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsRelatedConstraintTest.java b/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsRelatedConstraintTest.java
deleted file mode 100644
index fc4de5b26..000000000
--- a/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsRelatedConstraintTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.apache.maven.archiva.database.constraints;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-import org.apache.maven.archiva.database.AbstractArchivaDatabaseTestCase;
-import org.apache.maven.archiva.database.ArchivaDAO;
-import org.apache.maven.archiva.database.ArtifactDAO;
-import org.apache.maven.archiva.database.Constraint;
-import org.apache.maven.archiva.model.ArchivaArtifact;
-
-import java.util.Calendar;
-import java.util.List;
-
-/**
- * ArtifactsRelatedConstraintTest
- *
- * @version $Id$
- */
-public class ArtifactsRelatedConstraintTest
- extends AbstractArchivaDatabaseTestCase
-{
- private static final String TEST_GROUPID = "org.apache.maven.archiva.test";
- private ArtifactDAO artifactDao;
-
- protected void setUp()
- throws Exception
- {
- super.setUp();
-
- ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" );
- artifactDao = dao.getArtifactDAO();
- }
-
- public ArchivaArtifact createArtifact( String artifactId, String version, String classifier, String type )
- {
- ArchivaArtifact artifact = artifactDao.createArtifact( TEST_GROUPID, artifactId, version,
- classifier, type, "testable_repo" );
- Calendar cal = Calendar.getInstance();
- artifact.getModel().setLastModified( cal.getTime() );
- artifact.getModel().setRepositoryId( "testable_repo" );
- return artifact;
- }
-
- public void testConstraint()
- throws Exception
- {
- // Setup artifacts in fresh DB.
- artifactDao.saveArtifact( createArtifact( "test-one", "1.0", "", "jar" ) );
- artifactDao.saveArtifact( createArtifact( "test-one", "1.0", "", "pom" ) );
- artifactDao.saveArtifact( createArtifact( "test-one", "1.0", "javadoc", "jar" ) );
- artifactDao.saveArtifact( createArtifact( "test-one", "1.0", "sources", "jar" ) );
-
- artifactDao.saveArtifact( createArtifact( "test-one", "1.1", "", "jar" ) );
- artifactDao.saveArtifact( createArtifact( "test-one", "1.2", "", "jar" ) );
-
- artifactDao.saveArtifact( createArtifact( "test-two", "1.0", "", "jar" ) );
- artifactDao.saveArtifact( createArtifact( "test-two", "2.0", "", "jar" ) );
- artifactDao.saveArtifact( createArtifact( "test-two", "2.1", "", "jar" ) );
- artifactDao.saveArtifact( createArtifact( "test-two", "3.0", "", "jar" ) );
-
- assertConstraint( 4, new ArtifactsRelatedConstraint( TEST_GROUPID, "test-one", "1.0" ) );
- assertConstraint( 1, new ArtifactsRelatedConstraint( TEST_GROUPID, "test-one", "1.1" ) );
- }
-
- private void assertConstraint( int expectedHits, Constraint constraint )
- throws Exception
- {
- List<ArchivaArtifact> results = artifactDao.queryArtifacts( constraint );
- assertNotNull( "Related Artifacts: Not Null", results );
- assertEquals( "Related Artifacts: Results.size", expectedHits, results.size() );
- }
-
-}