-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FURNACE-98: Introduced FurnaceProvider implementation
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
impl/src/main/java/org/jboss/forge/furnace/container/simple/impl/SimpleFurnaceProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2016 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package org.jboss.forge.furnace.container.simple.impl; | ||
|
||
import org.jboss.forge.furnace.Furnace; | ||
import org.jboss.forge.furnace.container.simple.lifecycle.SimpleContainer; | ||
import org.jboss.forge.furnace.spi.FurnaceProvider; | ||
|
||
/** | ||
* | ||
* @author <a href="mailto:ggastald@redhat.com">George Gastaldi</a> | ||
*/ | ||
public class SimpleFurnaceProvider implements FurnaceProvider | ||
{ | ||
@Override | ||
public Furnace getFurnace(ClassLoader loader) | ||
{ | ||
return SimpleContainer.getFurnace(loader); | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
impl/src/main/resources/META-INF/services/org.jboss.forge.furnace.spi.FurnaceProvider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.jboss.forge.furnace.container.simple.impl.SimpleFurnaceProvider |
31 changes: 31 additions & 0 deletions
31
tests/src/test/java/org/jboss/forge/furnace/container/simple/FurnaceProviderTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 2016 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package org.jboss.forge.furnace.container.simple; | ||
|
||
import org.jboss.arquillian.junit.Arquillian; | ||
import org.jboss.forge.furnace.Furnace; | ||
import org.jboss.forge.furnace.container.simple.lifecycle.SimpleContainer; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* | ||
* @author <a href="mailto:ggastald@redhat.com">George Gastaldi</a> | ||
*/ | ||
@RunWith(Arquillian.class) | ||
public class FurnaceProviderTest | ||
{ | ||
@Test | ||
public void testFurnaceInstance() | ||
{ | ||
ClassLoader loader = getClass().getClassLoader(); | ||
Furnace furnace = SimpleContainer.getFurnace(loader); | ||
Assert.assertSame(furnace, Furnace.instance(loader)); | ||
} | ||
} |