[jugevents.version3] 5 new revisions pushed by enricogi...@gmail.com on 2013-05-19 22:19 GMT

0 views
Skip to first unread message

juge...@googlecode.com

unread,
May 19, 2013, 6:19:49 PM5/19/13
to jugevent...@googlegroups.com
5 new revisions:

Revision: 5a3d2d372c62
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Sun May 19 10:58:10 2013
Log: build cleanup, update tests to junit4, cleanup pons & reduce
dependenc...
http://code.google.com/p/jugevents/source/detail?r=5a3d2d372c62&repo=version3

Revision: 9466e4053050
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Sun May 19 11:10:44 2013
Log: back in 90's, switch to Java 6
http://code.google.com/p/jugevents/source/detail?r=9466e4053050&repo=version3

Revision: 33763a27b01a
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Sun May 19 11:47:24 2013
Log: (re)add missing dwr3plugin
http://code.google.com/p/jugevents/source/detail?r=33763a27b01a&repo=version3

Revision: 11d4ca91b614
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Sun May 19 11:54:40 2013
Log: fix transitive dependency
http://code.google.com/p/jugevents/source/detail?r=11d4ca91b614&repo=version3

Revision: e07bceccd068
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Sun May 19 12:25:20 2013
Log: fix inexistent import package
http://code.google.com/p/jugevents/source/detail?r=e07bceccd068&repo=version3

==============================================================================
Revision: 5a3d2d372c62
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Sun May 19 10:58:10 2013
Log: build cleanup, update tests to junit4, cleanup pons & reduce
dependencies
http://code.google.com/p/jugevents/source/detail?r=5a3d2d372c62&repo=version3

Added:
/jugevents/jugevents-web/src/main/java/it/jugpadova/JugEventsDaos.java
/jugevents/jugevents-web/src/test/resources/applicationContext-test.xml
Deleted:
/jugevents/jugevents-web/src/main/java/it/jugpadova/Daos.java

/jugevents/jugevents-web/src/main/java/it/jugpadova/mock/ParancoeMockMailSender.java
/jugevents/jugevents-web/src/main/resources/log4j.properties
/jugevents/jugevents-web/src/test/resources/log4j.properties
/jugevents/jugevents-web/src/test/resources/spring-test.xml
Modified:
/jugevents/jugevents-core/pom.xml
/jugevents/jugevents-web/pom.xml
/jugevents/jugevents-web/src/main/java/it/jugpadova/Blos.java
/jugevents/jugevents-web/src/main/java/it/jugpadova/blo/EventBo.java

/jugevents/jugevents-web/src/main/java/it/jugpadova/controllers/AdminController.java

/jugevents/jugevents-web/src/main/java/it/jugpadova/controllers/JCaptchaController.java
/jugevents/jugevents-web/src/main/java/it/jugpadova/po/Event.java
/jugevents/jugevents-web/src/main/java/it/jugpadova/po/Speaker.java

/jugevents/jugevents-web/src/main/java/it/jugpadova/util/CustomCommonsMultipartResolver.java

/jugevents/jugevents-web/src/main/java/it/jugpadova/util/mime/MagicMimeEntry.java
/jugevents/jugevents-web/src/main/resources/logback.xml
/jugevents/jugevents-web/src/main/webapp/WEB-INF/applicationContext.xml
/jugevents/jugevents-web/src/test/java/it/jugpadova/FootprintTest.java
/jugevents/jugevents-web/src/test/java/it/jugpadova/JugEventsBaseTest.java

/jugevents/jugevents-web/src/test/java/it/jugpadova/JugEventsControllerTest.java
/jugevents/jugevents-web/src/test/java/it/jugpadova/ParancoeTest.java
/jugevents/jugevents-web/src/test/java/it/jugpadova/SanityTest.java

/jugevents/jugevents-web/src/test/java/it/jugpadova/bean/SpeakerBeanTest.java
/jugevents/jugevents-web/src/test/java/it/jugpadova/blo/EventBoTest.java

/jugevents/jugevents-web/src/test/java/it/jugpadova/blo/EventRegistrationOpenTest.java
/jugevents/jugevents-web/src/test/java/it/jugpadova/blo/JugBoTest.java
/jugevents/jugevents-web/src/test/java/it/jugpadova/blo/JuggerBoTest.java

/jugevents/jugevents-web/src/test/java/it/jugpadova/blo/ParticipantBadgeBoTest.java
/jugevents/jugevents-web/src/test/java/it/jugpadova/blol/FeedsBoTest.java

/jugevents/jugevents-web/src/test/java/it/jugpadova/blol/SchedulerBoTest.java

/jugevents/jugevents-web/src/test/java/it/jugpadova/controllers/EventEditControllerTest.java

/jugevents/jugevents-web/src/test/java/it/jugpadova/controllers/HomeControllerTest.java
/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/EventDaoTest.java

/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/EventResourceDaoTest.java
/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/JUGDaoTest.java
/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/JuggerDaoTest.java

/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/ParticipantDaoTest.java
/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/SpeakerDaoTest.java

/jugevents/jugevents-web/src/test/java/it/jugpadova/plugins/TestSecurityPlugin.java
/jugevents/jugevents-web/src/test/java/it/jugpadova/util/UtilitiesTest.java

/jugevents/jugevents-web/src/test/java/it/jugpadova/util/mime/MimeUtilTest.java
/jugevents/jugevents-web/src/test/resources/database-test.xml
/jugevents/pom.xml

=======================================
--- /dev/null
+++ /jugevents/jugevents-web/src/main/java/it/jugpadova/JugEventsDaos.java
Sun May 19 10:58:10 2013
@@ -0,0 +1,73 @@
+/**
+ * Copyright (C) 2007-2011 JUG Events Team <in...@jugevents.org>
+ *
+ * This file is part of JUG Events Web Application.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package it.jugpadova;
+
+import it.jugpadova.dao.ArchiveVideoResourceDao;
+import it.jugpadova.dao.EventDao;
+import it.jugpadova.dao.EventLinkDao;
+import it.jugpadova.dao.EventResourceDao;
+import it.jugpadova.dao.FlickrResourceDao;
+import it.jugpadova.dao.JUGDao;
+import it.jugpadova.dao.JuggerDao;
+import it.jugpadova.dao.ParticipantDao;
+
+import it.jugpadova.dao.SlideShareResourceDao;
+import it.jugpadova.dao.YouTubeResourceDao;
+import org.lambico.dao.Daos;
+import org.parancoe.plugins.securityevolution.AuthorityDao;
+import org.parancoe.plugins.securityevolution.UserDao;
+import org.parancoe.plugins.world.ContinentDao;
+import org.parancoe.plugins.world.CountryDao;
+
+/**
+ * Interface for the DAO Provider. Doesn't require an implementation.
Simply add
+ * methods for the DAOs you need to use. The convention for the methods is
get<dao_bean_id>.
+ */
+public interface JugEventsDaos extends Daos {
+
+ public EventDao getEventDao();
+
+ public ParticipantDao getParticipantDao();
+
+ public JuggerDao getJuggerDao();
+
+ public UserDao getUserDao();
+
+ public AuthorityDao getAuthorityDao();
+
+ public CountryDao getCountryDao();
+
+ public ContinentDao getContinentDao();
+
+ public JUGDao getJUGDao();
+
+
+
+ public EventResourceDao getEventResourceDao();
+
+ public EventLinkDao getEventLinkDao();
+
+ public SlideShareResourceDao getSlideShareResourceDao();
+
+ public FlickrResourceDao getFlickrResourceDao();
+
+ public ArchiveVideoResourceDao getArchiveVideoResourceDao();
+
+ public YouTubeResourceDao getYouTubeResourceDao();
+}
=======================================
--- /dev/null
+++ /jugevents/jugevents-web/src/test/resources/applicationContext-test.xml
Sun May 19 10:58:10 2013
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2007-2011 JUG Events Team <in...@jugevents.org>
+
+ This file is part of JUG Events Web Application.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:lambico="http://www.lambico.org/schema/lambico"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.lambico.org/schema/lambico
http://www.lambico.org/schema/lambico.xsd">
+
+ <bean id="servicesBo" class="it.jugpadova.mock.MockServicesBo"/>
+
+ <bean id="mailSender"
class="org.parancoe.test.InspectableTestMailSender"/>
+
+ <bean id="footprintSettings"
class="net.java.dev.footprint.model.generated.FootprintProperties">
+ <property name="title" value="JUG Event Certificate"/>
+ <property name="template">
+ <bean
class="net.java.dev.footprint.model.generated.ConfigPdfTemplate">
+ <property name="pdfTemplateFilename"
value="footprint/template.pdf"/>
+ <property name="pdfGeneratedPrefix" value=""/>
+ <property name="pdfGeneratedPath" value="delete_this"/>
+ <property name="pdfGeneratedExtension" value=".pdf"/>
+ </bean>
+ </property>
+ <property name="security">
+ <bean
class="net.java.dev.footprint.model.generated.ConfigSecurity">
+ <property name="keystoreType" value="JKS"/>
+ <property name="keystorePkProvider" value="SUN"/>
+ <property name="keystorePkAlias" value="fpdemo"/>
+ <property name="keystoreFilename"
value="footprint/demo.keystore"/>
+ <property name="keystorePassword" value="footprint"/>
+ <property name="keystorePkPassword" value="footprint"/>
+ <property name="signatureContactMail"
value="ma...@mail.com"/>
+ <property name="signatureLocation" value="Fortaleza Ce
Brasil"/>
+ <property name="signatureReason" value="Evento cafe com
Tapioca"/>
+ <property name="signatureStamp">
+ <bean
class="net.java.dev.footprint.model.generated.SignatureStamp">
+ <property name="signatureStampImageFilename"
value="footprint/stamp.png"/>
+ <property name="signatureStampX1" value="140"/>
+ <property name="signatureStampY1" value="100"/>
+ <property name="signatureStampX2" value="165"/>
+ <property name="signatureStampY2" value="124"/>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ </bean>
+
+ <bean id="tilesDefinitionUrls" class="java.util.ArrayList">
+ <constructor-arg>
+ <list >
+
<value>file://${basedir}/src/main/webapp/WEB-INF/tiles/defs/default.xml</value>
+ </list>
+ </constructor-arg>
+ </bean>
+
+</beans>
=======================================
--- /jugevents/jugevents-web/src/main/java/it/jugpadova/Daos.java Sun Feb
24 15:16:13 2013
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright (C) 2007-2011 JUG Events Team <in...@jugevents.org>
- *
- * This file is part of JUG Events Web Application.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package it.jugpadova;
-
-import it.jugpadova.dao.ArchiveVideoResourceDao;
-import it.jugpadova.dao.EventDao;
-import it.jugpadova.dao.EventLinkDao;
-import it.jugpadova.dao.EventResourceDao;
-import it.jugpadova.dao.FlickrResourceDao;
-import it.jugpadova.dao.JUGDao;
-import it.jugpadova.dao.JuggerDao;
-import it.jugpadova.dao.ParticipantDao;
-
-import it.jugpadova.dao.SlideShareResourceDao;
-import it.jugpadova.dao.YouTubeResourceDao;
-import org.lambico.dao.DaoProvider;
-import org.parancoe.plugins.securityevolution.AuthorityDao;
-import org.parancoe.plugins.securityevolution.UserDao;
-import org.parancoe.plugins.world.ContinentDao;
-import org.parancoe.plugins.world.CountryDao;
-
-/**
- * Interface for the DAO Provider. Doesn't require an implementation.
Simply add
- * methods for the DAOs you need to use. The convention for the methods is
get<dao_bean_id>.
- */
-public interface Daos extends DaoProvider {
-
- public EventDao getEventDao();
-
- public ParticipantDao getParticipantDao();
-
- public JuggerDao getJuggerDao();
-
- public UserDao getUserDao();
-
- public AuthorityDao getAuthorityDao();
-
- public CountryDao getCountryDao();
-
- public ContinentDao getContinentDao();
-
- public JUGDao getJUGDao();
-
-
-
- public EventResourceDao getEventResourceDao();
-
- public EventLinkDao getEventLinkDao();
-
- public SlideShareResourceDao getSlideShareResourceDao();
-
- public FlickrResourceDao getFlickrResourceDao();
-
- public ArchiveVideoResourceDao getArchiveVideoResourceDao();
-
- public YouTubeResourceDao getYouTubeResourceDao();
-}
=======================================
---
/jugevents/jugevents-web/src/main/java/it/jugpadova/mock/ParancoeMockMailSender.java
Tue Apr 16 18:38:46 2013
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Copyright (C) 2007-2011 JUG Events Team <in...@jugevents.org>
- *
- * This file is part of JUG Events Web Application.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package it.jugpadova.mock;
-
-import javax.mail.internet.MimeMessage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.mail.MailException;
-import org.springframework.mail.javamail.JavaMailSenderImpl;
-
-/**
- * Mock implementation of JavaMailSender for test porpouse.
- *
- * @author Enrico Giurin
- * @author Lucio Benfante
- *
- */
-public class ParancoeMockMailSender extends JavaMailSenderImpl {
-
- private static final Logger logger = LoggerFactory.getLogger(
- ParancoeMockMailSender.class);
-
- @Override
- protected void doSend(MimeMessage[] mimeMessages, Object[]
originalMessages)
- throws MailException {
- if (mimeMessages != null) {
- for (MimeMessage mimeMessage : mimeMessages) {
- try {
- logger.info(mimeMessage.getContent().toString());
- } catch (Exception ex) {
- logger.error("Can't get message content", ex);
- }
- }
- }
- if (originalMessages != null) {
- for (Object o : originalMessages) {
- logger.info(o.toString());
- }
- }
- }
-}
=======================================
--- /jugevents/jugevents-web/src/main/resources/log4j.properties Wed Mar 30
08:34:27 2011
+++ /dev/null
@@ -1,16 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE, MEMORY
-log4j.additivity.default=false
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d [%p] %c: %m%n
-
-log4j.appender.MEMORY=org.parancoe.util.MemoryAppender
-log4j.appender.MEMORY.layout=org.apache.log4j.PatternLayout
-log4j.appender.MEMORY.layout.ConversionPattern=%d [%p] %c: %m%n
-
-log4j.logger.org.parancoe=INFO
-log4j.logger.it.jugpadova=INFO
-#log4j.logger.javax.mail=DEBUG
-#log4j.logger.org.springframework.mail=DEBUG
-#log4j.logger.org.springframework.ui=DEBUG
-log4j.logger.net.jawr=INFO
=======================================
--- /jugevents/jugevents-web/src/test/resources/log4j.properties Tue Apr 16
18:38:46 2013
+++ /dev/null
@@ -1,34 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE, MEMORY
-log4j.additivity.default=false
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d [%p] %c: %m%n
-
-log4j.appender.MEMORY=org.parancoe.util.MemoryAppender
-log4j.appender.MEMORY.layout=org.apache.log4j.PatternLayout
-log4j.appender.MEMORY.layout.ConversionPattern=%d [%p] %c: %m%n
-
-#log4j.appender.SMTP=org.apache.log4j.net.SMTPAppender
-#log4j.appender.SMTP.Threshold=ERROR
-#log4j.appender.SMTP.BufferSize=20
-#log4j.appender.SMTP.To=x...@yyy.it, z...@yyy.it
-#log4j.appender.SMTP.From=h...@yyy.it
-#log4j.appender.SMTP.SMTPHost=mail.yyy.it
-#log4j.appender.SMTP.Subject=Parancoe Error Message
-#log4j.appender.SMTP.SMTPUsername=username
-#log4j.appender.SMTP.SMTPPassword=password
-#log4j.appender.SMTP.layout=org.apache.log4j.PatternLayout
-#log4j.appender.SMTP.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
-
-#log4j.logger.java.sql=DEBUG
-#log4j.logger.javax.sql=DEBUG
-
-# log hibernate
-# la riga seguente abilita il log dei prepared statement
-#log4j.logger.org.hibernate.SQL=DEBUG
-
-# la riga seguente abilita il logging dei parametri passati ai prepared
statement
-#log4j.logger.org.hibernate.type=DEBUG
-#log4j.additivity.org.hibernate.SQL=false
-
-log4j.logger.org.parancoe=INFO
=======================================
--- /jugevents/jugevents-web/src/test/resources/spring-test.xml Thu Mar 31
08:27:26 2011
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2007-2011 JUG Events Team <in...@jugevents.org>
-
- This file is part of JUG Events Web Application.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:lambico="http://www.lambico.org/schema/lambico"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.lambico.org/schema/lambico
http://www.lambico.org/schema/lambico.xsd">
-
- <bean id="servicesBo" class="it.jugpadova.mock.MockServicesBo"/>
-
- <!-- start mail section (test purpose)-->
- <bean id="mailSender"
class="it.jugpadova.mock.ParancoeMockMailSender"/>
-
- <bean id="footprintSettings"
class="net.java.dev.footprint.model.generated.FootprintProperties">
- <property name="title" value="JUG Event Certificate"/>
- <property name="template">
- <bean
class="net.java.dev.footprint.model.generated.ConfigPdfTemplate">
- <property name="pdfTemplateFilename"
value="footprint/template.pdf"/>
- <property name="pdfGeneratedPrefix" value=""/>
- <property name="pdfGeneratedPath" value="delete_this"/>
- <property name="pdfGeneratedExtension" value=".pdf"/>
- </bean>
- </property>
- <property name="security">
- <bean
class="net.java.dev.footprint.model.generated.ConfigSecurity">
- <property name="keystoreType" value="JKS"/>
- <property name="keystorePkProvider" value="SUN"/>
- <property name="keystorePkAlias" value="fpdemo"/>
- <property name="keystoreFilename"
value="footprint/demo.keystore"/>
- <property name="keystorePassword" value="footprint"/>
- <property name="keystorePkPassword" value="footprint"/>
- <property name="signatureContactMail"
value="ma...@mail.com"/>
- <property name="signatureLocation" value="Fortaleza Ce
Brasil"/>
- <property name="signatureReason" value="Evento cafe com
Tapioca"/>
- <property name="signatureStamp">
- <bean
class="net.java.dev.footprint.model.generated.SignatureStamp">
- <property name="signatureStampImageFilename"
value="footprint/stamp.png"/>
- <property name="signatureStampX1" value="140"/>
- <property name="signatureStampY1" value="100"/>
- <property name="signatureStampX2" value="165"/>
- <property name="signatureStampY2" value="124"/>
- </bean>
- </property>
- </bean>
- </property>
- </bean>
-
- <bean id="tilesDefinitionUrls" class="java.util.ArrayList">
- <constructor-arg>
- <list >
-
<value>file://${basedir}/src/main/webapp/WEB-INF/tiles/defs/default.xml</value>
- </list>
- </constructor-arg>
- </bean>
-
-</beans>
=======================================
--- /jugevents/jugevents-core/pom.xml Mon Apr 30 17:37:43 2012
+++ /jugevents/jugevents-core/pom.xml Sun May 19 10:58:10 2013
@@ -65,7 +65,12 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>hsqldb</groupId>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>test</scope>
</dependency>
@@ -79,10 +84,5 @@
<artifactId>commons-dbcp</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- <scope>provided</scope>
- </dependency>
</dependencies>
</project>
=======================================
--- /jugevents/jugevents-web/pom.xml Tue Apr 16 18:38:46 2013
+++ /jugevents/jugevents-web/pom.xml Sun May 19 10:58:10 2013
@@ -28,7 +28,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
- <version>2.2</version>
+ <version>2.3</version>
<configuration>
<encoding>UTF-8</encoding>
<webResources>
@@ -91,7 +91,7 @@
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
- <version>1.0-beta-1</version>
+ <version>1.4.0</version>
<configuration>
<wait>false</wait>
<container>
@@ -105,14 +105,14 @@

