use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class JDBCGroupDatabaseTest method setUp.
/**
*/
@Before
public void setUp() throws Exception {
m_hu.setUp();
Properties props = TestEngine.getTestProperties();
WikiEngine engine = new TestEngine(props);
m_wiki = engine.getApplicationName();
// Set up the mock JNDI initial context
TestJNDIContext.initialize();
Context initCtx = new InitialContext();
try {
initCtx.bind("java:comp/env", new TestJNDIContext());
} catch (NameAlreadyBoundException e) {
// ignore
}
Context ctx = (Context) initCtx.lookup("java:comp/env");
DataSource ds = new TestJDBCDataSource(new File("target/test-classes/jspwiki-custom.properties"));
ctx.bind(JDBCGroupDatabase.DEFAULT_GROUPDB_DATASOURCE, ds);
try {
m_conn = ds.getConnection();
} catch (SQLException e) {
Assert.fail("Looks like your database could not be connected to - " + "please make sure that you have started your database, exception: " + e.getMessage());
}
// Initialize the user database
m_db = new JDBCGroupDatabase();
m_db.initialize(engine, new Properties());
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class XMLGroupDatabaseTest method setUp.
/**
*/
@Before
public void setUp() throws Exception {
Properties props = TestEngine.getTestProperties();
WikiEngine engine = new TestEngine(props);
m_db = new XMLGroupDatabase();
m_db.initialize(engine, props);
m_wiki = engine.getApplicationName();
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class CookieAssertionLoginModuleTest method setUp.
/**
*/
@Before
public void setUp() throws Exception {
Properties props = TestEngine.getTestProperties();
props.put(XMLUserDatabase.PROP_USERDATABASE, "target/test-classes/userdatabase.xml");
m_engine = new TestEngine(props);
m_db = new XMLUserDatabase();
m_subject = new Subject();
try {
m_db.initialize(m_engine, props);
} catch (NoRequiredPropertyException e) {
System.err.println(e.getMessage());
Assert.assertTrue(false);
}
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class BasicAttachmentProviderTest method setUp.
@Before
public void setUp() throws Exception {
m_engine = new TestEngine(props);
TestEngine.deleteAll(new File(TextUtil.getRequiredProperty(props, BasicAttachmentProvider.PROP_STORAGEDIR)));
m_provider = new BasicAttachmentProvider();
m_provider.initialize(m_engine, props);
m_engine.saveText(NAME1, "Foobar");
m_engine.saveText(NAME2, "Foobar2");
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class CachingProviderTest method setUp.
@Before
public void setUp() throws Exception {
TestEngine.emptyWorkDir();
CacheManager.getInstance().removeAllCaches();
Properties props2 = TestEngine.getTestProperties();
testEngine = new TestEngine(props2);
PropertyConfigurator.configure(props2);
}
Aggregations