emacarron / mybatis

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

MyBatis-Spring JUnit updates #97

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have updated the MyBatis-Spring code with some more tests that:
1) cover the MapperFactoryBean's addToConfig property
2) cover SqlSessionFactoryBean

As part of this, I refactored out a new BaseMybatisSpringTest abstract class 
with 2 subclasses: MyBatisSpringTest & MapperFactoryBeanTest. These cover basic 
API usage and MapperFactoryBeans, respectively.

Also included in the attached files is an updated SqlSessionFactoryBean class 
with a very minor update for a null check (found in the above tests ;)

Finally, though not really part of the tests, I cleaned up the POM file, adding 
exclusions for some jars we don't need at all. I also removed the log4j 
dependency since neither Spring nor iBatis use it. Users could include log4j, 
if needed, in their own POMs. I don't know what our policy should be, but I 
went ahead and added revision constraints on Spring rather than hardcoding a 
specific version. It's [3.0,) now, but I am not sure if we want to be explicit 
or not.

Note, I started with rev 2398 and I think I reconciled all the diffs up to 
2419, but please take a second look to make sure.

Original issue reported on code.google.com by hpresnall@gmail.com on 6 Sep 2010 at 6:40

Attachments:

GoogleCodeExporter commented 9 years ago
Changed to SqlSessionFactoryBeanTest (dropped the plural) to be consistent with 
the other test classed.

Also added tests for setting the TransactionFactory class.

Original comment by hpresnall@gmail.com on 11 Sep 2010 at 12:47

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for your contributions, I'm going to review them.

Original comment by simone.t...@gmail.com on 11 Sep 2010 at 12:47

GoogleCodeExporter commented 9 years ago
Thanks a lot Hunter and well done, your updates have been successfully applied, 
with trivial modifications. Log4j has been kept since its scope is just test, 
MyBatis  will use it if found in the classpath, for more informations see 
source in 
http://mybatis.googlecode.com/svn/trunk/src/main/java/org/apache/ibatis/logging

At the moment I fixed the version to 3.0.4.RELEASE, since using the range I met 
the error below:

----
[INFO] Failed to resolve artifact.

Couldn't find a version in [2.5.6.SEC01, 2.5.6.SEC02, 3.0.0.RELEASE, 
3.0.1.RELEASE, 3.0.2.RELEASE, 3.0.3.RELEASE, 3.0.4.RELEASE, 2.0, 2.0.1, 2.0.2, 
2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.5, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 
2.5.5, 2.5.6] to match range [3.0,)
  org.springframework:spring-core:jar:null

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

Path to dependency: 
    1) org.mybatis:mybatis-spring:jar:1.0.0-SNAPSHOT
----

For future patches, if possible, I'd prefer you submit a patch file, simply 
running svn diff File > patchfile.patch to speed up the merge process, 
otherwise I need more time to merge.

Original comment by simone.t...@gmail.com on 11 Sep 2010 at 7:00

GoogleCodeExporter commented 9 years ago
I am fine with the changes you made.
I updated from SVN and confirmed that everything is working too. Thanks.

Original comment by hpresnall@gmail.com on 12 Sep 2010 at 12:16

GoogleCodeExporter commented 9 years ago

Original comment by eduardo.macarron on 1 Jan 2011 at 5:25