<cargo.remote.username>${tomcat.remote.username}</cargo.remote.username>

<cargo.remote.password>${tomcat.remote.password}</cargo.remote.password>
</properties>
- <deployables>
- <deployable>
- <groupId>org.jugevents</groupId>
- <artifactId>jugevents-web</artifactId>
- <type>war</type>
- </deployable>
- </deployables>
</configuration>
+ <deployables>
+ <deployable>
+ <groupId>org.jugevents</groupId>
+ <artifactId>jugevents-web</artifactId>
+ <type>war</type>
+ </deployable>
+ </deployables>
</configuration>
</plugin>
</plugins>
@@ -121,28 +121,27 @@
<dependency>
<groupId>org.jugevents</groupId>
<artifactId>jugevents-core</artifactId>
- <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-web</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.parancoe</groupId>
- <artifactId>parancoe-test</artifactId>
</dependency>
<dependency>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-plugin-tiles</artifactId>
- <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-plugin-world</artifactId>
- <scope>compile</scope>
</dependency>
-
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ </dependency>
<!-- Servlet/JSP APIs provided by your container -->
<dependency>
<groupId>javax.servlet</groupId>
@@ -157,7 +156,7 @@

<!-- Spring Security -->
<!-- springsecurity tag lib -->
- <!-- <dependency>
+ <!-- <dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<exclusions>
@@ -209,20 +208,12 @@
</dependency> -->

<!-- db driver(s) -->
- <!-- HSQLDB -->
- <dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <scope>provided</scope>
- </dependency>
-
<!-- mysql db -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>provided</scope>
</dependency>
-
<!-- PostgreSQL db -->
<dependency>
<groupId>postgresql</groupId>
@@ -230,20 +221,18 @@
<scope>provided</scope>
</dependency>

- <dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <scope>test</scope>
- </dependency>
-
<!-- AJAX framework -->
- <!--
+ <!--
<dependency>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-plugin-dwr</artifactId>
</dependency>
+ <dependency>
+ <groupId>net.jawr.dwr</groupId>
+ <artifactId>dwr3plugin</artifactId>
+ </dependency>
-->
- <dependency>
+ <dependency>
<groupId>org.directwebremoting</groupId>
<artifactId>dwr</artifactId>
</dependency>
@@ -252,22 +241,44 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
+ <scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ <version>1.3</version>
+ <scope>test</scope>
+ </dependency>

<!-- Other -->
<dependency>
<groupId>net.java.dev.textile-j</groupId>
<artifactId>textile-j</artifactId>
</dependency>
-<!--
+ <!--
<dependency>
<groupId>com.plink</groupId>
<artifactId>plextile</artifactId>
<version>1.0.5</version>
</dependency>
--->
+ -->
<dependency>
- <groupId>jcaptcha</groupId>
+ <groupId>com.octo.captcha</groupId>
<artifactId>jcaptcha-all</artifactId>
</dependency>
<dependency>
@@ -302,12 +313,6 @@
<groupId>displaytag</groupId>
<artifactId>displaytag</artifactId>
<scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>footprint</groupId>
@@ -331,17 +336,12 @@
<dependency>
<groupId>com.benfante</groupId>
<artifactId>JSlideShare</artifactId>
- <scope>compile</scope>
</dependency>
<dependency>
<groupId>net.jawr</groupId>
<artifactId>jawr</artifactId>
</dependency>
<dependency>
- <groupId>net.jawr.dwr</groupId>
- <artifactId>dwr3plugin</artifactId>
- </dependency>
- <dependency>
<groupId>com.yahoo.platform.yui</groupId>
<artifactId>yuicompressor</artifactId>
</dependency>
@@ -352,7 +352,6 @@
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
- <type>jar</type>
</dependency>
<dependency>
<groupId>net.fortuna.ical4j</groupId>
@@ -369,34 +368,14 @@
<type>jar</type>
</dependency>
<dependency>
- <artifactId>log4j</artifactId>
- <groupId>log4j</groupId>
- <type>jar</type>
- </dependency>
- <dependency>
- <artifactId>slf4j-log4j12</artifactId>
- <groupId>org.slf4j</groupId>
- <type>jar</type>
- </dependency>
- <dependency>
- <artifactId>slf4j-api</artifactId>
- <groupId>org.slf4j</groupId>
- <type>jar</type>
- </dependency>
- <dependency>
- <artifactId>slf4j-simple</artifactId>
- <groupId>org.slf4j</groupId>
- <type>jar</type>
- </dependency>
- <dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<scope>compile</scope>
</dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-openid</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-openid</artifactId>
+ </dependency>
</dependencies>
<profiles>
<profile>
@@ -411,4 +390,3 @@
</profile>
</profiles>
</project>
-
=======================================
--- /jugevents/jugevents-web/src/main/java/it/jugpadova/Blos.java Sat Mar
9 20:41:28 2013
+++ /jugevents/jugevents-web/src/main/java/it/jugpadova/Blos.java Sun May
19 10:58:10 2013
@@ -28,7 +28,6 @@
import it.jugpadova.blo.ParticipantBo;

import it.jugpadova.blol.ServicesBo;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("blos")
=======================================
--- /jugevents/jugevents-web/src/main/java/it/jugpadova/blo/EventBo.java
Tue Apr 16 18:38:46 2013
+++ /jugevents/jugevents-web/src/main/java/it/jugpadova/blo/EventBo.java
Sun May 19 10:58:10 2013
@@ -79,10 +79,8 @@
import org.hibernate.search.Search;
import org.joda.time.DateTime;
import org.lambico.dao.spring.hibernate.HibernateGenericDao;
-
-import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.LoggerFactory;
import org.springframework.context.MessageSource;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
=======================================
---
/jugevents/jugevents-web/src/main/java/it/jugpadova/controllers/AdminController.java
Tue Apr 16 18:38:46 2013
+++
/jugevents/jugevents-web/src/main/java/it/jugpadova/controllers/AdminController.java
Sun May 19 10:58:10 2013
@@ -15,30 +15,26 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova.controllers;

+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.MemoryAppender;
import it.jugpadova.blo.EventBo;
import it.jugpadova.blo.JugBo;
import it.jugpadova.blo.SpeakerBo;
-import it.jugpadova.dao.SpeakerDao;
-import it.jugpadova.po.Speaker;
-import it.jugpadova.util.Utilities;

import java.util.HashMap;
+import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

-import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.parancoe.util.MemoryAppender;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
-import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@@ -48,13 +44,12 @@

@Resource
private JugBo jugBo;
-
@Resource
private EventBo eventBo;
@Resource
private SpeakerBo speakerBo;
private static final Logger logger =
- LoggerFactory.getLogger(AdminController.class);
+ LoggerFactory.getLogger(AdminController.class);

