1 package org.apache.maven.archiva.web.rss;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import java.util.ArrayList;
23 import java.util.Calendar;
24 import java.util.Date;
25 import java.util.List;
27 import org.apache.maven.archiva.database.ArchivaDatabaseException;
28 import org.apache.maven.archiva.database.ArtifactDAO;
29 import org.apache.maven.archiva.database.Constraint;
30 import org.apache.maven.archiva.database.ObjectNotFoundException;
31 import org.apache.maven.archiva.model.ArchivaArtifact;
34 * Stub used for RssFeedServlet unit test.
38 public class ArtifactDAOStub
39 implements ArtifactDAO
42 public ArchivaArtifact createArtifact( String groupId, String artifactId, String version, String classifier,
43 String type, String repositoryId )
45 // TODO Auto-generated method stub
49 public void deleteArtifact( ArchivaArtifact artifact )
50 throws ArchivaDatabaseException
52 // TODO Auto-generated method stub
56 public ArchivaArtifact getArtifact( String groupId, String artifactId, String version, String classifier,
57 String type, String repositoryId )
58 throws ObjectNotFoundException, ArchivaDatabaseException
60 // TODO Auto-generated method stub
64 public List<ArchivaArtifact> queryArtifacts( Constraint constraint )
65 throws ObjectNotFoundException, ArchivaDatabaseException
67 List<ArchivaArtifact> artifacts = new ArrayList<ArchivaArtifact>();
69 Date whenGathered = Calendar.getInstance().getTime();
70 whenGathered.setTime( 123456789 );
72 ArchivaArtifact artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-one", "1.0", "", "jar", "test-repo" );
73 artifact.getModel().setWhenGathered( whenGathered );
74 artifacts.add( artifact );
76 artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-one", "1.1", "", "jar", "test-repo" );
77 artifact.getModel().setWhenGathered( whenGathered );
78 artifacts.add( artifact );
80 artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-one", "2.0", "", "jar", "test-repo" );
81 artifact.getModel().setWhenGathered( whenGathered );
82 artifacts.add( artifact );
84 artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-two", "1.0.1", "", "jar", "test-repo" );
85 artifact.getModel().setWhenGathered( whenGathered );
86 artifacts.add( artifact );
88 artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-two", "1.0.2", "", "jar", "test-repo" );
89 artifact.getModel().setWhenGathered( whenGathered );
90 artifacts.add( artifact );
92 artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-two", "1.0.3-SNAPSHOT", "", "jar", "test-repo" );
93 artifact.getModel().setWhenGathered( whenGathered );
94 artifacts.add( artifact );
96 artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-three", "2.0-SNAPSHOT", "", "jar", "test-repo" );
97 artifact.getModel().setWhenGathered( whenGathered );
98 artifacts.add( artifact );
100 artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-four", "1.1-beta-2", "", "jar", "test-repo" );
101 artifact.getModel().setWhenGathered( whenGathered );
102 artifacts.add( artifact );
107 public ArchivaArtifact saveArtifact( ArchivaArtifact artifact )
108 throws ArchivaDatabaseException
110 // TODO Auto-generated method stub