Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
161 additions
and
139 deletions.
There are no files selected for viewing
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
2 changes: 1 addition & 1 deletion
2
...ing/ModeShapeRepositoryConfiguration.java → ...jcr/ModeShapeRepositoryConfiguration.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.fcrepo.spring; | ||
package org.fcrepo.jcr; | ||
|
||
import java.lang.annotation.RetentionPolicy; | ||
|
||
|
44 changes: 44 additions & 0 deletions
44
fcrepo-kernel/src/main/java/org/fcrepo/jcr/ModeShapeRepositoryFactoryBean.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,44 @@ | ||
|
||
package org.fcrepo.jcr; | ||
|
||
import java.net.URL; | ||
import java.util.Collections; | ||
|
||
import javax.annotation.PostConstruct; | ||
import javax.inject.Inject; | ||
import javax.jcr.RepositoryException; | ||
|
||
import org.modeshape.jcr.JcrRepository; | ||
import org.modeshape.jcr.JcrRepositoryFactory; | ||
import org.modeshape.jcr.api.RepositoryFactory; | ||
|
||
public class ModeShapeRepositoryFactoryBean { | ||
|
||
@Inject | ||
private JcrRepositoryFactory jcrRepositoryFactory; | ||
|
||
@Inject | ||
@ModeShapeRepositoryConfiguration | ||
private URL repositoryConfiguration; | ||
|
||
private JcrRepository repository; | ||
|
||
@PostConstruct | ||
public void buildRepository() { | ||
try { | ||
repository = | ||
(JcrRepository) jcrRepositoryFactory | ||
.getRepository(Collections.singletonMap( | ||
RepositoryFactory.URL, | ||
repositoryConfiguration)); | ||
} catch (RepositoryException e) { | ||
throw new IllegalStateException(e); | ||
} | ||
} | ||
|
||
public JcrRepository getRepository() { | ||
if (repository == null) buildRepository(); | ||
return repository; | ||
} | ||
|
||
} |
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
50 changes: 0 additions & 50 deletions
50
fcrepo-kernel/src/main/java/org/fcrepo/spring/ModeShapeRepositoryFactoryBean.java
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,19 +1,30 @@ | ||
|
||
package org.fcrepo; | ||
|
||
import static org.ops4j.pax.exam.CoreOptions.junitBundles; | ||
|
||
import org.junit.Before; | ||
import org.junit.runner.RunWith; | ||
import org.ops4j.pax.exam.Configuration; | ||
import org.ops4j.pax.exam.Option; | ||
import org.ops4j.pax.exam.junit.PaxExam; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||
|
||
@RunWith(SpringJUnit4ClassRunner.class) | ||
@RunWith(PaxExam.class) | ||
public abstract class AbstractTest { | ||
|
||
protected Logger logger; | ||
protected Logger logger; | ||
|
||
@Before | ||
public void setLogger() { | ||
logger = LoggerFactory.getLogger(this.getClass()); | ||
} | ||
|
||
@Before | ||
public void setLogger() { | ||
logger = LoggerFactory.getLogger(this.getClass()); | ||
} | ||
@Configuration | ||
public Option[] config() { | ||
Option[] config = {junitBundles()}; | ||
return config; | ||
} | ||
|
||
} |
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
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
Oops, something went wrong.