[[BackLinksMenu]] [[TicketQuery(summary=UNPLANNED_UNIT_TEST_FIX_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|)]] = Analysis = == Overview == Automatic tests need to be improved. Latest Hudson build reports 288 test failures out of 962 tests. == Task requirements == * Revise the current unit tests * Remove any useless test cases (for more, see implementation idea). * Make as much as possible tests / demos to work. This includes improving the source if tests report problems. * Writing new tests is not required for this revision, since it is too much effort. == Task result == Removed useless tests, others - passing. == Implementation idea == * Read about how to write good unit tests, [wiki:PLATFORM_STANDARDS_AUTO_TESTS] for documented convensions for testing and "Code smells" in the internal backlog. Look also at the available demos. * Describe what needs to be removed, what will be repaired and what tests need to be written during the next revision. * Use FakeModuleRegistry where you need to use extension points. == Related == [wiki:PLATFORM_STANDARDS_AUTO_TESTS] == How to demo == Run all the available tests (through Eclipse, right click sophie2-platform, run as.., maven test). = Design = * While refactoring tests, look for the following things: * Tests should UnitTestBase or IntegrationTestBase * All resources needed for tests should be placed in the /src/test/resources folder of the module where the test is in * Remove testing of simple getters * Repair fake JavaDoc * Where ither modules are needed, use FakeModuleRegistry.start(). In this case, make the class extend IntegrationTestBase. Look specifically at the modules ewhich have to be started, this is a common mistake. * Take care for "//TODO: refactor" things. * Remove "fail('not implemented')" methods. * Refactor any "try{fail();} catch(Throwable){}" statements, since they are useless. Fix the errors that will appear after refactoring them. * Either refactor commented tests, or delete them. * Look for the correct place of each test - if incorrect, fix it. * Here is a list of the current modules and what has to be changed there : ||org.sophie2.base.bound||refactor ||org.sophie2.base.commons||refactor ||org.sophie2.base.connectivity||nothing - no tests ||org.sophie2.base.dialogs|| ||org.sophie2.base.halos|| ||org.sophie2.base.layout|| ||org.sophie2.base.media|| ||org.sophie2.base.menus|| ||org.sophie2.base.model.book|| ||org.sophie2.base.model.resources|| ||org.sophie2.base.model.text|| ||org.sophie2.base.persistence|| ||org.sophie2.base.scene|| ||org.sophie2.base.skins|| ||org.sophie2.base.visual|| ||org.sophie2.core|| ||org.sophie2.core.modularity|| ||org.sophie2.core.mvc|| ||org.sophie2.extra.func.annotations|| ||org.sophie2.extra.func.embedded|| ||org.sophie2.extra.func.pdf|| ||org.sophie2.extra.func.print|| ||org.sophie2.launcher|| ||org.sophie2.main.app.commons|| ||org.sophie2.main.app.halos|| ||org.sophie2.main.app.layout|| ||org.sophie2.main.app.menus|| ||org.sophie2.main.app.model|| ||org.sophie2.main.dialogs.input|| ||org.sophie2.main.func.config|| ||org.sophie2.main.func.file|| ||org.sophie2.main.func.help|| ||org.sophie2.main.func.image|| ||org.sophie2.main.func.links|| ||org.sophie2.main.func.media|| ||org.sophie2.main.func.resources|| ||org.sophie2.main.func.servers|| ||org.sophie2.main.layout.mydoggy|| ||org.sophie2.main.layout.vldocking|| ||org.sophie2.main.media.fobs|| ||org.sophie2.main.persistence.r1|| ||org.sophie2.main.persistence.r2|| ||org.sophie2.main.scene.jogl|| ||org.sophie2.main.scene.simple|| ||org.sophie2.main.skin.alternative|| ||org.sophie2.main.ws_connector|| ||org.sophie2.server|| ||org.sophie2.server.connector|| ||org.sophie2.server.persistence|| = Implementation = ^(Describe and link the implementation results here (from the wiki or the repository).)^ = Testing = ^(Place the testing results here.)^ = Comments = ^(Write comments for this or later revisions here.)