ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbe...@apache.org
Subject svn commit: r705960 - in /ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example: MapperConfig.xml MapperConfigParserTest.java TestObjectFactory.java TestPlugin.java TestTypeHandler.java mapper.properties
Date Sun, 19 Oct 2008 05:41:05 GMT
Author: cbegin
Date: Sat Oct 18 22:41:05 2008
New Revision: 705960

URL: http://svn.apache.org/viewvc?rev=705960&view=rev
Log:
Created some test fixtures

Added:
    ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/MapperConfigParserTest.java
    ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/TestObjectFactory.java
    ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/TestPlugin.java
    ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/TestTypeHandler.java
    ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/mapper.properties
Modified:
    ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/MapperConfig.xml

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/MapperConfig.xml
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/MapperConfig.xml?rev=705960&r1=705959&r2=705960&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/MapperConfig.xml
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/MapperConfig.xml
Sat Oct 18 22:41:05 2008
@@ -1,46 +1,60 @@
 <configuration>
 
-  <properties resource="" url="">
-    <property name="" value=""/>
+  <properties resource="org/apache/ibatis/monarch/example/mapper.properties"> <!--
url="" -->
+    <property name="driver" value="org.apache.derby.jdbc.EmbeddedDriver"/>
   </properties>
 
   <settings>
-    <property name="" value=""/>
+    <property name="cacheEnabled" value="true"/>
+    <property name="lazyLoadingEnabled" value="true"/>
+    <property name="multipleResultSetsEnabled" value="true"/>
+    <property name="useColumnLabel" value="true"/>
+    <property name="enhancementEnabled" value="false"/>
+    <property name="generatedKeysEnabled" value="false"/>
+    <property name="defaultExecutorType" value="SIMPLE"/>
+    <property name="defaultStatementTimeout" value="25000"/>
   </settings>
 
   <typeAliases>
-    <typeAlias alias="" type=""/>
+    <typeAlias alias="Author" type="domain.blog.Author"/>
+    <typeAlias alias="Blog" type="domain.blog.Blog"/>
+    <typeAlias alias="Comment" type="domain.blog.Comment"/>
+    <typeAlias alias="Post" type="domain.blog.Post"/>
+    <typeAlias alias="Section" type="domain.blog.Section"/>
+    <typeAlias alias="Tag" type="domain.blog.Tag"/>
   </typeAliases>
 
   <typeHandlers>
-    <typeHandler javaType="" jdbcType="" handler=""/>
+    <typeHandler javaType="String" jdbcType="VARCHAR" handler="org.apache.ibatis.monarch.example.TestTypeHandler"/>
   </typeHandlers>
 
-  <objectFactory type="">
-    <property name="" value=""/>
+  <objectFactory type="org.apache.ibatis.monarch.example.TestObjectFactory">
+    <property name="objectFactoryProperty" value="100"/>
   </objectFactory>
 
   <plugins>
-    <plugin interceptor="">
-      <property name="" value=""/>
+    <plugin interceptor="org.apache.ibatis.monarch.example.TestPlugin">
+      <property name="pluginProperty" value="100"/>
     </plugin>
   </plugins>
 
   <environments default="development">
     <environment id="development">
-      <transactionManager type="JDBC|JTA|EXTERNAL">
+      <transactionManager type="JDBC">
         <property name="" value=""/>
       </transactionManager>
-      <dataSource type="POOLED|UNPOOLED|JNDI">
-        <property name="" value=""/>
+      <dataSource type="UNPOOLED">
+        <property name="driver" value="${driver}"/>
+        <property name="url" value="${url}"/>
+        <property name="username" value="${username}"/>
+        <property name="password" value="${password}"/>
       </dataSource>
     </environment>
   </environments>
 
   <mappers>
