[ 
https://issues.apache.org/jira/browse/DERBY-6315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13761092#comment-13761092
 ] 

ahsan shamsudeen commented on DERBY-6315:
-----------------------------------------

I deleted system directory in between each run of the test. That's fine.

I try to write a method to test the public long length() method of 
jarDBFile.java as follows.

public void testlength() throws Exception{
        JarStorageFactory storageFactory=new JarStorageFactory() ;
        File jarFile = SupportFilesSetup.getReadOnly("dclt.jar");
        final String path=jarFile.getPath();
        JarDBFile jdf=new JarDBFile( storageFactory, path);
        
        final File backupDir = SupportFilesSetup.getReadWrite("dbreadonly");
        final String db = getTestConfiguration().getDefaultDatabaseName();
        File file=new File(backupDir, db);
        
        
        
        if(!file.isDirectory()){
                if(jdf.length()==0){
                        assertEquals(jdf.length(),0);
                }
                else{
                        assertTrue(jdf.length()>0);
                        
                }
        }
    }

For this, I need to make some classes public. I know it's not allowed and 
wrong. 

Bryan, you said that the DirFile.java is tested well by our current test suite. 
Can you show me a method  and its appropriate test methods for this class? So, 
I can look at it and try my best to write some test methods. Still, I couldn't 
understand , how to test a method which is not public or not accessible 
directly via testing classes.

Thanks,
Ahsan


                
> Improve test coverage of org.apache.derby.impl.io.InputStreamFile
> -----------------------------------------------------------------
>
>                 Key: DERBY-6315
>                 URL: https://issues.apache.org/jira/browse/DERBY-6315
>             Project: Derby
>          Issue Type: Sub-task
>          Components: JDBC
>            Reporter: ahsan shamsudeen
>            Assignee: ahsan shamsudeen
>            Priority: Minor
>              Labels: gsoc2013
>
> According to code coverage analysis, org.apache.derby.impl.io.InputStreamFile 
> has a poor code coverage.
> This task is to investigate this class and add regression test that exercise 
> the code, as appropriate. The current coverage report of the class can be 
> found at  http://dbtg.foundry.sun.com/derby/test/coverage/_files/9a.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to