mybatis / old-google-code-issues

Automatically exported from code.google.com/p/mybatis
2 stars 4 forks source link

Example is NOT working #248

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The contact_manager example is not working:

http://code.google.com/p/mybatis/source/browse/#svn%2Fsub-projects%2Fcontact_man
ager

the tests fail & cannot deploy in tomcat.

mvn -Ptest clean compile test war:war

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.sample.guice.EnvironmentSettingsTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec
Running org.sample.guice.WebModuleTest
java.lang.RuntimeException: Could not find resource environment.properties
    at org.sample.guice.EnvironmentSettings.<init>(EnvironmentSettings.java:17)
    at org.sample.guice.EnvironmentSettings.<init>(EnvironmentSettings.java:22)
    at org.sample.guice.WebModule.<init>(WebModule.java:29)
    at org.sample.guice.WebModuleTest.instance(WebModuleTest.java:16)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
    at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.io.IOException: Could not find resource environment.properties
    at org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:89)
    at org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:76)
    at org.apache.ibatis.io.Resources.getResourceAsProperties(Resources.java:102)
    at org.sample.guice.EnvironmentSettings.<init>(EnvironmentSettings.java:14)
    ... 31 more
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec <<< 
FAILURE!
Running org.sample.mybatis.mappers.ContactMapperTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.187 sec <<< 
FAILURE!
Running org.sample.stripes.actions.ContactActionTest
log4j:WARN No appenders could be found for logger 
(com.silvermindsoftware.stripes.integration.guice.GuiceContextListener).
log4j:WARN Please initialize the log4j system properly.
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.032 sec <<< 
FAILURE!

Results :

Failed tests: 
  instance(org.sample.guice.WebModuleTest)

Tests in error: 
  crudOperations(org.sample.mybatis.mappers.ContactMapperTest)
  org.sample.stripes.actions.ContactActionTest

Tests run: 4, Failures: 1, Errors: 2, Skipped: 0

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

Original issue reported on code.google.com by haim.sch...@gmail.com on 15 Feb 2011 at 9:34

GoogleCodeExporter commented 9 years ago

Original comment by eduardo.macarron on 5 Jun 2011 at 4:15

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Try this version of mvn at command line - will build properly and skip the 
tests :

$ mvn -Pdev -DskipTests clean install war:war

Original comment by alphat...@gmail.com on 19 Jan 2013 at 2:40