- Fix unit tests ...

This commit is contained in:
Paulo Gustavo Veiga 2012-07-12 23:56:04 -03:00
parent 6582f073bd
commit a82439975d
5 changed files with 106 additions and 101 deletions

View File

@ -307,7 +307,7 @@
<configuration> <configuration>
<driver>org.hsqldb.jdbc.JDBCDriver</driver> <driver>org.hsqldb.jdbc.JDBCDriver</driver>
<url>jdbc:hsqldb:file:${basedir}/target/db/wisemapping</url> <url>jdbc:hsqldb:file:${project.basedir}/target/db/wisemapping</url>
<username>sa</username> <username>sa</username>
<!--all executions are ignored if -Dmaven.test.skipDB=true <!--all executions are ignored if -Dmaven.test.skipDB=true
Use this flag if you want to reuse an already created HSQL database instance Use this flag if you want to reuse an already created HSQL database instance
@ -339,7 +339,7 @@
<onError>continue</onError> <onError>continue</onError>
<orderFile>ascending</orderFile> <orderFile>ascending</orderFile>
<fileset> <fileset>
<basedir>${basedir}</basedir> <basedir>${project.basedir}</basedir>
<includes> <includes>
<include>src/test/sql/hsql/drop-schemas.sql</include> <include>src/test/sql/hsql/drop-schemas.sql</include>
</includes> </includes>
@ -356,7 +356,7 @@
<configuration> <configuration>
<orderFile>ascending</orderFile> <orderFile>ascending</orderFile>
<fileset> <fileset>
<basedir>${basedir}</basedir> <basedir>${project.basedir}</basedir>
<includes> <includes>
<include>src/test/sql/hsql/create-schemas.sql</include> <include>src/test/sql/hsql/create-schemas.sql</include>
</includes> </includes>
@ -372,7 +372,7 @@
<configuration> <configuration>
<orderFile>ascending</orderFile> <orderFile>ascending</orderFile>
<fileset> <fileset>
<basedir>${basedir}</basedir> <basedir>${project.basedir}</basedir>
<includes> <includes>
<include>src/test/sql/hsql/test-data.sql</include> <include>src/test/sql/hsql/test-data.sql</include>
</includes> </includes>
@ -461,13 +461,17 @@
<war>${project.build.directory}/wisemapping.war</war> <war>${project.build.directory}/wisemapping.war</war>
<reload>automatic</reload> <reload>automatic</reload>
<webAppConfig> <webAppConfig>
<overrideDescriptor>webdefault.xml</overrideDescriptor> <overrideDescriptor>${project.basedir}/webdefault.xml</overrideDescriptor>
</webAppConfig> </webAppConfig>
<systemProperties> <systemProperties>
<systemProperty> <systemProperty>
<name>org.mortbay.util.FileResource.checkAliases</name> <name>org.mortbay.util.FileResource.checkAliases</name>
<value>false</value> <value>false</value>
</systemProperty> </systemProperty>
<systemProperty>
<name>org.mortbay.util.FileResource.checkAliases</name>
<value>false</value>
</systemProperty>
</systemProperties> </systemProperties>
<!--<scanIntervalSeconds>10</scanIntervalSeconds>--> <!--<scanIntervalSeconds>10</scanIntervalSeconds>-->
</configuration> </configuration>

View File

@ -18,7 +18,7 @@
package com.wisemapping.model; package com.wisemapping.model;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable;
import java.io.Serializable; import java.io.Serializable;
import java.util.*; import java.util.*;
@ -141,11 +141,12 @@ public class User
this.username = username; this.username = username;
} }
@Nullable
public String getLocale() { public String getLocale() {
return locale; return locale;
} }
public void setLocale(@NotNull String locale) { public void setLocale(@Nullable String locale) {
this.locale = locale; this.locale = locale;
} }
} }

View File

