use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class DecisionQueueTest method setUp.
@Before
public void setUp() throws Exception {
Properties props = TestEngine.getTestProperties();
m_engine = new TestEngine(props);
m_queue = m_engine.getWorkflowManager().getDecisionQueue();
adminSession = m_engine.adminSession();
janneSession = m_engine.janneSession();
w = new Workflow("workflow.key", new WikiPrincipal("Owner1"));
w.setWorkflowManager(m_engine.getWorkflowManager());
d1 = new SimpleDecision(w, "decision1.key", new GroupPrincipal("Admin"));
d2 = new SimpleDecision(w, "decision2.key", new WikiPrincipal("Owner2"));
d3 = new SimpleDecision(w, "decision3.key", janneSession.getUserPrincipal());
m_queue.add(d1);
m_queue.add(d2);
m_queue.add(d3);
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class OutcomeTest method testMessage.
@Test
public void testMessage() throws Exception {
Properties props = TestEngine.getTestProperties();
WikiEngine engine = new TestEngine(props);
InternationalizationManager i18n = engine.getInternationalizationManager();
String core = "templates.default";
Locale rootLocale = Locale.ROOT;
Outcome o;
o = Outcome.DECISION_APPROVE;
Assert.assertEquals("Approve", i18n.get(core, rootLocale, o.getMessageKey()));
o = Outcome.DECISION_DENY;
Assert.assertEquals("Deny", i18n.get(core, rootLocale, o.getMessageKey()));
o = Outcome.DECISION_HOLD;
Assert.assertEquals("Hold", i18n.get(core, rootLocale, o.getMessageKey()));
o = Outcome.DECISION_REASSIGN;
Assert.assertEquals("Reassign", i18n.get(core, rootLocale, o.getMessageKey()));
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class WorkflowManagerTest method setUp.
@Before
public void setUp() throws Exception {
Properties props = TestEngine.getTestProperties();
m_engine = new TestEngine(props);
wm = m_engine.getWorkflowManager();
// Create a workflow with 3 steps, with a Decision in the middle
w = new Workflow("workflow.key", new WikiPrincipal("Owner1"));
w.setWorkflowManager(m_engine.getWorkflowManager());
Step startTask = new TaskTest.NormalTask(w);
Step endTask = new TaskTest.NormalTask(w);
Decision decision = new SimpleDecision(w, "decision.editWikiApproval", new WikiPrincipal("Actor1"));
startTask.addSuccessor(Outcome.STEP_COMPLETE, decision);
decision.addSuccessor(Outcome.DECISION_APPROVE, endTask);
w.setFirstStep(startTask);
// Add a message argument to the workflow with the page name
w.addMessageArgument("MyPage");
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class MailUtilTest method setUp.
@Before
public void setUp() throws Exception {
PropertyConfigurator.configure(m_props);
TestEngine testEngine = new TestEngine(m_props);
m_context = new WikiContext(testEngine, new WikiPage(testEngine, PAGE_NAME));
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class DefaultURLConstructorTest method getConstructor.
private URLConstructor getConstructor(String prefix) throws WikiException {
if (prefix != null)
props.setProperty(ShortViewURLConstructor.PROP_PREFIX, prefix);
testEngine = new TestEngine(props);
URLConstructor constr = new DefaultURLConstructor();
constr.initialize(testEngine, props);
return constr;
}
Aggregations