Moved SpringFactoriesLoader to io.support in order to resolve tangle.
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core;
|
||||
package org.springframework.core.io.support;
|
||||
|
||||
/**
|
||||
* Used by {@link SpringFactoriesLoaderTests}
|
||||
@@ -14,18 +14,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core;
|
||||
package org.springframework.core.io.support;
|
||||
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
/**
|
||||
* Used by {@link SpringFactoriesLoaderTests}
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
*/
|
||||
public class MyDummyFactory1 implements DummyFactory, Ordered {
|
||||
|
||||
public int getOrder() {
|
||||
return 1;
|
||||
}
|
||||
@Order(1)
|
||||
public class MyDummyFactory1 implements DummyFactory {
|
||||
|
||||
public String getString() {
|
||||
return "Foo";
|
||||
@@ -14,18 +14,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core;
|
||||
package org.springframework.core.io.support;
|
||||
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
/**
|
||||
* Used by {@link org.springframework.core.SpringFactoriesLoaderTests}
|
||||
* Used by {@link SpringFactoriesLoaderTests}
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
*/
|
||||
public class MyDummyFactory2 implements DummyFactory, Ordered {
|
||||
|
||||
public int getOrder() {
|
||||
return 2;
|
||||
}
|
||||
@Order(2)
|
||||
public class MyDummyFactory2 implements DummyFactory {
|
||||
|
||||
public String getString() {
|
||||
return "Bar";
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core;
|
||||
package org.springframework.core.io.support;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -25,11 +25,13 @@ import org.junit.Test;
|
||||
/** @author Arjen Poutsma */
|
||||
public class SpringFactoriesLoaderTests {
|
||||
|
||||
private static final String FACTORIES_LOCATION =
|
||||
"org/springframework/core/io/support/springFactoriesLoaderTests.properties";
|
||||
|
||||
@Test
|
||||
public void loadFactories() {
|
||||
List<DummyFactory> factories = SpringFactoriesLoader
|
||||
.loadFactories(DummyFactory.class, null,
|
||||
"org/springframework/core/springFactoriesLoaderTests.properties");
|
||||
.loadFactories(DummyFactory.class, null, FACTORIES_LOCATION);
|
||||
|
||||
assertEquals(2, factories.size());
|
||||
assertTrue(factories.get(0) instanceof MyDummyFactory1);
|
||||
@@ -39,7 +41,7 @@ public class SpringFactoriesLoaderTests {
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void loadInvalid() {
|
||||
SpringFactoriesLoader.loadFactories(String.class, null,
|
||||
"org/springframework/core/springFactoriesLoaderTests.properties");
|
||||
FACTORIES_LOCATION);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
org.springframework.core.io.support.DummyFactory=org.springframework.core.io.support.MyDummyFactory2,org.springframework.core.io.support.MyDummyFactory1
|
||||
java.lang.String=org.springframework.core.io.support.MyDummyFactory1
|
||||
@@ -1,2 +0,0 @@
|
||||
org.springframework.core.DummyFactory=org.springframework.core.MyDummyFactory2,org.springframework.core.MyDummyFactory1
|
||||
java.lang.String=org.springframework.core.MyDummyFactory1
|
||||
Reference in New Issue
Block a user