Examples of TestEngine


Examples of org.apache.wiki.TestEngine

        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

Examples of org.apache.wiki.TestEngine

  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

Examples of org.apache.wiki.TestEngine

    }

    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

Examples of org.apache.wiki.TestEngine

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

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

Examples of org.apache.wiki.TestEngine

        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

Examples of org.apache.wiki.TestEngine

    {
        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

Examples of org.apache.wiki.TestEngine

    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

Examples of org.apache.wiki.TestEngine

  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

Examples of org.apache.wiki.TestEngine

    public void setUp()
        throws Exception
    {
        props.setProperty( "jspwiki.breakTitleWithSpaces", "false" );
        engine = new TestEngine(props);

        engine.saveText( "TestPage", "Reference to [Foobar]." );
        engine.saveText( "Foobar", "Reference to [TestPage]." );
        engine.saveText( "Foobar2", "Reference to [TestPage]." );
        engine.saveText( "Foobar3", "Reference to [TestPage]." );
View Full Code Here

Examples of org.apache.wiki.TestEngine

  PluginManager manager;

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

        testEngine.saveText("TestPage01", "Some Text for testing 01 which refers [NonExistingPageA] ");
        testEngine.saveText("TestPage02", "Some Text for testing 02 which refers [NonExistingPageB] ");
    testEngine.saveText("TestPage03", "Some Text for testing 03 which refers [NonExistingPageC] ");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.