@RequestMapping
public ModelAndView index(HttpServletRequest req,
@@ -66,7 +61,7 @@
public ModelAndView logs(HttpServletRequest req,
HttpServletResponse res) {
if ("true".equals(req.getParameter("clean"))) {
- MemoryAppender.clean();
+ MemoryAppender.getInstance().clearLogs();
}

if ("error".equals(req.getParameter("test"))) {
@@ -75,8 +70,8 @@
if ("warn".equals(req.getParameter("test"))) {
logger.warn("sample warn message");
}
- String log = MemoryAppender.getFullLog();
- log = colourLog(log);
+ List<ILoggingEvent> logLines =
MemoryAppender.getInstance().getLogLines();
+ String log = colourLog(logLines);

Map params = new HashMap();
params.put("log", log);
@@ -95,25 +90,30 @@
return new ModelAndView("admin/spring", null);
}

- private String colourLog(String log) {
- String[] lines;
- if (log == null) {
- lines = new String[]{""};
- } else {
- lines = log.split("[\\n\\r]");
- }
- for (int i = 0; i < lines.length; i++) {
- if (lines[i].indexOf("[ERROR]") != -1) {
- lines[i] = "<span class=\"log_error\">" + lines[i]
+ "</span>";
- }
- if (lines[i].indexOf("[WARN]") != -1) {
- lines[i] = "<span class=\"log_warn\">" + lines[i]
+ "</span>";
- }
- if (StringUtils.isNotBlank(lines[i])) {
- lines[i] += "<br/>";
+ private String colourLog(List<ILoggingEvent> logLines) {
+ StringBuilder sb = new StringBuilder();
+ for (ILoggingEvent line : logLines) {
+ String cssClass;
+ switch (line.getLevel().levelInt) {
+ case Level.ERROR_INT:
+ cssClass = "text-error";
+ break;
+ case Level.DEBUG_INT:
+ cssClass = "muted";
+ break;
+ case Level.WARN_INT:
+ cssClass = "text-warning";
+ break;
+ case Level.INFO_INT:
+ cssClass = "text-info";
+ break;
+ default:
+ cssClass = "";
}
+ sb.append("<p
class=\"").append(cssClass).append("\">").append(line.
+ getFormattedMessage()).append("</p>");
}
- return StringUtils.join(lines);
+ return sb.toString();
}

@RequestMapping
@@ -123,7 +123,7 @@
return new ModelAndView("redirect:/admin/logs.html");
}

- @RequestMapping
+ @RequestMapping
public ModelAndView regenerateLuceneIndexes(HttpServletRequest req,
HttpServletResponse res) throws Exception {
eventBo.regenerateLuceneIndexes();
@@ -131,6 +131,4 @@
logger.info("Regenerated the Lucene indexes");
return new ModelAndView("redirect:/admin/logs.html");
}
-
-
}
=======================================
---
/jugevents/jugevents-web/src/main/java/it/jugpadova/controllers/JCaptchaController.java
Tue Apr 16 18:38:46 2013
+++
/jugevents/jugevents-web/src/main/java/it/jugpadova/controllers/JCaptchaController.java
Sun May 19 10:58:10 2013
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova.controllers;

import java.awt.image.BufferedImage;
@@ -27,13 +26,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import com.octo.captcha.service.image.ImageCaptchaService;
-import com.sun.image.codec.jpeg.JPEGCodec;
-import com.sun.image.codec.jpeg.JPEGImageEncoder;
-import org.springframework.beans.factory.annotation.Autowired;
+import javax.imageio.ImageIO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@@ -46,15 +40,11 @@
@RequestMapping("/jcaptcha/*.html")
public class JCaptchaController {

- private static final Logger logger = LoggerFactory.getLogger(
- JCaptchaController.class);
@Resource
private ImageCaptchaService captchaService;

@RequestMapping
- public void image(HttpServletRequest req, HttpServletResponse res)
- throws IOException {
- byte[] captchaChallengeAsJpeg = null;
+ public void image(HttpServletRequest req, HttpServletResponse res)
throws IOException {
// the output stream to render the captcha image as jpeg into
ByteArrayOutputStream jpegOutputStream = new
ByteArrayOutputStream();

@@ -66,12 +56,7 @@
BufferedImage challenge = captchaService.getImageChallengeForID(
captchaId, req.getLocale());

- // a jpeg encoder
- JPEGImageEncoder jpegEncoder = JPEGCodec.createJPEGEncoder(
- jpegOutputStream);
- jpegEncoder.encode(challenge);
-
- captchaChallengeAsJpeg = jpegOutputStream.toByteArray();
+ ImageIO.write(challenge, "jpeg", jpegOutputStream);

// flush it in the res
res.setHeader("Cache-Control", "no-store");
@@ -79,7 +64,7 @@
res.setDateHeader("Expires", 0);
res.setContentType("image/jpeg");
ServletOutputStream resOutputStream = res.getOutputStream();
- resOutputStream.write(captchaChallengeAsJpeg);
+ resOutputStream.write(jpegOutputStream.toByteArray());
resOutputStream.flush();
resOutputStream.close();
}
=======================================
--- /jugevents/jugevents-web/src/main/java/it/jugpadova/po/Event.java Fri
Mar 8 18:53:49 2013
+++ /jugevents/jugevents-web/src/main/java/it/jugpadova/po/Event.java Sun
May 19 10:58:10 2013
@@ -60,7 +60,6 @@
import org.hibernate.search.annotations.Resolution;
import org.hibernate.search.annotations.Store;
import org.hibernate.validator.constraints.NotBlank;
-import org.lambico.po.hibernate.EntityBase;

/**
* An event.
@@ -88,7 +87,7 @@
@FullTextFilterDef(name = "notPassedEvents", impl =
NotPassedEventsFilterFactory.class)
})
-public class Event implements Serializable {
+public class Event implements org.lambico.po.hibernate.Entity,
Serializable {

protected Long id;
private String title;
@@ -122,12 +121,12 @@
public Long getId() {
return this.id;
}
-
+
public void setId(Long id) {
this.id = id;
}
+

-


@Column(length = 1024)
=======================================
--- /jugevents/jugevents-web/src/main/java/it/jugpadova/po/Speaker.java Tue
Apr 16 18:38:46 2013
+++ /jugevents/jugevents-web/src/main/java/it/jugpadova/po/Speaker.java Sun
May 19 10:58:10 2013
@@ -19,7 +19,7 @@
package it.jugpadova.po;

import it.jugpadova.blo.FilterBo;
-import it.jugpadova.util.SpeakerFilterFactory;
+import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
@@ -39,15 +39,12 @@
import org.slf4j.LoggerFactory;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
-import org.hibernate.search.annotations.FullTextFilterDef;
-import org.hibernate.search.annotations.FullTextFilterDefs;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Store;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.URL;
-import org.lambico.po.hibernate.EntityBase;

/**
* Represents information about the speaker of the event.
@@ -68,7 +65,7 @@
@FullTextFilterDef(name = "onlyMyJUG", impl =
SpeakerFilterFactory.class)
})*/
-public class Speaker {
+public class Speaker implements org.lambico.po.hibernate.Entity,
Serializable {

private static final long serialVersionUID = 1L;
private static final Logger logger =
=======================================
---
/jugevents/jugevents-web/src/main/java/it/jugpadova/util/CustomCommonsMultipartResolver.java
Thu Mar 31 08:27:26 2011
+++
/jugevents/jugevents-web/src/main/java/it/jugpadova/util/CustomCommonsMultipartResolver.java
Sun May 19 10:58:10 2013
@@ -15,32 +15,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-/**
- *
- */
package it.jugpadova.util;

-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.web.multipart.MultipartException;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
- * This class it's just a prototype of a custom implementation of the
class {@link CommonsMultipartResolver}
- * We want to have the possibility to define more maxUploadSize properties
depending on the
- * type of the file to upload.
+ * This class it's just a prototype of a custom implementation of the class
+ * {@link CommonsMultipartResolver} We want to have the possibility to
define more maxUploadSize
+ * properties depending on the type of the file to upload.
+ *
* @author Enrico Giurin
- *
*/
+//TODO to complete
public class CustomCommonsMultipartResolver extends
CommonsMultipartResolver {
-
-
- @Override
- public MultipartParsingResult parseRequest(HttpServletRequest req)
- throws MultipartException {
- //TODO to complete
- return super.parseRequest(req);
- }
-
}
=======================================
---
/jugevents/jugevents-web/src/main/java/it/jugpadova/util/mime/MagicMimeEntry.java
Thu Mar 31 08:27:26 2011
+++
/jugevents/jugevents-web/src/main/java/it/jugpadova/util/mime/MagicMimeEntry.java
Sun May 19 10:58:10 2013
@@ -107,7 +107,7 @@
}

public void traverseAndPrint(String tabs) {
- System.out.println(tabs + toString());
+ // System.out.println(tabs + toString());
int len = subEntries.size();
for (int i = 0; i < len; i++) {
MagicMimeEntry me = (MagicMimeEntry) subEntries.get(i);
=======================================
--- /jugevents/jugevents-web/src/main/resources/logback.xml Tue Apr 16
18:38:46 2013
+++ /jugevents/jugevents-web/src/main/resources/logback.xml Sun May 19
10:58:10 2013
@@ -29,7 +29,7 @@
</appender>

<logger name="org.parancoe" level="INFO"/>
- <logger name="org.lambico" level="DEBUG"/>
+ <logger name="org.lambico" level="INFO"/>

<root level="ERROR">
<appender-ref ref="CONSOLE" />
=======================================
--- /jugevents/jugevents-web/src/main/webapp/WEB-INF/applicationContext.xml
Sun Feb 24 15:52:36 2013
+++ /jugevents/jugevents-web/src/main/webapp/WEB-INF/applicationContext.xml
Sun May 19 10:58:10 2013
@@ -60,7 +60,7 @@

<bean id="daos" parent="abstractDaoProvider">
<property name="proxyInterfaces">
- <value>it.jugpadova.Daos</value>
+ <value>it.jugpadova.JugEventsDaos</value>
</property>
<property name="target">
<bean parent="genericDaoProvider"/>
@@ -228,11 +228,6 @@
</property>
</bean>

- <!-- Use this only for test purposes -->
- <!--
- <bean id="mailSender"
class="it.jugpadova.mock.ParancoeMockMailSender"/>
- -->
-
<bean id="velocityEngine"
class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
<property name="velocityProperties">
<value>
=======================================
--- /jugevents/jugevents-web/src/test/java/it/jugpadova/FootprintTest.java
Sat Mar 9 20:41:28 2013
+++ /jugevents/jugevents-web/src/test/java/it/jugpadova/FootprintTest.java
Sun May 19 10:58:10 2013
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova;

import java.io.File;
@@ -30,30 +29,36 @@
import net.java.dev.footprint.exporter.Exporter;
import net.java.dev.footprint.exporter.pdf.PdfExporterFactory;
import net.java.dev.footprint.model.generated.FootprintProperties;
-
-import org.parancoe.web.test.BaseTest;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.parancoe.web.test.junit4.AbstractWebTest;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Assert;
+import org.junit.Test;

/**
*
* @author lucio
*/
-public class FootprintTest extends BaseTest {
+public class FootprintTest extends AbstractWebTest {
+
@Resource
private FootprintProperties footprintProperties;
-
- public void testConfiguration() {
- assertNotNull(footprintProperties);
+
+ @Test
+ public void configuration() {
+ assertThat(footprintProperties, is(notNullValue()));
}

- public void testExporter() {
+ @Test
+ public void exporter() {
try {
Exporter exporter =

PdfExporterFactory.getPdfExporter(Exporter.DEFAULT_SIGNED_PDF_EXPORTER,
new Object[]{footprintProperties});
- assertNotNull(exporter);
+ assertThat(exporter, is(notNullValue()));
Map map = new HashMap();
- map.put("jug", "JUG Padova JUG Padova JUG Padova JUG Padova
JUG Padova JUG Padova JUG Padova JUG Padova");
+ map.put("jug",
+ "JUG Padova JUG Padova JUG Padova JUG Padova JUG
Padova JUG Padova JUG Padova JUG Padova");
map.put("name", "Nome");
map.put("title", "Titolo");
DateFormat df = DateFormat.getDateInstance(DateFormat.LONG,
Locale.US);
@@ -62,7 +67,7 @@
exporter.export(new File("/tmp"), map);
} catch (Exception ex) {
ex.printStackTrace();
- fail(ex.getMessage());
+ Assert.fail(ex.getMessage());
}
}
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/JugEventsBaseTest.java
Tue Apr 16 18:38:46 2013
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/JugEventsBaseTest.java
Sun May 19 10:58:10 2013
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova;

import it.jugpadova.po.Event;
@@ -23,41 +22,30 @@
import it.jugpadova.po.JUG;
import it.jugpadova.po.Jugger;
import it.jugpadova.po.Participant;
-
-
import it.jugpadova.po.Speaker;
-
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.commons.io.IOUtils;
+import org.lambico.test.spring.hibernate.junit4.FixtureSet;
import org.parancoe.plugins.securityevolution.Authority;
import org.parancoe.plugins.securityevolution.Group;
import org.parancoe.plugins.securityevolution.User;
import org.parancoe.plugins.world.Continent;
import org.parancoe.plugins.world.Country;
-import org.parancoe.web.test.BaseTest;
-
-
+import org.parancoe.web.test.junit4.AbstractWebTest;

/**
* Base test class for test of JUG Events.
*
* @author lucio
*/
-public abstract class JugEventsBaseTest extends BaseTest {
- private static final Logger logger = LoggerFactory.getLogger(
- JugEventsBaseTest.class);
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{Continent.class, Country.class,
Authority.class, Group.class, User.class, JUG.class, Jugger.class,
Event.class, EventLink.class, Participant.class, Speaker.class};
- }
+@FixtureSet(modelClasses = {Continent.class, Country.class,
Authority.class, Group.class, User.class,
+ JUG.class, Jugger.class, Event.class, EventLink.class,
Participant.class, Speaker.class})
+public abstract class JugEventsBaseTest extends AbstractWebTest {

- protected void writeTestFile(String prefix, String suffix, byte[]
bytes)
- throws IOException {
+ protected void writeTestFile(String prefix, String suffix, byte[]
bytes) throws IOException {
final File tempFile = File.createTempFile(prefix, suffix);
OutputStream out = null;
try {
@@ -66,13 +54,7 @@
out.flush();
logger.info("Wrote test file " + tempFile.getAbsolutePath());
} finally {
- if (out != null) {
- try {
- out.close();
- } catch (IOException iOException) {
- }
- }
+ IOUtils.closeQuietly(out);
}
}
-
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/JugEventsControllerTest.java
Sun Feb 24 15:16:13 2013
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/JugEventsControllerTest.java
Sun May 19 10:58:10 2013
@@ -27,13 +27,15 @@

import it.jugpadova.po.Speaker;
import javax.annotation.Resource;
+import org.junit.Before;
+import org.lambico.test.spring.hibernate.junit4.FixtureSet;

import org.parancoe.plugins.securityevolution.Authority;
import org.parancoe.plugins.securityevolution.Group;
import org.parancoe.plugins.securityevolution.User;
import org.parancoe.plugins.world.Continent;
import org.parancoe.plugins.world.Country;
-import org.parancoe.web.test.ControllerTest;
+import org.parancoe.web.test.junit4.AbstractControllerTest;
import org.springframework.web.servlet.HandlerAdapter;

/**
@@ -41,24 +43,16 @@
*
* @author lucio
*/
-public abstract class JugEventsControllerTest extends ControllerTest {
- //@Qualifier("methodHandler")
- @Resource(
- name =
- "org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0")
+@FixtureSet(modelClasses = {Continent.class, Country.class,
Authority.class, Group.class, User.class,
+ JUG.class, Jugger.class, Event.class, EventLink.class,
Participant.class, Speaker.class})
+public abstract class JugEventsControllerTest extends
AbstractControllerTest {
+ @Resource(name
= "org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0")
protected HandlerAdapter handler;
@Resource
protected MockServicesBo servicesBo;

- @Override
+ @Before
public void onSetUpBeforeTransaction() throws Exception {
- super.onSetUpBeforeTransaction();
servicesBo.setAuthenticatedUsername(null);
}
-
- @Override
- public Class[] getFixtureClasses() {
-// return new Class[]{Continent.class, Country.class, User.class,
Authority.class, JUG.class, Jugger.class, Event.class, EventLink.class,
Participant.class};
- return new Class[]{Continent.class, Country.class,
Authority.class, Group.class, User.class, JUG.class, Jugger.class,
Event.class, EventLink.class, Participant.class, Speaker.class};
- }
}
=======================================
--- /jugevents/jugevents-web/src/test/java/it/jugpadova/ParancoeTest.java
Thu Mar 31 08:27:26 2011
+++ /jugevents/jugevents-web/src/test/java/it/jugpadova/ParancoeTest.java
Sun May 19 10:58:10 2013
@@ -15,25 +15,31 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova;

-import org.parancoe.web.test.BaseTest;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;
+import org.parancoe.web.test.junit4.AbstractWebTest;

-public class ParancoeTest extends BaseTest {
+public class ParancoeTest extends AbstractWebTest {

/* test everything has been loaded properly */
- public void testSanity(){
- assertNotNull(getApplicationContext().getBean("dataSource"));
-
assertNotNull(getApplicationContext().getBean("transactionManager"));
- assertNotNull(getApplicationContext().getBean("conf"));
- assertNotNull(getApplicationContext().getBean("sessionFactory"));
-
assertNotNull(getApplicationContext().getBean("org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0"));
- assertNotNull(getApplicationContext().getBean("messageSource"));
-
assertNotNull(getApplicationContext().getBean("hibernateGenericDaoInstrumentationAspect"));
+ @Test
+ public void sanity() {
+ assertThat(applicationContext.getBean("dataSource"),
is(notNullValue()));
+ assertThat(applicationContext.getBean("transactionManager"),
is(notNullValue()));
+ assertThat(applicationContext.getBean("conf"), is(notNullValue()));
+ assertThat(applicationContext.getBean("sessionFactory"),
is(notNullValue()));
+ assertThat(applicationContext.getBean(
+ "org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0"),
+ is(notNullValue()));
+ assertThat(applicationContext.getBean("messageSource"),
is(notNullValue()));
+
assertThat(applicationContext.getBean("hibernateGenericDaoInstrumentationAspect"),
is(
+ notNullValue()));

- assertNotNull(getApplicationContext().getBean("viewResolver"));
-
assertNotNull(getApplicationContext().getBean("exceptionResolver"));
-
assertNotNull(getApplicationContext().getBean("multipartResolver"));
+ assertThat(applicationContext.getBean("viewResolver"),
is(notNullValue()));
+ assertThat(applicationContext.getBean("exceptionResolver"),
is(notNullValue()));
+ assertThat(applicationContext.getBean("multipartResolver"),
is(notNullValue()));
}
}
=======================================
--- /jugevents/jugevents-web/src/test/java/it/jugpadova/SanityTest.java Sun
Feb 24 15:16:13 2013
+++ /jugevents/jugevents-web/src/test/java/it/jugpadova/SanityTest.java Sun
May 19 10:58:10 2013
@@ -15,95 +15,96 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova;

import it.jugpadova.dao.EventDao;
import it.jugpadova.dao.JuggerDao;
import it.jugpadova.dao.ParticipantDao;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.parancoe.web.test.junit4.AbstractWebTest;

-import org.parancoe.web.test.BaseTest;
+public class SanityTest extends AbstractWebTest {

-public class SanityTest extends BaseTest {
+ @Test
+ public void daos() {
+ Object daos = applicationContext.getBean("daos");
+ assertThat("Can't retrieve daos bean", daos, is(notNullValue()));
+ assertThat("Wrong class for the daos bean (" +
daos.getClass().getName() + ")",
+ daos, is(instanceOf(JugEventsDaos.class)));

- public SanityTest() {
- }
+ Object eventDao = applicationContext.getBean("eventDao");
+ assertThat("Can't retrieve eventDao bean", eventDao,
is(notNullValue()));
+ assertThat("Wrong class for the eventDao bean (" +
eventDao.getClass().getName() + ")",
+ eventDao, is(instanceOf(EventDao.class)));

- public void testDaos() {
- Object daos = getApplicationContext().getBean("daos");
- assertNotNull("Can't retrieve daos bean", daos);
- assertTrue("Wrong class for the daos bean (" +
daos.getClass().getName() +
- ")", daos instanceof Daos);
+ Object juggerDao = applicationContext.getBean("juggerDao");
+ assertThat("Can't retrieve juggerDao bean", juggerDao,
is(notNullValue()));
+ assertThat("Wrong class for the juggerDao bean (" +
juggerDao.getClass().getName() + ")",
+ juggerDao, is(instanceOf(JuggerDao.class)));

- Object eventDao = getApplicationContext().getBean("eventDao");
- assertNotNull("Can't retrieve eventDao bean", eventDao);
- assertTrue("Wrong class for the eventDao bean (" +
- eventDao.getClass().getName() + ")",
- eventDao instanceof EventDao);
-
- Object juggerDao = getApplicationContext().getBean("juggerDao");
- assertNotNull("Can't retrieve juggerDao bean", juggerDao);
- assertTrue("Wrong class for the juggerDao bean (" +
- juggerDao.getClass().getName() + ")",
- juggerDao instanceof JuggerDao);
-
- Object participantDao =
getApplicationContext().getBean("participantDao");
- assertNotNull("Can't retrieve participantDao bean",
participantDao);
- assertTrue("Wrong class for the participantDao bean (" +
- participantDao.getClass().getName() + ")",
- participantDao instanceof ParticipantDao);
+ Object participantDao =
applicationContext.getBean("participantDao");
+ assertThat("Can't retrieve participantDao bean", participantDao,
is(notNullValue()));
+ assertThat("Wrong class for the participantDao bean (" +
participantDao.getClass().getName()
+ + ")", participantDao,
is(instanceOf(ParticipantDao.class)));
}

-// public void testBlos() {
-// Object blos = getApplicationContext().getBean("blos");
-// assertNotNull("Can't retrieve blos bean", blos);
+// @Test
+// public void blos() {
+// Object blos = applicationContext.getBean("blos");
+// assertThat("Can't retrieve blos bean", blos,is(notNullValue()));
// assertTrue("Wrong class for the blos bean (" +
blos.getClass().getName() +
// ")", blos instanceof Blos);
//
-// Object eventBo = getApplicationContext().getBean("eventBo");
-// assertNotNull("Can't retrieve eventBo bean", eventBo);
+// Object eventBo = applicationContext.getBean("eventBo");
+// assertThat("Can't retrieve eventBo bean",
eventBo,is(notNullValue()));
// assertTrue("Wrong class for the eventBo bean (" +
// eventBo.getClass().getName() + ")",
// eventBo instanceof EventBo);
//
-// Object juggerBo = getApplicationContext().getBean("juggerBo");
-// assertNotNull("Can't retrieve juggerBo bean", juggerBo);
+// Object juggerBo = applicationContext.getBean("juggerBo");
+// assertThat("Can't retrieve juggerBo bean",
juggerBo,is(notNullValue()));
// assertTrue("Wrong class for the juggerBlo bean (" +
// juggerBo.getClass().getName() + ")",
// juggerBo instanceof JuggerBo);
//
-// Object filterBo = getApplicationContext().getBean("filterBo");
-// assertNotNull("Can't retrieve filterBO bean", filterBo);
+// Object filterBo = applicationContext.getBean("filterBo");
+// assertThat("Can't retrieve filterBO bean",
filterBo,is(notNullValue()));
// assertTrue("Wrong class for the filterOo bean (" +
// filterBo.getClass().getName() + ")",
// filterBo instanceof FilterBo);
// checkSpringBean("eventResourceBo");
// }
-
- public void testDaosThroughDaos() {
- Object odaos = getApplicationContext().getBean("daos");
- assertNotNull("Can't retrieve daos bean", odaos);
- assertTrue("Wrong class for the daos bean (" + odaos.getClass().
- getName() + ")", odaos instanceof Daos);
- Daos daos = (Daos) odaos;
- assertNotNull(daos.getEventDao());
- assertNotNull(daos.getJuggerDao());
- assertNotNull(daos.getParticipantDao());
+ @Test
+ @Ignore
+ public void daosThroughDaos() {
+ Object odaos = applicationContext.getBean("daos");
+ assertThat("Can't retrieve daos bean", odaos, is(notNullValue()));
+ assertThat("Wrong class for the daos bean (" + odaos.getClass().
+ getName() + ")", odaos instanceof JugEventsDaos, is(true));
+ JugEventsDaos daos = (JugEventsDaos) odaos;
+ assertThat(daos.getEventDao(), is(notNullValue()));
+ assertThat(daos.getEventDao(), is(notNullValue()));
+ assertThat(daos.getJuggerDao(), is(notNullValue()));
+ assertThat(daos.getParticipantDao(), is(notNullValue()));
}

-// public void testBlosThroughBlos() {
-// Object oblos = getApplicationContext().getBean("blos");
-// assertNotNull("Can't retrieve blos bean", oblos);
+// @Test
+// public void blosThroughBlos() {
+// Object oblos = applicationContext.getBean("blos");
+// assertThat("Can't retrieve blos bean", oblos,is(notNullValue()));
// assertTrue("Wrong class for the blos bean (" + oblos.getClass().
// getName() + ")", oblos instanceof Blos);
// Blos blos = (Blos) oblos;
-// assertNotNull(blos.getEventBo());
-// assertNotNull(blos.getJuggerBO());
-// assertNotNull(blos.getJuggerBO());
-// assertNotNull(blos.getFilterBo());
+// assertThat(blos.getEventBo(),is(notNullValue()));
+// assertThat(blos.getJuggerBO(),is(notNullValue()));
+// assertThat(blos.getJuggerBO(),is(notNullValue()));
+// assertThat(blos.getFilterBo(),is(notNullValue()));
// }
-
- public void testControllers() {
+ @Test
+ public void controllers() {
checkSpringBean("addParticipantController");
checkSpringBean("adminController");
checkSpringBean("binController");
@@ -121,24 +122,24 @@
checkSpringBean("juggerRegistrationController");
checkSpringBean("juggerSearchController");
checkSpringBean("participantRegistrationController");
- checkSpringBean("passwordRecoveryController");
+ checkSpringBean("passwordRecoveryController");
checkSpringBean("serviceController");
}
- /**
- * Checks the correct configuration for the security.
- */
- public void testSecurity() {
- /*
- DaoAuthenticationProvider dap =
(DaoAuthenticationProvider)getApplicationContext().getBean("daoAuthenticationProvider");
- //assertTrue(dap.getPasswordEncoder() instanceof Md5PasswordEncoder);
- //System.out.println(dap.getPasswordEncoder().getClass().getName());
- String pluginSecurityFilterDefinitions =
(String)getApplicationContext().getBean("pluginSecurityFilterDefinitions");
-
assertTrue(pluginSecurityFilterDefinitions.contains("/adminjugger/**=ROLE_ADMIN"));
- */
- }
+
+// /**
+// * Checks the correct configuration for the security.
+// */
+// @Test
+// public void security() {
+// DaoAuthenticationProvider dap =
(DaoAuthenticationProvider)applicationContext.getBean("daoAuthenticationProvider");
+// //assertTrue(dap.getPasswordEncoder() instanceof
Md5PasswordEncoder);
+//
//System.out.println(dap.getPasswordEncoder().getClass().getName());
+// String pluginSecurityFilterDefinitions =
(String)applicationContext.getBean("pluginSecurityFilterDefinitions");
+//
assertTrue(pluginSecurityFilterDefinitions.contains("/adminjugger/**=ROLE_ADMIN"));
+// }

private void checkSpringBean(String id) {
- assertNotNull("Il bean con id '" + id +
- "' non è stato configurato in Spring",
getApplicationContext().getBean(id));
+ assertThat("Il bean con id '" + id + "' non è stato configurato in
Spring",
+ applicationContext.getBean(id), is(notNullValue()));
}
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/bean/SpeakerBeanTest.java
Thu Mar 31 08:27:26 2011
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/bean/SpeakerBeanTest.java
Sun May 19 10:58:10 2013
@@ -15,45 +15,47 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova.bean;

import it.jugpadova.po.Speaker;
-import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Test;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;

-public class SpeakerBeanTest extends TestCase {
+public class SpeakerBeanTest {

- public void testSpeakerBean() {
- try {
- SpeakerBean sb = new SpeakerBean(null);
- fail("Exception should be thrown");
- } catch (Exception e) {
- assertTrue(e instanceof IllegalArgumentException);
- }
- }
+ @Test
+ public void speakerBean() {
+ try {
+ SpeakerBean sb = new SpeakerBean(null);
+ Assert.fail("Exception should be thrown");
+ } catch (Exception e) {
+ assertThat(e, is(instanceOf(IllegalArgumentException.class)));
+ }
+ }

- public void testEqualsObject() {
- Speaker mario = new Speaker();
- mario.setFirstName("Mario");
- mario.setLastName("Rossi");
- mario.setEmail("a...@bbb.com");
-
- Speaker Mario = new Speaker();
- Mario.setFirstName("MARIO");
- Mario.setLastName("rossi");
- Mario.setEmail("x...@yyy.com");
-
- Speaker Antonio = new Speaker();
- Antonio.setFirstName("Antonio");
- Antonio.setLastName("rossi");
- Antonio.setEmail("x...@yyy.com");
-
- SpeakerBean marioBean = new SpeakerBean(mario);
- SpeakerBean MarioBean = new SpeakerBean(Mario);
- SpeakerBean AntonioBean = new SpeakerBean(Antonio);
- assertEquals(marioBean, MarioBean);
- assertFalse(marioBean.equals(AntonioBean));
-
- }
+ @Test
+ public void equalsObject() {
+ Speaker mario1 = new Speaker();
+ mario1.setFirstName("Mario");
+ mario1.setLastName("Rossi");
+ mario1.setEmail("a...@bbb.com");
+
+ Speaker mario2 = new Speaker();
+ mario2.setFirstName("MARIO");
+ mario2.setLastName("rossi");
+ mario2.setEmail("x...@yyy.com");
+
+ Speaker antonio = new Speaker();
+ antonio.setFirstName("Antonio");
+ antonio.setLastName("rossi");
+ antonio.setEmail("x...@yyy.com");

+ SpeakerBean marioBean1 = new SpeakerBean(mario1);
+ SpeakerBean marioBean2 = new SpeakerBean(mario2);
+ SpeakerBean antonioBean = new SpeakerBean(antonio);
+ assertThat(marioBean1, is(equalTo((marioBean2))));
+ assertThat(marioBean1, is(not(equalTo(antonioBean))));
+ }
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/blo/EventBoTest.java
Sat Mar 9 20:41:28 2013
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/blo/EventBoTest.java
Sun May 19 10:58:10 2013
@@ -15,19 +15,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova.blo;

import it.jugpadova.JugEventsBaseTest;
import java.util.List;
-
import javax.annotation.Resource;
-
-import org.springframework.beans.factory.annotation.Autowired;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;

/**
* Thest on the EventBo class
- *
+ *
* @author Lucio Benfante
*
*/
@@ -36,18 +35,18 @@
@Resource
private EventBo eventBo;

- public void testGetBadgeCode() {
- String result =
- eventBo.getBadgeCode(
+ @Test
+ public void getBadgeCode() {
+ String result = eventBo.getBadgeCode(
"<div class=\"jeb_event_even\"><div
class=\"jeb_date\"><span class=\"jeb_text\">26-apr-2008</span></div><div
class=\"jeb_title\"><span class=\"jeb_text\"><a
href=\"http://localhost:8081/jugevents/event/show.html?id=1\">Meeting
#50</a></span></div><div class=\"jeb_description\"><span
class=\"jeb_text\"><p>Meeting dei JUG Padova\n<br />\r<br />Prova\r\n<br
/>\n<br />prova\n<br />\\n</p></span></div></div>");
String expected =
"var badge='';\nbadge += '<div
class=\"jeb_event_even\"><div class=\"jeb_date\"><span
class=\"jeb_text\">26-apr-2008</span></div><div class=\"jeb_title\"><span
class=\"jeb_text\"><a
href=\"http://localhost:8081/jugevents/event/show.html?id=1\">Meeting
#50</a></span></div><div class=\"jeb_description\"><span
class=\"jeb_text\"><p>Meeting dei JUG Padova\\n<br />\\n<br />Prova\\n<br
/>\\n<br />prova\\n<br
/>\\n</p></span></div></div>';\ndocument.write(badge);";
- assertEquals(expected, result);
+ assertThat(result, is(equalTo(expected)));
}

- public void testFindPartialLocation() {
+ @Test
+ public void findPartialLocation() {
List locations = eventBo.findPartialLocation("DEI", "JUG Padova");
- assertSize(2, locations);
- }
-
+ assertThat(locations.size(), is(2));
+ }
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/blo/EventRegistrationOpenTest.java
Thu Mar 31 08:27:26 2011
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/blo/EventRegistrationOpenTest.java
Sun May 19 10:58:10 2013
@@ -15,153 +15,168 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova.blo;

-import it.jugpadova.JugEventsBaseTest;
import it.jugpadova.po.Event;
import it.jugpadova.po.Participant;
import it.jugpadova.po.Registration;
import java.util.ArrayList;
import java.util.Date;
+import org.junit.Before;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;
+import org.parancoe.web.test.junit4.AbstractWebTest;

/**
* Test on the activation of the registration to an event.
- *
+ *
* @author Lucio Benfante
*/
-public class EventRegistrationOpenTest extends JugEventsBaseTest {
+public class EventRegistrationOpenTest extends AbstractWebTest {
+
private Event event;
private Registration registration;
private static Date NOW = new Date();
- private static long ONE_DAY = 24*60*60*1000;
- private static Date YESTERDAY = new Date(NOW.getTime()-ONE_DAY);
- private static Date TOMORROW = new Date(NOW.getTime()+ONE_DAY);
- private static Date ONE_WEEK_AGO = new Date(NOW.getTime()-7*ONE_DAY);
- private static Date ONE_WEEK_FORWARD = new
Date(NOW.getTime()+7*ONE_DAY);
-
- @Override
- public void onSetUp() {
+ private static long ONE_DAY = 24 * 60 * 60 * 1000;
+ private static Date YESTERDAY = new Date(NOW.getTime() - ONE_DAY);
+ private static Date TOMORROW = new Date(NOW.getTime() + ONE_DAY);
+ private static Date ONE_WEEK_AGO = new Date(NOW.getTime() - 7 *
ONE_DAY);
+ private static Date ONE_WEEK_FORWARD = new Date(NOW.getTime() + 7 *
ONE_DAY);
+
+ @Before
+ public void setup() {
this.event = new Event();
event.setStartDate(ONE_WEEK_FORWARD);
event.setEndDate(ONE_WEEK_FORWARD);
this.registration = new Registration();
event.setRegistration(this.registration);
}
-
- public void testWithoutRegistrationRules() {
+
+ @Test
+ public void withoutRegistrationRules() {
this.event.setRegistration(null);
- assertTrue(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(true));
}

- public void testPassedWithoutRegistrationRules() {
+ @Test
+ public void passedWithoutRegistrationRules() {
event.setStartDate(ONE_WEEK_AGO);
event.setEndDate(ONE_WEEK_AGO);
this.event.setRegistration(null);
- assertFalse(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(false));
}
-
- public void testNotEnabledRegistration() {
+
+ @Test
+ public void notEnabledRegistration() {
this.registration.setEnabled(false);
- assertFalse(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(false));
}
-
- public void testNotPassedWithSimpleEnabledRegistration() {
+
+ @Test
+ public void notPassedWithSimpleEnabledRegistration() {
this.registration.setEnabled(true);
- assertTrue(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(true));
}

- public void testPassedWithSimpleEnabledRegistration() {
+ @Test
+ public void passedWithSimpleEnabledRegistration() {
event.setStartDate(ONE_WEEK_AGO);
event.setEndDate(ONE_WEEK_AGO);
this.registration.setEnabled(true);
- assertFalse(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(false));
}

- public void testPassedWithoutEndRegistrationDate() {
+ @Test
+ public void passedWithoutEndRegistrationDate() {
event.setStartDate(ONE_WEEK_AGO);
event.setEndDate(ONE_WEEK_AGO);
this.registration.setEnabled(true);
- this.registration.setStartRegistration(new Date(14*ONE_DAY));
+ this.registration.setStartRegistration(new Date(14 * ONE_DAY));
this.registration.setEndRegistration(null);
this.registration.setMaxParticipants(25L);
this.registration.setManualActivation(null);
- assertFalse(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(false));
}
-
- public void testManualActivationEnabled() {
+
+ @Test
+ public void manualActivationEnabled() {
this.registration.setManualActivation(true);
- assertTrue(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(true));
}

- public void testManualActivationDisabled() {
+ @Test
+ public void manualActivationDisabled() {
this.registration.setManualActivation(false);
- assertFalse(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(false));
}
-
- public void testParticipansUnderTheMaxLimit() {
+
+ @Test
+ public void participansUnderTheMaxLimit() {
this.event.setParticipants(new ArrayList<Participant>());
- for (int i=0; i < 24; i++) {
- final Participant participant = new Participant();
+ for (int i = 0; i < 24; i++) {
+ final Participant participant = new Participant();
participant.setConfirmed(true);
this.event.getParticipants().add(participant);
}
this.registration.setMaxParticipants(25L);
- assertTrue(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(true));
}

- public void testParticipansOverTheMaxLimit() {
+ @Test
+ public void participansOverTheMaxLimit() {
this.event.setParticipants(new ArrayList<Participant>());
- for (int i=0; i < 25; i++) {
- final Participant participant = new Participant();
+ for (int i = 0; i < 25; i++) {
+ final Participant participant = new Participant();
participant.setConfirmed(true);
this.event.getParticipants().add(participant);
}
this.registration.setMaxParticipants(25L);
- assertFalse(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(false));
}

- public void testRegistrationBeforeTheStart() {
+ @Test
+ public void registrationBeforeTheStart() {
this.registration.setStartRegistration(TOMORROW);
this.registration.setEndRegistration(ONE_WEEK_FORWARD);
- assertFalse(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(false));
}
-
- public void testRegistrationBetweenTheValidDates() {
+
+ @Test
+ public void registrationBetweenTheValidDates() {
this.registration.setStartRegistration(YESTERDAY);
this.registration.setEndRegistration(ONE_WEEK_FORWARD);
- assertTrue(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(true));
}

- public void testRegistrationAfterTheEnd() {
+ @Test
+ public void registrationAfterTheEnd() {
this.registration.setStartRegistration(ONE_WEEK_AGO);
this.registration.setEndRegistration(YESTERDAY);
- assertFalse(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(false));
}

- public void testRegistrationBeforeTheStartWithOnlyStartDate() {
+ @Test
+ public void registrationBeforeTheStartWithOnlyStartDate() {
this.registration.setStartRegistration(TOMORROW);
- assertFalse(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(false));
}
-
- public void testRegistrationAfterTheStartWithOnlyStartDate() {
+
+ @Test
+ public void registrationAfterTheStartWithOnlyStartDate() {
this.registration.setStartRegistration(YESTERDAY);
- assertTrue(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(true));
}

- public void testRegistrationBeforeTheEndWithOnlyEndDate() {
+ @Test
+ public void registrationBeforeTheEndWithOnlyEndDate() {
this.registration.setEndRegistration(TOMORROW);
- assertTrue(this.event.getRegistrationOpen());
- }
-
- public void testRegistrationAfterTheEndWithOnlyEndDate() {
- this.registration.setEndRegistration(YESTERDAY);
- assertFalse(this.event.getRegistrationOpen());
+ assertThat(this.event.getRegistrationOpen(), is(true));
}

- @Override
- public Class[] getFixtureClasses() {
- return new Class[] {};
+ @Test
+ public void registrationAfterTheEndWithOnlyEndDate() {
+ this.registration.setEndRegistration(YESTERDAY);
+ assertThat(this.event.getRegistrationOpen(), is(false));
}
-
}
=======================================
--- /jugevents/jugevents-web/src/test/java/it/jugpadova/blo/JugBoTest.java
Sat Mar 9 20:41:28 2013
+++ /jugevents/jugevents-web/src/test/java/it/jugpadova/blo/JugBoTest.java
Sun May 19 10:58:10 2013
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova.blo;

import it.jugpadova.JugEventsBaseTest;
@@ -23,12 +22,12 @@
import it.jugpadova.po.JUG;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
-
import javax.annotation.Resource;
-
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang.StringEscapeUtils;
-import org.springframework.beans.factory.annotation.Autowired;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;

/**
* Test of the JugBo methods.
@@ -42,84 +41,84 @@
@Resource
private JugBo jugBo;

- public void testBuildKmlPlacemarkText() throws IOException {
- String result = "<Placemark>\n" +
- " <name>GOJAVA</name>\n" +
- " <description>\n" +
- " <![CDATA[\n" +
- " Grupo de Usu&#225;rios JAVA Estado de
Goi&#225;s<br/>\n" +
- " <b>Leader:</b> <a
href=\"mailto:raphael...@gmail.com\">Raphael Adrien</a><br/>\n" +
- " <b>Site:</b> http://www.gojava.org\n" +
- " ]]>\n" +
- " </description>\n" +
- " <Point>\n" +
- "
<coordinates>-49.269009502375,-16.666921744733,0</coordinates>\n" +
- " </Point>\n" +
- " <styleUrl>#jugStyle</styleUrl>\n" +
- "</Placemark>";
+ @Test
+ public void buildKmlPlacemarkText() throws IOException {
+ String result = "<Placemark>\n" + " <name>GOJAVA</name>\n"
+ " <description>\n"
+ + " <![CDATA[\n"
+ + " Grupo de Usu&#225;rios JAVA Estado de
Goi&#225;s<br/>\n"
+ + " <b>Leader:</b> <a
href=\"mailto:raphael...@gmail.com\">Raphael Adrien</a><br/>\n"
+ + " <b>Site:</b> http://www.gojava.org\n" + "
]]>\n"
+ + " </description>\n" + " <Point>\n"
+ + "
<coordinates>-49.269009502375,-16.666921744733,0</coordinates>\n"
+ + " </Point>\n" + "
<styleUrl>#jugStyle</styleUrl>\n" + "</Placemark>";
JUG jug = getGojavaJug();
jug.setInfos("Grupo de Usu\u00E1rios JAVA Estado de Goi\u00E1s");
String placemark = this.jugBo.buildKmlPlacemarkText(jug,
"Raphael Adrien", "raphael...@gmail.com");
- assertEquals(result, placemark);
+ assertThat(result, is(equalTo(placemark)));
}

- public void testEvaluateModifiedKmlDataNoModifications() throws
IllegalAccessException,
+ @Test
+ public void evaluateModifiedKmlDataNoModifications() throws
IllegalAccessException,
InvocationTargetException {
JUG jug = getGojavaJug();
JUG modifiedJug = cloneJug(jug);
Boolean b = jugBo.evaluateModifiedKmlData(modifiedJug, jug);
- assertFalse(b);
+ assertThat(b, is(false));
}

- public void testEvaluateModifiedKmlDataInfos() throws
IllegalAccessException,
+ @Test
+ public void evaluateModifiedKmlDataInfos() throws
IllegalAccessException,
InvocationTargetException {
JUG jug = getGojavaJug();
JUG modifiedJug = cloneJug(jug);
modifiedJug.setInfos("Modified");
Boolean b = jugBo.evaluateModifiedKmlData(modifiedJug, jug);
- assertTrue(b);
+ assertThat(b, is(true));
modifiedJug.setInfos(null);
b = jugBo.evaluateModifiedKmlData(modifiedJug, jug);
- assertFalse(b);
+ assertThat(b, is(false));
}

- public void testEvaluateModifiedKmlDataLongitude() throws
IllegalAccessException,
+ @Test
+ public void evaluateModifiedKmlDataLongitude() throws
IllegalAccessException,
InvocationTargetException {
JUG jug = getGojavaJug();
JUG modifiedJug = cloneJug(jug);
modifiedJug.setLongitude(0.1);
Boolean b = jugBo.evaluateModifiedKmlData(modifiedJug, jug);
- assertTrue(b);
+ assertThat(b, is(true));
modifiedJug.setLongitude(null);
b = jugBo.evaluateModifiedKmlData(modifiedJug, jug);
- assertFalse(b);
+ assertThat(b, is(false));
}

- public void testEvaluateModifiedKmlDataLatitude() throws
IllegalAccessException,
+ @Test
+ public void evaluateModifiedKmlDataLatitude() throws
IllegalAccessException,
InvocationTargetException {
JUG jug = getGojavaJug();
JUG modifiedJug = cloneJug(jug);
modifiedJug.setLatitude(0.1);
Boolean b = jugBo.evaluateModifiedKmlData(modifiedJug, jug);
- assertTrue(b);
+ assertThat(b, is(true));
modifiedJug.setLatitude(null);
b = jugBo.evaluateModifiedKmlData(modifiedJug, jug);
- assertFalse(b);
+ assertThat(b, is(false));
}

- public void testEvaluateModifiedKmlDataWebSite() throws
IllegalAccessException,
+ @Test
+ public void evaluateModifiedKmlDataWebSite() throws
IllegalAccessException,
InvocationTargetException {
JUG jug = getGojavaJug();
JUG modifiedJug = cloneJug(jug);
modifiedJug.setWebSite("www.google.com");
Boolean b = jugBo.evaluateModifiedKmlData(modifiedJug, jug);
- assertTrue(b);
+ assertThat(b, is(true));
modifiedJug.setWebSite(null);
b = jugBo.evaluateModifiedKmlData(modifiedJug, jug);
- assertFalse(b);
+ assertThat(b, is(false));
}
-
+
private JUG cloneJug(JUG jug) throws IllegalAccessException,
InvocationTargetException {
JUG modifiedJug = new JUG();
@@ -129,13 +128,15 @@

private JUG getGojavaJug() {
JUG jug = jugDao.findByName("GOJAVA");
- assertNotNull(jug);
+ assertThat(jug, is(notNullValue()));
return jug;
}
-
- public void testEscapeXml() {
+
+ @Test
+ public void EscapeXml() {
String result = "Grupo de Usu&#225;rios JAVA Estado de Goi&#225;s";
- String escaped = StringEscapeUtils.escapeXml("Grupo de
Usu\u00E1rios JAVA Estado de Goi\u00E1s");
- assertEquals(result, escaped);
+ String escaped = StringEscapeUtils.escapeXml(
+ "Grupo de Usu\u00E1rios JAVA Estado de Goi\u00E1s");
+ assertThat(result, is(equalTo(escaped)));
}
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/blo/JuggerBoTest.java
Sat Mar 9 20:41:28 2013
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/blo/JuggerBoTest.java
Sun May 19 10:58:10 2013
@@ -25,7 +25,9 @@
import it.jugpadova.exception.UserAlreadyEnabledException;

import org.parancoe.plugins.securityevolution.User;
-import org.springframework.beans.factory.annotation.Autowired;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;

/**
* @author Enrico Giurin
@@ -38,17 +40,19 @@
@Resource
private Conf appConf;

- public void testNewUser() {
+ @Test
+ public void newUser() {
try {
User user = juggerBo.newUser("new user");
- assertEquals("new user", user.getUsername());
+ assertThat(user.getUsername(), is(equalTo("new user")));
} catch (Exception e) {
- assertTrue(e instanceof UserAlreadyEnabledException);
+ assertThat(e,
is(instanceOf(UserAlreadyEnabledException.class)));
}

}//end of method

- public void testThresholdAccess() {
- assertEquals(1, 0d, appConf.getThresholdAccess());
+ @Test
+ public void thresholdAccess() {
+ assertThat(appConf.getThresholdAccess(), is(equalTo(1.0d)));
}
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/blo/ParticipantBadgeBoTest.java
Thu Mar 31 08:27:26 2011
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/blo/ParticipantBadgeBoTest.java
Sun May 19 10:58:10 2013
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova.blo;

import com.lowagie.text.DocumentException;
@@ -26,6 +25,11 @@
import java.io.InputStream;
import java.util.List;
import javax.annotation.Resource;
+import static org.hamcrest.collection.IsCollectionWithSize.*;
+import static org.hamcrest.number.OrderingComparison.*;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;

/**
*
@@ -41,27 +45,30 @@
/**
* Test of buildPDFBadges method, of class ParticipantBo.
*/
- public void testBuildPDFBadges() throws IOException, DocumentException
{
+ @Test
+ public void buildPDFBadges() throws IOException, DocumentException {
List<Event> events = eventDao.findByTitle("Future Meeting");
- assertEquals(1, events.size());
+ assertThat(events, hasSize(1));
Event event = events.get(0);
byte[] pdfBytes = participantBadgeBo.buildPDFBadges(event);
- assertNotNull(pdfBytes);
- assertTrue("The PDF is empty", pdfBytes.length > 0);
+ assertThat(pdfBytes, is(notNullValue()));
+ assertThat("The PDF is empty", pdfBytes.length,
is(greaterThan(0)));
writeTestFile("testBuildPDFBadges", ".pdf", pdfBytes);
}

/**
* Test of getDefaultBadgePageTemplateInputStream method, of class
ParticipantBo.
*/
- public void testGetDefaultBadgePageTemplateInputStream() throws
IOException {
+ @Test
+ public void getDefaultBadgePageTemplateInputStream() throws
IOException {
InputStream is =
participantBadgeBo.getDefaultBadgePageTemplateInputStream();
- assertNotNull(is);
+ assertThat(is, is(notNullValue()));
is.close();
}

- public void testGetParticipantPerPage() throws IOException {
+ @Test
+ public void getParticipantPerPage() throws IOException {
int count = participantBadgeBo.getParticipantsPerPage(null);
- assertEquals(6, count);
+ assertThat(count, is(6));
}
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/blol/FeedsBoTest.java
Thu Mar 31 08:27:26 2011
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/blol/FeedsBoTest.java
Sun May 19 10:58:10 2013
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova.blol;

import it.jugpadova.JugEventsBaseTest;
@@ -34,6 +33,10 @@
import net.fortuna.ical4j.model.TimeZoneRegistryFactory;
import net.fortuna.ical4j.model.ValidationException;
import org.apache.commons.lang.StringUtils;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Assert;
+import org.junit.Test;

/**
* Test of methos of the FeedBo.
@@ -51,17 +54,19 @@
/**
* Test of buildCalendar method, of class FeedsBo.
*/
- public void testBuildCalendar() throws URISyntaxException,
ParseException {
+ @Test
+ public void buildCalendar() throws URISyntaxException, ParseException {
Calendar calendar =
feedsBo.buildCalendar(eventDao.findAll(), TEST_BASE_URL);
try {
calendar.validate(true);
} catch (ValidationException ex) {
- fail(ex.getLocalizedMessage());
+ Assert.fail(ex.getLocalizedMessage());
}
}

- public void testConvertDateAndTime() throws ParseException {
+ @Test
+ public void convertDateAndTime() throws ParseException {
SimpleDateFormat df =
new SimpleDateFormat("dd/MM/yyyy");
df.setTimeZone(TimeZone.getTimeZone("GMT"));
@@ -71,13 +76,14 @@
Date d = df.parse("18/09/2009");
net.fortuna.ical4j.model.Date cd1 =
feedsBo.convertDateAndTime(d, "12:00 AM", tz);
- assertEquals("20090918T120000", cd1.toString());
+ assertThat(cd1.toString(), is(equalTo("20090918T120000")));
net.fortuna.ical4j.model.Date cd2 =
feedsBo.convertDateAndTime(d, "05:00 PM", tz);
- assertEquals("20090918T170000", cd2.toString());
+ assertThat(cd2.toString(), is(equalTo("20090918T170000")));
}

- public void testConvertDateAndTimeBrazil() throws ParseException {
+ @Test
+ public void convertDateAndTimeBrazil() throws ParseException {
SimpleDateFormat df =
new SimpleDateFormat("dd/MM/yyyy");
df.setTimeZone(TimeZone.getTimeZone("America/Sao_Paulo"));
@@ -87,39 +93,36 @@
Date d = df.parse("18/09/2009");
net.fortuna.ical4j.model.Date cd1 =
feedsBo.convertDateAndTime(d, "12:00 AM", tz);
- assertEquals("20090918T120000", cd1.toString());
+ assertThat(cd1.toString(), is(equalTo("20090918T120000")));
net.fortuna.ical4j.model.Date cd2 =
feedsBo.convertDateAndTime(d, "05:00 PM", tz);
- assertEquals("20090918T170000", cd2.toString());
+ assertThat(cd2.toString(), is(equalTo("20090918T170000")));
}

/**
* Test of buildJson method, of class FeedsBo.
*/
- public void testBuildJson() {
+ @Test
+ public void buildJson() {
List<Event> events = eventDao.findAll();
String json = feedsBo.buildJson(events, TEST_BASE_URL, true);
- assertNotNull(json);
- assertTrue("The json resul is blank",
StringUtils.isNotBlank(json));
+ assertThat(json, is(notNullValue()));
+ assertThat("The json resul is blank",
StringUtils.isNotBlank(json), is(true));
}

/**
* Test of buildJson method, of class FeedsBo.
*/
- public void testBuildJsonSimple() {
+ @Test
+ public void buildJsonSimple() {
List<Event> events = new LinkedList<Event>();
- events.add(createTestEvent("Meeting 1", "JBoss", 2010, 0,
9, "05:30 PM",
- "07:30 PM"));
- events.add(createTestEvent("Meeting 2", "JQuery", 2010, 0, 10,
- "05:30 PM",
- "07:30 PM"));
+ events.add(createTestEvent("Meeting 1", "JBoss", 2010, 0,
9, "05:30 PM", "07:30 PM"));
+ events.add(createTestEvent("Meeting 2", "JQuery", 2010, 0,
10, "05:30 PM", "07:30 PM"));
String json = feedsBo.buildJson(events, TEST_BASE_URL, false);
- assertNotNull(json);
- assertTrue("The json resul is blank",
StringUtils.isNotBlank(json));
- System.out.println(json);
- assertEquals(
- "[{\"title\":\"Meeting
1\",\"description\":\"\\u003cp\\u003eJBoss\\u003c/p\\u003e\",\"start\":\"2010-01-09
17:30:00\",\"end\":\"2010-01-09
19:30:00\",\"allDay\":false},{\"title\":\"Meeting
2\",\"description\":\"\\u003cp\\u003eJQuery\\u003c/p\\u003e\",\"start\":\"2010-01-10
17:30:00\",\"end\":\"2010-01-10 19:30:00\",\"allDay\":false}]",
- json);
+ assertThat(json, is(notNullValue()));
+ assertThat("The json result is blank",
StringUtils.isNotBlank(json), is(true));
+ assertThat(json, is(equalTo(
+ "[{\"title\":\"Meeting
1\",\"description\":\"\\u003cp\\u003eJBoss\\u003c/p\\u003e\",\"start\":\"2010-01-09
17:30:00\",\"end\":\"2010-01-09
19:30:00\",\"allDay\":false},{\"title\":\"Meeting
2\",\"description\":\"\\u003cp\\u003eJQuery\\u003c/p\\u003e\",\"start\":\"2010-01-10
17:30:00\",\"end\":\"2010-01-10 19:30:00\",\"allDay\":false}]")));
}

private Event createTestEvent(String title, String description, int
year,
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/blol/SchedulerBoTest.java
Thu Mar 31 08:27:26 2011
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/blol/SchedulerBoTest.java
Sun May 19 10:58:10 2013
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova.blol;

import it.jugpadova.JugEventsBaseTest;
@@ -27,6 +26,11 @@
import java.util.GregorianCalendar;
import java.util.List;
import javax.annotation.Resource;
+import static org.hamcrest.collection.IsCollectionWithSize.*;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.number.OrderingComparison.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;

public class SchedulerBoTest extends JugEventsBaseTest {

@@ -37,7 +41,8 @@
@Resource
private ParticipantDao participantDao;

- public void testRemindToParticipants() {
+ @Test
+ public void remindToParticipants() {
Event futureEvent = retrieveFutureEvent();

futureEvent.setActiveReminder(true);
@@ -49,31 +54,31 @@
futureEvent.setStartDate(cal.getTime());
futureEvent.updateReminderDate();

- assertTrue(futureEvent.getReminderDate().compareTo(futureEvent.
- getStartDate()) < 0);
- assertTrue(currentDate.compareTo(futureEvent.getStartDate()) < 0);
+
assertThat(futureEvent.getReminderDate().compareTo(futureEvent.getStartDate()),
+ is(lessThan(0)));
+ assertThat(currentDate.compareTo(futureEvent.getStartDate()),
is(lessThan(0)));

List<Participant> partcipantsToRemind = participantDao.
findParticipantsToBeReminded();
- assertEquals(2, partcipantsToRemind.size());
+ assertThat(partcipantsToRemind, hasSize(2));

schedulerBo.remindToParticipants();
partcipantsToRemind =
participantDao.findParticipantsToBeReminded();
- assertEquals(0, partcipantsToRemind.size());
+ assertThat(partcipantsToRemind, hasSize(0));
}

private Event retrieveFutureEvent() {
List<Event> futureEvent = eventDao.findByTitle("Future Meeting");
- assertSize(1, futureEvent);
+ assertThat(futureEvent, hasSize(1));
return futureEvent.get(0);
}

/**
- * Checking if the class is AOP/CGLIB instrumented. It's needed for
- * annotation-based transaction management.
+ * Checking if the class is AOP/CGLIB instrumented. It's needed for
annotation-based transaction
+ * management.
*/
- public void testIsInstrumented() {
-
assertFalse(schedulerBo.getClass().getName().equals(SchedulerBo.class.
- getName()));
+ @Test
+ public void isInstrumented() {
+ assertThat(schedulerBo, is(instanceOf(SchedulerBo.class)));
}
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/controllers/EventEditControllerTest.java
Sat Mar 9 20:41:28 2013
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/controllers/EventEditControllerTest.java
Sun May 19 10:58:10 2013
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova.controllers;

import it.jugpadova.JugEventsControllerTest;
@@ -23,21 +22,22 @@
import it.jugpadova.dao.SpeakerDao;
import it.jugpadova.po.Event;
import it.jugpadova.po.Speaker;
-
import java.util.Calendar;
import java.util.List;
import javax.annotation.Resource;
-
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.lambico.dao.spring.hibernate.HibernateGenericDao;
-import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.context.SecurityContextHolder;
+import static org.hamcrest.collection.IsCollectionWithSize.*;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;
+import org.springframework.test.web.ModelAndViewAssert;
import org.springframework.web.servlet.ModelAndView;

/**
* Tests on the EventEditController.
- *
+ *
* @author Lucio Benfante
*/
public class EventEditControllerTest extends JugEventsControllerTest {
@@ -53,151 +53,143 @@
private EventDao eventDao;
@Resource
private SpeakerDao speakerDao;
-

- public void testConfiguration() {
- assertNotNull(controller);
+ @Test
+ public void configuration() {
+ assertThat(controller, is(notNullValue()));
}

- public void testUpdate() throws Exception {
+ @Test
+ public void update() throws Exception {
Event testEvent = getTestEvent();
callForm(testEvent.getId().toString());
resetRequestAndResponse();
- req.setMethod("POST");
- req.setRequestURI(FORM_REQUEST_URI);
- req.setParameter("startDate", "20/08/2008");
- ModelAndView mv = handler.handle(req, res, controller);
- assertEquals(DONE_VIEW + testEvent.getId(), mv.getViewName());
+ request.setMethod("POST");
+ request.setRequestURI(FORM_REQUEST_URI);
+ request.setParameter("startDate", "20/08/2008");
+ ModelAndView mv = handler.handle(request, response, controller);
+ ModelAndViewAssert.assertViewName(mv, DONE_VIEW +
testEvent.getId());
Object reqModel = mv.getModel().get(MODEL_ATTRIBUTE);
- assertNotNull(reqModel);
- assertEquals(getExpectedTime(2008, 07, 20),
- ((Event) reqModel).getStartDate().getTime());
- Object sesModel = req.getSession().getAttribute(MODEL_ATTRIBUTE);
- assertNull("The " + MODEL_ATTRIBUTE +
- " attribute should have been removed from the session",
sesModel);
+ assertThat(reqModel, is(notNullValue()));
+ assertThat(((Event) reqModel).getStartDate().getTime(),
is(equalTo(getExpectedTime(2008, 07,
+ 20))));
+ Object sesModel =
request.getSession().getAttribute(MODEL_ATTRIBUTE);
+ assertThat("The " + MODEL_ATTRIBUTE + " attribute should have been
removed from the session",
+ sesModel, is(nullValue()));
}

- public void testUpdateFailedForValidation() throws Exception {
+ @Test
+ public void updateFailedForValidation() throws Exception {
Event testEvent = getTestEvent();
callForm(testEvent.getId().toString());
resetRequestAndResponse();
- req.setMethod("POST");
- req.setRequestURI(FORM_REQUEST_URI);
- req.setParameter("startDate", "");
- ModelAndView mv = handler.handle(req, res, controller);
- assertEquals(FORM_VIEW, mv.getViewName());
- Object sesModel = req.getSession().getAttribute(MODEL_ATTRIBUTE);
- assertNotNull(
- "The " + MODEL_ATTRIBUTE +
- " jugger attribute shouldn't have been removed from the
session",
- sesModel);
- this.endTransaction();
- this.startNewTransaction();
- Event event = eventDao.get(testEvent.getId());
- assertEquals(getExpectedTime(2007, 10, 24),
event.getStartDate().getTime());
+ request.setMethod("POST");
+ request.setRequestURI(FORM_REQUEST_URI);
+ request.setParameter("startDate", "");
+ ModelAndView mv = handler.handle(request, response, controller);
+ ModelAndViewAssert.assertViewName(mv, FORM_VIEW);
+ Object sesModel =
request.getSession().getAttribute(MODEL_ATTRIBUTE);
+ assertThat("The " + MODEL_ATTRIBUTE
+ + " jugger attribute shouldn't have been removed from the
session",
+ sesModel, is(notNullValue()));
+ // FIXME
+ // non viene scritto nel db, ma ritorna l'istanza modificata dal
controiller
+ // Event event = eventDao.get(testEvent.getId());
+ // assertThat(event.getStartDate().getTime(),
is(equalTo(getExpectedTime(2007, 10, 24))));
}

- public void testForm() throws Exception {
+ @Test
+ public void form() throws Exception {
Event testEvent = getTestEvent();
ModelAndView mv = callForm(testEvent.getId().toString());
Object reqModel = mv.getModel().get(MODEL_ATTRIBUTE);
- assertNotNull(reqModel);
- assertTrue("The object is not of type Event", reqModel instanceof
Event);
- Object sesModel = req.getSession().getAttribute(MODEL_ATTRIBUTE);
- assertNotNull(sesModel);
- assertTrue("The object is not of type Event", sesModel instanceof
Event);
- assertSame(reqModel, sesModel);
- assertEquals(testEvent.getId(), ((Event) reqModel).getId());
- assertEquals(FORM_VIEW, mv.getViewName());
+ assertThat(reqModel, is(notNullValue()));
+ assertThat("The object is not of type Event", reqModel,
is(instanceOf(Event.class)));
+ Object sesModel =
request.getSession().getAttribute(MODEL_ATTRIBUTE);
+ assertThat(sesModel, is(notNullValue()));
+ assertThat("The object is not of type Event", sesModel,
is(instanceOf(Event.class)));
+ assertThat(reqModel, is(sameInstance(sesModel)));
+ assertThat(((Event) reqModel).getId(),
is(equalTo(testEvent.getId())));
+ ModelAndViewAssert.assertViewName(mv, FORM_VIEW);
}
-
-
-
-
- public void testNewEventWithSpeakers() throws Exception
- {
- callForm(null);
- resetRequestAndResponse();
- req.setMethod("POST");
- req.setRequestURI("/event/eventspeaker.form");
- req.setParameter("title", "test-title");
- req.setParameter("location", "test-location");
- req.setParameter("startDate", "20/08/2010");
- req.setParameter("endDate", "20/08/2010");
- handler.handle(req, res, controller);
-
+
+ @Test
+ public void newEventWithSpeakers() throws Exception {
+ callForm(null);
resetRequestAndResponse();
- req.setMethod("POST");
- req.setRequestURI("/event/speakerevent.form");
- req.setParameter("firstName", "Enrico");
- req.setParameter("lastName", "Giurin");
- req.setParameter("email", "enr...@giurin.com");
- req.setParameter("resume", "myResume");
- handler.handle(req, res, controller);
-
+ request.setMethod("POST");
+ request.setRequestURI("/event/eventspeaker.form");
+ request.setParameter("title", "test-title");
+ request.setParameter("location", "test-location");
+ request.setParameter("startDate", "20/08/2010");
+ request.setParameter("endDate", "20/08/2010");
+ handler.handle(request, response, controller);
+
resetRequestAndResponse();
-
- req.setMethod("POST");
- req.setRequestURI(FORM_REQUEST_URI);
- handler.handle(req, res, controller);
-
+ request.setMethod("POST");
+ request.setRequestURI("/event/speakerevent.form");
+ request.setParameter("firstName", "Enrico");
+ request.setParameter("lastName", "Giurin");
+ request.setParameter("email", "enr...@giurin.com");
+ request.setParameter("resume", "myResume");
+ handler.handle(request, response, controller);
+
+ resetRequestAndResponse();
+
+ request.setMethod("POST");
+ request.setRequestURI(FORM_REQUEST_URI);
+ handler.handle(request, response, controller);
+
Event event = eventDao.findByTitle("test-title").get(0);
- assertEquals(event.getLocation(), "test-location");
+ assertThat(event.getLocation(), is(equalTo("test-location")));
List<Speaker> speakers = speakerDao.allByEvent(event.getId());
- assertEquals(1, speakers.size());
- assertEquals(speakers.get(0).getFirstName(), "Enrico");
- }
-
-
- public void testDeleteSpeakersFromExistingEvent() throws Exception
- {
- Event testEvent = getSpringFrameworkTestEvent();
- List<Speaker> oldSpeakers = testEvent.getSpeakers();
- assertEquals(2, oldSpeakers.size());
- callForm(testEvent.getId().toString());
-
-
+ assertThat(speakers, hasSize(1));
+ assertThat(speakers.get(0).getFirstName(), is(equalTo("Enrico")));
+ }
+
+ @Test
+ public void deleteSpeakersFromExistingEvent() throws Exception {
+ Event testEvent = getSpringFrameworkTestEvent();
+ List<Speaker> oldSpeakers = testEvent.getSpeakers();
+ assertThat(oldSpeakers, hasSize(2));
+ callForm(testEvent.getId().toString());
+
//remove all speakers
- for(int j=0;j<2;j++)
- {
- resetRequestAndResponse();
- req.setMethod("GET");
- req.setRequestURI(REQUEST_REMOVE_SPEAKER_URI);
- req.setParameter("indexSpeaker", new Long(1).toString());
- handler.handle(req, res, controller);
- }
+ for (int j = 0; j < 2; j++) {
+ resetRequestAndResponse();
+ request.setMethod("GET");
+ request.setRequestURI(REQUEST_REMOVE_SPEAKER_URI);
+ request.setParameter("indexSpeaker", new Long(1).toString());
+ handler.handle(request, response, controller);
+ }
//save the event
resetRequestAndResponse();
- req.setMethod("POST");
- req.setRequestURI(FORM_REQUEST_URI);
- handler.handle(req, res, controller);
-
+ request.setMethod("POST");
+ request.setRequestURI(FORM_REQUEST_URI);
+ handler.handle(request, response, controller);
+
//check data
Event event = getSpringFrameworkTestEvent();
List<Speaker> speakers = speakerDao.allByEvent(event.getId());
//no speakers bound to this event
- assertEquals(0, speakers.size());
- List<Speaker> allSpeakers = speakerDao.findAll();
+ assertThat(speakers, hasSize(0));
+ List<Speaker> allSpeakers = speakerDao.findAll();
//only 1 speaker still alive
- assertEquals(1, allSpeakers.size());
- assertEquals("Lucio Benfante &egrave; il presidente del JUG Padova
e responsabile di jugevents.", allSpeakers.get(0).getResume());
-
-
- }
-
-
-
-/**
- ********************* Utilities methods *****************************
- */
+ assertThat(allSpeakers, hasSize(1));
+ assertThat(allSpeakers.get(0).getResume(),
+ is(equalTo(
+ "Lucio Benfante &egrave; il presidente del JUG Padova e
responsabile di jugevents.")));
+ }
+
+ /**
+ ********************* Utilities methods *****************************
+ */
private ModelAndView callForm(String eventId) throws Exception {
servicesBo.setAuthenticatedUsername("enrico");
- req.setMethod("GET");
- req.setRequestURI(FORM_REQUEST_URI);
- req.setParameter("id", eventId);
- ModelAndView mv = handler.handle(req, res, controller);
- this.endTransaction();
- this.startNewTransaction();
+ request.setMethod("GET");
+ request.setRequestURI(FORM_REQUEST_URI);
+ request.setParameter("id", eventId);
+ ModelAndView mv = handler.handle(request, response, controller);
return mv;
}

@@ -211,14 +203,16 @@

private Event getTestEvent() {
List<Event> events =
-
((HibernateGenericDao)eventDao).searchByCriteria(DetachedCriteria.forClass(Event.class).add(Restrictions.eq("title",
- "JUG Padova Meeting #38")));
+// ((HibernateGenericDao)
eventDao).searchByCriteria(DetachedCriteria.forClass(
+// Event.class).add(Restrictions.eq("title", "JUG Padova
Meeting #38")));
+ eventDao.findByTitle("JUG Padova Meeting #38");
return events.get(0);
}

private Event getSpringFrameworkTestEvent() {
List<Event> events =
-
((HibernateGenericDao)eventDao).searchByCriteria(DetachedCriteria.forClass(Event.class).add(Restrictions.eq("title",
+ ((HibernateGenericDao)
eventDao).searchByCriteria(DetachedCriteria.forClass(
+ Event.class).add(Restrictions.eq("title",
"Springframework Meeting 2007")));
return events.get(0);
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/controllers/HomeControllerTest.java
Sat Mar 9 20:41:28 2013
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/controllers/HomeControllerTest.java
Sun May 19 10:58:10 2013
@@ -21,7 +21,10 @@
import javax.annotation.Resource;

import it.jugpadova.JugEventsControllerTest;
-import org.springframework.beans.factory.annotation.Autowired;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.springframework.test.web.ModelAndViewAssert;
+import org.junit.Test;
import org.springframework.web.servlet.ModelAndView;

public class HomeControllerTest extends JugEventsControllerTest {
@@ -29,15 +32,17 @@
@Resource
private HomeController controller;

+ @Test
public void testNotNull() {
- assertNotNull(controller);
- assertNotNull(handler);
+ assertThat(controller, is(notNullValue()));
+ assertThat(handler, is(notNullValue()));
}

+ @Test
public void testWelcome() throws Exception {
- req.setRequestURI("/home/welcome.html");
- ModelAndView mv = handler.handle(req, res, controller);
- assertEquals("welcome", mv.getViewName());
- assertNotNull(mv.getModel().get("something"));
+ request.setRequestURI("/home/welcome.html");
+ ModelAndView mv = handler.handle(request, response, controller);
+ ModelAndViewAssert.assertViewName(mv, "welcome");
+ ModelAndViewAssert.assertModelAttributeAvailable(mv, "something");
}
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/EventDaoTest.java
Sat Mar 9 20:41:28 2013
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/EventDaoTest.java
Sun May 19 10:58:10 2013
@@ -15,37 +15,32 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package it.jugpadova.dao;

-/**
- *
- */
-package it.jugpadova.dao;
import it.jugpadova.JugEventsBaseTest;
import it.jugpadova.po.Event;
import it.jugpadova.po.Speaker;
-
import java.util.List;
-
import javax.annotation.Resource;
-
-import org.springframework.beans.factory.annotation.Autowired;
-
-
+import static org.hamcrest.collection.IsCollectionWithSize.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;

/**
* @author Enrico Giurin
*
*/
public class EventDaoTest extends JugEventsBaseTest {
- @Resource
+
+ @Resource
private EventDao eventDao;
-
- public void testFindByTitle() {
- List<Event> events = eventDao.findByTitle("Springframework%");
- assertEquals(1, events.size());
- Event eventSF = events.get(0);
- List<Speaker> speakers = eventSF.getSpeakers();
- assertEquals(2, speakers.size());
- }

+ @Test
+ public void findByTitle() {
+ List<Event> events = eventDao.findByTitle("Springframework%");
+ assertThat(events, hasSize(1));
+ Event eventSF = events.get(0);
+ List<Speaker> speakers = eventSF.getSpeakers();
+ assertThat(speakers, hasSize(2));
+ }
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/EventResourceDaoTest.java
Sat Mar 9 20:41:28 2013
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/EventResourceDaoTest.java
Sun May 19 10:58:10 2013
@@ -15,28 +15,28 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova.dao;

import it.jugpadova.JugEventsBaseTest;
import it.jugpadova.po.EventResource;
-
import java.util.List;
-
import javax.annotation.Resource;
-
-import org.springframework.beans.factory.annotation.Autowired;
+import static org.hamcrest.collection.IsCollectionWithSize.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;

/**
*
* @author lucio
*/
public class EventResourceDaoTest extends JugEventsBaseTest {
+
@Resource
private EventResourceDao eventResourceDao;

- public void testFindAll() {
+ @Test
+ public void findAll() {
List<EventResource> resources = eventResourceDao.findAll();
- assertSize(7, resources);
+ assertThat(resources, hasSize(7));
}
}
=======================================
--- /jugevents/jugevents-web/src/test/java/it/jugpadova/dao/JUGDaoTest.java
Sat Mar 9 20:41:28 2013
+++ /jugevents/jugevents-web/src/test/java/it/jugpadova/dao/JUGDaoTest.java
Sun May 19 10:58:10 2013
@@ -20,12 +20,12 @@

import it.jugpadova.JugEventsBaseTest;
import it.jugpadova.po.JUG;
-
import java.util.List;
-
import javax.annotation.Resource;
-
-import org.springframework.beans.factory.annotation.Autowired;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.collection.IsCollectionWithSize.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;

/**
*
@@ -36,27 +36,28 @@
@Resource
private JUGDao jugDao;

- public void testFindByPartialName() {
+ @Test
+ public void findByPartialName() {
List<JUG> jugs = jugDao.findByPartialName("%J%");
- assertSize(3, jugs);
+ assertThat(jugs, hasSize(3));
}
-
- public void testFindByPartialJugNameAndCountry() {
+
+ @Test
+ public void findByPartialJugNameAndCountry() {
List<JUG> jugs =
jugDao.findByPartialJugNameAndCountry("J%", "It%");
- assertSize(2, jugs);
+ assertThat(jugs, hasSize(2));
}
-
-
- public void testfindByNameAndCountryEN() {
+
+ @Test
+ public void findByNameAndCountryEN() {
List<JUG> jugs = jugDao.findByNameAndCountryEN("JUG
Padova", "Italy");
- assertSize(1, jugs);
+ assertThat(jugs, hasSize(1));
}
-
- public void testFindByICName() {
+
+ @Test
+ public void findByICName() {
JUG jug = jugDao.findByICName("jug padova");
- assertNotNull(jug);
- assertEquals(jug.getName(), "JUG Padova");
+ assertThat(jug, is(notNullValue()));
+ assertThat(jug.getName(), is(equalTo("JUG Padova")));
}
-
-
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/JuggerDaoTest.java
Sat Mar 9 20:41:28 2013
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/JuggerDaoTest.java
Sun May 19 10:58:10 2013
@@ -15,17 +15,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova.dao;

import it.jugpadova.JugEventsBaseTest;
import it.jugpadova.po.Jugger;
-
import java.util.List;
-
import javax.annotation.Resource;
-
-import org.springframework.beans.factory.annotation.Autowired;
+import static org.hamcrest.collection.IsCollectionWithSize.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;

/**
*
@@ -36,13 +34,16 @@
@Resource
private JuggerDao juggerDao;

- public void testFindByPartialJugNameAndCountryAndContinent() {
- List<Jugger> juggers =
juggerDao.findByPartialJugNameAndCountryAndContinent("%J%", "%Ital%", "%Eur%");
- assertSize(3, juggers);
+ @Test
+ public void findByPartialJugNameAndCountryAndContinent() {
+ List<Jugger> juggers =
juggerDao.findByPartialJugNameAndCountryAndContinent("%J%", "%Ital%",
+ "%Eur%");
+ assertThat(juggers, hasSize(3));
}

- public void testFindAll() {
+ @Test
+ public void findAll() {
List<Jugger> juggers = juggerDao.findAll();
- assertSize(3, juggers);
+ assertThat(juggers, hasSize(3));
}
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/ParticipantDaoTest.java
Thu Mar 31 08:27:26 2011
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/ParticipantDaoTest.java
Sun May 19 10:58:10 2013
@@ -15,19 +15,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova.dao;

import it.jugpadova.JugEventsBaseTest;
import it.jugpadova.po.Event;
import it.jugpadova.po.Participant;
-import it.jugpadova.util.NumOfDaysReminder;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
import java.util.List;
import javax.annotation.Resource;
+import static org.hamcrest.collection.IsCollectionWithSize.*;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;

/**
* Tests on the ParticipantDao methods (and queries)
@@ -44,40 +42,44 @@
/**
* Test of findConfirmedParticipantsByEventId method, of class
ParticipantDao.
*/
- public void testFindConfirmedParticipantsByEventId() {
+ @Test
+ public void findConfirmedParticipantsByEventId() {
List<Event> futureEvent = retrieveFutureEvent();
List<Participant> participants =

participantDao.findConfirmedParticipantsByEventId(futureEvent.
get(0).getId());
- assertSize(7, participants);
+ assertThat(participants, hasSize(7));
}

/**
* Test of findNotConfirmedParticipantsByEventId method, of class
ParticipantDao.
*/
- public void testFindNotConfirmedParticipantsByEventId() {
+ @Test
+ public void findNotConfirmedParticipantsByEventId() {
List<Event> futureEvent = retrieveFutureEvent();
List<Participant> participants =

participantDao.findNotConfirmedParticipantsByEventId(futureEvent.get(0).
getId());
- assertSize(2, participants);
+ assertThat(participants, hasSize(2));
}

/**
* Test of findCancelledParticipantsByEventId method, of class
ParticipantDao.
*/
- public void testFindCancelledParticipantsByEventId() {
+ @Test
+ public void findCancelledParticipantsByEventId() {
List<Event> futureEvent = retrieveFutureEvent();
List<Participant> participants = participantDao.

findCancelledParticipantsByEventId(futureEvent.get(0).getId());
- assertSize(2, participants);
+ assertThat(participants, hasSize(2));
}

/**
* Test the consistency of the lists of participants.
*
*/
- public void testParticipantListsConsistency() {
+ @Test
+ public void participantListsConsistency() {
List<Event> futureEvent = retrieveFutureEvent();
Long eventId = futureEvent.get(0).getId();
List<Participant> all =
participantDao.findParticipantsByEventId(eventId);
@@ -87,15 +89,13 @@

participantDao.findNotConfirmedParticipantsByEventId(eventId);
List<Participant> cancelled = participantDao.
findCancelledParticipantsByEventId(eventId);
- assertEquals(all.size(),
confirmed.size()+notConfirmed.size()+cancelled.size());
+ assertThat(all.size(),
+ is(equalTo(confirmed.size() + notConfirmed.size() +
cancelled.size())));
}
-
-
-

private List<Event> retrieveFutureEvent() {
List<Event> futureEvent = eventDao.findByTitle("Future Meeting");
- assertSize(1, futureEvent);
+ assertThat(futureEvent, hasSize(1));
return futureEvent;
}
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/SpeakerDaoTest.java
Sat Mar 9 20:41:28 2013
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/dao/SpeakerDaoTest.java
Sun May 19 10:58:10 2013
@@ -15,75 +15,70 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova.dao;

import it.jugpadova.JugEventsBaseTest;
import it.jugpadova.po.Event;
import it.jugpadova.po.Speaker;
-
import it.jugpadova.util.Utilities;
-
-import java.io.InputStream;
import java.util.List;
-
import javax.annotation.Resource;
-
-import org.springframework.beans.factory.annotation.Autowired;
+import static org.hamcrest.collection.IsCollectionWithSize.*;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;

/**
* @author Enrico Giurin
*
*/
public class SpeakerDaoTest extends JugEventsBaseTest {
+
@Resource
private SpeakerDao speakerDao;
-
-
- public void testFindAll() {
+
+ @Test
+ public void findAll() {
List<Speaker> speakers = speakerDao.findAll();
- assertEquals(speakers.size(), 3);
+ assertThat(speakers, hasSize(3));
}
-
- public void testFindEventsByPartialSpeakerEmail()
- {
- List<Event> events =
speakerDao.findEventsByPartialSpeakerEmail("lucio%");
- assertEquals(2, events.size());
+
+ @Test
+ public void findEventsByPartialSpeakerEmail() {
+ List<Event> events =
speakerDao.findEventsByPartialSpeakerEmail("lucio%");
+ assertThat(events, hasSize(2));
}
-
- public void testFindSpeakersByPartialEventTitle()
- {
- List<Speaker> speakers =
speakerDao.findSpeakersByPartialEventTitle("Springframework%");
- assertEquals(2, speakers.size());
- Speaker speakerLucio = speakerDao.findByResume("%is the
president%").get(0);
- Speaker speakerEnrico = speakerDao.findByResume("%electronic
engineer%").get(0);
- assertTrue(speakers.contains(speakerLucio));
- assertTrue(speakers.contains(speakerEnrico));
- assertEquals("enrico...@gmail.com", speakerEnrico.getEmail());
- assertEquals("http://benfante.blogspot.com/", speakerLucio.getUrl());
- assertEquals("benfante", speakerLucio.getSkypeId());
+
+ @Test
+ public void findSpeakersByPartialEventTitle() {
+ List<Speaker> speakers =
speakerDao.findSpeakersByPartialEventTitle("Springframework%");
+ assertThat(speakers, hasSize(2));
+ Speaker speakerLucio = speakerDao.findByResume("%is the
president%").get(0);
+ Speaker speakerEnrico = speakerDao.findByResume("%electronic
engineer%").get(0);
+ assertThat(speakers.contains(speakerLucio), is(true));
+ assertThat(speakers.contains(speakerEnrico), is(true));
+ assertThat(speakerEnrico.getEmail(),
is(equalTo("enrico...@gmail.com")));
+ assertThat(speakerLucio.getUrl(),
is(equalTo("http://benfante.blogspot.com/")));
+ assertThat(speakerLucio.getSkypeId(), is(equalTo("benfante")));
}
-
- public void testInsertDuplicateKey()
- {
+
+// @Test
+// public void insertDuplicateKey() {
// SpeakerCoreAttributes duplicateSpeaker = new
SpeakerCoreAttributes("enrico", "giurin", "a...@bbb.com");
// //I was expecting this method would throw an exception, not only
logging the error
// speakerCoreAttributesDao.store(duplicateSpeaker);
- //TODO I cannot check any results as I have an hibernate exception
- //assertEquals(1,
speakerCoreAttributesDao.findByFirstNameAndLastName("enrico", "giurin").size());
- //TODO check why the method findAll returns null...
- //assertEquals(2, speakerCoreAttributesDao.findAll().size());
- }
-
- public void testInsertImage() throws Exception {
- byte[] image = Utilities.resourceToBytes("/images/enrico.jpg");
- assertEquals(2402, image.length);
- Speaker speakerEnrico = speakerDao.findByResume("%electronic
engineer%").get(0);
- speakerEnrico.setPicture(image);
- speakerDao.store(speakerEnrico);
-
+// TODO I cannot check any results as I have an hibernate exception
+// assertThat(1,
speakerCoreAttributesDao.findByFirstNameAndLastName("enrico",is(equalTo( "giurin").size())));
+// TODO check why the method findAll returns null...
+// assertThat(2,is(equalTo(
speakerCoreAttributesDao.findAll().size())));
+// }
+
+ @Test
+ public void insertImage() throws Exception {
+ byte[] image = Utilities.resourceToBytes("/images/enrico.jpg");
+ assertThat(image.length, is(2402));
+ Speaker speakerEnrico = speakerDao.findByResume("%electronic
engineer%").get(0);
+ speakerEnrico.setPicture(image);
+ speakerDao.store(speakerEnrico);
}
-
-
-
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/plugins/TestSecurityPlugin.java
Fri May 4 16:14:35 2012
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/plugins/TestSecurityPlugin.java
Sun May 19 10:58:10 2013
@@ -21,20 +21,23 @@

import org.parancoe.plugins.securityevolution.User;
import org.parancoe.plugins.securityevolution.UserDao;
-
import it.jugpadova.JugEventsBaseTest;
+import static org.hamcrest.collection.IsCollectionWithSize.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;

/**
* @author enrico
*
*/
public class TestSecurityPlugin extends JugEventsBaseTest {
- @Resource
- private UserDao userDao;
- public void testUser()
- {
- User admin = userDao.findByUsername("admin");
- assertEquals(1, admin.getGroups().size());
- }
+
+ @Resource
+ private UserDao userDao;

+ @Test
+ public void user() {
+ User admin = userDao.findByUsername("admin");
+ assertThat(admin.getGroups(), hasSize(1));
+ }
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/util/UtilitiesTest.java
Thu Mar 31 09:40:30 2011
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/util/UtilitiesTest.java
Sun May 19 10:58:10 2013
@@ -15,10 +15,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package it.jugpadova.util;

-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;

/**
* Tests of the Utilities methods.
@@ -26,22 +27,18 @@
* @author Lucio Benfante (<a
href="lucio.b...@jugpadova.it">lucio.b...@jugpadova.it</a>)
* @version $Revision$
*/
-public class UtilitiesTest extends TestCase {
-
- public UtilitiesTest(String testName) {
- super(testName);
- }
+public class UtilitiesTest {

/**
* Test of appendUrlParameter method, of class Utilities.
*/
- public void testAppendUrlParameterAllNotNull() throws Exception {
+ @Test
+ public void appendUrlParameterAllNotNull() throws Exception {
StringBuilder sb = new
StringBuilder("http://www.jugevents.org/jugevents/prova.html");
Utilities.appendUrlParameter(sb, "p1", "v1", true);
Utilities.appendUrlParameter(sb, "p2", "v2", true);
Utilities.appendUrlParameter(sb, "p3", "v3", true);
String expResult
= "http://www.jugevents.org/jugevents/prova.html?p1=v1&p2=v2&p3=v3";
- assertEquals(expResult, sb.toString());
+ assertThat(expResult, is(equalTo(sb.toString())));
}
-
}
=======================================
---
/jugevents/jugevents-web/src/test/java/it/jugpadova/util/mime/MimeUtilTest.java
Thu Mar 31 08:27:26 2011
+++
/jugevents/jugevents-web/src/test/java/it/jugpadova/util/mime/MimeUtilTest.java
Sun May 19 10:58:10 2013
@@ -29,28 +29,15 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import junit.framework.TestCase;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;

/**
* Tests on MimeUtil
*
* @author lucio
*/
-public class MimeUtilTest extends TestCase {
-
- public MimeUtilTest(String testName) {
- super(testName);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
+public class MimeUtilTest {

/**
* Test of getMimeType method, of class MimeUtil.
@@ -59,7 +46,7 @@
byte[] content =
loadToByteArray("it/jugpadova/util/mime/noJugLogo.jpg");
String expResult = "image/jpeg";
String result = MimeUtil.getMimeType(content);
- assertEquals(expResult, result);
+ assertThat(expResult, is(equalTo(result)));
}

/**
@@ -69,7 +56,7 @@
byte[] content =
loadToByteArray("it/jugpadova/util/mime/noJugLogo.png");
String expResult = "image/png";
String result = MimeUtil.getMimeType(content);
- assertEquals(expResult, result);
+ assertThat(expResult, is(equalTo(result)));
}

/**
@@ -79,7 +66,7 @@
byte[] content =
loadToByteArray("it/jugpadova/util/mime/noJugLogo.gif");
String expResult = "image/gif";
String result = MimeUtil.getMimeType(content);
- assertEquals(expResult, result);
+ assertThat(expResult, is(equalTo(result)));
}

/**
@@ -89,7 +76,7 @@
byte[] content =
loadToByteArray("it/jugpadova/util/mime/template.pdf");
String expResult = "application/pdf";
String result = MimeUtil.getMimeType(content);
- assertEquals(expResult, result);
+ assertThat(expResult, is(equalTo(result)));
}

/**
@@ -99,7 +86,7 @@
String mimeType = "image/jpeg";
String expResult = "image";
String result = MimeUtil.getMajorComponent(mimeType);
- assertEquals(expResult, result);
+ assertThat(expResult, is(equalTo(result)));
}

/**
@@ -109,7 +96,7 @@
String mimeType = "image/jpeg";
String expResult = "jpeg";
String result = MimeUtil.getMinorComponent(mimeType);
- assertEquals(expResult, result);
+ assertThat(expResult, is(equalTo(result)));
}

/**
@@ -119,7 +106,7 @@
File file = new File("jugevents.jpg");
String expResult = "jpg";
String result = MimeUtil.getFileExtension(file);
- assertEquals(expResult, result);
+ assertThat(expResult, is(equalTo(result)));
}

private byte[] loadToByteArray(String resource) throws IOException {
=======================================
--- /jugevents/jugevents-web/src/test/resources/database-test.xml Tue Apr
16 18:38:46 2013
+++ /jugevents/jugevents-web/src/test/resources/database-test.xml Sun May
19 10:58:10 2013
@@ -61,7 +61,7 @@
<property name="hibernateProperties">
<props merge="true">
<prop key="hibernate.hbm2ddl.auto">create</prop>
- <prop key="hibernate.show_sql">true</prop>
+ <prop key="hibernate.show_sql">false</prop>
<prop
key="hibernate.search.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider</prop>
<prop
key="hibernate.search.default.indexBase">target</prop>
</props>
=======================================
--- /jugevents/pom.xml Tue Apr 16 18:38:46 2013
+++ /jugevents/pom.xml Sun May 19 10:58:10 2013
@@ -13,12 +13,9 @@
<year>2007</year>
<app.parancoe.version>3.1-SNAPSHOT</app.parancoe.version>
<app.lambico.version>1.1-SNAPSHOT</app.lambico.version>
- <!-- <app.springsecurity.version></app.springsecurity.version> -->
- <app.hibernate.version>3.6.2.GA</app.hibernate.version>
- <app.log4j.version>1.2.14</app.log4j.version>
- <app.junit3.version>3.8.2</app.junit3.version>
- <app.hsqldb.version>1.8.0.10</app.hsqldb.version>
-
+ <app.junit4.version>4.11</app.junit4.version>
+ <app.hsqldb.version>2.2.9</app.hsqldb.version>
+
<app.springsecurity.version>3.1.3.RELEASE</app.springsecurity.version>
<!-- jugevents default configuration -->
<app.datasource>java:comp/env/jdbc/ipsa-webDS</app.datasource>

<app.datasource.driver>org.hsqldb.jdbcDriver</app.datasource.driver>
@@ -29,9 +26,9 @@
<app.log.console.level>INFO</app.log.console.level>
<app.log.file.level>DEBUG</app.log.file.level>
<app.log.rootdir>/tmp/log-ipsa</app.log.rootdir>
- <log4j.logger.org.parancoe>INFO</log4j.logger.org.parancoe>
-
<log4j.logger.org.jugevents.core>DEBUG</log4j.logger.org.jugevents.core>
-
<log4j.logger.org.jugevents.web>DEBUG</log4j.logger.org.jugevents.web>
+ <slf4j.logger.org.parancoe>INFO</slf4j.logger.org.parancoe>
+
<slf4j.logger.org.jugevents.core>DEBUG</slf4j.logger.org.jugevents.core>
+
<slf4j.logger.org.jugevents.web>DEBUG</slf4j.logger.org.jugevents.web>

<mail.host>localhost</mail.host>
<mail.username>myusername</mail.username>
@@ -121,17 +118,17 @@
<version>${app.parancoe.version}</version>
</dependency>
<dependency>
- <groupId>org.parancoe</groupId>
- <artifactId>parancoe-test</artifactId>
- <version>${app.parancoe.version}</version>
- <scope>test</scope>
- </dependency>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-test</artifactId>
+ <version>${app.parancoe.version}</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.lambico</groupId>
<artifactId>lambico-test</artifactId>
<version>${app.lambico.version}</version>
</dependency>
- <!-- <dependency>
+ <!-- <dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${app.springsecurity.version}</version>
@@ -270,10 +267,10 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>${app.junit3.version}</version>
+ <version>${app.junit4.version}</version>
</dependency>
<dependency>
- <groupId>hsqldb</groupId>
+ <groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>${app.hsqldb.version}</version>
</dependency>
@@ -300,12 +297,12 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
- <version>5.1.6</version>
+ <version>5.1.25</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
- <version>8.3-603.jdbc3</version>
+ <version>9.2-1002.jdbc4</version>
</dependency>
<dependency>
<groupId>net.java.dev.textile-j</groupId>
@@ -313,14 +310,20 @@
<version>2.2.864</version>
</dependency>
<dependency>
- <groupId>jcaptcha</groupId>
+ <groupId>com.octo.captcha</groupId>
<artifactId>jcaptcha-all</artifactId>
<version>1.0-RC6</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
- <version>1.4</version>
+ <version>1.4.7</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
@@ -336,7 +339,7 @@
<dependency>
<groupId>rome</groupId>
<artifactId>rome</artifactId>
- <version>0.9</version>
+ <version>1.0</version>
</dependency>
<dependency>
<groupId>xom</groupId>
@@ -353,6 +356,10 @@
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</exclusion>
+ <exclusion>
+ <artifactId>slf4j-log4j12</artifactId>
+ <groupId>org.slf4j</groupId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -368,7 +375,7 @@
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
- <version>1.3</version>
+ <version>2.2</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
@@ -379,6 +386,12 @@
<groupId>com.benfante</groupId>
<artifactId>JSlideShare</artifactId>
<version>0.6</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>log4j</artifactId>
+ <groupId>log4j</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>net.jawr</groupId>
@@ -393,7 +406,7 @@
<dependency>
<groupId>com.yahoo.platform.yui</groupId>
<artifactId>yuicompressor</artifactId>
- <version>2.3.6</version>
+ <version>2.4.7</version>
</dependency>
<dependency>
<groupId>org.tuckey</groupId>
@@ -404,6 +417,16 @@
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>2.0.8</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>bcmail-jdk14</artifactId>
+ <groupId>bouncycastle</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>bcprov-jdk14</artifactId>
+ <groupId>bouncycastle</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>net.fortuna.ical4j</groupId>
@@ -421,43 +444,47 @@
<version>1.4</version>
</dependency>
<dependency>
- <artifactId>log4j</artifactId>
- <groupId>log4j</groupId>
- <version>${app.log4j.version}</version>
+ <artifactId>slf4j-api</artifactId>
+ <groupId>org.slf4j</groupId>
+ <version>1.7.5</version>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.7.2</version>
- </dependency>
+ <artifactId>slf4j-simple</artifactId>
+ <groupId>org.slf4j</groupId>
+ <version>1.7.5</version>
+ </dependency>
<dependency>
- <artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
- <version>1.7.2</version>
+ <artifactId>log4j-over-slf4j</artifactId>
+ <version>1.7.5</version>
</dependency>
<dependency>
- <artifactId>slf4j-simple</artifactId>
- <groupId>org.slf4j</groupId>
- <version>1.7.2</version>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.0.13</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
- <version>1.2.2</version>
+ <version>1.3</version>
</dependency>
- <!-- openId support -->
<dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-openid</artifactId>
- <version>3.1.0.RELEASE</version>
- </dependency>
- <!-- explicit DWR - replace the parancoe dwr plugin -->
- <dependency>
- <groupId>org.directwebremoting</groupId>
- <artifactId>dwr</artifactId>
- <version>3.0-M1-RCL4</version>
- </dependency>
-
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-core</artifactId>
+ <version>${app.springsecurity.version}</version>
+ </dependency>
+ <!-- openId support -->
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-openid</artifactId>
+ <version>${app.springsecurity.version}</version>
+ </dependency>
+ <!-- explicit DWR - replace the parancoe dwr plugin -->
+ <dependency>
+ <groupId>org.directwebremoting</groupId>
+ <artifactId>dwr</artifactId>
+ <version>3.0-M1-RCL4</version>
+ </dependency>
</dependencies>
</dependencyManagement>
<build>
@@ -465,7 +492,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
- <version>2.3</version>
+ <version>2.4</version>
<configuration>
<descriptors>
<descriptor>src/assembly/bin.xml</descriptor>
@@ -475,17 +502,17 @@
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
+ <version>3.1</version>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.7</source>
+ <target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.12</version>
+ <version>2.14.1</version>
<configuration>
<skip>false</skip>
<useFile>true</useFile>
@@ -496,7 +523,7 @@
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
- <version>2.5</version>
+ <version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
@@ -504,8 +531,9 @@
<plugin>
<groupId>com.mycila.maven-license-plugin</groupId>
<artifactId>maven-license-plugin</artifactId>
- <version>1.5.0</version>
+ <version>1.9.0</version>
<configuration>
+ <strictCheck>true</strictCheck>
<header>${main.basedir}/LICENSE_HEADER</header>
<excludes>
<exclude>target/**</exclude>
@@ -525,32 +553,30 @@

<exclude>src/main/webapp/javascripts/sound.js</exclude>

<exclude>src/main/webapp/javascripts/scriptaculous.js</exclude>

<exclude>src/main/webapp/javascripts/controls.js</exclude>
-
<exclude>src/main/webapp/javascripts/jquery-1.4.4.min.js</exclude>
-
<exclude>src/main/webapp/javascripts/jquery-ui.min.js</exclude>

<exclude>src/main/webapp/javascripts/less-1.0.41.min.js</exclude>
-
<exclude>src/main/webapp/javascripts/jquery.imgareaselect.pack.js</exclude>
-
<exclude>src/main/webapp/javascripts/jquery.textareaCounter.plugin.js</exclude>
-
<exclude>src/main/webapp/javascripts/jquery.lazyload.js</exclude>
-
<exclude>src/main/webapp/javascripts/autoresize.jquery.js</exclude>
-
<exclude>src/main/webapp/javascripts/jquery.fileupload.js</exclude>
-
<exclude>src/main/webapp/javascripts/jquery.fileupload-ui.js</exclude>
+
<exclude>src/main/webapp/javascripts/jquery*.js</exclude>

<exclude>src/main/webapp/javascripts/fancybox/**</exclude>
-
<exclude>src/main/webapp/templates/clarity/**</exclude>
-
<exclude>src/main/webapp/WEB-INF/tiles/templates/clarity_main.jsp</exclude>
- <exclude>src/main/webapp/images/silk/**</exclude>
-
<exclude>src/main/webapp/stylesheets/blueprint/**</exclude>
-
<exclude>src/main/webapp/stylesheets/imgareaselect/**</exclude>
-
<exclude>src/main/webapp/stylesheets/jqueryui/**</exclude>
-
<exclude>src/main/webapp/stylesheets/jquery.fileupload/**</exclude>
-
<exclude>src/main/webapp/stylesheets/displaytag/**</exclude>
-
<exclude>src/main/webapp/stylesheets/prototip/**</exclude>
-
<exclude>src/main/webapp/dtds/urlrewrite3.2.dtd</exclude>

<exclude>src/main/webapp/javascripts/calendar.js</exclude>

<exclude>src/main/webapp/javascripts/calendar-setup.js</exclude>

<exclude>src/main/webapp/javascripts/lib/**</exclude>

<exclude>src/main/webapp/javascripts/nifty.js</exclude>

<exclude>src/main/webapp/javascripts/modal.js</exclude>

<exclude>src/main/webapp/javascripts/calendar-lang/**</exclude>
+
<exclude>src/main/webapp/templates/clarity/**</exclude>
+
<exclude>src/main/webapp/WEB-INF/tiles/templates/clarity_main.jsp</exclude>
+ <exclude>src/main/webapp/images/silk/**</exclude>
+
<exclude>src/main/webapp/stylesheets/blueprint/*.css</exclude>
+
<exclude>src/main/webapp/stylesheets/imgareaselect/*.css</exclude>
+
<exclude>src/main/webapp/stylesheets/jqueryui/*.css</exclude>
+
<exclude>src/main/webapp/stylesheets/jquery.fileupload/*.css</exclude>
+
<exclude>src/main/webapp/stylesheets/displaytag/*.css</exclude>
+
<exclude>src/main/webapp/stylesheets/prototip/*.css</exclude>
+
<exclude>src/main/webapp/dtds/urlrewrite3.2.dtd</exclude>
+ <exclude>src/main/webapp/docs/**</exclude>
+
<exclude>src/main/resources/it/jugpadova/**</exclude>
+ <exclude>src/main/resources/footprint/**</exclude>
+ <exclude>src/test/resources/footprint/**</exclude>
+ <exclude>src/test/resources/**/*.pdf</exclude>
</excludes>
<properties>
<name>${project.name}</name>
@@ -580,7 +606,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.4</version>
+ <version>2.10</version>
<configuration>

<configLocation>${main.basedir}/jugevents_checks.xml</configLocation>
<encoding>UTF-8</encoding>
@@ -596,15 +622,6 @@
<snapshots>
<enabled>true</enabled>
</snapshots>
- </repository>
- <repository>
- <id>maven2-repository.dev.java.net</id>
- <name>Java.net Repository for Maven</name>
- <url>http://download.java.net/maven/2/</url>
- <layout>default</layout>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
</repository>
<repository>
<id>jboss-maven2-repository</id>

==============================================================================
Revision: 9466e4053050
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Sun May 19 11:10:44 2013
Log: back in 90's, switch to Java 6
http://code.google.com/p/jugevents/source/detail?r=9466e4053050&repo=version3

Modified:
/jugevents/pom.xml

=======================================
--- /jugevents/pom.xml Sun May 19 10:58:10 2013
+++ /jugevents/pom.xml Sun May 19 11:10:44 2013
@@ -504,8 +504,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
- <source>1.7</source>
- <target>1.7</target>
+ <source>1.6</source>
+ <target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>

==============================================================================
Revision: 33763a27b01a
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Sun May 19 11:47:24 2013
Log: (re)add missing dwr3plugin
http://code.google.com/p/jugevents/source/detail?r=33763a27b01a&repo=version3

Modified:
/jugevents/jugevents-web/pom.xml

=======================================
--- /jugevents/jugevents-web/pom.xml Sun May 19 10:58:10 2013
+++ /jugevents/jugevents-web/pom.xml Sun May 19 11:47:24 2013
@@ -153,7 +153,7 @@
<artifactId>jsp-api</artifactId>
<scope>provided</scope>
</dependency>
-
+
<!-- Spring Security -->
<!-- springsecurity tag lib -->
<!-- <dependency>
@@ -206,7 +206,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
</dependency> -->
-
+
<!-- db driver(s) -->
<!-- mysql db -->
<dependency>
@@ -222,31 +222,31 @@
</dependency>

<!-- AJAX framework -->
- <!--
+ <!--
<dependency>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-plugin-dwr</artifactId>
</dependency>
+ -->
<dependency>
<groupId>net.jawr.dwr</groupId>
<artifactId>dwr3plugin</artifactId>
</dependency>
- -->
<dependency>
<groupId>org.directwebremoting</groupId>
- <artifactId>dwr</artifactId>
+ <artifactId>dwr</artifactId>
</dependency>
-
+
<!-- Only for tests of your application (if any ;) )-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <scope>test</scope>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-test</artifactId>
- <scope>test</scope>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
@@ -264,7 +264,7 @@
<version>1.3</version>
<scope>test</scope>
</dependency>
-
+
<!-- Other -->
<dependency>
<groupId>net.java.dev.textile-j</groupId>
@@ -295,7 +295,7 @@
</exclusion>
</exclusions>
</dependency>
-
+
<!--dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
@@ -374,7 +374,7 @@
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
- <artifactId>spring-security-openid</artifactId>
+ <artifactId>spring-security-openid</artifactId>
</dependency>
</dependencies>
<profiles>

==============================================================================
Revision: 11d4ca91b614
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Sun May 19 11:54:40 2013
Log: fix transitive dependency
http://code.google.com/p/jugevents/source/detail?r=11d4ca91b614&repo=version3

Modified:
/jugevents/jugevents-web/pom.xml

=======================================
--- /jugevents/jugevents-web/pom.xml Sun May 19 11:47:24 2013
+++ /jugevents/jugevents-web/pom.xml Sun May 19 11:54:40 2013
@@ -231,6 +231,12 @@
<dependency>
<groupId>net.jawr.dwr</groupId>
<artifactId>dwr3plugin</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.directwebremoting</groupId>
+ <artifactId>dwr</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.directwebremoting</groupId>

==============================================================================
Revision: e07bceccd068
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Sun May 19 12:25:20 2013
Log: fix inexistent import package
http://code.google.com/p/jugevents/source/detail?r=e07bceccd068&repo=version3

Modified:
/jugevents/jugevents-web/src/main/webapp/WEB-INF/jsp/language.jsp

=======================================
--- /jugevents/jugevents-web/src/main/webapp/WEB-INF/jsp/language.jsp Thu
Mar 31 09:40:30 2011
+++ /jugevents/jugevents-web/src/main/webapp/WEB-INF/jsp/language.jsp Sun
May 19 12:25:20 2013
@@ -23,15 +23,7 @@
<%@ page import="org.apache.commons.lang.StringUtils" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
-<%@ page import="org.parancoe.util.Utils" %>
-<%--
-Map paramMap = request.getParameterMap();
-Map tmp = new HashMap(paramMap);
-tmp.remove("language");
-tmp.put("null", "null");
-List<String> paramKeyValuesList = Utils.convertToNameValueList(tmp, true);
-String queryString = "?" +
StringUtils.join(paramKeyValuesList.iterator(), "&amp;");
---%>
+
<span id="language">
<!-- lang: ${requestScope.lang} -->
<!-- locale: ${requestScope.requestContext.locale} -->
Reply all
Reply to author
Forward
0 new messages