@ -122,7 +122,7 @@ public class AdminController extends BaseController {
userService.changePassword(user); userService.changePassword(user);
} }
@RequestMapping(method = RequestMethod.DELETE) @RequestMapping(method = RequestMethod.DELETE,value = "admin/users/{id}")
@ResponseStatus(value = HttpStatus.NO_CONTENT) @ResponseStatus(value = HttpStatus.NO_CONTENT)
public void getUserByEmail(@PathVariable long id) throws IOException, WiseMappingException { public void getUserByEmail(@PathVariable long id) throws IOException, WiseMappingException {
final User user = userService.getUserBy(id); final User user = userService.getUserBy(id);

View File

@ -78,7 +78,7 @@ public class RestUser {
return user.getId(); return user.getId();
} }
public void setId(int id) { public void setId(long id) {
user.setId(id); user.setId(id);
} }

View File

@ -1,93 +1,93 @@
##################################################################################
# Database Configuration ##################################################################################
################################################################################## # Database Configuration
##################################################################################
# MySQL 5.X configuration properties
#database.url=jdbc:mysql://localhost/wisemapping # MySQL 5.X configuration properties
#database.driver=com.mysql.jdbc.Driver #database.url=jdbc:mysql://localhost/wisemapping
#database.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect #database.driver=com.mysql.jdbc.Driver
#database.username=wisemapping #database.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
#database.password=password #database.username=wisemapping
#database.password=password
# HSQL Configuration properties
database.url=jdbc:hsqldb:file:target/db/wisemapping # HSQL Configuration properties
database.driver=org.hsqldb.jdbc.JDBCDriver database.url=jdbc:hsqldb:file:target/db/wisemapping
database.hibernate.dialect=org.hibernate.dialect.HSQLDialect database.driver=org.hsqldb.jdbc.JDBCDriver
database.username=sa database.hibernate.dialect=org.hibernate.dialect.HSQLDialect
database.password= database.username=sa
database.password=
################################################################################## ##################################################################################
# Mail configuration. Must be configured to enable user registration confirmation. # Mail configuration. Must be configured to enable user registration confirmation.
################################################################################## ##################################################################################
#------------------------ #------------------------
# Plain SMTP Server Configuration # Plain SMTP Server Configuration
#------------------------ #------------------------
mail.smtp.port=465 mail.smtp.port=465
mail.smtp.host=localhost mail.smtp.host=localhost
mail.username=root mail.username=root
mail.password= mail.password=
mail.smtp.auth=false mail.smtp.auth=false
mail.smtp.starttls.enable=false mail.smtp.starttls.enable=false
mail.smtp.quitwait=false mail.smtp.quitwait=false
#------------------------ #------------------------
# SSL SMTP Server Configuration # SSL SMTP Server Configuration
#------------------------ #------------------------
#------------------------ #------------------------
# GMAIL SMTP Configuration # GMAIL SMTP Configuration
#------------------------ #------------------------
#mail.smtp.port=587 #mail.smtp.port=587
#mail.smtp.host=smtp.gmail.com #mail.smtp.host=smtp.gmail.com
#mail.username=<gmail-user-account> #mail.username=<gmail-user-account>
#mail.password=<gmail-password> #mail.password=<gmail-password>
#mail.smtp.auth=true #mail.smtp.auth=true
#mail.smtp.starttls.enable=true #mail.smtp.starttls.enable=true
#mail.smtp.quitwait=false #mail.smtp.quitwait=false
#------------------------ #------------------------
# Emails configuration # Emails configuration
#------------------------ #------------------------
# Required: "from" email account that will appear in the emails sent from the sender. # Required: "from" email account that will appear in the emails sent from the sender.
mail.serverSendEmail=root@localhost mail.serverSendEmail=root@localhost
# Optional: Support account that the users could use to contact you. This address will appear in emails and in some places in the site. # Optional: Support account that the users could use to contact you. This address will appear in emails and in some places in the site.
mail.supportEmail=root@localhost mail.supportEmail=root@localhost
# Optional: Unexpected error will be reported to this address. # Optional: Unexpected errors will be reported to this address.
mail.errorReporterEmail= mail.errorReporterEmail=
################################################################################## ##################################################################################
# Users Registration Configuration # Users Registration Configuration
################################################################################## ##################################################################################
# Enable/Disable user registration confirmation by e-mail. If it's enabled, mail must be configured. # Enable/Disable user registration confirmation by e-mail. If it's enabled, mail must be configured.
registration.email.enabled = false registration.email.enabled = false
# Enable captcha confirmation # Enable captcha confirmation
google.recaptcha.enabled = true google.recaptcha.enabled = true
# ReCaptcha is the default captcha. Public and private keys are required. # ReCaptcha is the default captcha. Public and private keys are required.
# More Info: http://www.google.com/recaptcha . # More Info: http://www.google.com/recaptcha .
google.recaptcha.privateKey = 6LeQ4tISAAAAAMfHMPRKyHupTfA-KE4QeTCnLXhK google.recaptcha.privateKey = 6LeQ4tISAAAAAMfHMPRKyHupTfA-KE4QeTCnLXhK
google.recaptcha.publicKey = 6LeQ4tISAAAAALzCGKNgRv8UqsDx7Cb0vq4wbJBr google.recaptcha.publicKey = 6LeQ4tISAAAAALzCGKNgRv8UqsDx7Cb0vq4wbJBr
################################################################################## ##################################################################################
# Site configuration # Site configuration
################################################################################## ##################################################################################
# Site administration user. This user will have special permissions for operations such as removing users, set password # Site administration user. This user will have special permissions for operations such as removing users, set password
# etc. # etc.
admin.user = admin@wisemapping.org admin.user = admin@wisemapping.org
# Site URL. This url will be used during sharing emails and public views. # Site URL. This url will be used during sharing emails and public views.
site.baseurl = http://localhost:8080 site.baseurl = http://localhost:8080
################################################################################## ##################################################################################
# Google Analytics Settings # Google Analytics Settings
################################################################################## ##################################################################################
google.analytics.enabled=false google.analytics.enabled=false
google.analytics.account=UA-XXXX google.analytics.account=UA-XXXX