Skip to content

Build and Test [Archive]

Tony Qu edited this page Oct 7, 2018 · 1 revision

NOTE: this document is obsolete. It used to be located at \'Build and Test.txt'. We put it here for archive purpose only

Build

Getting the latest source code is described at https://code.google.com/p/npoi/source/checkout

The build itself depends on your IDE and your target.

Select the solution from the appropriate solution folder:

  • visualstudio - Visual Studio 2008
  • visualstudio2010 - Visual Studio 2010
  • mono

The name of the solution defines the target:

  • NPOI.sln for the library NPOI itself.
  • NPOITest.sln for the library together with a test suite.
  • OOXML.sln for the OOXML library of NPOI
  • OOXMLTest.sln for the OOXML library with a test suite

Test Suite

Prior to execute the test suite, the test data must be downloaded, too. The test data is available from the Apache POI project as described on https://poi.apache.org/subversion.html

Copy the content of testcases/test-data to the same folder within NPOI.

Load the the NPOITest.sln into your IDE, build the project and execute all the unit tests.

2013-03-06 Test Result* NPOI.OOXML and NPOI test suite: 2511 passed, 22 skiped, 24 failed

2012-05-04 Test Result* NPOI test suite: unit tests: 1712, passed: 1705 (failed 7)

There are 11 unit tests flagged with the [Ignore] attribute:

  • testcases\main\HSSF\Model\TestOperandClassTransformer.cs(63): [Ignore] //this test is disabled in poi.
  • testcases\main\HSSF\UserModel\TestBugs.cs(115): [Ignore] //not found in poi
  • testcases\main\HSSF\UserModel\TestBugs.cs(225): [Ignore] //this test was not found in poi 3.8beta4
  • testcases\main\HSSF\UserModel\TestBugs.cs(343): [Ignore] //not found in poi 3.8beat4
  • testcases\main\HSSF\UserModel\TestBugs.cs(363): [Ignore] //this test was not found in poi 3.8beta4
  • testcases\main\HSSF\UserModel\TestBugs.cs(504): [Ignore] // not found in poi
  • testcases\main\HSSF\UserModel\TestBugs.cs(1439): [Ignore] //this test is disabled in poi.
  • testcases\main\HSSF\UserModel\TestUnfixedBugs.cs(43): [Ignore] // because of WON'T FIX
  • testcases\main\HSSF\UserModel\TestUnfixedBugs.cs(64): [Ignore] //TestUnfixedBugs
  • testcases\main\SS\Formula\Eval\TestMinusZeroResult.cs(72): [Ignore] //no representation for -0.0 in c#, this test always failed.
  • testcases\main\SS\Formula\Functions\TestDate.cs(50): [Ignore] //this test is disabled in poi.

These are the failing test cases: Failed Test51461 Test method TestCases.HSSF.UserModel.TestBugs.Test51461 threw exception: System.NotImplementedException: not find class NPOIFSFileSystem
Failed Test51535 Test method TestCases.HSSF.UserModel.TestBugs.Test51535 threw exception: System.NotImplementedException: not find class NPOIFSFileSystem

Failed TestWordDocEmbeddedInXls Test method TestCases.HSSF.UserModel.TestHSSFWorkbook.TestWordDocEmbeddedInXls threw exception: System.NotImplementedException: class NPOIFSFileSystem is not implemented Failed TestDifferentPOIFS Test method TestCases.HSSF.UserModel.TestHSSFWorkbook.TestDifferentPOIFS threw exception: System.NotImplementedException: class NPOIFSFileSystem is not implemented Failed TestWriteWorkbookFromNPOIFS Test method TestCases.HSSF.UserModel.TestHSSFWorkbook.TestWriteWorkbookFromNPOIFS threw exception: System.NotImplementedException: class NPOIFSFileSystem is not implemented

Failed TestSome Test method TestCases.SS.format.TestCellFormat.TestSome threw exception: ... System.NotImplementedException: The method or operation is not implemented.

Failed TestCreateCF testcases vs10 Test method TestCases.SS.UserModel.BaseTestConditionalFormatting.TestCreateCF threw exception: ... Failed TestCreateCF testcases vs10 Test method TestCases.HSSF.UserModel.TestHSSFConditionalFormatting.TestCreateCF threw exception: ... Failed TestCreateBorderFormatting testcases vs10 Test method TestCases.SS.UserModel.BaseTestConditionalFormatting.TestCreateBorderFormatting threw exception: ... Failed TestCreateCFRuleRecord testcases vs10 Test method TestCases.HSSF.Record.TestCFRuleRecord.TestCreateCFRuleRecord threw exception: ... Failed TestRecreate testcases vs10 Test method TestCases.HPSF.Basic.TestWrite.TestRecreate threw exception: ... Failed TestReadAllFiles1 testcases vs10 Assert.Fail failed. System.IO.IOException: The process cannot access the file 'D:_xi\P201009.1xi FNO Shortcut Tool\Code\npoi-trunk2\testcases\test-data\hpsf\Test0313rur.adm' because it is being used by another process....

Succeed on second run: Failed TestPropertiesAndFatOnRead testcases vs10 Test method TestCases.POIFS.FileSystem.TestNPOIFSFileSystem.TestPropertiesAndFatOnRead threw exception: ...

Patches to make the unit tests work as expected are greatly appreciated. This belongs to the failing and to the ignored ones.

Conditional Defines

There are some intentional warnings "Unreachable code detected". Each of the code areas describes the intention of the unreachable code in comments. To avoid these warnings it is possible to define HIDE_UNREACHABLE_CODE in the project settings. The conditional compilation symbols are located in Build in the General group.