-    <mapper type="com.domain.PersonMapper"/>
-    <mapper type="com.domain.AnotherMapper" xml="resources/AnotherMapper.xml"/>
-    <mapper xml="resources/AnonymousMapper.xml"/>
+    <mapper xml="org/apache/ibatis/monarch/example/AuthorMapper.xml"/>
+    <mapper xml="org/apache/ibatis/monarch/example/BlogMapper.xml"/>
   </mappers>
 
 </configuration>

Added: ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/MapperConfigParserTest.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/MapperConfigParserTest.java?rev=705960&view=auto
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/MapperConfigParserTest.java
(added)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/MapperConfigParserTest.java
Sat Oct 18 22:41:05 2008
@@ -0,0 +1,12 @@
+package org.apache.ibatis.monarch.example;
+
+import org.junit.Test;
+
+public class MapperConfigParserTest {
+
+  @Test
+  public void shouldBuildBlogMappers() throws Exception {
+
+  }
+
+}

Added: ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/TestObjectFactory.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/TestObjectFactory.java?rev=705960&view=auto
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/TestObjectFactory.java
(added)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/TestObjectFactory.java
Sat Oct 18 22:41:05 2008
@@ -0,0 +1,22 @@
+package org.apache.ibatis.monarch.example;
+
+import org.apache.ibatis.reflection.DefaultObjectFactory;
+
+import java.util.List;
+import java.util.Properties;
+
+public class TestObjectFactory extends DefaultObjectFactory {
+
+  public Object create(Class type) {
+    return super.create(type);
+  }
+
+  public Object create(Class type, List<Class> constructorArgTypes, List<Object>
constructorArgs) {
+    return super.create(type,constructorArgTypes,constructorArgs);
+  }
+
+  public void setProperties(Properties properties) {
+    super.setProperties(properties);
+  }
+
+}

Added: ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/TestPlugin.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/TestPlugin.java?rev=705960&view=auto
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/TestPlugin.java
(added)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/TestPlugin.java
Sat Oct 18 22:41:05 2008
@@ -0,0 +1,23 @@
+package org.apache.ibatis.monarch.example;
+
+import org.apache.ibatis.plugin.Interceptor;
+import org.apache.ibatis.plugin.Invocation;
+import org.apache.ibatis.plugin.Plugin;
+
+import java.util.Properties;
+
+public class TestPlugin implements Interceptor {
+
+  public Object intercept(Invocation invocation) throws Throwable {
+    return invocation.proceed();
+  }
+
+  public Object plugin(Object target) {
+    return Plugin.wrap(target,this);
+  }
+
+  public void setProperties(Properties properties) {
+
+  }
+
+}

Added: ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/TestTypeHandler.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/TestTypeHandler.java?rev=705960&view=auto
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/TestTypeHandler.java
(added)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/TestTypeHandler.java
Sat Oct 18 22:41:05 2008
@@ -0,0 +1,25 @@
+package org.apache.ibatis.monarch.example;
+
+import org.apache.ibatis.type.TypeHandler;
+import org.apache.ibatis.type.JdbcType;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.ResultSet;
+import java.sql.CallableStatement;
+
+public class TestTypeHandler implements TypeHandler {
+
+  public void setParameter(PreparedStatement ps, int i, Object parameter, JdbcType jdbcType)
throws SQLException {
+    ps.setString(i,(String)parameter);
+  }
+
+  public Object getResult(ResultSet rs, String columnName) throws SQLException {
+    return rs.getString(columnName);
+  }
+
+  public Object getResult(CallableStatement cs, int columnIndex) throws SQLException {
+    return cs.getString(columnIndex);
+  }
+
+}

Added: ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/mapper.properties
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/mapper.properties?rev=705960&view=auto
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/mapper.properties
(added)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-monarch/src/test/java/org/apache/ibatis/monarch/example/mapper.properties
Sat Oct 18 22:41:05 2008
@@ -0,0 +1,3 @@
+url=jdbc:derby:ibderby;create=true
+username=
+password=
\ No newline at end of file



Mime
View raw message