Package org.apache.wiki

Examples of org.apache.wiki.TestEngine


       
        // Make sure we are using the default security policy file jspwiki.policy
        props.put( AuthorizationManager.POLICY, "jspwiki-testUserPolicy.policy" );
       
        // Initialize the test engine
        m_engine = new TestEngine( props );
        m_auth = m_engine.getAuthorizationManager();
        m_groupMgr = m_engine.getGroupManager();
        m_session = WikiSessionTest.adminSession( m_engine );
       
        WikiSession s = WikiSessionTest.anonymousSession( m_engine );
View Full Code Here


    }

    public void setUp() throws Exception
    {
        Properties props = TestEngine.getTestProperties();
        WikiEngine engine  = new TestEngine( props );
        m_wiki = engine.getApplicationName();
       
        m_group = new Group( "TestGroup", m_wiki );
    }
View Full Code Here

        props.setProperty( FileSystemProvider.PROP_PAGEDIR,
                           m_pagedir );

        PropertyConfigurator.configure(props2);
       
        m_engine = new TestEngine(props);

        m_provider = new FileSystemProvider();

        m_provider.initialize( m_engine, props );
       
View Full Code Here

  PluginManager manager;

  public void setUp() throws Exception {
        CacheManager.getInstance().removalAll();
    testEngine = new TestEngine(props);

    testEngine.saveText("TestPage01", "Some Text for testing 01");
    testEngine.saveText("TestPage02", "Some Text for testing 02");
    testEngine.saveText("TestPage03", "Some Text for testing 03");
View Full Code Here

    }

    public void setUp() throws Exception
    {
        Properties props = TestEngine.getTestProperties();
        m_engine = new TestEngine( props );
        m_authorizer = new WebContainerAuthorizer();
        m_authorizer.initialize( m_engine, props );
        m_webxml = m_authorizer.getWebXml();
        if ( m_webxml == null )
        {
View Full Code Here

    {
        TestEngine.emptyWorkDir();
        CacheManager.getInstance().removalAll();

        Properties props2 = TestEngine.getTestProperties();
        testEngine = new TestEngine(props2);
        PropertyConfigurator.configure(props2);
    }
View Full Code Here

        props.setProperty( "jspwiki.usePageCache", "true" );
        props.setProperty( "jspwiki.pageProvider", "org.apache.wiki.providers.CounterProvider" );
        props.setProperty( "jspwiki.cachingProvider.capacity", "100" );

        TestEngine engine = new TestEngine( props );

        CounterProvider p = (CounterProvider)((CachingProvider)engine.getPageManager().getProvider()).getRealProvider();

        assertEquals("init", 1, p.m_initCalls);
        assertEquals("getAllPages", 1, p.m_getAllPagesCalls);
        assertEquals("pageExists", 0, p.m_pageExistsCalls);
        assertEquals("getPageText", 4, p.m_getPageTextCalls);

        engine.getPage( "Foo" );

        assertEquals("pageExists2", 0, p.m_pageExistsCalls);
    }
View Full Code Here

    {
        Properties props = TestEngine.getTestProperties();

        props.setProperty( "jspwiki.cachingProvider.cacheCheckInterval", "2" );
       
        TestEngine engine = new TestEngine( props );
       
        String dir = props.getProperty( FileSystemProvider.PROP_PAGEDIR );
       
        File f = new File( dir, "Testi.txt" );
        String content = "[fuufaa]";
       
        PrintWriter out = new PrintWriter( new FileWriter(f) );
        FileUtil.copyContents( new StringReader(content), out );
        out.close();
       
        Thread.sleep( 4000L ); // Make sure we wait long enough
       
        WikiPage p = engine.getPage( "Testi" );
        assertNotNull( "page did not exist?", p );
       
        String text = engine.getText( "Testi");
        assertEquals("text", "[fuufaa]", text );
       
        // TODO: ReferenceManager check as well
    }
View Full Code Here

    public void setUp() throws Exception
    {
        Properties props = TestEngine.getTestProperties();

        m_engine = new TestEngine( props );
        m_groupMgr = m_engine.getGroupManager();
        m_session = WikiSessionTest.adminSession( m_engine );

        // Flush any pre-existing groups (left over from previous failures, perhaps)
        try
View Full Code Here

  protected void setUp() throws Exception
  {
      super.setUp();
      Properties props = TestEngine.getTestProperties();
      props.put(XMLUserDatabase.PROP_USERDATABASE, "target/test-classes/userdatabase.xml" );
      WikiEngine engine  = new TestEngine(props);
      m_db = new XMLUserDatabase();
      m_db.initialize(engine, props);
  }
View Full Code Here

TOP

Related Classes of org.apache.wiki.TestEngine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.