1package org.apache.archiva.test.utils;
23/*4 * Copyright 2012 The Apache Software Foundation.5 *6 * Licensed under the Apache License, Version 2.0 (the "License");7 * you may not use this file except in compliance with the License.8 * You may obtain a copy of the License at9 *10 * http://www.apache.org/licenses/LICENSE-2.011 *12 * Unless required by applicable law or agreed to in writing, software13 * distributed under the License is distributed on an "AS IS" BASIS,14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.15 * See the License for the specific language governing permissions and16 * limitations under the License.17 */1819import org.junit.runners.model.FrameworkMethod;
20import org.junit.runners.model.InitializationError;
21import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
2223import java.io.IOException;
24import java.nio.file.Files;
25import java.nio.file.Path;
26import java.util.List;
2728/**29 * @author Eric30 */31publicclassArchivaSpringJUnit4ClassRunner32extends SpringJUnit4ClassRunner
33 {
3435static {
3637if (System.getProperty("archiva.user.configFileName")!=null && !"".equals(System.getProperty("archiva.user.configFileName").trim())) {
38try {
39 Path file = Files.createTempFile("archiva-test-conf", ".xml");
40 System.setProperty("archiva.user.configFileName", file.toAbsolutePath().toString());
41 } catch (IOException e) {
42 e.printStackTrace();
43 }
44 }
45 }
4647publicArchivaSpringJUnit4ClassRunner( Class<?> clazz )
48throws InitializationError
49 {
50super( clazz );
51 }
5253 @Override
54protected List<FrameworkMethod> computeTestMethods()
55 {
56return ListGenerator.getShuffleList( super.computeTestMethods() );
57 }
585960 }