Author: echatellier Date: 2014-06-27 16:50:53 +0200 (Fri, 27 Jun 2014) New Revision: 278 Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/278 Log: Fix database attachment Added: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MiscTest.java Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/AbstractFaxToMailServiceTest.java trunk/pom.xml Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties =================================================================== --- trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-06-27 14:22:11 UTC (rev 277) +++ trunk/faxtomail-persistence/src/main/xmi/faxtomail.properties 2014-06-27 14:50:53 UTC (rev 278) @@ -24,7 +24,6 @@ model.tagValue.notGenerateToString=true model.tagValue.constantPrefix=PROPERTY_ model.tagValue.hibernateAttributeType.java.lang.String=text -model.tagValue.hibernateAttributeType.byte[]=binary model.tagValue.useEnumerationName=true model.tagValue.doNotGenerateBooleanGetMethods=true @@ -60,6 +59,9 @@ # AttachmentFile com.franciaflex.faxtomail.persistence.entities.AttachmentFile.attribute.filename.tagvalue.notNull=true com.franciaflex.faxtomail.persistence.entities.AttachmentFile.attribute.content.tagvalue.notNull=true +# il faut mettre une valeur > � 8000 pour que la mapping g�n�re un type varbinary(max) +com.franciaflex.faxtomail.persistence.entities.AttachmentFile.attribute.content.tagValue.hibernateAttributeType=binary +com.franciaflex.faxtomail.persistence.entities.AttachmentFile.attribute.content.tagvalue.length=9999999 # MailFolder com.franciaflex.faxtomail.persistence.entities.MailFolder.class.tagvalue.naturalIdMutable=true Modified: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/AbstractFaxToMailServiceTest.java =================================================================== --- trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/AbstractFaxToMailServiceTest.java 2014-06-27 14:22:11 UTC (rev 277) +++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/AbstractFaxToMailServiceTest.java 2014-06-27 14:50:53 UTC (rev 278) @@ -62,8 +62,7 @@ protected File databaseFile; - protected FaxToMailTopiaApplicationContext newApplicationContext(String dataBase) { - + protected Map<String, String> getDatabaseConfiguration(String dataBase) { Map<String, String> hibernateH2Config = new HashMap<String, String>(); hibernateH2Config.putAll(getApplicationConfig().getTopiaProperties()); @@ -92,7 +91,14 @@ if (log.isDebugEnabled()) { log.debug("jdbc url is\n" + jdbcUrl); } + + return hibernateH2Config; + } + protected FaxToMailTopiaApplicationContext newApplicationContext(String dataBase) { + + Map<String, String> hibernateH2Config = getDatabaseConfiguration(dataBase); + FaxToMailTopiaApplicationContext applicationContext = new FaxToMailTopiaApplicationContext(hibernateH2Config); if (log.isTraceEnabled()) { @@ -241,7 +247,9 @@ } // clear full directory - FileUtils.deleteDirectory(databaseFile); + if (databaseFile != null) { + FileUtils.deleteDirectory(databaseFile); + } } protected static FaxToMailConfiguration getApplicationConfig() { Added: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MiscTest.java =================================================================== --- trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MiscTest.java (rev 0) +++ trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MiscTest.java 2014-06-27 14:50:53 UTC (rev 278) @@ -0,0 +1,54 @@ +package com.franciaflex.faxtomail.services.service; + +/* + * #%L + * FaxToMail :: Service + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2014 Franciaflex, Code Lutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import java.util.HashMap; +import java.util.Map; + +import org.hibernate.cfg.Environment; +import org.junit.Ignore; +import org.junit.Test; + +@Ignore +public class MiscTest extends AbstractFaxToMailServiceTest { + + @Override + protected Map<String, String> getDatabaseConfiguration(String dataBase) { + Map<String, String> hibernateH2Config = new HashMap<String, String>(); + + hibernateH2Config.put(Environment.DIALECT, "org.hibernate.dialect.SQLServer2008Dialect"); + hibernateH2Config.put(Environment.DRIVER, "net.sourceforge.jtds.jdbc.Driver"); + hibernateH2Config.put(Environment.USER, "fx"); + hibernateH2Config.put(Environment.PASS, "FX2013!"); + hibernateH2Config.put(Environment.HBM2DDL_AUTO, ""); + hibernateH2Config.put(Environment.URL, "jdbc:jtds:sqlserver://192.168.100.247:1433/faxtomailtest"); + return hibernateH2Config; + } + + @Test + public void getSqlServerSchema() { + getApplicationContext().showCreateSchema(); + } +} Property changes on: trunk/faxtomail-service/src/test/java/com/franciaflex/faxtomail/services/service/MiscTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2014-06-27 14:22:11 UTC (rev 277) +++ trunk/pom.xml 2014-06-27 14:50:53 UTC (rev 278) @@ -104,8 +104,8 @@ <nuitonValidatorVersion>3.0-rc-1</nuitonValidatorVersion> <nuitonWebVersion>1.16</nuitonWebVersion> - <eugeneVersion>2.10</eugeneVersion> - <topiaVersion>3.0-beta-6</topiaVersion> + <eugeneVersion>2.11-SNAPSHOT</eugeneVersion> + <topiaVersion>3.0-SNAPSHOT</topiaVersion> <hibernateVersion>4.3.5.Final</hibernateVersion> <h2Version>1.3.176</h2Version>