unit testing - UnitilsException: File cannot be found -
After
this error can cause
org.unitils.core.UnitilsException: inserting the error DBUnit for the org.unitils.dbunit.DbUnitModule method at the test method public void fi.utu.nettiopsu.selenium.student.function.ExamRegistrationTest.examRegistrationTest () org.unitils.dbunit.DbUnitModule.insertDataSet (DbUnitModule.java.156) Data from dataset is $ DbUnitListener.beforeTestSetUp (dbUnitModule.java t57) org.unitils.core.Unitils $ UNISTSTLISER. Predecessor ORG on Testsset (org.unitils.UnitilsJUnit4TestClassRunner $ TestListenerInvokingMethodRoadie.RunBeforesThenTestThenAfters (UnitilsJUnit4TestClassRunner.java151). Org.junit.internal.runners.MethodRoadie.run on Org.unitils.unitils.UnitilsJUnit4TestClassRunner.invokeTestMethod (Unitsjyunet 4TestClassRunner.java:95) (MethodRoadie.java:49) at junit.internal.runners.MethodRoadie.runTest (MethodRoadie.java:84) At org.junit.internal.runners.JUnit4ClassRunner.runMethods (JUnit4ClassRunner.java:61) At org.unitils.UnitilsJUnit4TestClassRunner. access $ 000 org.unitils.UnitilsJUnit4TestClassRunner at $ 1.run (UnitilsJUnit4TestClassRunner.java:62) protected ORG.junit.internal.runners.ClassRoadie.runUn on (ClassRoadie.java:34)) at org.junit.internal.runners. ClassRoadie.run protected (ClassRoadie.java:44) org.unitils.UnitilsJUnit4TestClassRunner.run (Un ItilsJUnit4TestClassRunner.java:68) org.apache.maven.surefire.junit4.JUnit4TestSet.execute at (JUnit4TestSet.java:53) org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet (JUnit4Provider.java:123) org.apache java.lang on .maven.surefire.junit4.JUnit4Provider.invoke (.reflect.NativeMethodAccessorImpl.invoke0 on JUnit4Provider.java:104) sun (Native method) SunkreflectkNativeMethodAccessorImplkinvoke (NativeMethodAccessorImplkjava:39) on sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) on .reflect.Method.invoke (Method.java:597) org.apache.maven ctionUtils.invokeMethodWithArray on org.apache.maven.surefire.util.Refle. surefire.booter.ProviderFactory $ ProviderProxy.invoke (ProviderFactory.java:110) on org.apache.maven.surefire.booter.SurefireStarter.invokeProvider (ReflectionUtils.java:164) (SurefireStarter. Java: org: 175) due on org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked (SurefireStarter.java:107) org.apache.maven.surefire.booter.ForkedBooter.main (ForkedBooter.java:68) The file was not found with .unitils.core.UnitilsException: Name Com / Company / App / Selenium / Roll / Function / Regatt.xmm. At org.unitils.core.util.FileResolver.resolveFileName (fileResolver.java:118) org.unitils.dbunit.datasetfactory.impl.DefaultDataSetResolver.resolve at (DefaultDataSetResolver.java:88) org.unitils.dbunit.DbUnitModule.getDataSet on org.unitils.dbunit.DbUnitModule.getDataSet (DbUnitModule.java:320) on org.unitils.dbunit.DbUnitModule.insertDataSet (DbUnitModule.java:368) (DbUnitModule.java:147) < P> The "missing" XML file on the same package as my test class.
I get the same error, even if I'm not defining the filename on the auction.
Restart the RegTest.xml file for testing / resources. Units your file. Properties need to be used in the property: dbUnit.datasetresolver.prefixWithPackageName = false - This property tells the unit that your file is not used before the search package name. After all these changes, the Units folder will start searching RegTest.xml in testing / resources.
I hope this will help.
Comments
Post a Comment