/*
 * DumpParserFactoryTest.java
 *
 * This file is part of TDA - Thread Dump Analysis Tool.
 *
 * Foobar is free software; you can redistribute it and/or modify
 * it under the terms of the Lesser GNU General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * Foobar is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * Lesser GNU General Public License for more details.
 *
 * You should have received a copy of the Lesser GNU General Public License
 * along with Foobar; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * $Id: DumpParserFactoryTest.java,v 1.4 2008-01-09 09:40:07 irockel Exp $
 */
package com.pironet.tda;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import junit.framework.*;
import java.io.InputStream;
import java.util.Map;

/**
 *
 * @author irockel
 */
public class DumpParserFactoryTest extends TestCase {
    
    public DumpParserFactoryTest(String testName) {
        super(testName);
    }

    protected void setUp() throws Exception {
    }

    protected void tearDown() throws Exception {
    }

    public static Test suite() {
        TestSuite suite = new TestSuite(DumpParserFactoryTest.class);
        
        return suite;
    }

    /**
     * Test of get method, of class com.pironet.tda.DumpParserFactory.
     */
    public void testGet() {
        System.out.println("get");
        
        DumpParserFactory result = DumpParserFactory.get();
        assertNotNull(result);                
    }

    /**
     * Test of getDumpParserForVersion method, of class com.pironet.tda.DumpParserFactory.
     */
    public void testGetDumpParserForSunLogfile() throws FileNotFoundException {
        System.out.println("getDumpParserForVersion");
        
        InputStream dumpFileStream = new FileInputStream("test/none/test.log");
        Map threadStore = null;
        DumpParserFactory instance = DumpParserFactory.get();
        
        DumpParser result = instance.getDumpParserForLogfile(dumpFileStream, threadStore, false, 0);
        assertNotNull(result);
        
        assertTrue(result instanceof com.pironet.tda.SunJDKParser);
    }

    /**
     * Test of getDumpParserForVersion method, of class com.pironet.tda.DumpParserFactory.
     */
    public void testGetDumpParserForBeaLogfile() throws FileNotFoundException {
        System.out.println("getDumpParserForVersion");
        
        InputStream dumpFileStream = new FileInputStream("test/none/jrockit_15_dump.txt");
        Map threadStore = null;
        DumpParserFactory instance = DumpParserFactory.get();
        
        DumpParser result = instance.getDumpParserForLogfile(dumpFileStream, threadStore, false, 0);
        assertNotNull(result);
        
        assertTrue(result instanceof com.pironet.tda.BeaJDKParser);
    }

    /**
     * Test of getCurrentDumpParser method, of class com.pironet.tda.DumpParserFactory.
     */
    public void testGetCurrentDumpParser() {
        System.out.println("getCurrentDumpParser");
        
        DumpParserFactory instance = DumpParserFactory.get();
        
        DumpParser result = instance.getCurrentDumpParser();
        assertNotNull(result);        
    }
    
}

@@ -854,29 +854,29 @@
 v 1.
-4
+5
  2008-0
-1-09
+2-15
  09:
-4
 0
+5
 :0
-7
+4
  iro
@@ -3072,397 +3072,8 @@
    %7D
-%0A%0A    /**%0A     * Test of getCurrentDumpParser method, of class com.pironet.tda.DumpParserFactory.%0A     */%0A    public void testGetCurrentDumpParser() %7B%0A        System.out.println(%22getCurrentDumpParser%22);%0A        %0A        DumpParserFactory instance = DumpParserFactory.get();%0A        %0A        DumpParser result = instance.getCurrentDumpParser();%0A        assertNotNull(result);        %0A    %7D%0A
     

test not needed any more.