mirror of https://github.com/apache/archiva.git
[MRM-1490] Expose Archiva services trough rest
add modules structure with the very first service : ping :-) git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1158972 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9357da09d3
commit
f3189bad3e
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>archiva-rest</artifactId>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<version>1.4-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>archiva-rest-api</artifactId>
|
||||
<name>Archiva Web :: REST support :: Api</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-authorization-api</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.ws.rs</groupId>
|
||||
<artifactId>jsr311-api</artifactId>
|
||||
</dependency>
|
||||
<!-- normally not needed but here for wadl feature currently in cxf -->
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-bundle-jaxrs</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,173 @@
|
|||
package org.apache.archiva.rest.api.model;
|
||||
|
||||
/*
|
||||
* 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 javax.xml.bind.annotation.XmlRootElement;
|
||||
import java.io.Serializable;
|
||||
|
||||
@XmlRootElement( name = "artifact" )
|
||||
public class Artifact
|
||||
implements Serializable
|
||||
{
|
||||
private String repositoryId;
|
||||
|
||||
private String groupId;
|
||||
|
||||
private String artifactId;
|
||||
|
||||
private String version;
|
||||
|
||||
private String type;
|
||||
|
||||
//private Date whenGathered;
|
||||
|
||||
public Artifact()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object o )
|
||||
{
|
||||
if ( this == o )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ( o == null || getClass() != o.getClass() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Artifact artifact = (Artifact) o;
|
||||
|
||||
if ( !artifactId.equals( artifact.artifactId ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ( !groupId.equals( artifact.groupId ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ( !repositoryId.equals( artifact.repositoryId ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ( type != null ? !type.equals( artifact.type ) : artifact.type != null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ( !version.equals( artifact.version ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int result = repositoryId.hashCode();
|
||||
result = 31 * result + groupId.hashCode();
|
||||
result = 31 * result + artifactId.hashCode();
|
||||
result = 31 * result + version.hashCode();
|
||||
result = 31 * result + ( type != null ? type.hashCode() : 0 );
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Artifact{" + "repositoryId='" + repositoryId + '\'' + ", groupId='" + groupId + '\'' + ", artifactId='"
|
||||
+ artifactId + '\'' + ", version='" + version + '\'' + ", type='" + type + '\'' + '}';
|
||||
}
|
||||
|
||||
public Artifact( String repositoryId, String groupId, String artifactId, String version, String type )
|
||||
// String type, Date whenGathered )
|
||||
{
|
||||
this.repositoryId = repositoryId;
|
||||
this.groupId = groupId;
|
||||
this.artifactId = artifactId;
|
||||
this.version = version;
|
||||
this.type = type;
|
||||
//this.whenGathered = whenGathered;
|
||||
}
|
||||
|
||||
public String getGroupId()
|
||||
{
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public String getArtifactId()
|
||||
{
|
||||
return artifactId;
|
||||
}
|
||||
|
||||
public String getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getRepositoryId()
|
||||
{
|
||||
return repositoryId;
|
||||
}
|
||||
|
||||
/*public Date getWhenGathered()
|
||||
{
|
||||
return whenGathered;
|
||||
}*/
|
||||
|
||||
public void setGroupId( String groupId )
|
||||
{
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public void setArtifactId( String artifactId )
|
||||
{
|
||||
this.artifactId = artifactId;
|
||||
}
|
||||
|
||||
public void setVersion( String version )
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public void setType( String type )
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public void setRepositoryId( String repositoryId )
|
||||
{
|
||||
this.repositoryId = repositoryId;
|
||||
}
|
||||
|
||||
/*@ServiceBeanField( "whenGathered" )
|
||||
public void setWhenGathered( Date whenGathered )
|
||||
{
|
||||
this.whenGathered = whenGathered;
|
||||
}*/
|
||||
}
|
|
@ -0,0 +1,172 @@
|
|||
package org.apache.archiva.rest.api.model;
|
||||
|
||||
/*
|
||||
* 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 javax.xml.bind.annotation.XmlRootElement;
|
||||
import java.io.Serializable;
|
||||
|
||||
@XmlRootElement( name = "dependency" )
|
||||
public class Dependency
|
||||
implements Serializable
|
||||
{
|
||||
private String groupId;
|
||||
|
||||
private String artifactId;
|
||||
|
||||
private String version;
|
||||
|
||||
private String classifier;
|
||||
|
||||
private String type;
|
||||
|
||||
private String scope;
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Dependency{" + "groupId='" + groupId + '\'' + ", artifactId='" + artifactId + '\'' + ", version='"
|
||||
+ version + '\'' + ", classifier='" + classifier + '\'' + ", type='" + type + '\'' + ", scope='" + scope
|
||||
+ '\'' + '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object o )
|
||||
{
|
||||
if ( this == o )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ( o == null || getClass() != o.getClass() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Dependency that = (Dependency) o;
|
||||
|
||||
if ( !artifactId.equals( that.artifactId ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ( classifier != null ? !classifier.equals( that.classifier ) : that.classifier != null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ( !groupId.equals( that.groupId ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ( scope != null ? !scope.equals( that.scope ) : that.scope != null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ( type != null ? !type.equals( that.type ) : that.type != null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ( !version.equals( that.version ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int result = groupId.hashCode();
|
||||
result = 31 * result + artifactId.hashCode();
|
||||
result = 31 * result + version.hashCode();
|
||||
result = 31 * result + ( classifier != null ? classifier.hashCode() : 0 );
|
||||
result = 31 * result + ( type != null ? type.hashCode() : 0 );
|
||||
result = 31 * result + ( scope != null ? scope.hashCode() : 0 );
|
||||
return result;
|
||||
}
|
||||
|
||||
public Dependency( String groupId, String artifactId, String version, String classifier, String type, String scope )
|
||||
{
|
||||
this.groupId = groupId;
|
||||
this.artifactId = artifactId;
|
||||
this.version = version;
|
||||
this.classifier = classifier;
|
||||
this.type = type;
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
public String getGroupId()
|
||||
{
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId( String groupId )
|
||||
{
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getArtifactId()
|
||||
{
|
||||
return artifactId;
|
||||
}
|
||||
|
||||
public void setArtifactId( String artifactId )
|
||||
{
|
||||
this.artifactId = artifactId;
|
||||
}
|
||||
|
||||
public String getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion( String version )
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getClassifier()
|
||||
{
|
||||
return classifier;
|
||||
}
|
||||
|
||||
public void setClassifier( String classifier )
|
||||
{
|
||||
this.classifier = classifier;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType( String type )
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getScope()
|
||||
{
|
||||
return scope;
|
||||
}
|
||||
|
||||
public void setScope( String scope )
|
||||
{
|
||||
this.scope = scope;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package org.apache.archiva.rest.api.services;
|
||||
|
||||
/*
|
||||
* 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.codehaus.plexus.redback.authorization.RedbackAuthorization;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
* @author Olivier Lamy
|
||||
* @since 1.4
|
||||
*/
|
||||
@Path( "/pingService/" )
|
||||
public interface PingService
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* ping service to monitor Archiva with a nice returned message :-)
|
||||
* @return Yeah Baby It rocks!
|
||||
*/
|
||||
@Path( "addAuthenticationKey" )
|
||||
@GET
|
||||
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
|
||||
@RedbackAuthorization( noRestriction = true )
|
||||
String ping( );
|
||||
|
||||
}
|
|
@ -0,0 +1,145 @@
|
|||
<?xml version="1.0"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>archiva-rest</artifactId>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<version>1.4-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>archiva-rest-services</artifactId>
|
||||
<version>1.4-SNAPSHOT</version>
|
||||
<name>Archiva Web :: REST support :: Services</name>
|
||||
|
||||
<properties>
|
||||
<jettyVersion>7.4.5.v20110725</jettyVersion>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-authorization-api</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-authentication-api</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-common-integrations</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-rest-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-rest-services</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-rest-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.ws.rs</groupId>
|
||||
<artifactId>jsr311-api</artifactId>
|
||||
</dependency>
|
||||
<!-- normally not needed but here for wadl feature currently in cxf -->
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-bundle-jaxrs</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-rest-services</artifactId>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<version>${jettyVersion}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-plus</artifactId>
|
||||
<version>${jettyVersion}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.derby</groupId>
|
||||
<artifactId>derby</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-authentication-memory</artifactId>
|
||||
<scope>test</scope>
|
||||
<version>${redback.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-keys-memory</artifactId>
|
||||
<scope>test</scope>
|
||||
<version>${redback.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,18 @@
|
|||
package org.apache.archiva.rest.services;
|
||||
|
||||
import org.apache.archiva.rest.api.services.PingService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author Olivier Lamy
|
||||
* @since TODO
|
||||
*/
|
||||
@Service( "pingService#rest" )
|
||||
public class DefaultPingService
|
||||
implements PingService
|
||||
{
|
||||
public String ping()
|
||||
{
|
||||
return "Yeah Baby It rocks!";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-3.0.xsd
|
||||
http://cxf.apache.org/jaxrs
|
||||
http://cxf.apache.org/schemas/jaxrs.xsd">
|
||||
|
||||
<import resource="classpath:META-INF/cxf/cxf.xml"/>
|
||||
<!--
|
||||
<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"/>
|
||||
-->
|
||||
<import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
|
||||
|
||||
<context:annotation-config />
|
||||
<context:component-scan
|
||||
base-package="org.apache.archiva.rest.services"/>
|
||||
|
||||
<jaxrs:server id="archivaServices" address="/archivaServices">
|
||||
|
||||
<jaxrs:serviceBeans>
|
||||
<ref bean="pingService#rest"/>
|
||||
</jaxrs:serviceBeans>
|
||||
<jaxrs:providers>
|
||||
<ref bean="authenticationInterceptor#rest"/>
|
||||
<ref bean="permissionInterceptor#rest"/>
|
||||
</jaxrs:providers>
|
||||
|
||||
</jaxrs:server>
|
||||
|
||||
</beans>
|
|
@ -0,0 +1,50 @@
|
|||
package org.apache.archiva.rest.services;
|
||||
|
||||
import org.apache.archiva.rest.api.services.PingService;
|
||||
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
|
||||
import org.codehaus.redback.rest.services.AbstractRestServicesTest;
|
||||
import org.codehaus.redback.rest.services.FakeCreateAdminService;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Olivier Lamy
|
||||
* @since TODO
|
||||
*/
|
||||
public class PingServiceTest
|
||||
extends AbstractRestServicesTest
|
||||
{
|
||||
|
||||
@Before
|
||||
public void setUp()
|
||||
throws Exception
|
||||
{
|
||||
super.startServer();
|
||||
|
||||
FakeCreateAdminService fakeCreateAdminService =
|
||||
JAXRSClientFactory.create( "http://localhost:" + port + "/services/fakeCreateAdminService/",
|
||||
FakeCreateAdminService.class );
|
||||
|
||||
Boolean res = fakeCreateAdminService.createAdminIfNeeded();
|
||||
assertTrue( res.booleanValue() );
|
||||
}
|
||||
|
||||
PingService getPingService()
|
||||
{
|
||||
return JAXRSClientFactory.create( "http://localhost:" + port + "/services/archivaServices/",
|
||||
PingService.class );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void ping()
|
||||
throws Exception
|
||||
{
|
||||
// 1000000L
|
||||
//WebClient.getConfig( userService ).getHttpConduit().getClient().setReceiveTimeout(3000);
|
||||
|
||||
String res = getPingService().ping();
|
||||
assertEquals( "Yeah Baby It rocks!", res );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
|
||||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
||||
|
||||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
|
||||
|
||||
<appender name="console" class="org.apache.log4j.ConsoleAppender">
|
||||
<layout class="org.apache.log4j.PatternLayout">
|
||||
<param name="ConversionPattern" value="%d [%t] %-5p %c %x - %m%n"/>
|
||||
</layout>
|
||||
</appender>
|
||||
<!--
|
||||
<logger name="org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor">
|
||||
<level value="trace"/>
|
||||
</logger>
|
||||
<logger name="org.apache.cxf.jaxrs.utils.JAXRSUtils">
|
||||
<level value="trace"/>
|
||||
</logger>
|
||||
-->
|
||||
<logger name="org.codehaus.redback.rest.services" >
|
||||
<level value="debug"/>
|
||||
</logger>
|
||||
|
||||
<root>
|
||||
<priority value ="info" />
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
</log4j:configuration>
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-web</artifactId>
|
||||
<version>1.4-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>archiva-rest</artifactId>
|
||||
<name>Archiva Web :: REST support</name>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>archiva-rest-api</module>
|
||||
<module>archiva-rest-services</module>
|
||||
</modules>
|
||||
</project>
|
|
@ -13,9 +13,7 @@
|
|||
~ 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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
|
@ -34,6 +32,7 @@
|
|||
<module>archiva-webdav</module>
|
||||
<module>archiva-rss</module>
|
||||
<module>archiva-xmlrpc</module>
|
||||
<module>archiva-rest</module>
|
||||
</modules>
|
||||
|
||||
<profiles>
|
||||
|
@ -44,4 +43,4 @@
|
|||
</modules>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
</project>
|
74
pom.xml
74
pom.xml
|
@ -75,6 +75,7 @@
|
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
|
||||
<lucene.version>3.0.3</lucene.version>
|
||||
<cxfVersion>2.4.2</cxfVersion>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
@ -234,6 +235,16 @@
|
|||
<artifactId>archiva-indexer</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-rest-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-rest-services</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.indexer</groupId>
|
||||
<artifactId>indexer-core</artifactId>
|
||||
|
@ -410,6 +421,27 @@
|
|||
<version>3.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.ws.rs</groupId>
|
||||
<artifactId>jsr311-api</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-bundle-jaxrs</artifactId>
|
||||
<version>${cxfVersion}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
|
@ -702,6 +734,17 @@
|
|||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-authorization-api</artifactId>
|
||||
<version>${redback.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-users-memory</artifactId>
|
||||
|
@ -831,7 +874,36 @@
|
|||
<version>${redback.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- redback -->
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-rest-api</artifactId>
|
||||
<version>${redback.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-rest-services</artifactId>
|
||||
<version>${redback.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-rest-services</artifactId>
|
||||
<version>${redback.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback</groupId>
|
||||
<artifactId>redback-authentication-api</artifactId>
|
||||
<version>${redback.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- redback components -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.codehaus.redback.components.registry</groupId>
|
||||
|
|
Loading…
Reference in New Issue