mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-05 23:22:47 +00:00
Fixes an issue when loading the server using a zipped data folder
This commit is contained in:
@@ -130,15 +130,15 @@ public class ServiceManager {
|
||||
*/
|
||||
public void init(Injector injector) throws ServiceStartException {
|
||||
this.injector = injector;
|
||||
// final LoggingService service = injector
|
||||
// .getInstance(LoggingService.class);
|
||||
// knownServices.add(service);
|
||||
// service.start();
|
||||
// final LoggingService service = injector
|
||||
// .getInstance(LoggingService.class);
|
||||
// knownServices.add(service);
|
||||
// service.start();
|
||||
configurationService = start(ConfigurationService.class);
|
||||
//start(LoggingService.class);
|
||||
//knownServices.add(configurationService);
|
||||
//start(ConfigurationService.class);
|
||||
//configurationService.start();
|
||||
// start(LoggingService.class);
|
||||
// knownServices.add(configurationService);
|
||||
// start(ConfigurationService.class);
|
||||
// configurationService.start();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,6 +157,9 @@ public class ServiceManager {
|
||||
* implementation of <code>serviceClass</code>, <code>null</code> is
|
||||
* returned.
|
||||
*
|
||||
* @param <T>
|
||||
* the service type
|
||||
*
|
||||
* @param serviceClass
|
||||
* the service class
|
||||
* @return the {@link ServiceDescriptor} for the requested service
|
||||
|
||||
@@ -31,6 +31,9 @@ public interface ConfigurationService extends Service {
|
||||
/**
|
||||
* Get the configuration for the given service
|
||||
*
|
||||
* @param <C>
|
||||
* the service configuration instance type
|
||||
*
|
||||
* @param service
|
||||
* the service
|
||||
* @param serviceInterface
|
||||
|
||||
@@ -30,6 +30,9 @@ public class ArrayUtils {
|
||||
/**
|
||||
* Copy an entire array except objects in <code>except</code> array.
|
||||
*
|
||||
* @param <T>
|
||||
* the array component type
|
||||
*
|
||||
* @param array
|
||||
* the source array
|
||||
* @param except
|
||||
@@ -58,6 +61,9 @@ public class ArrayUtils {
|
||||
* Searches for the <code>expected</code> item to be in the
|
||||
* <code>array</code>.
|
||||
*
|
||||
* @param <T>
|
||||
* the array component type
|
||||
*
|
||||
* @param array
|
||||
* the array to search in
|
||||
* @param expected
|
||||
|
||||
@@ -73,6 +73,9 @@ public class ClassUtils {
|
||||
* If after all those steps, no annotation is found, <code>null</code> is
|
||||
* returned.
|
||||
*
|
||||
* @param <T>
|
||||
* the annotation type
|
||||
*
|
||||
* @param annotationClass
|
||||
* the annotation class
|
||||
* @param cls
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* This file is part of l2jserver2 <l2jserver2.com>.
|
||||
*
|
||||
* l2jserver2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver2. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.transformer.impl;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class ArrayTransformerTest {
|
||||
/**
|
||||
* An Integer[] array as an string
|
||||
*/
|
||||
private static final String INT_ARRAY_STRING = "1|2|3";
|
||||
/**
|
||||
* An Integer[] array
|
||||
*/
|
||||
private static final Integer[] INT_ARRAY = new Integer[] { 1, 2, 3 };
|
||||
|
||||
/**
|
||||
* An String[] array as an string
|
||||
*/
|
||||
private static final String STRING_ARRAY_STRING = "test1|test2|test3";
|
||||
/**
|
||||
* An String[] array
|
||||
*/
|
||||
private static final String[] STRING_ARRAY = new String[] { "test1",
|
||||
"test2", "test3" };
|
||||
|
||||
/**
|
||||
* An Class[] array as an string
|
||||
*/
|
||||
private static final String CLASS_ARRAY_STRING = "java.lang.Object|java.lang.Integer|java.lang.Long";
|
||||
/**
|
||||
* An Class[] array
|
||||
*/
|
||||
private static final Class<?>[] CLASS_ARRAY = new Class<?>[] {
|
||||
Object.class, Integer.class, Long.class };
|
||||
|
||||
/**
|
||||
* Tests transforming an {@link Integer} array
|
||||
*/
|
||||
@Test
|
||||
public void testIntegerTransforming() {
|
||||
final ArrayTransformer<Integer> transformer = new ArrayTransformer<Integer>();
|
||||
Assert.assertEquals(INT_ARRAY_STRING,
|
||||
transformer.transform(Integer[].class, INT_ARRAY));
|
||||
Assert.assertArrayEquals(INT_ARRAY,
|
||||
transformer.untransform(Integer[].class, INT_ARRAY_STRING));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests transforming an {@link String} array
|
||||
*/
|
||||
@Test
|
||||
public void testStringTransforming() {
|
||||
final ArrayTransformer<String> transformer = new ArrayTransformer<String>();
|
||||
Assert.assertEquals(STRING_ARRAY_STRING,
|
||||
transformer.transform(String[].class, STRING_ARRAY));
|
||||
Assert.assertArrayEquals(STRING_ARRAY,
|
||||
transformer.untransform(String[].class, STRING_ARRAY_STRING));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests transforming an {@link Class} array
|
||||
*/
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testClassTransforming() {
|
||||
@SuppressWarnings("rawtypes")
|
||||
final ArrayTransformer<Class> transformer = new ArrayTransformer<Class>();
|
||||
Assert.assertEquals(CLASS_ARRAY_STRING, transformer.transform(
|
||||
Class[].class, CLASS_ARRAY));
|
||||
Assert.assertArrayEquals(CLASS_ARRAY, transformer
|
||||
.untransform((Class<? extends Class<?>[]>) Class[].class,
|
||||
CLASS_ARRAY_STRING));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user