import java.util.Collections;
import java.util.Date;
import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
+import org.junit.Assume;
+import org.junit.BeforeClass;
import org.junit.runner.RunWith;
+import org.slf4j.LoggerFactory;
/**
* @author Olivier Lamy
// END SNIPPET: authz-header
-
+ @BeforeClass
+ public static void chekRepo() {
+ Assume.assumeTrue( !System.getProperty( "appserver.base" ).contains(" ") );
+ LoggerFactory.getLogger( AbstractArchivaRestTest.class.getName() ).
+ error( "Rest services unit test must be run in a folder with no space" );
+ // skygo: was not possible to fix path in this particular module
+ // Skip test if not in proper folder , otherwise test are not fair coz repository
+ // cannot have space in their name.
+ }
+
@Override
@Before
public void startServer()
throws Exception
- {
+ {
File appServerBase = new File( System.getProperty( "appserver.base" ) );
File jcrDirectory = new File( appServerBase, "jcr" );
-
+
if ( jcrDirectory.exists() )
{
FileUtils.deleteDirectory( jcrDirectory );
}
- super.startServer();
+ super.startServer();
}
@Override
return "classpath*:META-INF/spring-context.xml,classpath:META-INF/spring-context-test.xml";
}
+ @Override
protected String getRestServicesPath()
{
return "restServices";
protected SearchService getSearchService( String authzHeader )
{
- // START SNIPPET: cxf-searchservice-creation
+ // START SNIPPET: cxf-searchservice-creation
SearchService service =
JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
SearchService.class,
}
}
-
+
protected void createAndIndexRepo( String testRepoId, String repoPath, boolean scan )
throws Exception
{
{
FileUtils.deleteDirectory( badContent );
}
-
+
managedRepository.setLocation( new File( repoPath ).getPath() );
managedRepository.setIndexDirectory(
System.getProperty( "java.io.tmpdir" ) + "/target/.index-" + Long.toString( new Date().getTime() ) );