[parancoe] 19 new revisions pushed by lucio.be...@gmail.com on 2013-03-18 11:01 GMT

6 views
Skip to first unread message

para...@googlecode.com

unread,
Mar 18, 2013, 7:02:30 AM3/18/13
to parancoe...@googlegroups.com
19 new revisions:

Revision: ae5a289aeb74
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 07:39:32 2013
Log: discontinued parancoe yaml module, replaced by lambico pump
http://code.google.com/p/parancoe/source/detail?r=ae5a289aeb74

Revision: 20e4c0676355
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Sun Feb 24 06:16:44 2013
Log: added reference guide in ePub format, cleanup build
http://code.google.com/p/parancoe/source/detail?r=20e4c0676355

Revision: d9ce2623e57e
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Fri Mar 1 04:03:24 2013
Log: PLUGINS - refresh jar versions, ease dependencies & poms, move
log4j t...
http://code.google.com/p/parancoe/source/detail?r=d9ce2623e57e

Revision: 18bbbb5bfa1a
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 08:46:53 2013
Log: MAIN - refresh jar versions, ease dependencies & poms, move log4j
to s...
http://code.google.com/p/parancoe/source/detail?r=18bbbb5bfa1a

Revision: 972125a93e5f
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 10:37:34 2013
Log: jump to lambico v1.1
http://code.google.com/p/parancoe/source/detail?r=972125a93e5f

Revision: 5b9133f2b470
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Fri Feb 22 04:36:16 2013
Log: remove parancoe-core duplicated tests (already present in lambico)
http://code.google.com/p/parancoe/source/detail?r=5b9133f2b470

Revision: 4441c542ce4b
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Sun Feb 24 06:37:07 2013
Log: EXAMPLES - refresh jar versions, ease dependencies & poms, move
log4j ...
http://code.google.com/p/parancoe/source/detail?r=4441c542ce4b

Revision: bf4bea7d992d
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Thu Feb 28 09:41:36 2013
Log: new MemoryAppender log back based (drops log4j dependency at all)
http://code.google.com/p/parancoe/source/detail?r=bf4bea7d992d

Revision: 121fc19353e4
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 10:36:02 2013
Log: ARCHETYPES - refresh jar versions, ease dependencies & poms, move
log4...
http://code.google.com/p/parancoe/source/detail?r=121fc19353e4

Revision: 4a6a30c09ca6
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 11:10:45 2013
Log: delete WebUtils (name clash & is apache commons duplicate)
http://code.google.com/p/parancoe/source/detail?r=4a6a30c09ca6

Revision: eab80fc51cb0
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Tue Feb 26 02:51:02 2013
Log: added new jUnit4 test classes & listeners (deprecate old ones)
http://code.google.com/p/parancoe/source/detail?r=eab80fc51cb0

Revision: b36902616982
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 11:26:14 2013
Log: EXAMPLES - license header update, basic persistence application +
basi...
http://code.google.com/p/parancoe/source/detail?r=b36902616982

Revision: 04cccafa4317
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 09:47:35 2013
Log: remove unused mapping files from example applications
http://code.google.com/p/parancoe/source/detail?r=04cccafa4317

Revision: ece9c2598f70
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 09:48:50 2013
Log: plugins gets new jUnit4 tests
http://code.google.com/p/parancoe/source/detail?r=ece9c2598f70

Revision: 56d96fbe29ad
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Thu Feb 28 12:58:30 2013
Log: moved all test related stuff in parancoe-test project
http://code.google.com/p/parancoe/source/detail?r=56d96fbe29ad

Revision: e6b592dd62de
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 11:11:54 2013
Log: delete legacy util methods (strings, camel-case, utf-8, String IO)
http://code.google.com/p/parancoe/source/detail?r=e6b592dd62de

Revision: 08d2aec46b38
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Thu Mar 7 22:53:54 2013
Log: upgrade to hibernate v3.6.10.Final
http://code.google.com/p/parancoe/source/detail?r=08d2aec46b38

Revision: 4225dc4cae17
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Thu Mar 7 22:55:53 2013
Log: license formatting
http://code.google.com/p/parancoe/source/detail?r=4225dc4cae17

Revision: 43b03b02f832
Branch: default
Author: lucio.benfante <lucio.b...@gmail.com>
Date: Mon Mar 18 04:01:08 2013
Log: Merged Franzin's updates. Moved to 3.1 version.
http://code.google.com/p/parancoe/source/detail?r=43b03b02f832

==============================================================================
Revision: ae5a289aeb74
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 07:39:32 2013
Log: discontinued parancoe yaml module, replaced by lambico pump
http://code.google.com/p/parancoe/source/detail?r=ae5a289aeb74

Deleted:
/parancoe-yaml/BUGS
/parancoe-yaml/TODO
Modified:
/parancoe-webarchetype/src/main/resources/archetype-resources/pom.xml
/parancoe-yaml/pom.xml
/parancoe-yaml/src/main/java/org/ho/util/BiDirectionalMap.java
/parancoe-yaml/src/main/java/org/ho/util/Logger.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/JYamlParserEvent.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/ListState.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/MapState.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/NoneState.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/ReflectionUtil.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/SpecialTreatmentManager.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/State.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/Yaml.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/YamlConfig.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/YamlDecoder.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/YamlEncoder.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/YamlOperations.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/YamlParserException.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/YamlStream.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/parser/ParserEvent.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/parser/ParserReader.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/parser/SyntaxException.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/parser/YamlCharacter.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/parser/YamlParser.java
/parancoe-yaml/src/main/java/org/parancoe/yaml/parser/YamlParserEvent.java

/parancoe-yaml/src/main/java/org/parancoe/yaml/parser/YamlParserRefEvent.java
/parancoe-yaml/src/test/java/org/parancoe/yaml/Array.java
/parancoe-yaml/src/test/java/org/parancoe/yaml/Circular.java
/parancoe-yaml/src/test/java/org/parancoe/yaml/Company.java
/parancoe-yaml/src/test/java/org/parancoe/yaml/Department.java
/parancoe-yaml/src/test/java/org/parancoe/yaml/IntegrationTests.java
/parancoe-yaml/src/test/java/org/parancoe/yaml/Node.java
/parancoe-yaml/src/test/java/org/parancoe/yaml/PDG.java
/parancoe-yaml/src/test/java/org/parancoe/yaml/Person.java
/parancoe-yaml/src/test/java/org/parancoe/yaml/Play.java
/parancoe-yaml/src/test/java/org/parancoe/yaml/Test.java
/parancoe-yaml/src/test/java/org/parancoe/yaml/TestYamlParserEvent.java
/parancoe-yaml/src/test/java/org/parancoe/yaml/UnionSet.java
/pom.xml

=======================================
--- /parancoe-yaml/BUGS Sat Jun 23 06:52:59 2007
+++ /dev/null
@@ -1,3 +0,0 @@
-# MICHELE :
-- Non funziona con le inner classes !!
-- Se il documento è vuoto non ritorna il tipo indicato nella prima riga ma
un'hashmap
=======================================
--- /parancoe-yaml/TODO Sat Jun 23 06:52:59 2007
+++ /dev/null
@@ -1,32 +0,0 @@
-# MICHELE :
-- Rendere customizzabile la dimensione del circula buffer
-
-# ORIGINALI :
-
-- hanging bug with large files(done)
-- references(done)
-- special handling of classes (done)
-- remove unnecessary output of properties(done)
-- Array handling(done)
-- convert RuntimeExceptions to YmlParserExceptions(done)
-- simple values(done)
-- licensing(done)
-- additional test cases(done)
-- streams(done)
-- same line mapping?(done)
-- multi-line strings and non-quoted strings(done)
-- more readable date handling(done)
-- date to handle exact millisecond(done)
-- better logging and error messages(partial)
-- enums(done)
-- allow mapping of class names(done)
-- jyaml config file(done)
-- string references no need to preserve(done)
-- 1.4 compatibility(done, thanks to Retrotranslator)
-- refactoring (renaming from yml to yaml and YamlConfig, Yaml, and
YamlOperations) (done)
-- documentation
-- get config file from resource classpath(done)
-- redesign special treatment
-- inline maps and complex objects for keys
-- large file bug
-- non-ascii characters
=======================================
--- /parancoe-webarchetype/src/main/resources/archetype-resources/pom.xml
Tue Sep 7 07:53:17 2010
+++ /parancoe-webarchetype/src/main/resources/archetype-resources/pom.xml
Wed Feb 27 07:39:32 2013
@@ -72,16 +72,14 @@
<!-- common db driver(s) -->
<!-- HSQLDB -->
<dependency>
- <groupId>hsqldb</groupId>
+ <groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
- <version>1.8.0.10</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
</dependency>

<!-- Servlet/JSP APIs provided by your container -->
=======================================
--- /parancoe-yaml/pom.xml Sat Sep 4 02:41:52 2010
+++ /parancoe-yaml/pom.xml Wed Feb 27 07:39:32 2013
@@ -7,7 +7,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-yaml</artifactId>
- <name>Parancoe Yaml</name>
+ <name>Parancoe Yaml - DISCONTINUED</name>
<version>3.0-SNAPSHOT</version>
<url>http://www.parancoe.org</url>
<properties>
@@ -17,7 +17,6 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
=======================================
--- /parancoe-yaml/src/main/java/org/ho/util/BiDirectionalMap.java Sat Sep
4 02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/ho/util/BiDirectionalMap.java Wed Feb
27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.ho.util;

import java.util.HashMap;
=======================================
--- /parancoe-yaml/src/main/java/org/ho/util/Logger.java Sat Sep 4
02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/ho/util/Logger.java Wed Feb 27
07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.ho.util;

// TODO SOSTITUIRE CON LOG4J
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/JYamlParserEvent.java
Sat Sep 4 02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/JYamlParserEvent.java
Wed Feb 27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import java.util.HashMap;
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/ListState.java Sat Sep
4 02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/ListState.java Wed Feb
27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import static org.parancoe.yaml.parser.YamlParser.LIST_CLOSE;
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/MapState.java Sat Sep 4
02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/MapState.java Wed Feb 27
07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import static org.parancoe.yaml.parser.YamlParser.MAP_CLOSE;
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/NoneState.java Sat Sep
4 02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/NoneState.java Wed Feb
27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import java.util.Map;
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/ReflectionUtil.java Tue
Jan 31 01:19:14 2012
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/ReflectionUtil.java Wed
Feb 27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import java.beans.IntrospectionException;
=======================================
---
/parancoe-yaml/src/main/java/org/parancoe/yaml/SpecialTreatmentManager.java
Sat Sep 4 02:41:52 2010
+++
/parancoe-yaml/src/main/java/org/parancoe/yaml/SpecialTreatmentManager.java
Wed Feb 27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import java.awt.Color;
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/State.java Tue Jan 31
01:19:14 2012
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/State.java Wed Feb 27
07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import static org.parancoe.yaml.parser.YamlParser.LIST_OPEN;
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/Yaml.java Sat Sep 4
02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/Yaml.java Wed Feb 27
07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import java.io.File;
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/YamlConfig.java Sat Sep
4 02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/YamlConfig.java Wed Feb
27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import java.io.ByteArrayInputStream;
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/YamlDecoder.java Sat
Sep 4 02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/YamlDecoder.java Wed Feb
27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import java.io.BufferedReader;
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/YamlEncoder.java Tue Jan
31 01:19:14 2012
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/YamlEncoder.java Wed Feb
27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import java.beans.PropertyDescriptor;
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/YamlOperations.java Sat
Sep 4 02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/YamlOperations.java Wed
Feb 27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import java.io.File;
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/YamlParserException.java
Sat Sep 4 02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/YamlParserException.java
Wed Feb 27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

/**
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/YamlStream.java Sat Sep
4 02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/YamlStream.java Wed Feb
27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import java.util.Iterator;
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/parser/ParserEvent.java
Sat Sep 4 02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/parser/ParserEvent.java
Wed Feb 27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml.parser;

/**
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/parser/ParserReader.java
Sat Sep 4 02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/parser/ParserReader.java
Wed Feb 27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml.parser;

import java.io.IOException;
=======================================
---
/parancoe-yaml/src/main/java/org/parancoe/yaml/parser/SyntaxException.java
Sat Sep 4 02:41:52 2010
+++
/parancoe-yaml/src/main/java/org/parancoe/yaml/parser/SyntaxException.java
Wed Feb 27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml.parser;

public class SyntaxException extends Exception {
=======================================
---
/parancoe-yaml/src/main/java/org/parancoe/yaml/parser/YamlCharacter.java
Sat Sep 4 02:41:52 2010
+++
/parancoe-yaml/src/main/java/org/parancoe/yaml/parser/YamlCharacter.java
Wed Feb 27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
=======================================
--- /parancoe-yaml/src/main/java/org/parancoe/yaml/parser/YamlParser.java
Sat Sep 4 02:41:52 2010
+++ /parancoe-yaml/src/main/java/org/parancoe/yaml/parser/YamlParser.java
Wed Feb 27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml.parser;

import java.io.IOException;
=======================================
---
/parancoe-yaml/src/main/java/org/parancoe/yaml/parser/YamlParserEvent.java
Sat Sep 4 02:41:52 2010
+++
/parancoe-yaml/src/main/java/org/parancoe/yaml/parser/YamlParserEvent.java
Wed Feb 27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml.parser;

public class YamlParserEvent implements ParserEvent {
=======================================
---
/parancoe-yaml/src/main/java/org/parancoe/yaml/parser/YamlParserRefEvent.java
Sat Sep 4 02:41:52 2010
+++
/parancoe-yaml/src/main/java/org/parancoe/yaml/parser/YamlParserRefEvent.java
Wed Feb 27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml.parser;

import java.io.File;
=======================================
--- /parancoe-yaml/src/test/java/org/parancoe/yaml/Array.java Sat Sep 4
02:41:52 2010
+++ /parancoe-yaml/src/test/java/org/parancoe/yaml/Array.java Wed Feb 27
07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

public class Array {
=======================================
--- /parancoe-yaml/src/test/java/org/parancoe/yaml/Circular.java Sat Sep 4
02:41:52 2010
+++ /parancoe-yaml/src/test/java/org/parancoe/yaml/Circular.java Wed Feb 27
07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

public class Circular {
=======================================
--- /parancoe-yaml/src/test/java/org/parancoe/yaml/Company.java Sat Sep 4
02:41:52 2010
+++ /parancoe-yaml/src/test/java/org/parancoe/yaml/Company.java Wed Feb 27
07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import java.math.BigDecimal;
=======================================
--- /parancoe-yaml/src/test/java/org/parancoe/yaml/Department.java Sat Sep
4 02:41:52 2010
+++ /parancoe-yaml/src/test/java/org/parancoe/yaml/Department.java Wed Feb
27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*
/*
* Copyright (c) 2005, Yu Cheung Ho
=======================================
--- /parancoe-yaml/src/test/java/org/parancoe/yaml/IntegrationTests.java
Sat Sep 4 02:41:52 2010
+++ /parancoe-yaml/src/test/java/org/parancoe/yaml/IntegrationTests.java
Wed Feb 27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import java.awt.Color;
=======================================
--- /parancoe-yaml/src/test/java/org/parancoe/yaml/Node.java Sat Sep 4
02:41:52 2010
+++ /parancoe-yaml/src/test/java/org/parancoe/yaml/Node.java Wed Feb 27
07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

public class Node {
=======================================
--- /parancoe-yaml/src/test/java/org/parancoe/yaml/PDG.java Sat Sep 4
02:41:52 2010
+++ /parancoe-yaml/src/test/java/org/parancoe/yaml/PDG.java Wed Feb 27
07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

public class PDG {
=======================================
--- /parancoe-yaml/src/test/java/org/parancoe/yaml/Person.java Sat Sep 4
02:41:52 2010
+++ /parancoe-yaml/src/test/java/org/parancoe/yaml/Person.java Wed Feb 27
07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import java.math.BigDecimal;
=======================================
--- /parancoe-yaml/src/test/java/org/parancoe/yaml/Play.java Sat Sep 4
02:41:52 2010
+++ /parancoe-yaml/src/test/java/org/parancoe/yaml/Play.java Wed Feb 27
07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

public class Play {
=======================================
--- /parancoe-yaml/src/test/java/org/parancoe/yaml/Test.java Sat Sep 4
02:41:52 2010
+++ /parancoe-yaml/src/test/java/org/parancoe/yaml/Test.java Wed Feb 27
07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import java.io.Reader;
=======================================
--- /parancoe-yaml/src/test/java/org/parancoe/yaml/TestYamlParserEvent.java
Sat Sep 4 02:41:52 2010
+++ /parancoe-yaml/src/test/java/org/parancoe/yaml/TestYamlParserEvent.java
Wed Feb 27 07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

import org.parancoe.yaml.parser.ParserEvent;
=======================================
--- /parancoe-yaml/src/test/java/org/parancoe/yaml/UnionSet.java Sat Sep 4
02:41:52 2010
+++ /parancoe-yaml/src/test/java/org/parancoe/yaml/UnionSet.java Wed Feb 27
07:39:32 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of Parancoe Yaml.
+ * This file is part of Parancoe Yaml - DISCONTINUED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.yaml;

public class UnionSet {
=======================================
--- /pom.xml Wed May 2 17:07:47 2012
+++ /pom.xml Wed Feb 27 07:39:32 2013
@@ -47,11 +47,6 @@
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>org.parancoe</groupId>
- <artifactId>parancoe-yaml</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-core</artifactId>
<version>${project.version}</version>

==============================================================================
Revision: 20e4c0676355
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Sun Feb 24 06:16:44 2013
Log: added reference guide in ePub format, cleanup build
http://code.google.com/p/parancoe/source/detail?r=20e4c0676355

Modified:
/parancoe-reference-guide/pom.xml
/parancoe-reference-guide/src/docbkx/startANewProject.xml

=======================================
--- /parancoe-reference-guide/pom.xml Sun Nov 16 21:54:10 2008
+++ /parancoe-reference-guide/pom.xml Sun Feb 24 06:16:44 2013
@@ -19,11 +19,13 @@
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
+ <version>2.0.14</version>
<executions>
<execution>
<goals>
<goal>generate-html</goal>
<goal>generate-pdf</goal>
+ <goal>generate-epub</goal>
</goals>
<phase>generate-sources</phase>
</execution>
@@ -46,7 +48,7 @@
<entities>
<entity>
<name>version</name>
- <value>${pom.version}</value>
+ <value>${project.version}</value>
</entity>
</entities>
<postProcess>
@@ -69,17 +71,9 @@
</plugin>
</plugins>
</build>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
<properties>
<docbook.source>${basedir}/src/docbkx</docbook.source>

<netbeans.hint.useExternalMaven>true</netbeans.hint.useExternalMaven>
- <docbook.target>${basedir}/target/site/guide</docbook.target>
- </properties>
+ <docbook.target>${basedir}/target/site/guide</docbook.target>
+ </properties>
</project>
=======================================
--- /parancoe-reference-guide/src/docbkx/startANewProject.xml Mon Nov 17
22:23:28 2008
+++ /parancoe-reference-guide/src/docbkx/startANewProject.xml Sun Feb 24
06:16:44 2013
@@ -504,7 +504,7 @@
<beans xmlns="http://www.springframework.org/schema/beans"
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-2.5.xsd">
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/testAppDS"/>

==============================================================================
Revision: d9ce2623e57e
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Fri Mar 1 04:03:24 2013
Log: PLUGINS - refresh jar versions, ease dependencies & poms, move
log4j to slf4j where possible, minor code cleanups
http://code.google.com/p/parancoe/source/detail?r=d9ce2623e57e

Deleted:
/plugins/parancoe-plugin-dwr/src/test/resources/log4j.properties

/plugins/parancoe-plugin-springsecurity-evolution/src/test/resources/log4j.properties
/plugins/parancoe-plugin-tiles/src/test/resources/log4j.properties
/plugins/parancoe-plugin-world/src/test/resources/log4j.properties
Modified:
/plugins/parancoe-plugin-configuration/pom.xml

/plugins/parancoe-plugin-configuration/src/main/java/org/parancoe/plugin/configuration/InitializerContextListener.java

/plugins/parancoe-plugin-configuration/src/main/java/org/parancoe/plugin/configuration/SampleInterceptor.java

/plugins/parancoe-plugin-configuration/src/main/java/org/parancoe/plugin/configuration/controllers/ConfigurationController.java
/plugins/parancoe-plugin-configuration/src/test/resources/log4j.properties
/plugins/parancoe-plugin-dwr/pom.xml
/plugins/parancoe-plugin-italy/pom.xml

/plugins/parancoe-plugin-italy/src/main/java/org/parancoe/plugins/italy/ItalyInterceptor.java

/plugins/parancoe-plugin-italy/src/main/java/org/parancoe/plugins/italy/PopulateData.java
/plugins/parancoe-plugin-sample/pom.xml

/plugins/parancoe-plugin-sample/src/main/java/org/parancoe/plugins/sample/SampleContextListener.java

/plugins/parancoe-plugin-sample/src/main/java/org/parancoe/plugins/sample/SampleInterceptor.java
/plugins/parancoe-plugin-security/pom.xml

/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/ParancoeSecurityContextHolderStrategy.java

/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/PopulateData.java

/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/SecureController.java

/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/SecureInterceptor.java

/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/User.java

/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/UserDao.java

/plugins/parancoe-plugin-security/src/test/java/org/parancoe/plugins/security/SecurityTest.java
/plugins/parancoe-plugin-springsecurity-evolution/pom.xml

/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/InitializerContextListener.java

/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/SecureController.java

/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/User.java

/plugins/parancoe-plugin-springsecurity-evolution/src/test/java/org/parancoe/plugins/securityevolution/AuthenticationManagerTest.java

/plugins/parancoe-plugin-springsecurity-evolution/src/test/java/org/parancoe/plugins/securityevolution/SanityTest.java

/plugins/parancoe-plugin-springsecurity-evolution/src/test/resources/spring-test.xml
/plugins/parancoe-plugin-springsecurity/pom.xml

/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/MockSecureInterceptor.java

/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/ParancoeSecurityContextHolderStrategy.java

/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/PopulateData.java

/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/SecureController.java

/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/SecureInterceptor.java

/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/User.java

/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/UserDao.java
/plugins/parancoe-plugin-tiles/pom.xml

/plugins/parancoe-plugin-tiles/src/main/java/org/parancoe/plugin/tiles/CheapTilesView.java
/plugins/parancoe-plugin-tiles/src/main/resources/parancoe-plugin.xml

/plugins/parancoe-plugin-tiles/src/test/java/org/parancoe/plugin/tiles/SanityTest.java
/plugins/parancoe-plugin-tiles/src/test/resources/spring-test.xml
/plugins/parancoe-plugin-tiles/src/test/resources/tiles/defs/default.xml
/plugins/parancoe-plugin-world/pom.xml

/plugins/parancoe-plugin-world/src/main/java/org/parancoe/plugins/world/WorldContextListener.java

/plugins/parancoe-plugin-world/src/main/java/org/parancoe/plugins/world/WorldInterceptor.java
/plugins/pom.xml

=======================================
--- /plugins/parancoe-plugin-dwr/src/test/resources/log4j.properties Thu
Jun 26 07:34:26 2008
+++ /dev/null
@@ -1,8 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE
-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.logger.org.parancoe=INFO
-log4j.logger.org.parancoe.plugin.dwr=INFO
=======================================
---
/plugins/parancoe-plugin-springsecurity-evolution/src/test/resources/log4j.properties
Wed Jan 18 09:35:16 2012
+++ /dev/null
@@ -1,9 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE
-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.logger.org.parancoe.plugins.securityevolution=DEBUG
-log4j.logger.org.parancoe=INFO
-log4j.logger.com.mycompany.testapp=INFO
=======================================
--- /plugins/parancoe-plugin-tiles/src/test/resources/log4j.properties Fri
Jan 2 23:34:08 2009
+++ /dev/null
@@ -1,8 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE
-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.logger.org.parancoe=INFO
-log4j.logger.org.parancoe.plugin.tiles=INFO
=======================================
--- /plugins/parancoe-plugin-world/src/test/resources/log4j.properties Thu
Jul 19 01:59:24 2007
+++ /dev/null
@@ -1,18 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE
-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.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
=======================================
--- /plugins/parancoe-plugin-configuration/pom.xml Mon Oct 29 01:24:47 2012
+++ /plugins/parancoe-plugin-configuration/pom.xml Fri Mar 1 04:03:24 2013
@@ -20,35 +20,30 @@
</build>
<dependencies>
<dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.17</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
- <version>2.6.2</version>
+ <version>2.7.3</version>
</dependency>
<dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
- <scope>test</scope>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-json-provider</artifactId>
+ <version>2.1.3</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.26</version>
<scope>test</scope>
- <type>jar</type>
</dependency>
<dependency>
- <artifactId>junit</artifactId>
- <groupId>junit</groupId>
- <type>jar</type>
- <version>4.10</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.jaxrs</groupId>
- <artifactId>jackson-jaxrs-json-provider</artifactId>
- <version>2.0.4</version>
- <type>jar</type>
- </dependency>
</dependencies>
</project>
=======================================
---
/plugins/parancoe-plugin-configuration/src/main/java/org/parancoe/plugin/configuration/InitializerContextListener.java
Tue Nov 13 03:43:17 2012
+++
/plugins/parancoe-plugin-configuration/src/main/java/org/parancoe/plugin/configuration/InitializerContextListener.java
Fri Mar 1 04:03:24 2013
@@ -21,10 +21,11 @@
import javax.annotation.Resource;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.stereotype.Component;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;

import javax.servlet.ServletContextEvent;
import org.parancoe.plugin.configuration.bo.ConfigurationService;
+import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

@@ -38,8 +39,8 @@
@Component("parancoe-plugin-configurationInitializerContextListener")
public class InitializerContextListener extends ContextLoaderListener {

- private static final Logger log =
Logger.getLogger(InitializerContextListener.class);
-
+ private static final Logger log =
LoggerFactory.getLogger(InitializerContextListener.class);
+
@Resource
private ConfigurationService configurationService;

=======================================
---
/plugins/parancoe-plugin-configuration/src/main/java/org/parancoe/plugin/configuration/SampleInterceptor.java
Thu Apr 26 07:55:58 2012
+++
/plugins/parancoe-plugin-configuration/src/main/java/org/parancoe/plugin/configuration/SampleInterceptor.java
Fri Mar 1 04:03:24 2013
@@ -19,25 +19,27 @@

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import org.springframework.stereotype.Component;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
+import org.slf4j.LoggerFactory;

/**
* A sample interceptor for the plugin.
- *
+ *
* @author paolo...@seesaw.it
* @author lucio.b...@seesaw.it
*/
@Component("parancoe-plugin-configurationSampleInterceptor")
public class SampleInterceptor extends HandlerInterceptorAdapter {
- public static final Logger logger =
Logger.getLogger(SampleInterceptor.class);
+ public static final Logger logger =
LoggerFactory.getLogger(SampleInterceptor.class);

public SampleInterceptor() {
logger.info("SampleInterceptor set up");
}

+ @Override
public boolean preHandle(HttpServletRequest req, HttpServletResponse res,
Object object) throws Exception {
logger.info("parancoe-plugin-configuration Plugin interceptor
preHandle");
=======================================
---
/plugins/parancoe-plugin-configuration/src/main/java/org/parancoe/plugin/configuration/controllers/ConfigurationController.java
Tue Nov 13 03:43:17 2012
+++
/plugins/parancoe-plugin-configuration/src/main/java/org/parancoe/plugin/configuration/controllers/ConfigurationController.java
Fri Mar 1 04:03:24 2013
@@ -24,12 +24,13 @@
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
import org.parancoe.plugin.configuration.bo.ConfigurationService;
import org.parancoe.plugin.configuration.po.Category;
import org.parancoe.plugin.configuration.po.Property;
import org.parancoe.plugin.configuration.po.PropertyType;
import org.parancoe.web.util.FlashHelper;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
@@ -45,11 +46,11 @@
@SessionAttributes("pluginConfigurationProperty")
public class ConfigurationController {

- private static final Logger logger =
Logger.getLogger(ConfigurationController.class);
+ private static final Logger logger =
LoggerFactory.getLogger(ConfigurationController.class);

@Resource
private ConfigurationService configurationService;
-
+
@RequestMapping(method= RequestMethod.GET)
public String index(HttpServletRequest req, HttpServletResponse res,
Model model) {
logger.info("Executing index in the ConfigurationController");
@@ -68,7 +69,7 @@
}
return "plugin/configuration/edit";
}
-
+
@RequestMapping(value="/{propertyId}/store", method =
{RequestMethod.PUT, RequestMethod.POST})
public String store(@ModelAttribute("pluginConfigurationProperty")
@Valid Property property,
BindingResult result, SessionStatus status, HttpServletRequest
req) {
@@ -81,13 +82,13 @@
try {
property.getValueAsInteger();
} catch (NumberFormatException numberFormatException) {
-
result.rejectValue("value", "PluginConfiguration_Error_NotAnInteger", new
Object[] {value}, "The value must be an integer number.");
+
result.rejectValue("value", "PluginConfiguration_Error_NotAnInteger", new
Object[] {value}, "The value must be an integer number.");
}
} else if (PropertyType.REAL.equals(property.getType())) {
try {
Double.valueOf(value);
} catch (NumberFormatException numberFormatException) {
-
result.rejectValue("value", "PluginConfiguration_Error_NotAReal", new
Object[] {value}, "The value must be a real number.");
+
result.rejectValue("value", "PluginConfiguration_Error_NotAReal", new
Object[] {value}, "The value must be a real number.");
}
}
if (result.hasErrors()) {
@@ -98,5 +99,5 @@
status.setComplete();
return "redirect:..";
}
-
+
}
=======================================
---
/plugins/parancoe-plugin-configuration/src/test/resources/log4j.properties
Mon Oct 29 01:24:47 2012
+++
/plugins/parancoe-plugin-configuration/src/test/resources/log4j.properties
Fri Mar 1 04:03:24 2013
@@ -6,5 +6,6 @@

log4j.logger.org.parancoe=DEBUG
log4j.logger.org.lambico=DEBUG
+log4j.logger.org.lambico.data=INFO
log4j.logger.org.parancoe.plugin.configuration=DEBUG
log4j.logger.org.apache.cxf=DEBUG
=======================================
--- /plugins/parancoe-plugin-dwr/pom.xml Sat Sep 4 02:41:52 2010
+++ /plugins/parancoe-plugin-dwr/pom.xml Fri Mar 1 04:03:24 2013
@@ -21,15 +21,8 @@
<version>3.0-M1-RCL4</version>
</dependency>
<dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <version>1.8.0.4</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
=======================================
--- /plugins/parancoe-plugin-italy/pom.xml Sat Sep 4 02:41:52 2010
+++ /plugins/parancoe-plugin-italy/pom.xml Fri Mar 1 04:03:24 2013
@@ -20,9 +20,8 @@
</build>
<dependencies>
<dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
=======================================
---
/plugins/parancoe-plugin-italy/src/main/java/org/parancoe/plugins/italy/ItalyInterceptor.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-italy/src/main/java/org/parancoe/plugins/italy/ItalyInterceptor.java
Fri Mar 1 04:03:24 2013
@@ -18,21 +18,22 @@
package org.parancoe.plugins.italy;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
-import org.apache.log4j.Logger;
-
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

/**
* @author paolo...@seesaw.it
*/
public class ItalyInterceptor extends HandlerInterceptorAdapter {
- public static final Logger logger =
Logger.getLogger(ItalyInterceptor.class);
+ private static final Logger logger =
LoggerFactory.getLogger(ItalyInterceptor.class);

public ItalyInterceptor() {
logger.info("ItalyInterceptor set up");
}

+ @Override
public boolean preHandle(HttpServletRequest req, HttpServletResponse res,
Object object) throws Exception {
logger.debug("ItalyInterceptor preHandle");
=======================================
---
/plugins/parancoe-plugin-italy/src/main/java/org/parancoe/plugins/italy/PopulateData.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-italy/src/main/java/org/parancoe/plugins/italy/PopulateData.java
Fri Mar 1 04:03:24 2013
@@ -18,25 +18,19 @@
package org.parancoe.plugins.italy;

import org.springframework.web.context.ContextLoaderListener;
-import org.springframework.context.ApplicationContext;
-import org.apache.log4j.Logger;
-
-import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

/**
* @author paolo...@seesaw.it
*/
public class PopulateData extends ContextLoaderListener {

- private static final Logger log = Logger.getLogger(PopulateData.class);
-
- private ServletContext servletContext;
-
- private ApplicationContext ctx;
+ private static final Logger log =
LoggerFactory.getLogger(PopulateData.class);

@Override
public void contextInitialized(ServletContextEvent evt) {
- log.info("ItalyPlugin contextInitialized");
+ log.info("ItalyPlugin contextInitialized");
}
}
=======================================
--- /plugins/parancoe-plugin-sample/pom.xml Sat Sep 4 02:41:52 2010
+++ /plugins/parancoe-plugin-sample/pom.xml Fri Mar 1 04:03:24 2013
@@ -24,7 +24,7 @@
<configuration>
<source>1.6</source>
<target>1.6</target>
- <!-- <compilerArgument>-encoding=UTF8</compilerArgument>-->
+ <!--
<compilerArgument>-encoding=UTF8</compilerArgument>-->
</configuration>
</plugin>
<plugin>
@@ -34,8 +34,8 @@
<skip>false</skip>
<useFile>true</useFile>
<forkMode>once</forkMode>
- <!-- pertest once or never -->
- <!-- <reportFormat>plain</reportFormat> -->
+ <!-- pertest once or never -->
+ <!-- <reportFormat>plain</reportFormat> -->
<argLine>-Xmx512M</argLine>
<systemProperties>
<property>
@@ -54,4 +54,11 @@
</plugin>
</plugins>
</build>
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>
=======================================
---
/plugins/parancoe-plugin-sample/src/main/java/org/parancoe/plugins/sample/SampleContextListener.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-sample/src/main/java/org/parancoe/plugins/sample/SampleContextListener.java
Fri Mar 1 04:03:24 2013
@@ -18,25 +18,19 @@
package org.parancoe.plugins.sample;

import org.springframework.web.context.ContextLoaderListener;
-import org.springframework.context.ApplicationContext;
-import org.apache.log4j.Logger;
-
-import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

/**
* @author paolo...@seesaw.it
*/
public class SampleContextListener extends ContextLoaderListener {

- private static final Logger log =
Logger.getLogger(SampleContextListener.class);
-
- private ServletContext servletContext;
-
- private ApplicationContext ctx;
+ private static final Logger log =
LoggerFactory.getLogger(SampleContextListener.class);

@Override
public void contextInitialized(ServletContextEvent evt) {
- log.info("SamplePlugin contextInitialized");
+ log.info("SamplePlugin contextInitialized");
}
}
=======================================
---
/plugins/parancoe-plugin-sample/src/main/java/org/parancoe/plugins/sample/SampleInterceptor.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-sample/src/main/java/org/parancoe/plugins/sample/SampleInterceptor.java
Fri Mar 1 04:03:24 2013
@@ -18,24 +18,27 @@
package org.parancoe.plugins.sample;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
-import org.apache.log4j.Logger;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

/**
* @author paolo...@seesaw.it
*/
public class SampleInterceptor extends HandlerInterceptorAdapter {
- public static final Logger logger =
Logger.getLogger(SampleInterceptor.class);

- public SampleInterceptor() {
- logger.info("ItalyInterceptor set up");
- }
+ public static final Logger logger =
LoggerFactory.getLogger(SampleInterceptor.class);

- public boolean preHandle(HttpServletRequest req, HttpServletResponse res,
- Object object) throws Exception {
- logger.info("SamplePlugin interceptor preHandle");
- return true;
- }
+ public SampleInterceptor() {
+ logger.info("ItalyInterceptor set up");
+ }
+
+ @Override
+ public boolean preHandle(HttpServletRequest req, HttpServletResponse
res,
+ Object object) throws Exception {
+ logger.info("SamplePlugin interceptor preHandle");
+ return true;
+ }
}
=======================================
--- /plugins/parancoe-plugin-security/pom.xml Sat Sep 4 02:41:52 2010
+++ /plugins/parancoe-plugin-security/pom.xml Fri Mar 1 04:03:24 2013
@@ -4,7 +4,7 @@
<groupId>org.parancoe</groupId>
<version>3.0-SNAPSHOT</version>
</parent>
-
+
<modelVersion>4.0.0</modelVersion>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-plugin-security</artifactId>
@@ -53,9 +53,8 @@
</exclusions>
</dependency>
<dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
=======================================
---
/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/ParancoeSecurityContextHolderStrategy.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/ParancoeSecurityContextHolderStrategy.java
Fri Mar 1 04:03:24 2013
@@ -20,8 +20,8 @@
import org.acegisecurity.context.SecurityContext;
import org.acegisecurity.context.SecurityContextHolderStrategy;
import org.acegisecurity.context.SecurityContextImpl;
-import org.apache.log4j.Logger;
-
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

/**
* A Parancoe <code>ThreadLocal</code>-based implementation of {@link
@@ -34,17 +34,18 @@
* @see org.acegisecurity.context.HttpSessionContextIntegrationFilter
*/
public class ParancoeSecurityContextHolderStrategy implements
SecurityContextHolderStrategy {
- private static Logger logger =
Logger.getLogger(ParancoeSecurityContextHolderStrategy.class);

+ private static Logger logger = LoggerFactory.getLogger(
+ ParancoeSecurityContextHolderStrategy.class);
+ private static ThreadLocal<SecurityContext> contextHolder = new
ThreadLocal<SecurityContext>();

- private static ThreadLocal contextHolder = new ThreadLocal();
-
//~ Methods
========================================================================================================
-
+ @Override
public void clearContext() {
logger.debug("This method has void implementation!");
}

+ @Override
public SecurityContext getContext() {
if (contextHolder.get() == null) {
contextHolder.set(new SecurityContextImpl());
@@ -53,8 +54,8 @@
return (SecurityContext) contextHolder.get();
}

+ @Override
public void setContext(SecurityContext context) {
-
contextHolder.set(context);
}
}
=======================================
---
/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/PopulateData.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/PopulateData.java
Fri Mar 1 04:03:24 2013
@@ -19,24 +19,21 @@

import org.springframework.web.context.ContextLoaderListener;
import org.springframework.context.ApplicationContext;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
+import org.slf4j.LoggerFactory;

/**
* @author Lucio Benfante
*/
public class PopulateData extends ContextLoaderListener {

- private static final Logger log = Logger.getLogger(PopulateData.class);
-
- private ServletContext servletContext;
-
- private ApplicationContext ctx;
+ private static final Logger log =
LoggerFactory.getLogger(PopulateData.class);

@Override
public void contextInitialized(ServletContextEvent evt) {
- log.info("SecurityPlugin contextInitialized");
+ log.info("SecurityPlugin contextInitialized");
}
}
=======================================
---
/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/SecureController.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/SecureController.java
Fri Mar 1 04:03:24 2013
@@ -20,7 +20,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

-import org.apache.log4j.Logger;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -35,8 +34,6 @@
@RequestMapping("/*.secure")
public class SecureController {

- private static Logger logger =
Logger.getLogger(SecureController.class);
-
@RequestMapping
public ModelAndView login(HttpServletRequest req, HttpServletResponse
res) {
return new ModelAndView("acegilogin");
=======================================
---
/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/SecureInterceptor.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/SecureInterceptor.java
Fri Mar 1 04:03:24 2013
@@ -27,23 +27,23 @@
import javax.servlet.http.HttpServletResponse;
import org.acegisecurity.Authentication;
import org.acegisecurity.context.SecurityContextHolder;
-import org.apache.log4j.Logger;
-import org.apache.log4j.MDC;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

/**
* Interceptor for secure features based on acegi framework.
+ *
* @author Enrico Giurin
- *
*/
public class SecureInterceptor extends HandlerInterceptorAdapter {

- public static final String USERNAME_LOG4J_MDC_KEY = "psec_username";
+ public static final String USERNAME_MDC_KEY = "psec_username";
private static final String STRATEGY_CLASS_NAME =
"org.parancoe.plugins.security.ParancoeSecurityContextHolderStrategy";
private Filter delegate;
- private static final Logger logger =
- Logger.getLogger(SecureInterceptor.class);
+ private static final Logger logger =
LoggerFactory.getLogger(SecureInterceptor.class);

public Filter getDelegate() {
return delegate;
@@ -54,15 +54,12 @@
}

/**
- * Costructor. In the costructor strategy of SecurityContextHolder
- * has set.
+ * Costructor. In the costructor strategy of SecurityContextHolder has
set.
*
*/
public SecureInterceptor() {
-
SecurityContextHolder.setStrategyName(STRATEGY_CLASS_NAME);
logger.info("SecureInterceptor set up");
-
}

/**
@@ -72,27 +69,26 @@
public boolean preHandle(HttpServletRequest req, HttpServletResponse
res,
Object handler) throws Exception {
delegate.doFilter(req, res, new ParancoeFilterChain());
- populateLog4JMDC();
+ populateMDC();
req.getSession(false);
if (res.isCommitted()) {
logger.debug("Response is committed!");
return false;
}
return true;
-
}

@Override
public void afterCompletion(HttpServletRequest req,
HttpServletResponse res, Object handler, Exception e) throws
Exception {
- cleanLog4JMDC();
+ cleanMDC();
}

/**
- * Put in the Log4J Mapped Diagnostic Context (MDC) the infos on the
logged user.
- * So these infos can be showed in the log, using the %X{key} format
sequence in the log layout.
+ * Put in the Mapped Diagnostic Context (MDC) the infos on the logged
user. So these infos
+ * can be showed in the log, using the %X{key} format sequence in the
log layout.
*/
- private void populateLog4JMDC() {
+ private void populateMDC() {
String username = "unknown";
Authentication authentication =

org.acegisecurity.context.SecurityContextHolder.getContext().
@@ -100,14 +96,14 @@
if (authentication != null && authentication.isAuthenticated()) {
username = authentication.getName();
}
- MDC.put(USERNAME_LOG4J_MDC_KEY, username);
+ MDC.put(USERNAME_MDC_KEY, username);
}

/**
- * Remove from the Log4J Mapped Diagnostic Context (MDC) the infos on
the logged user.
+ * Remove from the Mapped Diagnostic Context (MDC) the infos on the
logged user.
*/
- private void cleanLog4JMDC() {
- MDC.remove(USERNAME_LOG4J_MDC_KEY);
+ private void cleanMDC() {
+ MDC.remove(USERNAME_MDC_KEY);
}

/**
@@ -120,11 +116,11 @@
logger.debug("Instantiated");
}

+ @Override
public void doFilter(ServletRequest arg0, ServletResponse arg1)
throws IOException,
ServletException {
- // TODO Auto-generated method stub
+ // TODO Auto-generated method stub
}
- }//end of inner class
-}//end of class
-
+ }
+}

=======================================
---
/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/User.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/User.java
Fri Mar 1 04:03:24 2013
@@ -31,7 +31,7 @@
* A PO for UserProfile table.
*
* @author <a href="mailto:enrico...@gmail.com">Enrico Giurin</a>
- * @author <a href="mailto:michele...@seesaw.it">Michele Franzin</a>
+ * @author michele franzin <michele at franzin.net>
* @version $Revision$
*/
@javax.persistence.Entity
=======================================
---
/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/UserDao.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-security/src/main/java/org/parancoe/plugins/security/UserDao.java
Fri Mar 1 04:03:24 2013
@@ -25,7 +25,7 @@
* The DAO interface for the UserProfile entity.
*
* @author <a href="mailto:enrico...@gmail.com">Enrico Giurin</a>
- * @author <a href="mailto:michele...@seesaw.it">Michele Franzin</a>
+ * @author michele franzin <michele at franzin.net>
* @version $Revision$
*/
@Dao(entity = User.class)
=======================================
---
/plugins/parancoe-plugin-security/src/test/java/org/parancoe/plugins/security/SecurityTest.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-security/src/test/java/org/parancoe/plugins/security/SecurityTest.java
Fri Mar 1 04:03:24 2013
@@ -26,25 +26,25 @@

/**
* Test based on PluginTest.
- *
+ *
* @author Enrico Giurin
- *
+ *
*/
public class SecurityTest extends PluginTest {

@Resource
private WebPlugin webPluginSecurityConfig;
-
+
@Resource
UserDao userDao;
-
+
@Resource
AuthorityDao authorityDao;
-
+

public SecurityTest() {
}
-
+
public void testPlugin() throws Exception {
assertEquals(2, getFixtureClasses().length);

@@ -52,12 +52,12 @@

@Transactional
public void testInsertUser() {
-
+
// creates entities
User pippo = SecureUtility.newUserToValidate("pippo");
userDao.store(pippo);
Authority parancoeAuthority = authorityDao.findByRole("ROLE_ADMIN");
-
+
List<Authority> authorities = new ArrayList<Authority>();
authorities.add(parancoeAuthority);
pippo.setAuthorities(authorities);
@@ -68,7 +68,7 @@

@Override
public Class[] getFixtureClasses() {
- return new Class[] { User.class, Authority.class };
+ return new Class[] { Authority.class, User.class };
}

}
=======================================
--- /plugins/parancoe-plugin-springsecurity-evolution/pom.xml Thu Sep 20
20:43:08 2012
+++ /plugins/parancoe-plugin-springsecurity-evolution/pom.xml Fri Mar 1
04:03:24 2013
@@ -14,13 +14,13 @@
<url>http://www.parancoe.org</url>
<properties>
<main.basedir>${basedir}/..</main.basedir>
-
<parancoe.springsecurity.version>3.1.0.RELEASE</parancoe.springsecurity.version>
+
<parancoe.springsecurity.version>3.1.3.RELEASE</parancoe.springsecurity.version>
</properties>
<build>
<finalName>parancoe-plugin-springsecurity-evolution</finalName>
</build>
<dependencies>
- <dependency>
+ <dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${parancoe.springsecurity.version}</version>
@@ -67,7 +67,7 @@
</exclusion>
</exclusions>
</dependency>
- <!-- springsecurity tag lib -->
+ <!-- springsecurity tag lib -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
@@ -114,26 +114,22 @@
<artifactId>spring-web</artifactId>
</exclusion>
</exclusions>
- <type>jar</type>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${parancoe.springsecurity.version}</version>
</dependency>
-
-
- <dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.9.0</version>
- <scope>test</scope>
- </dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.9.5</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
=======================================
---
/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/InitializerContextListener.java
Tue May 15 15:15:46 2012
+++
/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/InitializerContextListener.java
Fri Mar 1 04:03:24 2013
@@ -17,13 +17,12 @@
*/
package org.parancoe.plugins.securityevolution;

-import org.apache.log4j.Logger;
-import org.springframework.context.ApplicationContext;
+import org.slf4j.Logger;
import org.springframework.stereotype.Component;
import org.springframework.web.context.ContextLoaderListener;

-import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
+import org.slf4j.LoggerFactory;

/**

@@ -31,11 +30,7 @@

@Component("parancoe-plugin-springsecurity-evolution-InitializerContextListener")
public class InitializerContextListener extends ContextLoaderListener {

- private static final Logger log =
Logger.getLogger(InitializerContextListener.class);
-
- /* private ServletContext servletContext;
-
- private ApplicationContext ctx;*/
+ private static final Logger log =
LoggerFactory.getLogger(InitializerContextListener.class);

@Override
public void contextInitialized(ServletContextEvent evt) {
=======================================
---
/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/SecureController.java
Sat Sep 15 16:14:38 2012
+++
/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/SecureController.java
Fri Mar 1 04:03:24 2013
@@ -21,7 +21,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@@ -35,15 +36,15 @@
@RequestMapping("/*.html")

public class SecureController {
- private static Logger logger =
Logger.getLogger(SecureController.class);
-
-
+ private static Logger logger =
LoggerFactory.getLogger(SecureController.class);
+
+
@Resource(name="loginView")
private String loginView;
-
+
@Resource(name="accessDeniedView")
private String accessDeniedView;
-
+
@RequestMapping
public ModelAndView login(HttpServletRequest req, HttpServletResponse
res){
if(logger.isDebugEnabled())
@@ -60,13 +61,13 @@
}
return new ModelAndView(accessDeniedView);
}
-
+
@RequestMapping
public ModelAndView securityCheck(HttpServletRequest req,
HttpServletResponse res) {
return null;
}
-
+
/*@RequestMapping
public ModelAndView j_spring_security_check(HttpServletRequest req,
HttpServletResponse res){
return null;
@@ -75,6 +76,6 @@
public ModelAndView logout(HttpServletRequest req, HttpServletResponse
res){
return null;
}*/
-
-
+
+
}
=======================================
---
/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/User.java
Thu Sep 20 20:43:08 2012
+++
/plugins/parancoe-plugin-springsecurity-evolution/src/main/java/org/parancoe/plugins/securityevolution/User.java
Fri Mar 1 04:03:24 2013
@@ -34,7 +34,7 @@
* A PO for UserProfile table.
*
* @author <a href="mailto:enrico...@gmail.com">Enrico Giurin</a>
- * @author <a href="mailto:michele...@seesaw.it">Michele Franzin</a>
+ * @author michele franzin <michele at franzin.net>
* @version $Revision$
*/
@javax.persistence.Entity
=======================================
---
/plugins/parancoe-plugin-springsecurity-evolution/src/test/java/org/parancoe/plugins/securityevolution/AuthenticationManagerTest.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-springsecurity-evolution/src/test/java/org/parancoe/plugins/securityevolution/AuthenticationManagerTest.java
Fri Mar 1 04:03:24 2013
@@ -37,47 +37,43 @@
*
*/
public class AuthenticationManagerTest extends PluginTest {
- @Resource
- private AuthenticationManager authenticationManager;
-
- private Authentication authentication;

- /**
- * Test method for {@link
org.springframework.security.authentication.AuthenticationManager#authenticate(org.springframework.security.core.Authentication)}.
- */
+ @Resource
+ private AuthenticationManager authenticationManager;
+ private Authentication authentication;

- public void testAuthenticate() {
- authentication = new
UsernamePasswordAuthenticationToken("parancoe", "parancoe");
- Authentication result =
authenticationManager.authenticate(authentication);
- assertTrue(result.isAuthenticated());
- }
-
-
- public void testAuthenticateWithUserLocked() {
- authentication = new
UsernamePasswordAuthenticationToken("locked", "locked");
- try {
- authenticationManager.authenticate(authentication);
- fail("User locked is locked!");
- } catch (AuthenticationException e) {
- assertTrue(e instanceof LockedException);
- }
- }
-
+ /**
+ * Test method for
+ * {@link
org.springframework.security.authentication.AuthenticationManager#authenticate(org.springframework.security.core.Authentication)}.
+ */
+ public void testAuthenticate() {
+ authentication = new
UsernamePasswordAuthenticationToken("parancoe", "parancoe");
+ Authentication result =
authenticationManager.authenticate(authentication);
+ assertTrue(result.isAuthenticated());
+ }

- public void testAuthenticateWithBadCredentials() {
- authentication = new
UsernamePasswordAuthenticationToken("parancoe", "wrongPassword");
- try {
- authenticationManager.authenticate(authentication);
- fail("Provided password is wrong");
- } catch (AuthenticationException e) {
- assertTrue(e instanceof BadCredentialsException);
- }
- }
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{User.class,};
+ public void testAuthenticateWithUserLocked() {
+ authentication = new
UsernamePasswordAuthenticationToken("locked", "locked");
+ try {
+ authenticationManager.authenticate(authentication);
+ fail("User locked is locked!");
+ } catch (AuthenticationException e) {
+ assertTrue(e instanceof LockedException);
+ }
}

+ public void testAuthenticateWithBadCredentials() {
+ authentication = new
UsernamePasswordAuthenticationToken("parancoe", "wrongPassword");
+ try {
+ authenticationManager.authenticate(authentication);
+ fail("Provided password is wrong");
+ } catch (AuthenticationException e) {
+ assertTrue(e instanceof BadCredentialsException);
+ }
+ }

+ @Override
+ public Class[] getFixtureClasses() {
+ return new Class[]{Authority.class, Group.class, User.class,};
+ }
}
=======================================
---
/plugins/parancoe-plugin-springsecurity-evolution/src/test/java/org/parancoe/plugins/securityevolution/SanityTest.java
Tue May 29 21:24:49 2012
+++
/plugins/parancoe-plugin-springsecurity-evolution/src/test/java/org/parancoe/plugins/securityevolution/SanityTest.java
Fri Mar 1 04:03:24 2013
@@ -17,41 +17,34 @@
*/
package org.parancoe.plugins.securityevolution;

-import org.apache.log4j.Logger;
import org.parancoe.web.plugin.WebPlugin;
import org.parancoe.web.test.PluginTest;
-import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

public class SanityTest extends PluginTest {
- private static Logger logger = Logger.getLogger(
- SanityTest.class);

+ @Autowired
+ @Qualifier("parancoe-plugin-springsecurity-evolutionPluginConfig")
+ private WebPlugin plugin;

+ /* test everything has been loaded properly */
+ public void testSanity() {

- @Autowired
- @Qualifier("parancoe-plugin-springsecurity-evolutionPluginConfig")
- private WebPlugin plugin;
-
- /* test everything has been loaded properly */
- public void testSanity() {
+ /*for (String beanName :
applicationContext.getBeanDefinitionNames()) {
+ try {
+ Object bean = applicationContext.getBean(beanName);
+ System.out.println("beanName: " + beanName + " -
class: "
+ + bean.getClass().getName());
+ } catch (BeansException e) {
+ System.err.println("Error with
beanName: "+beanName);
+ }
+ }*/
+ assertNotNull(plugin);
+ }

- /*for (String beanName : applicationContext.getBeanDefinitionNames()) {
- try {
- Object bean = applicationContext.getBean(beanName);
- System.out.println("beanName: " + beanName + " - class: "
- + bean.getClass().getName());
- } catch (BeansException e) {
- System.err.println("Error with beanName: "+beanName);
- }
- }*/
- assertNotNull(plugin);
- }
-
@Override
public Class[] getFixtureClasses() {
return new Class[]{};
}
-
}
=======================================
---
/plugins/parancoe-plugin-springsecurity-evolution/src/test/resources/spring-test.xml
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-springsecurity-evolution/src/test/resources/spring-test.xml
Fri Mar 1 04:03:24 2013
@@ -22,8 +22,8 @@
xmlns:parancoe="http://www.parancoe.org/schema/parancoe"
xmlns:context="http://www.springframework.org/schema/context"
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-2.5.xsd
- http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.parancoe.org/schema/parancoe
http://www.parancoe.org/schema/parancoe.xsd">


=======================================
--- /plugins/parancoe-plugin-springsecurity/pom.xml Tue Dec 13 13:41:54 2011
+++ /plugins/parancoe-plugin-springsecurity/pom.xml Fri Mar 1 04:03:24 2013
@@ -14,13 +14,13 @@
<url>http://www.parancoe.org</url>
<properties>
<main.basedir>${basedir}/..</main.basedir>
-
<parancoe.springsecurity.version>3.0.3.RELEASE</parancoe.springsecurity.version>
+
<parancoe.springsecurity.version>3.0.8.RELEASE</parancoe.springsecurity.version>
</properties>
<build>
<finalName>parancoe-plugin-springsecurity</finalName>
</build>
<dependencies>
- <!-- from spring security sample example -->
+ <!-- from spring security sample example -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
@@ -123,9 +123,8 @@
<version>${parancoe.springsecurity.version}</version>
</dependency>
<dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
=======================================
---
/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/MockSecureInterceptor.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/MockSecureInterceptor.java
Fri Mar 1 04:03:24 2013
@@ -16,7 +16,7 @@
* limitations under the License.
*/
/**
- *
+ *
*/
package org.parancoe.plugins.security;

@@ -24,20 +24,20 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;


/**
- * Mock secure interceptor for test purpose.
+ * Mock secure interceptor for test purpose.
* @author egiurin
*
*/
public class MockSecureInterceptor extends HandlerInterceptorAdapter {

- private static final Logger logger =
- Logger.getLogger(MockSecureInterceptor.class);
-
+ private static final Logger logger =
LoggerFactory.getLogger(MockSecureInterceptor.class);
+
private Filter parancoeDelegate;
public Filter getParancoeDelegate() {
return parancoeDelegate;
=======================================
---
/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/ParancoeSecurityContextHolderStrategy.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/ParancoeSecurityContextHolderStrategy.java
Fri Mar 1 04:03:24 2013
@@ -17,7 +17,8 @@
*/
package org.parancoe.plugins.security;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.security.core.context.SecurityContext;
import
org.springframework.security.core.context.SecurityContextHolderStrategy;
import org.springframework.security.core.context.SecurityContextImpl;
@@ -35,9 +36,9 @@
public class ParancoeSecurityContextHolderStrategy implements
SecurityContextHolderStrategy {

- private static Logger logger = Logger.getLogger(
+ private static Logger logger = LoggerFactory.getLogger(
ParancoeSecurityContextHolderStrategy.class);
- private static ThreadLocal contextHolder = new ThreadLocal();
+ private static ThreadLocal<SecurityContext> contextHolder = new
ThreadLocal<SecurityContext>();

@Override
public void clearContext() {
=======================================
---
/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/PopulateData.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/PopulateData.java
Fri Mar 1 04:03:24 2013
@@ -19,24 +19,21 @@

import org.springframework.web.context.ContextLoaderListener;
import org.springframework.context.ApplicationContext;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
+import org.slf4j.LoggerFactory;

/**
* @author Lucio Benfante
*/
public class PopulateData extends ContextLoaderListener {

- private static final Logger log = Logger.getLogger(PopulateData.class);
-
- private ServletContext servletContext;
-
- private ApplicationContext ctx;
+ private static final Logger log =
LoggerFactory.getLogger(PopulateData.class);

@Override
public void contextInitialized(ServletContextEvent evt) {
- log.info("SecurityPlugin contextInitialized");
+ log.info("SecurityPlugin contextInitialized");
}
}
=======================================
---
/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/SecureController.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/SecureController.java
Fri Mar 1 04:03:24 2013
@@ -20,7 +20,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

-import org.apache.log4j.Logger;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -35,8 +34,7 @@
@RequestMapping("/*.secure")

public class SecureController {
- private static Logger logger =
Logger.getLogger(SecureController.class);
-
+
@RequestMapping
public ModelAndView login(HttpServletRequest req, HttpServletResponse
res){
return new ModelAndView("login");
@@ -45,7 +43,7 @@
public ModelAndView accessDenied(HttpServletRequest req,
HttpServletResponse res){
return new ModelAndView("accessDenied");
}
-
+
@RequestMapping
public ModelAndView j_spring_security_check(HttpServletRequest req,
HttpServletResponse res){
return null;
@@ -54,6 +52,4 @@
public ModelAndView logout(HttpServletRequest req, HttpServletResponse
res){
return null;
}
-
-
}
=======================================
---
/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/SecureInterceptor.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/SecureInterceptor.java
Fri Mar 1 04:03:24 2013
@@ -25,8 +25,9 @@
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.log4j.Logger;
-import org.apache.log4j.MDC;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
@@ -38,12 +39,12 @@
*/
public class SecureInterceptor extends HandlerInterceptorAdapter {

- public static final String USERNAME_LOG4J_MDC_KEY = "psec_username";
+ public static final String USERNAME_MDC_KEY = "psec_username";
private static final String STRATEGY_CLASS_NAME =
"org.parancoe.plugins.security.ParancoeSecurityContextHolderStrategy";
private Filter delegate;
private static final Logger logger =
- Logger.getLogger(SecureInterceptor.class);
+ LoggerFactory.getLogger(SecureInterceptor.class);

/**
* Costructor. In the costructor strategy of SecurityContextHolder
@@ -64,7 +65,7 @@
public boolean preHandle(HttpServletRequest req, HttpServletResponse
res,
Object handler) throws Exception {
delegate.doFilter(req, res, new ParancoeFilterChain());
- populateLog4JMDC();
+ populateMDC();
req.getSession(false);
if (res.isCommitted()) {
logger.debug("Response is committed!");
@@ -78,28 +79,28 @@
public void afterCompletion(HttpServletRequest req,
HttpServletResponse res, Object handler, Exception e) throws
Exception {
- cleanLog4JMDC();
+ cleanMDC();
}

/**
- * Put in the Log4J Mapped Diagnostic Context (MDC) the infos on the
logged user.
+ * Put in the Mapped Diagnostic Context (MDC) the infos on the logged
user.
* So these infos can be showed in the log, using the %X{key} format
sequence in the log layout.
*/
- private void populateLog4JMDC() {
+ private void populateMDC() {
String username = "unknown";
Authentication authentication =
SecurityContextHolder.getContext().getAuthentication();
if (authentication != null && authentication.isAuthenticated()) {
username = authentication.getName();
}
- MDC.put(USERNAME_LOG4J_MDC_KEY, username);
+ MDC.put(USERNAME_MDC_KEY, username);
}

/**
- * Remove from the Log4J Mapped Diagnostic Context (MDC) the infos on
the logged user.
+ * Remove from the Mapped Diagnostic Context (MDC) the infos on the
logged user.
*/
- private void cleanLog4JMDC() {
- MDC.remove(USERNAME_LOG4J_MDC_KEY);
+ private void cleanMDC() {
+ MDC.remove(USERNAME_MDC_KEY);
}

/**
=======================================
---
/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/User.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/User.java
Fri Mar 1 04:03:24 2013
@@ -32,7 +32,7 @@
* A PO for UserProfile table.
*
* @author <a href="mailto:enrico...@gmail.com">Enrico Giurin</a>
- * @author <a href="mailto:michele...@seesaw.it">Michele Franzin</a>
+ * @author michele franzin <michele at franzin.net>
* @version $Revision$
*/
@javax.persistence.Entity
=======================================
---
/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/UserDao.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-springsecurity/src/main/java/org/parancoe/plugins/security/UserDao.java
Fri Mar 1 04:03:24 2013
@@ -25,7 +25,7 @@
* The DAO interface for the UserProfile entity.
*
* @author <a href="mailto:enrico...@gmail.com">Enrico Giurin</a>
- * @author <a href="mailto:michele...@seesaw.it">Michele Franzin</a>
+ * @author michele franzin <michele at franzin.net>
* @version $Revision$
*/
@Dao(entity = User.class)
=======================================
--- /plugins/parancoe-plugin-tiles/pom.xml Sat Sep 4 02:41:52 2010
+++ /plugins/parancoe-plugin-tiles/pom.xml Fri Mar 1 04:03:24 2013
@@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-plugin-tiles</artifactId>
- <name>parancoe-plugin-tiles Parancoe Plugin</name>
+ <name>Parancoe Plugin Tiles</name>
<version>3.0-SNAPSHOT</version>
<url>http://www.parancoe.org</url>
<properties>
@@ -20,25 +20,12 @@
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
- </testResources>
+ </testResources>
</build>
<dependencies>
<dependency>
- <groupId>org.parancoe</groupId>
- <artifactId>parancoe-web</artifactId>
- <version>3.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <version>1.8.0.10</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
<dependency>
=======================================
---
/plugins/parancoe-plugin-tiles/src/main/java/org/parancoe/plugin/tiles/CheapTilesView.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-tiles/src/main/java/org/parancoe/plugin/tiles/CheapTilesView.java
Fri Mar 1 04:03:24 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of parancoe-plugin-tiles Parancoe Plugin.
+ * This file is part of Parancoe Plugin Tiles.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,9 +27,9 @@
import org.apache.tiles.Attribute;
import org.apache.tiles.Definition;
import org.apache.tiles.TilesException;
-import org.apache.tiles.access.TilesAccess;

import org.apache.tiles.mgmt.MutableTilesContainer;
+import org.apache.tiles.servlet.context.ServletUtil;
import org.springframework.web.servlet.view.tiles2.TilesView;

/**
@@ -103,35 +103,32 @@
public class CheapTilesView extends TilesView {

public static final String DEFAULT_DEFAULT_TEMPLATE = "template.main";
- public static final String KEY_DEFAULT_TEMPLATE =
- CheapTilesView.class.getName() + ".DEFAULT_TEMPLATE";
+ public static final String KEY_DEFAULT_TEMPLATE =
CheapTilesView.class.getName()
+ + ".DEFAULT_TEMPLATE";
public static final String DEFAULT_DEFAULT_ATTRIBUTES = "main";
- public static final String KEY_DEFAULT_ATTRIBUTES =
- CheapTilesView.class.getName() + ".DEFAULT_ATTRIBUTES";
+ public static final String KEY_DEFAULT_ATTRIBUTES =
CheapTilesView.class.getName()
+ + ".DEFAULT_ATTRIBUTES";
public static final String DEFAULT_DEFAULT_PREFIX = "/WEB-INF/jsp/";
- public static final String KEY_DEFAULT_PREFIX =
- CheapTilesView.class.getName() + ".DEFAULT_PREFIX";
+ public static final String KEY_DEFAULT_PREFIX =
CheapTilesView.class.getName()
+ + ".DEFAULT_PREFIX";
public static final String DEFAULT_DEFAULT_SUFFIX = ".jsp";
- public static final String KEY_DEFAULT_SUFFIX =
- CheapTilesView.class.getName() + ".DEFAULT_SUFFIX";
+ public static final String KEY_DEFAULT_SUFFIX =
CheapTilesView.class.getName()
+ + ".DEFAULT_SUFFIX";

@Override
public boolean checkResource(Locale locale) throws Exception {
return true;
}
-

@Override
- protected void renderMergedOutputModel(Map model, HttpServletRequest
request,
- HttpServletResponse response)
- throws Exception {
+ protected void renderMergedOutputModel(Map<String, Object> model,
HttpServletRequest request,
+ HttpServletResponse response) throws Exception {

try {
super.renderMergedOutputModel(model, request, response);
} catch (TilesException te) {
ServletContext servletContext = getServletContext();
- MutableTilesContainer container =
- (MutableTilesContainer) TilesAccess.getContainer(
+ MutableTilesContainer container = (MutableTilesContainer)
ServletUtil.getContainer(
servletContext);
Definition definition = new Definition();
definition.setName(getUrl());
@@ -141,19 +138,14 @@
DEFAULT_DEFAULT_ATTRIBUTES);
String[] attributes = attributeList.split(",");
if (attributes.length == 1) {
- definition.putAttribute(attributes[0],
- new Attribute(
- (String) getAttribute(KEY_DEFAULT_PREFIX,
- DEFAULT_DEFAULT_PREFIX) +
- getUrl() + (String)
getAttribute(KEY_DEFAULT_SUFFIX,
- DEFAULT_DEFAULT_SUFFIX)));
+ definition.putAttribute(attributes[0], new
Attribute((String) getAttribute(
+ KEY_DEFAULT_PREFIX, DEFAULT_DEFAULT_PREFIX) +
getUrl()
+ + (String) getAttribute(KEY_DEFAULT_SUFFIX,
DEFAULT_DEFAULT_SUFFIX)));
} else {
for (String attribute : attributes) {
definition.putAttribute(attribute, new Attribute(
- (String) getAttribute(KEY_DEFAULT_PREFIX,
- DEFAULT_DEFAULT_PREFIX) +
- getUrl() + "_" + attribute +
- (String) getAttribute(KEY_DEFAULT_SUFFIX,
+ (String) getAttribute(KEY_DEFAULT_PREFIX,
DEFAULT_DEFAULT_PREFIX)
+ + getUrl() + "_" + attribute + (String)
getAttribute(KEY_DEFAULT_SUFFIX,
DEFAULT_DEFAULT_SUFFIX)));
}
}
=======================================
--- /plugins/parancoe-plugin-tiles/src/main/resources/parancoe-plugin.xml
Thu Apr 26 07:55:31 2012
+++ /plugins/parancoe-plugin-tiles/src/main/resources/parancoe-plugin.xml
Fri Mar 1 04:03:24 2013
@@ -3,7 +3,7 @@

Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>

- This file is part of parancoe-plugin-tiles Parancoe Plugin.
+ This file is part of Parancoe Plugin Tiles.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
=======================================
---
/plugins/parancoe-plugin-tiles/src/test/java/org/parancoe/plugin/tiles/SanityTest.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-tiles/src/test/java/org/parancoe/plugin/tiles/SanityTest.java
Fri Mar 1 04:03:24 2013
@@ -1,7 +1,7 @@
/**
* Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
*
- * This file is part of parancoe-plugin-tiles Parancoe Plugin.
+ * This file is part of Parancoe Plugin Tiles.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,17 +34,11 @@
private TilesConfigurer tilesConfigurer;
@Resource
private ViewResolver viewResolver;
-
+
/* test everything has been loaded properly */
public void testSanity() {
assertNotNull(plugin);
assertNotNull(tilesConfigurer);
assertNotNull(viewResolver);
}
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{};
- }
-
}
=======================================
--- /plugins/parancoe-plugin-tiles/src/test/resources/spring-test.xml Thu
Apr 26 07:55:31 2012
+++ /plugins/parancoe-plugin-tiles/src/test/resources/spring-test.xml Fri
Mar 1 04:03:24 2013
@@ -3,7 +3,7 @@

Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>

- This file is part of parancoe-plugin-tiles Parancoe Plugin.
+ This file is part of Parancoe Plugin Tiles.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
=======================================
---
/plugins/parancoe-plugin-tiles/src/test/resources/tiles/defs/default.xml
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-tiles/src/test/resources/tiles/defs/default.xml
Fri Mar 1 04:03:24 2013
@@ -3,7 +3,7 @@

Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>

- This file is part of parancoe-plugin-tiles Parancoe Plugin.
+ This file is part of Parancoe Plugin Tiles.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
=======================================
--- /plugins/parancoe-plugin-world/pom.xml Sat Sep 4 02:41:52 2010
+++ /plugins/parancoe-plugin-world/pom.xml Fri Mar 1 04:03:24 2013
@@ -18,9 +18,8 @@
</properties>
<dependencies>
<dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
=======================================
---
/plugins/parancoe-plugin-world/src/main/java/org/parancoe/plugins/world/WorldContextListener.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-world/src/main/java/org/parancoe/plugins/world/WorldContextListener.java
Fri Mar 1 04:03:24 2013
@@ -18,25 +18,20 @@
package org.parancoe.plugins.world;

import org.springframework.web.context.ContextLoaderListener;
-import org.springframework.context.ApplicationContext;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;

-import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
+import org.slf4j.LoggerFactory;

/**
* @author lucio.b...@jugpadova.it
*/
public class WorldContextListener extends ContextLoaderListener {

- private static final Logger log =
Logger.getLogger(WorldContextListener.class);
-
- private ServletContext servletContext;
-
- private ApplicationContext ctx;
+ private static final Logger log =
LoggerFactory.getLogger(WorldContextListener.class);

@Override
public void contextInitialized(ServletContextEvent evt) {
- log.info("WorldPlugin contextInitialized");
+ log.info("WorldPlugin contextInitialized");
}
}
=======================================
---
/plugins/parancoe-plugin-world/src/main/java/org/parancoe/plugins/world/WorldInterceptor.java
Thu Apr 26 07:55:31 2012
+++
/plugins/parancoe-plugin-world/src/main/java/org/parancoe/plugins/world/WorldInterceptor.java
Fri Mar 1 04:03:24 2013
@@ -18,16 +18,17 @@
package org.parancoe.plugins.world;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
+import org.slf4j.LoggerFactory;

/**
* @author lucio.b...@jugpadova.it
*/
public class WorldInterceptor extends HandlerInterceptorAdapter {

- public static final Logger logger =
Logger.getLogger(WorldInterceptor.class);
+ public static final Logger logger =
LoggerFactory.getLogger(WorldInterceptor.class);

public WorldInterceptor() {
logger.info("WorldInterceptor set up");
=======================================
--- /plugins/pom.xml Thu Apr 26 07:55:31 2012
+++ /plugins/pom.xml Fri Mar 1 04:03:24 2013
@@ -11,6 +11,10 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<main.basedir>${basedir}</main.basedir>
<year>2006-2012</year>
+ <parancoe.web.version>3.0-SNAPSHOT</parancoe.web.version>
+ <parancoe.slf4j.version>1.7.2</parancoe.slf4j.version>
+ <parancoe.junit4.version>4.11</parancoe.junit4.version>
+ <parancoe.hsqldb.version>2.2.9</parancoe.hsqldb.version>

<!-- NetBeans IDE properties -->

<org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
@@ -41,17 +45,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
+ <version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
- <!--
<compilerArgument>-encoding=UTF8</compilerArgument>-->
+ <encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.10</version>
+ <version>2.13</version>
<configuration>
<skip>false</skip>
<useFile>true</useFile>
@@ -70,7 +74,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
- <version>2.5</version>
+ <version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
@@ -78,7 +82,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
- <version>2.2.1</version>
+ <version>2.4</version>
<configuration>
<goals>deploy</goals>
</configuration>
@@ -86,7 +90,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
- <version>2.2.1</version>
+ <version>2.4</version>
<configuration>
<descriptors>
<descriptor>src/assembly/bin.xml</descriptor>
@@ -173,29 +177,77 @@
<url>http://parancoe.googlecode.com/svn/trunk</url>
</scm>
<dependencies>
- <!-- parancoe framework -->
<dependency>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-web</artifactId>
- <version>3.0-SNAPSHOT</version>
- <scope>compile</scope>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <artifactId>log4j</artifactId>
+ <groupId>log4j</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
-
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
- <version>2.4</version>
<scope>provided</scope>
</dependency>
-
- <!-- db driver -->
<dependency>
- <groupId>hsqldb</groupId>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
- <version>1.8.0.4</version>
<scope>test</scope>
</dependency>
</dependencies>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-web</artifactId>
+ <version>${parancoe.web.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ <version>1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>${parancoe.hsqldb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${parancoe.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${parancoe.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${parancoe.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${parancoe.junit4.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
<modules>
<module>parancoe-plugin-italy</module>
<module>parancoe-plugin-world</module>

==============================================================================
Revision: 18bbbb5bfa1a
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 08:46:53 2013
Log: MAIN - refresh jar versions, ease dependencies & poms, move log4j
to slf4j where possible, minor code cleanups
http://code.google.com/p/parancoe/source/detail?r=18bbbb5bfa1a

Deleted:
/parancoe-core/src/main/java/org/parancoe/util/FixtureHelper.java

/parancoe-core/src/test/java/org/parancoe/persistence/util/FixtureHelperTest.java
Modified:
/parancoe-core/pom.xml

/parancoe-core/src/main/java/org/parancoe/test/InspectableTestMailSender.java
/parancoe-core/src/main/java/org/parancoe/test/MailSenderMock.java
/parancoe-core/src/main/java/org/parancoe/util/Utils.java

/parancoe-core/src/main/resources/org/parancoe/core/applicationContextBase.xml

/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/AuthorTC.java

/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/AuthorTCDao.java

/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/BookTC.java

/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/BookTCDao.java
/parancoe-core/src/test/java/org/parancoe/persistence/util/BaseTest.java
/parancoe-core/src/test/java/org/parancoe/test/ManyToManyFixturesTest.java
/parancoe-validator/pom.xml
/parancoe-web/pom.xml
/parancoe-web/src/main/java/org/parancoe/web/ContextListener.java
/parancoe-web/src/main/java/org/parancoe/web/ExceptionResolver.java
/parancoe-web/src/main/java/org/parancoe/web/LanguageInterceptor.java

/parancoe-web/src/main/java/org/parancoe/web/ParancoeOpenSessionInViewInterceptor.java

/parancoe-web/src/main/java/org/parancoe/web/PopulateInitialDataContextListener.java
/parancoe-web/src/main/java/org/parancoe/web/plugin/PluginHelper.java
/parancoe-web/src/main/java/org/parancoe/web/plugin/PluginInterceptor.java
/parancoe-web/src/main/java/org/parancoe/web/tag/FlashTag.java
/parancoe-web/src/main/java/org/parancoe/web/test/BaseTest.java
/parancoe-web/src/main/java/org/parancoe/web/test/PluginTest.java

/parancoe-web/src/main/java/org/parancoe/web/xml/ControllerBeanDefinitionParser.java

/parancoe-web/src/test/java/org/parancoe/web/test/controller/ForTestController.java
/pom.xml

=======================================
--- /parancoe-core/src/main/java/org/parancoe/util/FixtureHelper.java Thu
Jan 26 20:49:06 2012
+++ /dev/null
@@ -1,239 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.util;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.ArrayUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
-import org.parancoe.yaml.Yaml;
-import org.springframework.core.io.ClassPathResource;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.lambico.dao.generic.GenericDaoBase;
-import org.lambico.dao.spring.hibernate.HibernateGenericDao;
-
-/**
- * @author Paolo Dona paolo...@seesaw.it
- * @author Michele Franzin michele...@seesaw.it
- */
-public class FixtureHelper {
-
- private final static Logger logger =
Logger.getLogger(FixtureHelper.class);
-
- private final static Pattern headerMatch = Pattern.compile(
- "^-\\s??(\\S*)\\s*?$", Pattern.MULTILINE);
-
- private final static Pattern lineMatch = Pattern.compile("^(.+)$",
- Pattern.MULTILINE);
-
- /**
- * Gets file name of a fixture fragment related to a model.
- */
- public static String getFixtureFileName(Class model) {
- return model.getSimpleName() + ".yml";
- }
-
- /**
- * Gets id of dao related to a model.
- * <p/>
- * *WARNING*: strong condition on the DAO id (entity_name+Dao) For
retriving
- * a dao for an entity it's better something like: <code>
- * DaoProvider daos = (DaoProvider)ctx.getBean(DAO_PROVIDER_ID);
- * GenericDao dao = (GenericDao)daos.getDao(clazz);
- * </code>
- * <p/>
- * The DAO_PROVIDER_ID usually is "daos".
- */
- public static String getFixtureDaoId(Class model) {
- return StringUtils.uncapitalize(model.getSimpleName()) + "Dao";
- }
-
- /**
- * Gets id of dao related to a model.
- * <p/>
- * *WARNING*: strong condition on the DAO id (entity_name+Dao) For
retriving
- * a dao for an entity it's better something like: <code>
- * DaoProvider daos = (DaoProvider)ctx.getBean(DAO_PROVIDER_ID);
- * GenericDao dao = (GenericDao)daos.getDao(clazz);
- * </code>
- * <p/>
- * The DAO_PROVIDER_ID usually is "daos".
- */
- public static String getFixtureBusinessDaoId(Class model) {
- return StringUtils.uncapitalize(model.getSimpleName())
+ "BusinessDao";
- }
-
- /**
- * Gets human readable name of a model.
- */
- public static String getModelName(Class model) {
- return model.getSimpleName();
- }
-
- /**
- * @param classpathResource dir relative path
- */
- public static Map<Class, Object[]> loadFixturesFromResource(
- final String classpathResource, final Set<Class> models) {
- return loadFixturesFromResource(
- new ClassPathResource(classpathResource), models);
- }
-
- public static Map<Class, Object[]> loadFixturesFromResource(
- final ClassPathResource fixtureDir, final Set<Class> models) {
- LinkedHashMap<Class, Object[]> fixtures = new LinkedHashMap<Class,
Object[]>(
- models.size());
- String fixtureFileName = null;
- StringBuffer sb = new StringBuffer();
- for (Class model : models) {
- fixtureFileName = fixtureDir.getPath() +
getFixtureFileName(model);
- InputStream stream = null;
- try {
- String content = loadFixtureStringForClass(
- stream = new ClassPathResource(fixtureFileName)
- .getInputStream(), model);
- if (StringUtils.isNotBlank(content)) {
- sb.append(content);
- sb.append(IOUtils.LINE_SEPARATOR);
- // Mantiene l'ordine di inserimento
- fixtures.put(model, null);
- } else {
- logger.warn("No fixture for "
- + getModelName(model) + " in the file '"
- + fixtureFileName + "' ?");
- }
- } catch (FileNotFoundException e) {
- logger.warn("Fixture file not found for "
- + getModelName(model) + ", did you create the
file '"
- + fixtureFileName + "' ?");
- } catch (IOException e) {
- logger.error("Loading of fixtures failed for "
- + getModelName(model), e);
- } finally {
- IOUtils.closeQuietly(stream);
- }
- }
-
- if (sb.length() == 0) {
- sb.append("--- !java.lang.Object[] []" +
IOUtils.LINE_SEPARATOR);
- } else {
- sb.insert(0, "--- !java.lang.Object[]" +
IOUtils.LINE_SEPARATOR);
- }
-
- sb.append("...");
- sb.append(IOUtils.LINE_SEPARATOR);
-
- if (logger.isDebugEnabled()) {
- logger
- .debug("### Start of Yaml generated merging the
fixtures ###\n"
- + sb.toString()
- + "\n### End of Yaml generated merging the
fixtures ###");
- }
-
- // Debug file output
- // try {
- // FileUtils.writeStringToFile(new File("dump.yml"), sb.toString(),
- // "UTF-8");
- // } catch (IOException e) {
- // e.printStackTrace();
- // }
-
- // Se il documento è vuoto, yaml ritorna un'HashMap
- Object any = Yaml.load(sb.toString());
-
- if (any instanceof Object[]) {
- Object[] fixtureObjects = (Object[]) any;
- for (Object fixtureObject : fixtureObjects) {
- Object[] objects = (Object[]) fixtureObject;
- // null safe handling
- if (!ArrayUtils.isEmpty(objects)) {
- fixtures.put(objects[0].getClass(), objects);
- }
- }
- }
- return fixtures;
- }
-
- /**
- * ritorna il contenuto del file <Class>.yml
- */
- private static String loadFixtureStringForClass(InputStream stream,
- Class model) throws
IOException {
- String fixtureString = Utils.unsafeLoadString(stream);
- // Add fixture class into header
- Matcher matcher = headerMatch.matcher(fixtureString);
- // Il replace del $ serve alla regex nel caso di inner classes
- fixtureString = matcher.replaceAll("- $1 !"
- + model.getName().replace("$", "\\$"));
- // Indent lines
- matcher = lineMatch.matcher(fixtureString);
- fixtureString = matcher.replaceAll(" $1");
- // aggiungo l'header (Array di oggetti <Class>)
- return "- !" + model.getName() + "[]" + IOUtils.LINE_SEPARATOR
- + fixtureString;
- }
-
- @SuppressWarnings("unchecked")
- public static void populateDbForModel(Class model, Object[] fixtures,
- GenericDaoBase dao) {
- logger.debug("Populating table for " + getModelName(model));
- if (fixtures == null) {
- logger.warn("No fixture for " + getModelName(model)
- + ", did you create the file '" +
getFixtureFileName(model)
- + "'?");
- return;
- }
- try {
- for (Object entity : fixtures) {
- dao.store(entity);
- ((HibernateGenericDao)dao).getHibernateTemplate().flush();
- }
- } catch (Exception e) {
- logger.error("Error populating rows in " + getModelName(model)
- + " table", e);
- }
- }
-
- @SuppressWarnings("unchecked")
- public static void eraseDbForModel(Class model, GenericDaoBase dao) {
- logger.debug("Erasing table for " + getModelName(model));
- try {
- // List rows = dao.findAll();
- // for (Object o : rows) {
- // dao.delete(o);
- // }
- if (dao == null) {
- throw new IllegalArgumentException("Dao associated to " +
model.getName() + " PO is null!");
- }
- int deleted =
((HibernateGenericDao)dao).getHibernateTemplate().bulkUpdate("DELETE FROM "
+
org.hibernate.cfg.DefaultComponentSafeNamingStrategy.INSTANCE.tableName(model.getSimpleName()));
-// deleteAll();
- } catch (Exception e) {
- logger.error("Error deleting rows in " + getModelName(model)
- + " table", e);
- }
- }
-
-}
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/util/FixtureHelperTest.java
Sat Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,149 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.persistence.util;
-
-import java.math.BigDecimal;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-import org.lambico.test.spring.hibernate.DBTest;
-
-import org.parancoe.persistence.po.hibernate.AuthorTC;
-import org.parancoe.persistence.po.hibernate.BookTC;
-import org.parancoe.util.FixtureHelper;
-import org.springframework.util.CollectionUtils;
-
-/**
- * @author <a href="mailto:michele...@seesaw.it">Michele Franzin</a>
- * @version $Revision$
- */
-public class FixtureHelperTest extends DBTest {
-
- private DemoBean[] expected;
-
- @Override
- public void onSetUpBeforeTransaction() throws Exception {
- super.onSetUpBeforeTransaction();
- expected = new DemoBean[5];
- expected[0] = new DemoBean("first one", new Long(356));
- expected[1] = new DemoBean("Demo 1", new Long(6789));
- expected[2] = new DemoBean("àèéìòù", new Long(-980000));
- expected[3] = new DemoBean("Demo3", new Long(98000));
- expected[4] = new DemoBean("Demo#2", new Long(-9800));
- }
-
- @SuppressWarnings("unchecked")
- public void testShouldNotFailWrongFixtureDir() throws Exception {
- Set<Class> models = new LinkedHashSet<Class>(
- CollectionUtils.arrayToList(new Class[]{DemoBean.class}));
- Map<Class, Object[]> result =
FixtureHelper.loadFixturesFromResource(
- "nonExistant/", models);
- assertTrue("Le fixture non sono vuote", result.isEmpty());
- }
-
- @SuppressWarnings("unchecked")
- public void testShouldNotFailIfMissingFixtureFile() throws Exception {
- Set<Class> models = new LinkedHashSet<Class>(
- CollectionUtils.arrayToList(new
Class[]{BigDecimal.class}));
- Map<Class, Object[]> result =
FixtureHelper.loadFixturesFromResource(
- "fixtures/", models);
- assertTrue("Le fixture non sono vuote", result.isEmpty());
- }
-
- public void testShouldNotFailIfEmptyDocs() throws Exception {
- Map<Class, Object[]> result =
FixtureHelper.loadFixturesFromResource(
- "emptyDir/", new LinkedHashSet<Class>());
- assertTrue("Le fixture non sono vuote", result.isEmpty());
- }
-
- public void testJarLoading() throws Exception {
- // TODO Testare il caricamento di una risorsa nei JAR
- }
-
- // TODO Completare il test
- // public void testStripUTF8preamble() {
- // byte[] stringWithPreamble = Utils
- // .loadBinary("testdata/UTF8WithPreamble.txt");
- // byte[] stringWithoutPreamble = Utils
- // .loadBinary("testdata/UTF8WithoutPreamble.txt");
- //
- // assertTrue(FixtureHelper.hasUTF8preamble(stringWithPreamble));
- // assertFalse(FixtureHelper.hasUTF8preamble(stringWithoutPreamble));
- //
- // byte[] stripped =
FixtureHelper.stripUTF8preamble(stringWithPreamble);
- // assertFalse(FixtureHelper.hasUTF8preamble(stripped));
- // assertEquals(stringWithPreamble.length, stripped.length + 3);
- // }
- // TODO Completare il test
- // public void testPrependUTF8preamble() {
- // byte[] stringWithoutPreamble = Utils
- // .loadBinary("testdata/UTF8WithoutPreamble.txt");
- // byte[] preambled = FixtureHelper
- // .prependUTF8preamble(stringWithoutPreamble);
- // assertTrue(FixtureHelper.hasUTF8preamble(preambled));
- // assertEquals(stringWithoutPreamble.length + 3, preambled.length);
- // }
- @SuppressWarnings("unchecked")
- public void testBeanLoading() throws Exception {
- Set<Class> models = new LinkedHashSet<Class>(
- CollectionUtils.arrayToList(new Class[]{DemoBean.class}));
- Map<Class, Object[]> objects =
FixtureHelper.loadFixturesFromResource(
- "fixtures/", models);
- assertNotNull("Non ha ritornato la mappa di fixtures", objects);
- assertEquals("Non carica tutti i beans", 1, objects.size());
- assertTrue("Non crea istanze di " +
DemoBean.class.getCanonicalName(),
- objects.containsKey(DemoBean.class));
- DemoBean[] result = (DemoBean[]) objects.get(DemoBean.class);
- assertEquals("Non carica tutti i beans", 5, result.length);
- for (int i = 0; i < 5; i++) {
- assertEquals("Non ha caricato correttamente il beans numero "
+ i,
- expected[i], result[i]);
- }
- }
-
- public void testBookLoading() {
- Set<Class> models = new LinkedHashSet<Class>(
- CollectionUtils.arrayToList(new Class[]{AuthorTC.class,
- BookTC.class
- }));
- Map<Class, Object[]> objects =
FixtureHelper.loadFixturesFromResource(
- "fixtures/", models);
- assertNotNull("Non ha ritornato la mappa di fixtures", objects);
- assertEquals(2, objects.size());
- assertEquals(3, objects.get(BookTC.class).length);
- assertEquals(4, objects.get(AuthorTC.class).length);
- assertBookAuthorsAreIdentical(objects.get(BookTC.class),
objects.get(
- AuthorTC.class));
- }
-
- private void assertBookAuthorsAreIdentical(Object[] books, Object[]
authors) {
- for (int i = 0; i < books.length; i++) {
- BookTC currentBook = (BookTC) books[i];
- for (AuthorTC author : currentBook.getAuthors()) {
- boolean found = false;
- for (int j = 0; j < authors.length; j++) {
- if (author == authors[j]) {
- found = true;
- break;
- }
- }
- assertTrue("The book author is not in the author array",
found);
- }
- }
- }
-}
=======================================
--- /parancoe-core/pom.xml Tue Dec 13 13:41:54 2011
+++ /parancoe-core/pom.xml Wed Feb 27 08:46:53 2013
@@ -20,9 +20,8 @@
<artifactId>lambico-spring-hibernate</artifactId>
</dependency>
<dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <scope>test</scope>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
@@ -31,19 +30,23 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- <version>1.4</version>
- <scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
- <version>1.5</version>
- <scope>compile</scope>
</dependency>
+ <!-- MemoryAppender -->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.17</version>
+ <scope>provided</scope>
+ </dependency>
+ <!-- InspectableTestMailSender & MailSenderMock -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
- <version>1.4.2</version>
+ <version>1.4.5</version>
<scope>provided</scope>
</dependency>
<!-- Tests dependencies -->
@@ -53,23 +56,23 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context-support</artifactId>
- </dependency>
- <dependency>
- <groupId>org.parancoe</groupId>
- <artifactId>parancoe-yaml</artifactId>
- <type>jar</type>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
- <plugins>
+ <plugins>
<plugin>
<groupId>com.mycila.maven-license-plugin</groupId>
<artifactId>maven-license-plugin</artifactId>
=======================================
---
/parancoe-core/src/main/java/org/parancoe/test/InspectableTestMailSender.java
Mon Jan 9 16:58:34 2012
+++
/parancoe-core/src/main/java/org/parancoe/test/InspectableTestMailSender.java
Wed Feb 27 08:46:53 2013
@@ -18,18 +18,16 @@
package org.parancoe.test;

import javax.mail.internet.MimeMessage;
-import org.apache.log4j.Logger;
import org.springframework.mail.MailException;
import org.springframework.mail.javamail.JavaMailSenderImpl;

/**
- * Inspectable mock implementation of JavaMailSender for test porpouse.
- *
- * @author Michele Franzin
+ * Inspectable mock implementation of JavaMailSender for testing porpouses.
+ *
+ * @author michele franzin <michele at franzin.net>
*/
public class InspectableTestMailSender extends JavaMailSenderImpl {

- private static final Logger logger =
Logger.getLogger(InspectableTestMailSender.class);
private MimeMessage[] messages = new MimeMessage[0];

@Override
=======================================
--- /parancoe-core/src/main/java/org/parancoe/test/MailSenderMock.java Sat
Sep 4 02:41:52 2010
+++ /parancoe-core/src/main/java/org/parancoe/test/MailSenderMock.java Wed
Feb 27 08:46:53 2013
@@ -18,20 +18,21 @@
package org.parancoe.test;

import javax.mail.internet.MimeMessage;
-import org.apache.log4j.Logger;
+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 MailSenderMock extends JavaMailSenderImpl {

- private static final Logger logger = Logger.getLogger(
+ private static final Logger logger = LoggerFactory.getLogger(
MailSenderMock.class);

@Override
@@ -40,7 +41,7 @@
if (mimeMessages != null) {
for (MimeMessage mimeMessage : mimeMessages) {
try {
- logger.info(mimeMessage.getContent());
+ logger.info(mimeMessage.getContent().toString());
} catch (Exception ex) {
logger.error("Can't get message content", ex);
}
@@ -48,7 +49,7 @@
}
if (originalMessages != null) {
for (Object o : originalMessages) {
- logger.info(o);
+ logger.info(o.toString());
}
}
}
=======================================
--- /parancoe-core/src/main/java/org/parancoe/util/Utils.java Sat Sep 4
02:41:52 2010
+++ /parancoe-core/src/main/java/org/parancoe/util/Utils.java Wed Feb 27
08:46:53 2013
@@ -27,19 +27,20 @@
import java.util.regex.Pattern;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.ArrayUtils;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

/**
* @author Paolo Dona paolo...@seesaw.it
- * @author Michele Franzin paolo...@seesaw.it
+ * @author michele franzin <michele at franzin.net>
* @author Andrea Nasato <mailto:andrea...@jugpadova.it/>
*/
+@Deprecated
public class Utils {

- private static final Logger logger =
- Logger.getLogger(Utils.class);
+ private static final Logger logger =
LoggerFactory.getLogger(Utils.class);

private static final byte[] UTF8_PREAMBLE =
new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF};
@@ -182,7 +183,7 @@
public static boolean hasUTF8preamble(String s) {
return s.startsWith(UTF8_UNICODE_PREAMBLE);
}
-
+
/**
* Return an array containing all the substrings of
* <code>camelString</code>, according to this rule: divide
<code>camelString</code>
@@ -214,7 +215,7 @@
}

// no upper case found: we return the entire word
- if (idxList.size() == 0) {
+ if (idxList.isEmpty()) {
return new String[]{camelString};
}

@@ -238,5 +239,5 @@

return strList.toArray(new String[strList.size() - 1]);
}
-
+
}
=======================================
---
/parancoe-core/src/main/resources/org/parancoe/core/applicationContextBase.xml
Sat Sep 4 02:41:52 2010
+++
/parancoe-core/src/main/resources/org/parancoe/core/applicationContextBase.xml
Wed Feb 27 08:46:53 2013
@@ -24,9 +24,9 @@
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
- http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
+ http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springmodules.org/validation/bean/validator
http://www.springmodules.org/validation/bean/validator.xsd
http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd">

=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/AuthorTC.java
Sat Sep 4 02:41:52 2010
+++
/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/AuthorTC.java
Wed Feb 27 08:46:53 2013
@@ -31,7 +31,7 @@
/**
* An persistent object to be used for the tests M:N relationships.
*
- * @author <a href="mailto:michele...@seesaw.it">Michele Franzin</a>
+ * @author michele franzin <michele at franzin.net>
* @version $Revision$
*/
@javax.persistence.Entity
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/AuthorTCDao.java
Sat Sep 4 02:41:52 2010
+++
/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/AuthorTCDao.java
Wed Feb 27 08:46:53 2013
@@ -24,7 +24,7 @@
/**
* A DAO to be used for the tests M:N relationships.
*
- * @author <a href="mailto:michele...@seesaw.it">Michele Franzin</a>
+ * @author michele franzin <michele at franzin.net>
* @version $Revision$
*/
@Dao(entity = AuthorTC.class)
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/BookTC.java
Sat Sep 4 02:41:52 2010
+++
/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/BookTC.java
Wed Feb 27 08:46:53 2013
@@ -29,7 +29,7 @@
/**
* An persistent object to be used for the tests M:N relationships.
*
- * @author <a href="mailto:michele...@seesaw.it">Michele Franzin</a>
+ * @author michele franzin <michele at franzin.net>
* @version $Revision$
*/
@javax.persistence.Entity
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/BookTCDao.java
Sat Sep 4 02:41:52 2010
+++
/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/BookTCDao.java
Wed Feb 27 08:46:53 2013
@@ -24,7 +24,7 @@
/**
* A DAO to be used for the tests M:N relationships.
*
- * @author <a href="mailto:michele...@seesaw.it">Michele Franzin</a>
+ * @author michele franzin <michele at franzin.net>
* @version $Revision$
*/
@Dao(entity = BookTC.class)
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/util/BaseTest.java
Sat Sep 4 02:41:52 2010
+++
/parancoe-core/src/test/java/org/parancoe/persistence/util/BaseTest.java
Wed Feb 27 08:46:53 2013
@@ -24,13 +24,13 @@

/**
* A base class for Parancoe-core tests.
- *
+ *
* @author lucio
*/
public abstract class BaseTest extends DBTest {

@Override
public Class[] getFixtureClasses() {
- return new Class[]{EntityTC.class, AuthorTC.class, BookTC.class};
+ return new Class[]{EntityTC.class, BookTC.class, AuthorTC.class};
}
}
=======================================
---
/parancoe-core/src/test/java/org/parancoe/test/ManyToManyFixturesTest.java
Sat Sep 4 02:41:52 2010
+++
/parancoe-core/src/test/java/org/parancoe/test/ManyToManyFixturesTest.java
Wed Feb 27 08:46:53 2013
@@ -30,7 +30,7 @@
/**
* Tests fixture load with M:N relationships
*
- * @author <a href="mailto:michele...@seesaw.it">Michele Franzin</a>
+ * @author michele franzin <michele at franzin.net>
* @author Jacopo Murador <jacopo.murador at seesaw.it>
* @version $Revision$
*/
=======================================
--- /parancoe-validator/pom.xml Wed Apr 6 08:50:21 2011
+++ /parancoe-validator/pom.xml Wed Feb 27 08:46:53 2013
@@ -27,28 +27,17 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- <scope>test</scope>
- <type>jar</type>
- </dependency>
- <dependency>
<groupId>org.slf4j</groupId>
- <artifactId>slf4j-nop</artifactId>
- <version>1.6.1</version>
+ <artifactId>slf4j-simple</artifactId>
<scope>test</scope>
- <type>jar</type>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.6.1</version>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
<scope>test</scope>
- <type>jar</type>
</dependency>
</dependencies>
</project>
=======================================
--- /parancoe-web/pom.xml Tue Dec 13 13:41:54 2011
+++ /parancoe-web/pom.xml Wed Feb 27 08:46:53 2013
@@ -41,55 +41,51 @@
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
- <scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
- <version>1.1.2</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
+ <version>1.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context-support</artifactId>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2.1</version>
- <scope>compile</scope>
+ <groupId>org.lambico</groupId>
+ <artifactId>lambico-pump</artifactId>
</dependency>
<dependency>
<groupId>org.lambico</groupId>
<artifactId>lambico-test</artifactId>
- <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.17</version>
</dependency>
<dependency>
- <groupId>hsqldb</groupId>
+ <groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
</dependency>
</dependencies>
<build>
- <plugins>
+ <plugins>
<plugin>
<groupId>com.mycila.maven-license-plugin</groupId>
<artifactId>maven-license-plugin</artifactId>
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/ContextListener.java Mon
Oct 29 01:24:47 2012
+++ /parancoe-web/src/main/java/org/parancoe/web/ContextListener.java Wed
Feb 27 08:46:53 2013
@@ -25,11 +25,12 @@
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

-import org.apache.log4j.Logger;
import org.lambico.spring.dao.DaoUtils;
import org.parancoe.util.BaseConf;
import org.parancoe.util.MemoryAppender;
import org.parancoe.web.plugin.PluginHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.XmlWebApplicationContext;

@@ -42,7 +43,7 @@
* @version $Revision$
*/
public class ContextListener implements ServletContextListener {
- private static final Logger log =
Logger.getLogger(ContextListener.class);
+ private static final Logger log =
LoggerFactory.getLogger(ContextListener.class);
protected ServletContext servletContext;
protected XmlWebApplicationContext applicationContext;

@@ -58,7 +59,7 @@
PluginHelper helper = new PluginHelper(applicationContext);
helper.initApplicationContextPlugins(evt); // deve essere DOPO
loadApplicationContext()
helper.invokePluginContextInitialized(evt);
- log.info("### Starting up Parancoe in " + BaseConf.getEnv()
+ " mode.");
+ log.info("### Starting up Parancoe in " + BaseConf.getEnv()
+ " mode.");
} catch (Exception e) {
log.error("Error in base ContextListener.contextInitialized",
e);
}
@@ -90,6 +91,7 @@
populateDaoMap(ctx);
}

+ @Override
public void contextDestroyed(ServletContextEvent evt) {
new
PluginHelper(applicationContext).invokePluginContextDestroyed(evt);
log.info("### Shutting down Parancoe in " + BaseConf.getEnv() + "
mode.");
@@ -98,6 +100,7 @@
/**
* Populate the "daoMap" bean with the DAOs defined in the context.
*/
+ @SuppressWarnings("unchecked")
protected void populateDaoMap(XmlWebApplicationContext ctx) {
Map daoMap = (Map) ctx.getBean("daoMap");
Map daos = DaoUtils.getDaos(ctx);
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/ExceptionResolver.java Sat
Sep 4 02:41:52 2010
+++ /parancoe-web/src/main/java/org/parancoe/web/ExceptionResolver.java Wed
Feb 27 08:46:53 2013
@@ -23,18 +23,17 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

-import org.apache.log4j.Logger;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;
/**
* @author paolo...@seesaw.it
*/
public class ExceptionResolver implements HandlerExceptionResolver {
- private static final Logger log =
Logger.getLogger(ExceptionResolver.class);

/**
* sends unhandled exceptions to genericError.jsp
*/
+ @Override
public ModelAndView resolveException(HttpServletRequest req,
HttpServletResponse res,
Object object, Exception e) {
Map<String, Object> params = new HashMap<String, Object>();
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/LanguageInterceptor.java
Sat Sep 4 02:41:52 2010
+++ /parancoe-web/src/main/java/org/parancoe/web/LanguageInterceptor.java
Wed Feb 27 08:46:53 2013
@@ -20,7 +20,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.support.RequestContext;
@@ -29,27 +30,30 @@
* @author paolo...@seesaw.it
*/
public class LanguageInterceptor implements HandlerInterceptor {
- public static final Logger logger =
Logger.getLogger(LanguageInterceptor.class);

+ public static final Logger logger =
LoggerFactory.getLogger(LanguageInterceptor.class);

public LanguageInterceptor() {
logger.debug("LanguageInterceptor set up");
}

+ @Override
public boolean preHandle(HttpServletRequest req, HttpServletResponse
res,
- Object object) throws Exception {
+ Object object) throws Exception {
RequestContext rc = new RequestContext(req);
- req.setAttribute("requestContext",rc);
+ req.setAttribute("requestContext", rc);
req.setAttribute("lang", rc.getLocale().getLanguage());
logger.debug("LanguageInterceptor.preHandle()");
return true;
}

- public void postHandle(HttpServletRequest arg0, HttpServletResponse
arg1, Object arg2, ModelAndView arg3) throws Exception {
-
+ @Override
+ public void postHandle(HttpServletRequest arg0, HttpServletResponse
arg1, Object arg2,
+ ModelAndView arg3) throws Exception {
}

- public void afterCompletion(HttpServletRequest arg0,
HttpServletResponse arg1, Object arg2, Exception arg3) throws Exception {
-
+ @Override
+ public void afterCompletion(HttpServletRequest arg0,
HttpServletResponse arg1, Object arg2,
+ Exception arg3) throws Exception {
}
}
=======================================
---
/parancoe-web/src/main/java/org/parancoe/web/ParancoeOpenSessionInViewInterceptor.java
Sat Sep 4 02:41:52 2010
+++
/parancoe-web/src/main/java/org/parancoe/web/ParancoeOpenSessionInViewInterceptor.java
Wed Feb 27 08:46:53 2013
@@ -15,14 +15,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.parancoe.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.SessionHolder;
import
org.springframework.transaction.support.TransactionSynchronizationManager;
@@ -30,60 +30,71 @@
import org.springframework.web.servlet.ModelAndView;

/**
- * I don't know why the transaction annotations aren't recognized. This
class is
- * a workaround until I will find a solution.
- *
+ * I don't know why the transaction annotations aren't recognized. This
class is a workaround until
+ * I will find a solution.
+ *
* @author Jacopo Murador <jacopo.murador at seesaw.it>
*/
public class ParancoeOpenSessionInViewInterceptor implements
HandlerInterceptor {

- private static final Logger logger =
Logger.getLogger(ParancoeOpenSessionInViewInterceptor.class.getPackage().getName());
-
+ private static final Logger logger = LoggerFactory.getLogger(
+
ParancoeOpenSessionInViewInterceptor.class.getPackage().getName());
@Autowired
private SessionFactory sessionFactory;

- public boolean preHandle(HttpServletRequest req, HttpServletResponse
res, Object handler) throws Exception {
+ @Override
+ public boolean preHandle(HttpServletRequest req, HttpServletResponse
res, Object handler) throws
+ Exception {
logger.debug("Opening session and beginning transaction");
Session session = sessionFactory.openSession();
session.beginTransaction();
if
(!TransactionSynchronizationManager.hasResource(sessionFactory)) {
- TransactionSynchronizationManager.bindResource(sessionFactory,
new SessionHolder(session));
+ TransactionSynchronizationManager.bindResource(sessionFactory,
+ new SessionHolder(session));
TransactionSynchronizationManager.initSynchronization();
}
return true;
}

- public void postHandle(HttpServletRequest req, HttpServletResponse
res, Object handler, ModelAndView model) throws Exception {
+ @Override
+ public void postHandle(HttpServletRequest req, HttpServletResponse
res, Object handler,
+ ModelAndView model) throws Exception {
//Nothing to do
}

- public void afterCompletion(HttpServletRequest req,
HttpServletResponse res, Object handler, Exception ex) throws Exception {
- Session session =sessionFactory.getCurrentSession();
- try{
- if(ex==null){
+ @Override
+ public void afterCompletion(HttpServletRequest req,
HttpServletResponse res, Object handler,
+ Exception ex) throws Exception {
+ Session session = sessionFactory.getCurrentSession();
+ try {
+ if (ex == null) {
logger.debug("Committing the database transaction");
- if (session.getTransaction().isActive()
&& !session.getTransaction().wasRolledBack())
session.getTransaction().commit();
- }else{
- logger.error(ex);
+ if (session.getTransaction().isActive()
&& !session.getTransaction().wasRolledBack()) {
+ session.getTransaction().commit();
+ }
+ } else {
+ logger.error("Error occurrend in request handling", ex);
logger.debug("Rolling back the database transaction");
- if (session.getTransaction().isActive()
&& !session.getTransaction().wasRolledBack())
session.getTransaction().rollback();
+ if (session.getTransaction().isActive()
&& !session.getTransaction().wasRolledBack()) {
+ session.getTransaction().rollback();
+ }
+ }
+ if (session.isOpen()) {
+ session.close();
}
- if(session.isOpen())
- session.close();
- }catch(Exception e){
- logger.error(e);
+ } catch (Exception e) {
+ logger.error("Error occurrend in request completion", ex);
throw e;
- }finally{
- try{
- if(session.isOpen()){
+ } finally {
+ try {
+ if (session.isOpen()) {
session.close();
}
- }catch(Exception e){/*do nothing*/}
+ } catch (Exception e) {/*do nothing*/
+
+ }

TransactionSynchronizationManager.unbindResource(sessionFactory);
TransactionSynchronizationManager.clearSynchronization();
}
-
}
-
-
}
=======================================
---
/parancoe-web/src/main/java/org/parancoe/web/PopulateInitialDataContextListener.java
Sat Sep 4 02:41:52 2010
+++
/parancoe-web/src/main/java/org/parancoe/web/PopulateInitialDataContextListener.java
Wed Feb 27 08:46:53 2013
@@ -21,17 +21,18 @@

import javax.servlet.ServletContextEvent;

-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang.ArrayUtils;
-import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.lambico.dao.DaoProvider;
import org.lambico.dao.generic.GenericDaoBase;
-import org.parancoe.util.FixtureHelper;
+import org.lambico.dao.spring.hibernate.GenericDaoHibernateSupport;
+import org.lambico.data.YamlFixtureHelper;
import org.parancoe.web.plugin.ApplicationContextPlugin;
import org.parancoe.web.plugin.PluginHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
+import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.orm.hibernate3.SessionHolder;
import
org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.web.context.ContextLoaderListener;
@@ -39,17 +40,17 @@

/**
* @author Paolo Dona paolo...@seesaw.it
- * @author Michele Franzin michele...@seesaw.it
+ * @author michele franzin <michele at franzin.net>
* @author Jacopo Murador <jacopo.murador at seesaw.it>
*/
public class PopulateInitialDataContextListener extends
ContextLoaderListener {

private static final String DAO_PROVIDER_ID = "daos";
-
- private static final Logger log =
Logger.getLogger(PopulateInitialDataContextListener.class);
+
+ private static final Logger log =
LoggerFactory.getLogger(PopulateInitialDataContextListener.class);

private ApplicationContext ctx;
-
+
protected List<Class> clazzToPopulate = new ArrayList<Class>();

@Override
@@ -57,16 +58,15 @@
ctx = (ApplicationContext) evt.getServletContext().getAttribute(

WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
Set<Class> fixtureClasses = new
LinkedHashSet<Class>(getFixtureClasses());
- if (CollectionUtils.isEmpty(fixtureClasses)) {
+ if (fixtureClasses.isEmpty()) {
log.info("Skipping initial data population (no models)");
return;
}

- Map<Class, Object[]> fixtures =
FixtureHelper.loadFixturesFromResource("initialData/",
+ Map<Class, List> fixtures =
YamlFixtureHelper.loadFixturesFromResource("initialData/",
fixtureClasses);
log.info("Populating initial data for models...");
- String className = "";
-
+
SessionFactory sessionFactory =
(SessionFactory)ctx.getBean("sessionFactory");
Session session = sessionFactory.openSession();
session.beginTransaction();
@@ -76,33 +76,35 @@

try{
for (Class clazz : fixtures.keySet()) {
- className = clazz.getName();
- if (ArrayUtils.isEmpty(fixtures.get(clazz))) {
- log.warn("Population of " +
FixtureHelper.getModelName(clazz)
- + " skipped (empty fixture file?)");
+ List modelFixtures = fixtures.get(clazz);
+ if (modelFixtures.isEmpty()) {
+ log.warn("No data for {}, did you created the fixture
file?",
+ YamlFixtureHelper.getModelName(clazz));
continue;
}
- populateTableForModel(clazz, fixtures.get(clazz));
+ populateTableForModel(clazz, modelFixtures);
}
fixtures.clear();
log.info("Populating initial data for models done!");
session.getTransaction().commit();
- if(session.isOpen()) session.close();
- }catch(Exception e){
- log.error(e);
- log.error("Error while populating initial data for models " +
e.getMessage(), e);
+ if (session.isOpen()) {
+ session.close();
+ }
+ } catch (Exception e) {
+ log.error("Error while populating initial data for models {}",
e.getMessage(), e);
log.debug("Rolling back the populating database transaction");
session.getTransaction().rollback();
- }finally{
- try{
- if(session.isOpen()){
+ } finally {
+ try {
+ if (session.isOpen()) {
session.close();
}
- }catch(Exception e){/*do nothing*/}
+ } catch (Exception e) {
+ /*do nothing*/
+ }

TransactionSynchronizationManager.unbindResource(sessionFactory);
TransactionSynchronizationManager.clearSynchronization();
}
-
}

private List<Class> getFixtureClasses() {
@@ -111,29 +113,35 @@
try {
clazzToPopulate.addAll(plugin.getFixtureClasses());
} catch (Exception e) {
- log.error("Impossibile reperire i nomi delle fixtures da
caricare per il plugin " + plugin.getName());
+ log.error("Impossibile reperire i nomi delle fixtures da
caricare per il plugin {}", plugin.getName());
}
}
return clazzToPopulate;
}

- private void populateTableForModel(Class clazz, Object[] fixtures) {
- String fixtureName = FixtureHelper.getModelName(clazz);
+ private void populateTableForModel(final Class model, final List
fixtures) {
+ String fixtureName = YamlFixtureHelper.getModelName(model);
DaoProvider daos = (DaoProvider)ctx.getBean(DAO_PROVIDER_ID);
- GenericDaoBase dao = (GenericDaoBase)daos.getDao(clazz);
- if (dao != null) {
- int count = dao.findAll().size();
- if (count == 0) {
- log.info("Populating " + fixtureName + " with " +
fixtures.length + " items...");
- FixtureHelper.populateDbForModel(clazz, fixtures, dao);
- log.info("Population of " + fixtureName + " done!");
- } else {
- log.info("Population of " + fixtureName + " skipped
(already populated)");
+ GenericDaoBase dao = (GenericDaoBase)daos.getDao(model);
+ if (dao == null) {
+ log.info("Dao not found for {} and po {}",fixtureName,
YamlFixtureHelper.getModelName(model));
+ return;
+ }
+ if (dao.count() == 0) {
+ log.info("Populating {} with {} items...", fixtureName,
fixtures.size());
+ final HibernateTemplate template =
((GenericDaoHibernateSupport) dao).getHibernateTemplate();
+ try {
+ for (Object entity : fixtures) {
+ template.saveOrUpdate(entity);
+ }
+ template.flush();
+ template.clear();
+ } catch (Exception e) {
+ log.error("Error populating rows in {} table",
YamlFixtureHelper.getModelName(model), e);
}
- }
- else {
- log.info("Dao not found for " + fixtureName + " and po " +
clazz.getName());
+ log.info("Population of {} done!", fixtureName);
+ } else {
+ log.info("Population of {} skipped (already populated)",
fixtureName);
}
}
-
}
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/plugin/PluginHelper.java
Thu Apr 26 07:55:31 2012
+++ /parancoe-web/src/main/java/org/parancoe/web/plugin/PluginHelper.java
Wed Feb 27 08:46:53 2013
@@ -30,16 +30,14 @@
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;

-import org.apache.log4j.Logger;
import org.parancoe.util.Constants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.core.io.Resource;
import org.springframework.web.context.ContextLoaderListener;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
-import org.springframework.web.servlet.ViewResolver;

/**
* Questa classe è solo un helper non è configurato in spring
@@ -50,7 +48,7 @@
public class PluginHelper {

private ApplicationContext ctx;
- private Logger log = Logger.getLogger(PluginHelper.class);
+ private Logger log = LoggerFactory.getLogger(PluginHelper.class);

public PluginHelper(ApplicationContext ctx) {
this.ctx = ctx;
=======================================
---
/parancoe-web/src/main/java/org/parancoe/web/plugin/PluginInterceptor.java
Sat Sep 4 02:41:52 2010
+++
/parancoe-web/src/main/java/org/parancoe/web/plugin/PluginInterceptor.java
Wed Feb 27 08:46:53 2013
@@ -20,7 +20,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
@@ -31,38 +32,42 @@
* Questa classe fa da proxy per tutti gli interceptor configurati nei
plugins.
* Parancoe chiama questo interceptor che poi fa il dispatch a tutti gli
* interceptor dei plugin.
- *
+ *
* @author paolo...@seesaw.it
* @author Jacopo Murador <jacopo.murador at seesaw.it>
*/
public class PluginInterceptor implements HandlerInterceptor,
ApplicationContextAware {
private ApplicationContext ctx;

- private static final Logger logger =
Logger.getLogger(PluginInterceptor.class);
+ private static final Logger logger =
LoggerFactory.getLogger(PluginInterceptor.class);

public PluginInterceptor() {
logger.info("PluginInterceptor set up");
}

+ @Override
public boolean preHandle(HttpServletRequest req, HttpServletResponse
res, Object handler)
throws Exception {
logger.debug("PluginInterceptor.preHandle()");
return new PluginHelper(ctx).invokePluginPreHandle(req, res,
handler);
}

+ @Override
public void postHandle(HttpServletRequest request, HttpServletResponse
response, Object handler,
ModelAndView modelAndView) throws Exception {
new PluginHelper(ctx).invokePluginPostHandle(request, response,
handler, modelAndView);
}

+ @Override
public void afterCompletion(HttpServletRequest request,
HttpServletResponse response, Object handler,
Exception exception) throws Exception {
new PluginHelper(ctx).invokeAfterCompletion(request, response,
handler, exception); // To
}

+ @Override
public void setApplicationContext(ApplicationContext
applicationContext) throws BeansException {
ctx = applicationContext;
}
-
-
+
+
}
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/tag/FlashTag.java Mon Jun
11 08:49:50 2012
+++ /parancoe-web/src/main/java/org/parancoe/web/tag/FlashTag.java Wed Feb
27 08:46:53 2013
@@ -58,13 +58,13 @@
// And clean the session
flashSession.remove(type);
}
- if (flash != null && flash.get(type) != null) {
+ if (flash.get(type) != null) {
// Resolve the message.
MessageSource messageSource = getMessageSource();
if (messageSource == null) {
throw new JspTagException("No corresponding
MessageSource found");
}
- String msg = "";
+ String msg;
try {
Object[] argumentsArray = {};
msg = messageSource.getMessage(flash.get(type),
argumentsArray,
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/test/BaseTest.java Wed Sep
26 06:28:00 2012
+++ /parancoe-web/src/main/java/org/parancoe/web/test/BaseTest.java Wed Feb
27 08:46:53 2013
@@ -19,7 +19,6 @@

import java.io.File;
import java.io.IOException;
-import org.apache.log4j.Logger;
import org.lambico.test.spring.hibernate.DBTest;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.io.FileSystemResourceLoader;
@@ -35,7 +34,6 @@
*/
public abstract class BaseTest extends DBTest {

- private static final Logger log = Logger.getLogger(BaseTest.class);
// @Autowired
// protected BaseConf conf;

@@ -62,8 +60,7 @@
}

@Override
- protected ConfigurableApplicationContext createApplicationContext(
- String[] locations) {
+ protected ConfigurableApplicationContext
createApplicationContext(String[] locations) {
FileSystemResourceLoader rl = new FileSystemResourceLoader();
MockServletContext servletContext = new MockServletContext(rl);
servletContext.setMinorVersion(4);
@@ -86,5 +83,5 @@
}
return sb.toString();
}
-
+
}
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/test/PluginTest.java Sat
Sep 4 02:41:52 2010
+++ /parancoe-web/src/main/java/org/parancoe/web/test/PluginTest.java Wed
Feb 27 08:46:53 2013
@@ -20,7 +20,6 @@

import javax.annotation.Resource;
import javax.servlet.ServletContext;
-import org.apache.log4j.Logger;
import javax.sql.DataSource;
import org.lambico.test.spring.hibernate.DBTest;
import org.springframework.context.ConfigurableApplicationContext;
@@ -36,11 +35,9 @@
*/
public abstract class PluginTest extends DBTest {

- private static final Logger log = Logger.getLogger(PluginTest.class);
-
@Resource
protected DataSource dataSource;
-
+
@Override
protected String[] getConfigLocations() {
return new String[] {
@@ -51,10 +48,9 @@
"classpath*:parancoe-plugin.xml",
"classpath*:applicationContext-plugin.xml"};
}
-
+
@Override
- protected ConfigurableApplicationContext createApplicationContext(
- String[] locations) {
+ protected ConfigurableApplicationContext
createApplicationContext(String[] locations) {
FileSystemResourceLoader rl = new FileSystemResourceLoader();
ServletContext servletContext = new MockServletContext(rl);
XmlWebApplicationContext context = new XmlWebApplicationContext();
@@ -63,5 +59,5 @@
context.refresh();
return context;
}
-
+
}
=======================================
---
/parancoe-web/src/main/java/org/parancoe/web/xml/ControllerBeanDefinitionParser.java
Sat Sep 4 02:41:52 2010
+++
/parancoe-web/src/main/java/org/parancoe/web/xml/ControllerBeanDefinitionParser.java
Wed Feb 27 08:46:53 2013
@@ -20,7 +20,8 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
@@ -34,13 +35,13 @@

/**
* A parser to load all the controllers defined in 'basePackage'.
- *
+ *
* @author <mailto:andrea...@jugpadova.it/>
* @version $Revision$
*/
public class ControllerBeanDefinitionParser implements
BeanDefinitionParser {
-
- private static final Logger logger =
Logger.getLogger(ControllerBeanDefinitionParser.class);
+
+ private static final Logger logger =
LoggerFactory.getLogger(ControllerBeanDefinitionParser.class);

private BeanDefinitionParserDelegate delegate;
private ResourcePatternResolver resourceLoader;
@@ -51,21 +52,22 @@
* The package from which this parser loads controllers
*/
public static final String BASE_PACKAGE_ATTRIBUTE = "basePackage";
-
+
/**
* The parent used to define controllers found
*/
- public static final String PARENT_ATTRIBUTE = "parent";
-
+ public static final String PARENT_ATTRIBUTE = "parent";
+

/**
- * Register controllers found in <code>basePackage</code> attribute
giving them
+ * Register controllers found in <code>basePackage</code> attribute
giving them
* <code>parent</code> as parent.
*
- * @param element
- * @param parserContext
- * @return
+ * @param element
+ * @param parserContext
+ * @return
*/
+ @Override
public BeanDefinition parse(Element element, ParserContext
parserContext) {
String packageName = element.getAttribute(BASE_PACKAGE_ATTRIBUTE);
String parentName = element.getAttribute(PARENT_ATTRIBUTE);
@@ -128,6 +130,6 @@
}
//logger.info("registering bean definition: " +
rootBuilder.getBeanDefinition().toString());
registry.registerBeanDefinition(id,
rootBuilder.getBeanDefinition());
-
+
}
}
=======================================
---
/parancoe-web/src/test/java/org/parancoe/web/test/controller/ForTestController.java
Mon Feb 28 22:01:33 2011
+++
/parancoe-web/src/test/java/org/parancoe/web/test/controller/ForTestController.java
Wed Feb 27 08:46:53 2013
@@ -34,7 +34,6 @@


import javax.validation.Valid;
-import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
@@ -50,8 +49,6 @@
@SessionAttributes("something")
public class ForTestController {

- private static final Logger logger =
Logger.getLogger(ForTestController.class);
-
@RequestMapping(method = RequestMethod.GET)
public String form(@RequestParam("value") String value,
Model model) {
=======================================
--- /pom.xml Wed Feb 27 07:39:32 2013
+++ /pom.xml Wed Feb 27 08:46:53 2013
@@ -18,8 +18,12 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<main.basedir>${basedir}</main.basedir>
<year>2006-2010</year>
+ <parancoe.lambico.version>1.0-SNAPSHOT</parancoe.lambico.version>
<parancoe.spring.version>3.0.7.RELEASE</parancoe.spring.version>
-
<parancoe.hibernate.version>3.6.2.Final</parancoe.hibernate.version>
+
<parancoe.hibernate.version>3.6.7.Final</parancoe.hibernate.version>
+ <parancoe.slf4j.version>1.7.2</parancoe.slf4j.version>
+ <parancoe.junit4.version>4.11</parancoe.junit4.version>
+ <parancoe.hsqldb.version>2.2.9</parancoe.hsqldb.version>

<!-- NetBeans IDE properties -->

<org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
@@ -59,17 +63,22 @@
<dependency>
<groupId>org.lambico</groupId>
<artifactId>lambico-spring-hibernate</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>${parancoe.lambico.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.lambico</groupId>
+ <artifactId>lambico-pump</artifactId>
+ <version>${parancoe.lambico.version}</version>
</dependency>
<dependency>
<groupId>org.lambico</groupId>
<artifactId>lambico-test</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>${parancoe.lambico.version}</version>
</dependency>
<dependency>
- <groupId>hsqldb</groupId>
+ <groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
- <version>1.8.0.10</version>
+ <version>${parancoe.hsqldb.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
@@ -92,9 +101,49 @@
<version>4.1.0.Final</version>
</dependency>
<dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
- <version>2.4</version>
+ <version>2.6</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ <version>1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>1.2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ <version>1.9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${parancoe.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${parancoe.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${parancoe.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${parancoe.junit4.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
@@ -103,7 +152,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
+ <version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
@@ -113,7 +162,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.10</version>
+ <version>2.13</version>
<configuration>
<skip>false</skip>
<useFile>false</useFile>
@@ -129,7 +178,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
- <version>2.5</version>
+ <version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
@@ -137,7 +186,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
- <version>2.2.1</version>
+ <version>2.4</version>
<configuration>
<descriptors>
<descriptor>src/assembly/bin.xml</descriptor>
@@ -209,15 +258,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>
@@ -301,7 +341,7 @@
</mailingLists>
<developers>
<developer>
- <id>agente_volpe</id>
+ <id>michele</id>
<name>Michele Franzin</name>
<email>michele...@jugpadova.it</email>
<url>http://www.jugpadova.it</url>
@@ -311,8 +351,6 @@
<role>developer</role>
</roles>
<timezone>+1</timezone>
- <properties>
- </properties>
</developer>
<developer>
<id>benfante</id>

==============================================================================
Revision: 972125a93e5f
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 10:37:34 2013
Log: jump to lambico v1.1
http://code.google.com/p/parancoe/source/detail?r=972125a93e5f

Modified:
/pom.xml

=======================================
--- /pom.xml Wed Feb 27 08:46:53 2013
+++ /pom.xml Wed Feb 27 10:37:34 2013
@@ -18,7 +18,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<main.basedir>${basedir}</main.basedir>
<year>2006-2010</year>
- <parancoe.lambico.version>1.0-SNAPSHOT</parancoe.lambico.version>
+ <parancoe.lambico.version>1.1-SNAPSHOT</parancoe.lambico.version>
<parancoe.spring.version>3.0.7.RELEASE</parancoe.spring.version>

<parancoe.hibernate.version>3.6.7.Final</parancoe.hibernate.version>
<parancoe.slf4j.version>1.7.2</parancoe.slf4j.version>

==============================================================================
Revision: 5b9133f2b470
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Fri Feb 22 04:36:16 2013
Log: remove parancoe-core duplicated tests (already present in lambico)
http://code.google.com/p/parancoe/source/detail?r=5b9133f2b470

Added:
/parancoe-core/src/test/java/org/parancoe/core/BaseTest.java
/parancoe-core/src/test/java/org/parancoe/core/SanityTest.java
/parancoe-core/src/test/java/org/parancoe/util/TestConf.java
/parancoe-core/src/test/java/org/parancoe/util/UtilsTest.java
Deleted:
/parancoe-core/src/test/java/org/parancoe/persistence/dao/TestDaos.java

/parancoe-core/src/test/java/org/parancoe/persistence/dao/generic/EntityTCDao.java

/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/EntityTC.java
/parancoe-core/src/test/java/org/parancoe/persistence/util/BaseTest.java
/parancoe-core/src/test/java/org/parancoe/persistence/util/DemoBean.java
/parancoe-core/src/test/java/org/parancoe/persistence/util/UtilsTest.java
/parancoe-core/src/test/java/org/parancoe/test/ManyToManyFixturesTest.java
/parancoe-core/src/test/resources/beanRefFactory_test.xml
/parancoe-core/src/test/resources/fixtures.jar
/parancoe-core/src/test/resources/fixtures/CachedEntityTC.yml
/parancoe-core/src/test/resources/fixtures/DemoBean.yml
/parancoe-core/src/test/resources/fixtures/EntityTC.yml
/parancoe-core/src/test/resources/fixtures/String.yml
Modified:
/parancoe-core/src/main/java/org/parancoe/util/Utils.java
/parancoe-core/src/test/resources/applicationContext_test.xml

=======================================
--- /dev/null
+++ /parancoe-core/src/test/java/org/parancoe/core/BaseTest.java Fri Feb 22
04:36:16 2013
@@ -0,0 +1,35 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Core.
+ *
+ * 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 org.parancoe.core;
+
+import org.lambico.test.spring.hibernate.DBTest;
+import org.parancoe.persistence.po.hibernate.AuthorTC;
+import org.parancoe.persistence.po.hibernate.BookTC;
+
+/**
+ * A base class for Parancoe-core tests.
+ *
+ * @author lucio
+ */
+public abstract class BaseTest extends DBTest {
+
+ @Override
+ public Class[] getFixtureClasses() {
+ return new Class[]{BookTC.class, AuthorTC.class};
+ }
+}
=======================================
--- /dev/null
+++ /parancoe-core/src/test/java/org/parancoe/core/SanityTest.java Fri Feb
22 04:36:16 2013
@@ -0,0 +1,41 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Core.
+ *
+ * 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 org.parancoe.core;
+
+import javax.annotation.Resource;
+import org.parancoe.util.BaseConf;
+
+public class SanityTest extends BaseTest {
+
+ @Resource
+ private BaseConf developmentConfiguration;
+
+ public void testSanity() {
+ assertNotNull(developmentConfiguration);
+ }
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{
+ "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
+ "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
+ "classpath:org/parancoe/core/applicationContextBase.xml",
+ "classpath:applicationContext_test.xml"
+ };
+ }
+}
=======================================
--- /dev/null
+++ /parancoe-core/src/test/java/org/parancoe/util/TestConf.java Fri Feb 22
04:36:16 2013
@@ -0,0 +1,25 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Core.
+ *
+ * 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 org.parancoe.util;
+
+/**
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+public class TestConf extends BaseConf {
+}
=======================================
--- /dev/null
+++ /parancoe-core/src/test/java/org/parancoe/util/UtilsTest.java Fri Feb
22 04:36:16 2013
@@ -0,0 +1,64 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Core.
+ *
+ * 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 org.parancoe.util;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.parancoe.util.Utils;
+
+public class UtilsTest extends TestCase {
+
+ public void testConvertToNameValueList() {
+ Map<String, String> input = new HashMap<String, String>();
+ input.put("A", "B");
+ input.put("C", "D");
+ input.put("E", "F");
+ List<String> expected = new ArrayList<String>();
+ // changed add order in the list
+ expected.add("E=F");
+ expected.add("A=B");
+ expected.add("C=D");
+
+
assertTrue(expected.containsAll(Utils.convertToNameValueList(input)));
+ }
+
+ public void testBinaryStripUTF8preamble() {
+ byte[] stringWithPreamble =
Utils.loadBinary("testdata/UTF8WithPreamble.txt");
+ byte[] stringWithoutPreamble =
Utils.loadBinary("testdata/UTF8WithoutPreamble.txt");
+
+ assertTrue(Utils.hasUTF8preamble(stringWithPreamble));
+ assertFalse(Utils.hasUTF8preamble(stringWithoutPreamble));
+
+ byte[] stripped = Utils.stripUTF8preamble(stringWithPreamble);
+ assertFalse(Utils.hasUTF8preamble(stripped));
+ assertEquals(stringWithPreamble.length, stripped.length + 3);
+ }
+
+ public void testStringStripUTF8preamble() throws Exception {
+ String stringWithPreamble =
Utils.loadString("testdata/UTF8WithPreamble.txt");
+ String stringWithoutPreamble =
Utils.loadString("testdata/UTF8WithoutPreamble.txt");
+
+ assertFalse(Utils.hasUTF8preamble(stringWithPreamble));
+ assertFalse(Utils.hasUTF8preamble(stringWithoutPreamble));
+ }
+}
=======================================
--- /parancoe-core/src/test/java/org/parancoe/persistence/dao/TestDaos.java
Sat Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.persistence.dao;
-
-import org.lambico.dao.DaoProvider;
-import org.parancoe.persistence.dao.generic.EntityTCDao;
-
-/**
- * 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>.
- *
- * @author <a href="mailto:lucio.b...@jugpadova.it">Lucio Benfante</a>
- * @author Federico Russo <chicc...@gmail.com>
- * @version $Revision$
- */
-public interface TestDaos extends DaoProvider {
-
- public EntityTCDao getEntityTCDao();
-
-}
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/dao/generic/EntityTCDao.java
Sat Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.persistence.dao.generic;
-
-import java.util.List;
-import org.lambico.dao.generic.Compare;
-import org.lambico.dao.generic.CompareType;
-import org.lambico.dao.generic.Dao;
-import org.lambico.dao.generic.FirstResult;
-import org.lambico.dao.generic.GenericDao;
-import org.lambico.dao.generic.MaxResults;
-
-import org.parancoe.persistence.po.hibernate.EntityTC;
-
-/**
- * A DAO to be used for the tests of the generic DAO.
- *
- * @author <a href="mailto:lu...@benfante.com">Lucio Benfante</a>
- * @version $Revision$
- */
-@Dao(entity=EntityTC.class)
-public interface EntityTCDao extends GenericDao<EntityTC, Long> {
- List<EntityTC> findByFieldOne(String value);
- List<EntityTC> findByFieldTwo(String value);
- List<EntityTC> findByFieldThree(@Compare(CompareType.ILIKE) String
value);
- List<EntityTC> findByFieldOneAndFieldTwo(String one, String two);
- List<EntityTC> findByOrderByFieldOne();
- List<EntityTC> findByOrderByFieldTwo();
- List<EntityTC> findByOrderByFieldOneAndFieldTwo();
- EntityTC findByFieldOneOrderByFieldTwo(String one);
- List<EntityTC> findByOrderByFieldOne(@FirstResult int firstResult,
@MaxResults int maxResults);
- List<EntityTC> searchAllOrderByFieldOne(@FirstResult int firstResult,
@MaxResults int maxResults);
- Long countByFieldOne(String value);
- Long maxByFieldOne(String value);
-}
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/EntityTC.java
Sat Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.persistence.po.hibernate;
-
-import javax.persistence.Entity;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import org.lambico.po.hibernate.EntityBase;
-
-/**
- * An persistent object to be used for the tests of the generic DAO.
- *
- * @author <a href="mailto:lu...@benfante.com">Lucio Benfante</a>
- * @version $Revision$
- */
-@Entity()
-@NamedQueries({
-@NamedQuery(name="EntityTC.findByFieldOne", query="from EntityTC where
fieldOne = ?"),
-@NamedQuery(name="EntityTC.searchAllOrderByFieldOne", query="from EntityTC
order by fieldOne"),
-@NamedQuery(name="EntityTC.countByFieldOne", query="select count(etc) from
EntityTC etc where etc.fieldOne = ?"),
-@NamedQuery(name="EntityTC.maxByFieldOne", query="select
max(etc.numericField) from EntityTC etc where etc.fieldOne = ?")})
-public class EntityTC extends EntityBase {
- private String fieldOne;
- private String fieldTwo;
- private String fieldThree;
- private Long numericField;
-
- /**
- * Creates a new instance of EntityTC
- */
- public EntityTC() {
- }
-
- public String getFieldOne() {
- return fieldOne;
- }
-
- public void setFieldOne(String fieldOne) {
- this.fieldOne = fieldOne;
- }
-
- public String getFieldTwo() {
- return fieldTwo;
- }
-
- public void setFieldTwo(String fieldTwo) {
- this.fieldTwo = fieldTwo;
- }
-
- public String getFieldThree() {
- return fieldThree;
- }
-
- public void setFieldThree(String fieldThree) {
- this.fieldThree = fieldThree;
- }
-
- public Long getNumericField() {
- return numericField;
- }
-
- public void setNumericField(Long numericField) {
- this.numericField = numericField;
- }
-
-}
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/util/BaseTest.java
Wed Feb 27 08:46:53 2013
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.persistence.util;
-
-import org.lambico.test.spring.hibernate.DBTest;
-import org.parancoe.persistence.po.hibernate.AuthorTC;
-import org.parancoe.persistence.po.hibernate.BookTC;
-import org.parancoe.persistence.po.hibernate.EntityTC;
-
-/**
- * A base class for Parancoe-core tests.
- *
- * @author lucio
- */
-public abstract class BaseTest extends DBTest {
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{EntityTC.class, BookTC.class, AuthorTC.class};
- }
-}
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/util/DemoBean.java
Sat Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.persistence.util;
-
-public class DemoBean {
- public String nome;
-
- private Long id;
-
- public DemoBean() {
- super();
- }
-
- public DemoBean(String nome, Long id) {
- this.nome = nome;
- this.id = id;
- }
-
- public Long getId() {
- return id;
- }
-
- public void setId(Long value) {
- this.id = value;
- }
-
- @Override
- public String toString() {
- return "nome=" + nome + ", id=" + id;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if ((obj == null) || (obj.getClass() != this.getClass()))
- return false;
- // object must be DemoBean at this point
- DemoBean test = (DemoBean) obj;
- return (id == test.getId() || (id != null && id.equals(test.id)))
- && (nome == test.nome || (nome != null &&
nome.equals(test.nome)));
- }
-
- @Override
- public int hashCode() {
- int hash = 0;
- if (id != null) {
- hash += id.hashCode();
- }
- if (nome != null) {
- hash += nome.hashCode();
- }
- return hash == 0 ? super.hashCode() : hash;
- }
-}
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/util/UtilsTest.java
Sat Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.persistence.util;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.parancoe.util.Utils;
-
-public class UtilsTest extends TestCase {
-
- public void testConvertToNameValueList() {
- Map<String, String> input = new HashMap<String, String>();
- input.put("A", "B");
- input.put("C", "D");
- input.put("E", "F");
- List<String> expected = new ArrayList<String>();
- // changed add order in the list
- expected.add("E=F");
- expected.add("A=B");
- expected.add("C=D");
-
-
assertTrue(expected.containsAll(Utils.convertToNameValueList(input)));
- }
-
- public void testBinaryStripUTF8preamble() {
- byte[] stringWithPreamble =
Utils.loadBinary("testdata/UTF8WithPreamble.txt");
- byte[] stringWithoutPreamble =
Utils.loadBinary("testdata/UTF8WithoutPreamble.txt");
-
- assertTrue(Utils.hasUTF8preamble(stringWithPreamble));
- assertFalse(Utils.hasUTF8preamble(stringWithoutPreamble));
-
- byte[] stripped = Utils.stripUTF8preamble(stringWithPreamble);
- assertFalse(Utils.hasUTF8preamble(stripped));
- assertEquals(stringWithPreamble.length, stripped.length + 3);
- }
-
- public void testStringStripUTF8preamble() throws Exception {
- String stringWithPreamble =
Utils.loadString("testdata/UTF8WithPreamble.txt");
- String stringWithoutPreamble =
Utils.loadString("testdata/UTF8WithoutPreamble.txt");
-
- assertFalse(Utils.hasUTF8preamble(stringWithPreamble));
- assertFalse(Utils.hasUTF8preamble(stringWithoutPreamble));
- }
-}
=======================================
---
/parancoe-core/src/test/java/org/parancoe/test/ManyToManyFixturesTest.java
Wed Feb 27 08:46:53 2013
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.Resource;
-import org.parancoe.persistence.po.hibernate.AuthorTC;
-import org.parancoe.persistence.po.hibernate.AuthorTCDao;
-import org.parancoe.persistence.po.hibernate.BookTC;
-import org.parancoe.persistence.po.hibernate.BookTCDao;
-import org.parancoe.persistence.util.BaseTest;
-
-/**
- * Tests fixture load with M:N relationships
- *
- * @author michele franzin <michele at franzin.net>
- * @author Jacopo Murador <jacopo.murador at seesaw.it>
- * @version $Revision$
- */
-public class ManyToManyFixturesTest extends BaseTest {
-
- @Resource
- protected AuthorTCDao authorTCDao = null;
-
- @Resource
- protected BookTCDao bookTCDao = null;
-
-
- public void testDaoExists() {
- assertNotNull("Author dao variable not setted", authorTCDao);
- assertNotNull("Book dao variable not setted", bookTCDao);
- }
-
- // FIXME fails in call with other ones
- public void _testAllSize() {
- assertSize(4, authorTCDao.findAll());
- assertSize(3, bookTCDao.findAll());
- }
-
- // FIXME fails in call with other ones
- public void _testFixturesLoad() {
- List<AuthorTC> authors = authorTCDao.findByName("joe");
- assertSize(1, authors);
- assertSize(2, authors.get(0).getBooks());
- List<BookTC> books = bookTCDao.findByTitle("Java manual");
- assertSize(1, books);
- assertSize(3, books.get(0).getAuthors());
- books = bookTCDao.findByTitle("Mr. Bean");
- assertSize(1, books);
- assertSize(2, books.get(0).getAuthors());
- }
-
- // FIXME fails in call with other ones
- public void _testRelationSanity() {
- BookTC book1 = new BookTC();
- book1.setTitle("title1");
- bookTCDao.store(book1);
- BookTC book2 = new BookTC();
- book2.setTitle("title2");
- bookTCDao.store(book2);
-
- AuthorTC author1 = new AuthorTC();
- author1.setName("name1");
- List<BookTC> bookList = new ArrayList<BookTC>();
- bookList.add(book1);
- bookList.add(book2);
- author1.setBooks(bookList);
- authorTCDao.store(author1);
-
- AuthorTC author2 = new AuthorTC();
- author2.setName("name2");
- bookList.clear();
- bookList.add(book2);
- author2.setBooks(bookList);
- authorTCDao.store(author2);
-
- authorTCDao.deleteAll();
- bookTCDao.deleteAll();
-
- List<AuthorTC> authors = authorTCDao.findByName("name1");
- assertSize(1, authors);
- assertSize(2, authors.get(0).getBooks());
- List<BookTC> books = bookTCDao.findByTitle("title2");
- assertSize(1, books);
- assertSize(2, books.get(0).getAuthors());
-
- authorTCDao.deleteAll();
- bookTCDao.deleteAll();
- }
-}
=======================================
--- /parancoe-core/src/test/resources/beanRefFactory_test.xml Sat Sep 4
02:41:52 2010
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
-
- Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
-
- This file is part of Parancoe Core.
-
- 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.
-
--->
-
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD
BEAN//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
-<beans>
- <bean id="org.parancoe.persistence"
-
class="org.springframework.context.support.ClassPathXmlApplicationContext">
- <constructor-arg>
- <list>
-
<value>org/parancoe/persistence/dao/generic/genericDao.xml</value>
-
<value>org/parancoe/persistence/applicationContextBase.xml</value>
- <value>applicationContext_test.xml</value>
- </list>
- </constructor-arg>
- </bean>
-</beans>
=======================================
--- /parancoe-core/src/test/resources/fixtures.jar Sat Jun 23 06:52:59 2007
+++ /dev/null
@@ -1,14 +0,0 @@
-PK ReÂ6vF7Ü— þ
- DemoBean.yaml] ± ‚0 Ew’þÃ
-&n
- E`Æop&´J ZBkü
-GMœÜœß YHlÀ7½÷rν X hÓË
-ñY ÖÁh OO%*dûܯžÙà¨
-Ò Ü”ë`‡¦•–E ¶Bö& 3š9£ö7Ò Šò—pòª¹:4ºíÌèíE5ÝéAOzÑ›>ANÊBîBK¶Àëé^qYà8Âü |
ep } PK
- ` J3 META-INF/PK
- 8ŒÂ63É ßZ Z META-INF/MANIFEST.MFManifest-Version: 1.0
-Created-By: 1.6.0_01-b06 (Sun Microsystems Inc.)
-Built-By: MichelePK ReÂ6vF7Ü— þ
- DemoBean.yamlPK
- ` J3 íAÂ META-INF/PK
- 8ŒÂ63É ßZ Z
é META-INF/MANIFEST.MFPK ´ u
=======================================
--- /parancoe-core/src/test/resources/fixtures/CachedEntityTC.yml Sat Sep
4 02:41:52 2010
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
-#
-# This file is part of Parancoe Core.
-#
-# 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.
-#
-
--
- fieldOne: "one1"
- fieldTwo: "two5"
- fieldThree: "Three1"
- numericField: 1
--
- fieldOne: "one2"
- fieldTwo: "two4"
- fieldThree: "Three2"
- numericField: 2
--
- fieldOne: "one3"
- fieldTwo: "two3"
- fieldThree: "Three3"
- numericField: 3
--
- fieldOne: "one4"
- fieldTwo: "two2"
- fieldThree: "Three4"
- numericField: 4
--
- fieldOne: "one3"
- fieldTwo: "two1"
- fieldThree: "7hree5"
- numericField: 5
-
=======================================
--- /parancoe-core/src/test/resources/fixtures/DemoBean.yml Sat Sep 4
02:41:52 2010
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
-#
-# This file is part of Parancoe Core.
-#
-# 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.
-#
-
--
- nome: "first one"
- id: 356
-
-# Ending with spaces
-- &demo1
- nome: "Demo 1"
- id: 6789
-
-# Without anchor
--
- nome: "àèéìòù"
- id: -980000
-
-- &demo3
- nome: "Demo3"
- id: 98000
-
-- &demo2
- nome: "Demo#2"
- id: -9800
=======================================
--- /parancoe-core/src/test/resources/fixtures/EntityTC.yml Sat Sep 4
02:41:52 2010
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
-#
-# This file is part of Parancoe Core.
-#
-# 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.
-#
-
--
- fieldOne: "one1"
- fieldTwo: "two5"
- fieldThree: "Three1"
- numericField: 1
--
- fieldOne: "one2"
- fieldTwo: "two4"
- fieldThree: "Three2"
- numericField: 2
--
- fieldOne: "one3"
- fieldTwo: "two3"
- fieldThree: "Three3"
- numericField: 3
--
- fieldOne: "one4"
- fieldTwo: "two2"
- fieldThree: "Three4"
- numericField: 4
--
- fieldOne: "one3"
- fieldTwo: "two1"
- fieldThree: "7hree5"
- numericField: 5
=======================================
--- /parancoe-core/src/test/resources/fixtures/String.yml Sat Sep 4
02:41:52 2010
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
-#
-# This file is part of Parancoe Core.
-#
-# 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.
-#
-
--
- Questo è un file UTF8 con preambolo
--
- òàùèì
=======================================
--- /parancoe-core/src/main/java/org/parancoe/util/Utils.java Wed Feb 27
08:46:53 2013
+++ /parancoe-core/src/main/java/org/parancoe/util/Utils.java Fri Feb 22
04:36:16 2013
@@ -36,6 +36,7 @@
* @author Paolo Dona paolo...@seesaw.it
* @author michele franzin <michele at franzin.net>
* @author Andrea Nasato <mailto:andrea...@jugpadova.it/>
+ * @deprecated please use apache commons
*/
@Deprecated
public class Utils {
=======================================
--- /parancoe-core/src/test/resources/applicationContext_test.xml Sat Sep
4 02:41:52 2010
+++ /parancoe-core/src/test/resources/applicationContext_test.xml Fri Feb
22 04:36:16 2013
@@ -59,15 +59,7 @@
<!-- Authomatic DAO definition from persistent classes -->
<lambico:define-daos baseInterfacePackage="org.parancoe.persistence" />

- <bean id="daos" parent="abstractDaoProvider">
- <property name="proxyInterfaces">
- <value>org.parancoe.persistence.dao.TestDaos</value>
- </property>
- <property name="target">
- <bean parent="genericDaoProvider"/>
- </property>
- </bean>
+ <bean class="org.parancoe.util.TestConf" parent="abstractConf" />

<bean id="daoExceptionManager"
class="org.lambico.dao.BypassingExceptionManager"/>
-
</beans>

==============================================================================
Revision: 4441c542ce4b
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Sun Feb 24 06:37:07 2013
Log: EXAMPLES - refresh jar versions, ease dependencies & poms, move
log4j to slf4j where possible, minor code cleanups
http://code.google.com/p/parancoe/source/detail?r=4441c542ce4b

Added:
/examples/basicWebApp/src/test/resources/log4j.properties
Deleted:
/examples/basicPersistence/src/main/resources/log4j.properties
/examples/basicPersistence/src/test/resources/log4j.properties
Modified:
/examples/basicPersistence/pom.xml
/examples/basicPersistence/src/test/resources/fixtures/Person.yml
/examples/basicWebApp/pom.xml

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/AdminController.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/HomeController.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/ItalyController.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/PeopleController.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/PeopleEditController.java
/examples/basicWebApp/src/main/webapp/WEB-INF/applicationContext.xml
/examples/basicWebApp/src/main/webapp/WEB-INF/database.xml
/examples/basicWebApp/src/main/webapp/WEB-INF/parancoe-servlet.xml
/examples/basicWebApp/src/test/resources/fixtures/Person.yml
/examples/basicWebApp/src/test/resources/spring-test.xml
/examples/basicWebAppEvolution/pom.xml

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/AdminController.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/HomeController.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/ItalyController.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/PersonController.java
/examples/basicWebAppEvolution/src/test/resources/fixtures/Person.yml

=======================================
--- /dev/null
+++ /examples/basicWebApp/src/test/resources/log4j.properties Sun Feb 24
06:37:07 2013
@@ -0,0 +1,34 @@
+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
=======================================
--- /examples/basicPersistence/src/main/resources/log4j.properties Thu Dec
13 01:46:21 2007
+++ /dev/null
@@ -1,8 +0,0 @@
-log4j.rootLogger=INFO, A1
-log4j.appender.A1=org.apache.log4j.ConsoleAppender
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-
-# Print the date in ISO 8601 format
-log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
-
-log4j.logger.org.parancoe=INFO
=======================================
--- /examples/basicPersistence/src/test/resources/log4j.properties Tue Jul
1 09:17:56 2008
+++ /dev/null
@@ -1,7 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE
-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.logger.org.parancoe=INFO
=======================================
--- /examples/basicPersistence/pom.xml Thu Aug 26 09:01:23 2010
+++ /examples/basicPersistence/pom.xml Sun Feb 24 06:37:07 2013
@@ -22,9 +22,14 @@
<version>3.0-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>hsqldb</groupId>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.7.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
- <version>1.8.0.10</version>
+ <version>2.2.9</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
@@ -35,7 +40,12 @@
<groupId>org.lambico</groupId>
<artifactId>lambico-test</artifactId>
<version>1.0-SNAPSHOT</version>
- <type>jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ <version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -44,11 +54,21 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
+ <version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
- </build>
+ </build>
</project>
=======================================
--- /examples/basicPersistence/src/test/resources/fixtures/Person.yml Mon
Feb 25 01:07:35 2008
+++ /examples/basicPersistence/src/test/resources/fixtures/Person.yml Sun
Feb 24 06:37:07 2013
@@ -1,32 +1,32 @@
- &Person-lucio
firstName: Lucio
lastName: Benfante
- birthDate: 1177535645454
+ birthDate: 1970-01-02 9:42:33
- &Person-ugo
firstName: Ugo
lastName: Benfante
- birthDate: 1177535645454
+ birthDate: 1970-01-02 9:42:33
- &Person-grandugo
firstName: Ugo
lastName: Benfante
- birthDate: 1176535645454
+ birthDate: 1970-01-02 9:42:33
- &Person-guido
firstName: Guido
lastName: Benfante
- birthDate: 1177535645454
+ birthDate: 1970-01-02 9:42:33
- &Person-chiara
firstName: Chiara
lastName: Benfante
- birthDate: 1177535645454
+ birthDate: 1970-01-02 9:42:33
- &Person-Carlo
firstName: Carlo
lastName: Benfante
- birthDate: 1177535645454
+ birthDate: 1970-01-02 9:42:33
- &Person-Silvia
firstName: Silvia
lastName: Benfante
- birthDate: 1177535645454
+ birthDate: 1970-01-02 9:42:33
- &Person-Filippo
firstName: Filippo
lastName: Benfante
- birthDate: 1177535645454
+ birthDate: 1970-01-02 9:42:33
=======================================
--- /examples/basicWebApp/pom.xml Wed Apr 6 08:50:21 2011
+++ /examples/basicWebApp/pom.xml Sun Feb 24 06:37:07 2013
@@ -11,16 +11,27 @@
<finalName>basicWebApp</finalName>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
+ <version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
- <!--
<compilerArgument>-encoding=UTF8</compilerArgument>-->
+ <encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
+ <version>2.13</version>
<configuration>
<skip>false</skip>
<useFile>true</useFile>
@@ -64,14 +75,9 @@
<version>2.0</version>
</dependency>
<dependency>
- <groupId>hsqldb</groupId>
+ <groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
- <version>1.8.0.10</version>
- </dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>5.1.6</version>
+ <version>2.2.9</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
@@ -81,7 +87,7 @@
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
- <version>1.3</version>
+ <version>2.1</version>
</dependency>
</dependencies>
</dependencyManagement>
@@ -106,25 +112,34 @@
<dependency>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-web</artifactId>
- <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <artifactId>logback-classic</artifactId>
+ <groupId>ch.qos.logback</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
-
+
<!-- Plugins -->
<dependency>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-plugin-italy</artifactId>
- <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-plugin-security</artifactId>
- <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <artifactId>log4j-over-slf4j</artifactId>
+ <groupId>org.slf4j</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-plugin-dwr</artifactId>
</dependency>
-
+
<!-- Servlet/JSP APIs provided by your container -->
<dependency>
<groupId>javax.servlet</groupId>
@@ -136,19 +151,14 @@
<artifactId>jsp-api</artifactId>
<scope>provided</scope>
</dependency>
-
+
<!-- db driver -->
<dependency>
- <groupId>hsqldb</groupId>
+ <groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
</dependency>
@@ -156,8 +166,10 @@
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.7.2</version>
+ </dependency>
</dependencies>
- <properties>
- <netbeans.hint.deploy.server>Tomcat60</netbeans.hint.deploy.server>
- </properties>
</project>
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/AdminController.java
Tue Sep 23 13:50:22 2008
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/AdminController.java
Sun Feb 24 06:37:07 2013
@@ -20,8 +20,9 @@
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
import org.parancoe.util.MemoryAppender;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@@ -31,7 +32,7 @@
@Controller
@RequestMapping("/admin/*.html")
public class AdminController {
- private static final Logger logger =
Logger.getLogger(AdminController.class);
+ private static final Logger logger =
LoggerFactory.getLogger(AdminController.class);

@RequestMapping
public ModelAndView index(HttpServletRequest req, HttpServletResponse
res) {
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/HomeController.java
Tue Sep 23 13:50:22 2008
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/HomeController.java
Sun Feb 24 06:37:07 2013
@@ -17,8 +17,9 @@

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

-import org.apache.log4j.Logger;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -26,7 +27,7 @@
@Controller
@RequestMapping("/home/*.html")
public class HomeController {
- private static final Logger logger =
Logger.getLogger(HomeController.class);
+ private static final Logger logger =
LoggerFactory.getLogger(HomeController.class);

// the simplest possible action
@RequestMapping
@@ -35,7 +36,7 @@
params.put("something", new Object());
return new ModelAndView("welcome", params);
}
-
+
@RequestMapping
public ModelAndView page1(HttpServletRequest req, HttpServletResponse
res){
return new ModelAndView("page1", null);
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/ItalyController.java
Tue Sep 23 13:50:22 2008
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/ItalyController.java
Sun Feb 24 06:37:07 2013
@@ -1,6 +1,5 @@
package org.parancoe.basicWebApp.controllers;

-import org.apache.log4j.Logger;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
@@ -11,14 +10,8 @@
@Controller
@RequestMapping("/italy/*.html")
public class ItalyController {
- private static final Logger logger =
Logger.getLogger(ItalyController.class);
-
@RequestMapping
public ModelAndView index(HttpServletRequest req, HttpServletResponse
res) {
return new ModelAndView("italy/index", null);
}
-
- public Logger getLogger() {
- return logger;
- }
}
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/PeopleController.java
Thu Aug 26 09:01:23 2010
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/PeopleController.java
Sun Feb 24 06:37:07 2013
@@ -15,7 +15,6 @@

import java.text.ParseException;
import org.parancoe.basicWebApp.po.Person;
-import org.apache.log4j.Logger;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
@@ -26,6 +25,8 @@
import org.parancoe.basicWebApp.blo.PersonBo;
import org.parancoe.basicWebApp.dao.PersonDao;
import org.parancoe.web.util.FlashHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@@ -33,7 +34,7 @@
@RequestMapping("/people/*.html")
public class PeopleController {

- private static Logger logger =
Logger.getLogger(PeopleController.class);
+ private static final Logger logger =
LoggerFactory.getLogger(PeopleController.class);
@Resource
private PersonDao personDao;
@Resource
@@ -57,15 +58,11 @@
@RequestMapping
public ModelAndView show(HttpServletRequest req, HttpServletResponse
res) {
Long id = Long.parseLong(req.getParameter("id"));
- logger.debug("got id " + id);
+ logger.debug("got id {}", id);
Map params = new HashMap();
Person p = personDao.read(id);

params.put("person", p);
return new ModelAndView("people/show", params);
}
-
- public Logger getLogger() {
- return logger;
- }
}
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/PeopleEditController.java
Thu Aug 26 09:01:23 2010
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/PeopleEditController.java
Sun Feb 24 06:37:07 2013
@@ -15,9 +15,10 @@

import javax.annotation.Resource;
import javax.validation.Valid;
-import org.apache.log4j.Logger;
import org.parancoe.basicWebApp.dao.PersonDao;
import org.parancoe.basicWebApp.po.Person;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -37,9 +38,8 @@
private PersonDao personDao;
@Resource
private Validator validator;
-
- private final static Logger logger = Logger.getLogger(
- PeopleEditController.class);
+
+ private final static Logger logger =
LoggerFactory.getLogger(PeopleEditController.class);

/* questo viene chiamato solo in caso di una post a people/edit.form */
@RequestMapping
@@ -78,8 +78,4 @@
model.addAttribute("person", p);
return "people/edit";
}
-
- public Logger getLogger() {
- return logger;
- }
}
=======================================
--- /examples/basicWebApp/src/main/webapp/WEB-INF/applicationContext.xml
Thu Aug 26 09:01:23 2010
+++ /examples/basicWebApp/src/main/webapp/WEB-INF/applicationContext.xml
Sun Feb 24 06:37:07 2013
@@ -5,12 +5,12 @@
xmlns:parancoe-web="http://www.parancoe.org/schema/parancoe-web"
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
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-2.5.xsd
- http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.lambico.org/schema/lambico
http://www.lambico.org/schema/lambico.xsd
http://www.parancoe.org/schema/parancoe-web
http://www.parancoe.org/schema/parancoe-web.xsd
http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd">
-
+
<context:component-scan base-package="org.parancoe.basicWebApp.blo"/>
<!-- Authomatic discovering of persistent classes -->
<lambico:discover-persistent-classes
basePackage="org.parancoe.basicWebApp.po"/>
@@ -18,5 +18,5 @@
<lambico:define-daos
baseInterfacePackage="org.parancoe.basicWebApp.dao" />

<bean id="conf" class="org.parancoe.basicWebApp.Conf"
parent="abstractConf"/>
-
+
</beans>
=======================================
--- /examples/basicWebApp/src/main/webapp/WEB-INF/database.xml Wed Oct 8
07:26:22 2008
+++ /examples/basicWebApp/src/main/webapp/WEB-INF/database.xml Sun Feb 24
06:37:07 2013
@@ -2,21 +2,21 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:parancoe="http://www.parancoe.org/schema/parancoe"
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-2.5.xsd
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.parancoe.org/schema/parancoe
http://www.parancoe.org/schema/parancoe.xsd">

<!-- this conf file will be automatically merged with parancoe's
parancoeBase.xml -->
<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/dataSource"/>
</bean>
-
+
<bean id="sessionFactory" parent="abstractSessionFactory">
<property name="hibernateProperties">
<props merge="true">
-
+
<prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
-
- <!--
+
+ <!--
<prop
key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
-->
<prop key="hibernate.hbm2ddl.auto">create</prop>
=======================================
--- /examples/basicWebApp/src/main/webapp/WEB-INF/parancoe-servlet.xml Thu
Aug 26 09:01:23 2010
+++ /examples/basicWebApp/src/main/webapp/WEB-INF/parancoe-servlet.xml Sun
Feb 24 06:37:07 2013
@@ -5,12 +5,12 @@
xmlns:parancoe-web="http://www.parancoe.org/schema/parancoe-web"
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
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-2.5.xsd
- http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.parancoe.org/schema/parancoe
http://www.parancoe.org/schema/parancoe.xsd
http://www.parancoe.org/schema/parancoe-web
http://www.parancoe.org/schema/parancoe-web.xsd
http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd">
-
+
<context:component-scan
base-package="org.parancoe.basicWebApp.ajaxblo"/>
<context:component-scan
base-package="org.parancoe.basicWebApp.controllers"/>

@@ -27,14 +27,14 @@
</constructor-arg>
</bean>
<!-- end security section -->
-
+
<!-- begin dwr section -->
<!-- **WARNING** In production leave commented the following
definition for
the dwrController. It's useful only for debug. In production it's
a security hole.
If debug="true" point your browser to /<your
context>/dwr/index.html
-->
<dwr:controller id="dwrController" debug="true"/>
-
+
<dwr:configuration>
<dwr:convert type="bean"
class="org.parancoe.basicWebApp.po.Person" />
</dwr:configuration>
=======================================
--- /examples/basicWebApp/src/test/resources/fixtures/Person.yml Mon Mar 21
02:26:23 2011
+++ /examples/basicWebApp/src/test/resources/fixtures/Person.yml Sun Feb 24
06:37:07 2013
@@ -1,4 +1,4 @@
- &Person-rossi
firstName: Mario
lastName: Rossi
- birthDate: 04/25/1970
+ birthDate: 1970-04-25
=======================================
--- /examples/basicWebApp/src/test/resources/spring-test.xml Thu Aug 26
09:01:23 2010
+++ /examples/basicWebApp/src/test/resources/spring-test.xml Sun Feb 24
06:37:07 2013
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
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-2.5.xsd">
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
</beans>

=======================================
--- /examples/basicWebAppEvolution/pom.xml Tue May 15 15:15:46 2012
+++ /examples/basicWebAppEvolution/pom.xml Sun Feb 24 06:37:07 2013
@@ -1,220 +1,227 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.parancoe</groupId>
- <artifactId>basicWebAppEvolution</artifactId>
- <packaging>war</packaging>
- <version>3.0-SNAPSHOT</version>
- <name>Parancoe Example - Basic WebApp Evolution</name>
- <url>http://www.parancoe.org</url>
- <build>
- <finalName>basicWebAppEvolution</finalName>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- <!-- <compilerArgument>-encoding=UTF8</compilerArgument> -->
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>false</skip>
- <useFile>true</useFile>
- <forkMode>once</forkMode> <!-- pertest once or never -->
- <!-- <reportFormat>plain</reportFormat> -->
- <!--argLine>-Xmx512M</argLine -->
- </configuration>
- </plugin>
- <!-- copied from
http://blog.synyx.de/2011/10/testing-webapp-startup-on-jenkins-with-maven-tomcat-and-web-driver/
-->
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.parancoe</groupId>
+ <artifactId>basicWebAppEvolution</artifactId>
+ <packaging>war</packaging>
+ <version>3.0-SNAPSHOT</version>
+ <name>Parancoe Example - Basic WebApp Evolution</name>
+ <url>http://www.parancoe.org</url>
+ <build>
+ <finalName>basicWebAppEvolution</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.0</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.13</version>
+ <configuration>
+ <skip>false</skip>
+ <useFile>true</useFile>
+ <forkMode>once</forkMode> <!-- pertest once or never
-->
+ <!-- <reportFormat>plain</reportFormat> -->
+ <!--argLine>-Xmx512M</argLine -->
+ </configuration>
+ </plugin>
+ <!-- copied from
http://blog.synyx.de/2011/10/testing-webapp-startup-on-jenkins-with-maven-tomcat-and-web-driver/
-->

- <!-- <plugin> <groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
- <version>1.1</version> <configuration> <fork>true</fork>
<port>8081</port>
- </configuration> <executions> <execution> <id>start-tc</id>
<phase>pre-integration-test</phase>
- <goals> <goal>run-war-only</goal> </goals> </execution> <execution>
<id>stop-tc</id>
- <phase>post-integration-test</phase> <goals> <goal>shutdown</goal>
</goals>
- </execution> </executions> </plugin> -->
- </plugins>
- </build>
- <repositories>
- <repository>
- <id>parancoe-org-repository</id>
- <name>Parancoe Repository for Maven</name>
- <url>http://maven2.parancoe.org/repo/</url>
- <layout>default</layout>
- </repository>
- <repository>
- <id>sonatype-nexus-snapshots</id>
- <name>Sonatype Nexus snapshot repository</name>
- <url>https://oss.sonatype.org/content/repositories/snapshots</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.parancoe</groupId>
- <artifactId>parancoe-web</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.parancoe</groupId>
- <artifactId>parancoe-plugin-italy</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.parancoe</groupId>
- <artifactId>parancoe-plugin-springsecurity-evolution</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.parancoe</groupId>
- <artifactId>parancoe-plugin-dwr</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.parancoe</groupId>
- <artifactId>parancoe-plugin-configuration</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.0</version>
- </dependency>
- <dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <version>1.8.0.10</version>
- </dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>5.1.13</version>
- </dependency>
- <dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
- </dependency>
- <dependency>
- <groupId>joda-time</groupId>
- <artifactId>joda-time</artifactId>
- <version>1.3</version>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.2.2</version>
- </dependency>
+ <!-- <plugin> <groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
+ <version>1.1</version> <configuration> <fork>true</fork>
<port>8081</port>
+ </configuration> <executions> <execution> <id>start-tc</id>
<phase>pre-integration-test</phase>
+ <goals> <goal>run-war-only</goal> </goals> </execution>
<execution> <id>stop-tc</id>
+ <phase>post-integration-test</phase> <goals>
<goal>shutdown</goal> </goals>
+ </execution> </executions> </plugin> -->
+ </plugins>
+ </build>
+ <repositories>
+ <repository>
+ <id>parancoe-org-repository</id>
+ <name>Parancoe Repository for Maven</name>
+ <url>http://maven2.parancoe.org/repo/</url>
+ <layout>default</layout>
+ </repository>
+ <repository>
+ <id>sonatype-nexus-snapshots</id>
+ <name>Sonatype Nexus snapshot repository</name>
+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-web</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-plugin-italy</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.parancoe</groupId>
+
<artifactId>parancoe-plugin-springsecurity-evolution</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-plugin-dwr</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-plugin-configuration</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>2.2.9</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ <version>1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>1.2.2</version>
+ </dependency>
+
+ <!-- spring ldap support -->
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-ldap</artifactId>
+ <version>3.1.3.RELEASE</version>
+ </dependency>
+ <!-- maven dependencies needed for apache ldap -->
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-core</artifactId>
+ <version>1.5.7</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-server-jndi</artifactId>
+ <version>1.5.7</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <!-- The Parancoe framework -->
+ <dependency>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-web</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>logback-classic</artifactId>
+ <groupId>ch.qos.logback</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>

- <!-- spring ldap support -->
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-ldap</artifactId>
- <version>3.1.0.RELEASE</version>
- </dependency>
- <!-- maven dependencies needed for apache ldap -->
- <dependency>
- <groupId>org.apache.directory.server</groupId>
- <artifactId>apacheds-core</artifactId>
- <version>1.5.5</version>
- <scope>runtime</scope>
+ <!-- Plugins -->
+ <dependency>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-plugin-italy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.parancoe</groupId>
+
<artifactId>parancoe-plugin-springsecurity-evolution</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>log4j-over-slf4j</artifactId>
+ <groupId>org.slf4j</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-plugin-dwr</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.directory.server</groupId>
- <artifactId>apacheds-server-jndi</artifactId>
- <version>1.5.5</version>
- <scope>runtime</scope>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-plugin-configuration</artifactId>
</dependency>

- </dependencies>
- </dependencyManagement>
- <dependencies>
- <!-- The Parancoe framework -->
- <dependency>
- <groupId>org.parancoe</groupId>
- <artifactId>parancoe-web</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <!-- Plugins -->
- <dependency>
- <groupId>org.parancoe</groupId>
- <artifactId>parancoe-plugin-italy</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.parancoe</groupId>
- <artifactId>parancoe-plugin-springsecurity-evolution</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.parancoe</groupId>
- <artifactId>parancoe-plugin-dwr</artifactId>
- </dependency>
- <dependency>
- <groupId>org.parancoe</groupId>
- <artifactId>parancoe-plugin-configuration</artifactId>
- </dependency>
-
- <!-- Servlet/JSP APIs provided by your container -->
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jsp-api</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- db driver -->
- <dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- </dependency>
- <dependency>
- <groupId>joda-time</groupId>
- <artifactId>joda-time</artifactId>
- <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-ldap</artifactId>
- </dependency>
-
-
+ <!-- Servlet/JSP APIs provided by your container -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <scope>provided</scope>
+ </dependency>

- </dependencies>
- <properties>
- <netbeans.hint.deploy.server>Tomcat60</netbeans.hint.deploy.server>
- </properties>
+ <!-- db driver -->
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-ldap</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.7.2</version>
+ </dependency>
+ </dependencies>
</project>
=======================================
---
/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/AdminController.java
Mon Apr 2 21:12:10 2012
+++
/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/AdminController.java
Sun Feb 24 06:37:07 2013
@@ -20,8 +20,9 @@
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
import org.parancoe.util.MemoryAppender;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@@ -31,7 +32,7 @@
@Controller
@RequestMapping("/admin/*.html")
public class AdminController {
- private static final Logger logger =
Logger.getLogger(AdminController.class);
+ private static final Logger logger =
LoggerFactory.getLogger(AdminController.class);

@RequestMapping
public ModelAndView index(HttpServletRequest req, HttpServletResponse
res) {
=======================================
---
/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/HomeController.java
Mon Apr 2 21:12:10 2012
+++
/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/HomeController.java
Sun Feb 24 06:37:07 2013
@@ -17,8 +17,9 @@

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

-import org.apache.log4j.Logger;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -26,7 +27,7 @@
@Controller
@RequestMapping("/home/*.html")
public class HomeController {
- private static final Logger logger =
Logger.getLogger(HomeController.class);
+ private static final Logger logger =
LoggerFactory.getLogger(HomeController.class);

// the simplest possible action
@RequestMapping
@@ -35,7 +36,7 @@
params.put("something", new Object());
return new ModelAndView("welcome", params);
}
-
+
@RequestMapping
public ModelAndView page1(HttpServletRequest req, HttpServletResponse
res){
return new ModelAndView("page1", null);
@@ -54,6 +55,4 @@
}
return null;
}
-
- public Logger getLogger() {return logger;}
}
=======================================
---
/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/ItalyController.java
Mon Apr 2 21:12:10 2012
+++
/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/ItalyController.java
Sun Feb 24 06:37:07 2013
@@ -1,6 +1,5 @@
package org.parancoe.basicwebappevolution.controllers;

-import org.apache.log4j.Logger;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
@@ -11,14 +10,8 @@
@Controller
@RequestMapping("/italy/*.html")
public class ItalyController {
- private static final Logger logger =
Logger.getLogger(ItalyController.class);
-
@RequestMapping
public ModelAndView index(HttpServletRequest req, HttpServletResponse
res) {
return new ModelAndView("italy/index", null);
}
-
- public Logger getLogger() {
- return logger;
- }
}
=======================================
---
/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/PersonController.java
Mon Apr 2 21:12:10 2012
+++
/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/PersonController.java
Sun Feb 24 06:37:07 2013
@@ -14,7 +14,6 @@
package org.parancoe.basicwebappevolution.controllers;

import java.text.ParseException;
-import org.apache.log4j.Logger;

import javax.servlet.http.HttpServletRequest;
import javax.annotation.Resource;
@@ -24,6 +23,8 @@
import org.parancoe.basicwebappevolution.dao.PersonDao;
import org.parancoe.basicwebappevolution.po.Person;
import org.parancoe.web.util.FlashHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
@@ -39,7 +40,7 @@
@SessionAttributes("person")
public class PersonController {

- private static Logger logger =
Logger.getLogger(PersonController.class);
+ private static Logger logger =
LoggerFactory.getLogger(PersonController.class);
@Resource
private PersonDao personDao;
@Resource
=======================================
--- /examples/basicWebAppEvolution/src/test/resources/fixtures/Person.yml
Mon Apr 2 20:46:07 2012
+++ /examples/basicWebAppEvolution/src/test/resources/fixtures/Person.yml
Sun Feb 24 06:37:07 2013
@@ -1,4 +1,4 @@
- &Person-rossi
firstName: Mario
lastName: Rossi
- birthDate: 04/25/1970
+ birthDate: 1970-04-25

==============================================================================
Revision: bf4bea7d992d
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Thu Feb 28 09:41:36 2013
Log: new MemoryAppender log back based (drops log4j dependency at all)
http://code.google.com/p/parancoe/source/detail?r=bf4bea7d992d

Added:
/parancoe-core/src/main/java/ch/qos/logback/core/MemoryAppender.java

/parancoe-core/src/main/java/ch/qos/logback/core/read/InspectableCyclicBufferAppender.java
/parancoe-core/src/test/java/ch/qos/logback/core/MemoryAppenderTest.java
/parancoe-core/src/test/resources/logback-test.xml
/parancoe-web/src/test/resources/logback-test.xml
/plugins/parancoe-plugin-configuration/src/test/resources/logback-test.xml
/plugins/parancoe-plugin-dwr/src/test/resources/logback-test.xml
/plugins/parancoe-plugin-italy/src/test/resources/logback-test.xml
/plugins/parancoe-plugin-security/src/test/resources/logback-test.xml

/plugins/parancoe-plugin-springsecurity-evolution/src/test/resources/logback-test.xml
/plugins/parancoe-plugin-springsecurity/src/test/resources/logback-test.xml
/plugins/parancoe-plugin-tiles/src/test/resources/logback-test.xml
/plugins/parancoe-plugin-world/src/test/resources/logback-test.xml
Deleted:
/parancoe-web/src/test/resources/log4j.properties
/plugins/parancoe-plugin-configuration/src/test/resources/log4j.properties
/plugins/parancoe-plugin-security/src/test/resources/log4j.properties
/plugins/parancoe-plugin-springsecurity/src/test/resources/log4j.properties
Modified:
/parancoe-core/pom.xml
/parancoe-core/src/main/java/org/parancoe/test/MailSenderMock.java
/parancoe-core/src/main/java/org/parancoe/util/MemoryAppender.java
/parancoe-web/pom.xml
/parancoe-web/src/main/java/org/parancoe/web/ContextListener.java
/plugins/parancoe-plugin-configuration/pom.xml
/plugins/parancoe-plugin-dwr/pom.xml
/plugins/parancoe-plugin-italy/pom.xml
/plugins/parancoe-plugin-sample/pom.xml
/plugins/parancoe-plugin-security/pom.xml
/plugins/parancoe-plugin-springsecurity-evolution/pom.xml
/plugins/parancoe-plugin-springsecurity/pom.xml
/plugins/parancoe-plugin-tiles/pom.xml
/plugins/parancoe-plugin-world/pom.xml
/plugins/pom.xml
/pom.xml

=======================================
--- /dev/null
+++ /parancoe-core/src/main/java/ch/qos/logback/core/MemoryAppender.java
Thu Feb 28 09:41:36 2013
@@ -0,0 +1,43 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Core.
+ *
+ * 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 ch.qos.logback.core;
+
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.read.InspectableCyclicBufferAppender;
+
+/**
+ * LogBack in-memory log appender
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+public class MemoryAppender extends
InspectableCyclicBufferAppender<ILoggingEvent> {
+
+ private static MemoryAppender instance;
+
+ public MemoryAppender() {
+ instance = this;
+ }
+
+ public static MemoryAppender getInstance() {
+ if (instance == null) {
+ throw new NullPointerException(
+ "memory appender not initialized. Please provide a
valid logback.xml");
+ }
+ return instance;
+ }
+}
=======================================
--- /dev/null
+++
/parancoe-core/src/main/java/ch/qos/logback/core/read/InspectableCyclicBufferAppender.java
Thu Feb 28 09:41:36 2013
@@ -0,0 +1,41 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Core.
+ *
+ * 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 ch.qos.logback.core.read;
+
+import java.util.List;
+
+/**
+ * inspectable circular buffer appender
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+public class InspectableCyclicBufferAppender<E> extends
CyclicBufferAppender<E> {
+
+ public List<E> getLogLines() {
+ return cb.asList();
+ }
+
+ public List<E> getLogLines(final int max) {
+ List<E> lines = cb.asList();
+ return lines.size() <= max ? lines : lines.subList(lines.size() -
max, lines.size());
+ }
+
+ public void clearLogs() {
+ cb.clear();
+ }
+}
=======================================
--- /dev/null
+++
/parancoe-core/src/test/java/ch/qos/logback/core/MemoryAppenderTest.java
Thu Feb 28 09:41:36 2013
@@ -0,0 +1,93 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Core.
+ *
+ * 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 ch.qos.logback.core;
+
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import java.util.List;
+import org.junit.Test;
+import static org.hamcrest.MatcherAssert.*;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
+import static org.hamcrest.number.OrderingComparison.greaterThan;
+import org.junit.Before;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+public class MemoryAppenderTest {
+
+ Logger testLogger;
+ MemoryAppender inMemoryLogger;
+
+ @Before
+ public void setUp() {
+ testLogger = LoggerFactory.getLogger(MemoryAppenderTest.class);
+ inMemoryLogger = MemoryAppender.getInstance();
+ inMemoryLogger.clearLogs();
+ }
+
+ /**
+ * Test configuration.
+ */
+ @Test
+ public void environment() {
+ assertThat(inMemoryLogger, is(notNullValue()));
+ }
+
+ /**
+ * Test configuration.
+ */
+ @Test
+ public void clearLogs() {
+ testLogger.error("1");
+ testLogger.error("2");
+ testLogger.error("3");
+ testLogger.error("4");
+ assertThat(inMemoryLogger.getLogLines(), hasSize(greaterThan(0)));
+ inMemoryLogger.clearLogs();
+ assertThat(inMemoryLogger.getLogLines(), hasSize(0));
+ }
+
+ /**
+ * Test of getLogLines method, of class InMemoryLogger.
+ */
+ @Test
+ public void getLogLines() {
+ testLogger.error("debug line");
+ testLogger.error("error line");
+ List<ILoggingEvent> logLines = inMemoryLogger.getLogLines();
+ assertThat(logLines, hasSize(2));
+ assertThat(logLines.get(1).getMessage(), equalTo("error line"));
+ }
+
+ /**
+ * Test of getLogLines(int) method, of class InMemoryLogger.
+ */
+ @Test
+ public void getMaxLogLines() {
+ testLogger.error("line 1");
+ testLogger.error("line 2");
+ testLogger.error("line 3");
+ List<ILoggingEvent> logLines = inMemoryLogger.getLogLines(2);
+ assertThat(logLines, hasSize(2));
+ assertThat(logLines.get(0).getMessage(), equalTo("line 2"));
+ }
+}
=======================================
--- /dev/null
+++ /parancoe-core/src/test/resources/logback-test.xml Thu Feb 28 09:41:36
2013
@@ -0,0 +1,36 @@
+<!--
+
+ Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Core.
+
+ 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.
+
+-->
+<configuration>
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}
- %msg%n</pattern>
+ </encoder>
+ </appender>
+ <appender name="MEMORY" class="ch.qos.logback.core.MemoryAppender">
+ <MaxSize>100</MaxSize>
+ </appender>
+
+ <logger name="org.parancoe" level="INFO"/>
+
+ <root level="ERROR">
+ <appender-ref ref="CONSOLE" />
+ <appender-ref ref="MEMORY" />
+ </root>
+</configuration>
=======================================
--- /dev/null
+++ /parancoe-web/src/test/resources/logback-test.xml Thu Feb 28 09:41:36
2013
@@ -0,0 +1,37 @@
+<!--
+
+ Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Web.
+
+ 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.
+
+-->
+<configuration>
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}
- %msg%n</pattern>
+ </encoder>
+ </appender>
+ <appender name="MEMORY" class="ch.qos.logback.core.MemoryAppender">
+ <MaxSize>100</MaxSize>
+ </appender>
+
+ <logger name="org.parancoe" level="INFO"/>
+ <logger name="org.parancoe.plugin.dwr" level="INFO"/>
+
+ <root level="ERROR">
+ <appender-ref ref="CONSOLE" />
+ <appender-ref ref="MEMORY" />
+ </root>
+</configuration>
=======================================
--- /dev/null
+++
/plugins/parancoe-plugin-configuration/src/test/resources/logback-test.xml
Thu Feb 28 09:41:36 2013
@@ -0,0 +1,40 @@
+<!--
+
+ Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Plugin Configuration.
+
+ 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.
+
+-->
+<configuration>
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}
- %msg%n</pattern>
+ </encoder>
+ </appender>
+ <appender name="MEMORY" class="ch.qos.logback.core.MemoryAppender">
+ <MaxSize>100</MaxSize>
+ </appender>
+
+ <logger name="org.parancoe" level="DEBUG"/>
+ <logger name="org.lambico" level="DEBUG"/>
+ <logger name="org.lambico.data" level="INFO"/>
+ <logger name="org.parancoe.plugin.configuration" level="DEBUG"/>
+ <logger name="org.apache.cxf" level="DEBUG"/>
+
+ <root level="ERROR">
+ <appender-ref ref="CONSOLE" />
+ <appender-ref ref="MEMORY" />
+ </root>
+</configuration>
=======================================
--- /dev/null
+++ /plugins/parancoe-plugin-dwr/src/test/resources/logback-test.xml Thu
Feb 28 09:41:36 2013
@@ -0,0 +1,32 @@
+<!--
+
+ Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Plugin DWR.
+
+ 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.
+
+-->
+<configuration>
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}
- %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <logger name="org.parancoe" level="INFO"/>
+
+ <root level="ERROR">
+ <appender-ref ref="CONSOLE" />
+ </root>
+</configuration>
=======================================
--- /dev/null
+++ /plugins/parancoe-plugin-italy/src/test/resources/logback-test.xml Thu
Feb 28 09:41:36 2013
@@ -0,0 +1,32 @@
+<!--
+
+ Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Plugin Italy.
+
+ 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.
+
+-->
+<configuration>
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}
- %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <logger name="org.parancoe" level="INFO"/>
+
+ <root level="ERROR">
+ <appender-ref ref="CONSOLE" />
+ </root>
+</configuration>
=======================================
--- /dev/null
+++ /plugins/parancoe-plugin-security/src/test/resources/logback-test.xml
Thu Feb 28 09:41:36 2013
@@ -0,0 +1,33 @@
+<!--
+
+ Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Plugin Security.
+
+ 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.
+
+-->
+<configuration>
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}
- %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <logger name="org.parancoe" level="INFO"/>
+ <logger name="org.parancoe.plugin.dwr" level="INFO"/>
+
+ <root level="ERROR">
+ <appender-ref ref="CONSOLE" />
+ </root>
+</configuration>
=======================================
--- /dev/null
+++
/plugins/parancoe-plugin-springsecurity-evolution/src/test/resources/logback-test.xml
Thu Feb 28 09:41:36 2013
@@ -0,0 +1,32 @@
+<!--
+
+ Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Plugin Spring Security Evolution.
+
+ 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.
+
+-->
+<configuration>
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}
- %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <logger name="org.parancoe" level="INFO"/>
+
+ <root level="ERROR">
+ <appender-ref ref="CONSOLE" />
+ </root>
+</configuration>
=======================================
--- /dev/null
+++
/plugins/parancoe-plugin-springsecurity/src/test/resources/logback-test.xml
Thu Feb 28 09:41:36 2013
@@ -0,0 +1,32 @@
+<!--
+
+ Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Plugin Spring Security.
+
+ 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.
+
+-->
+<configuration>
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}
- %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <logger name="org.parancoe" level="INFO"/>
+
+ <root level="ERROR">
+ <appender-ref ref="CONSOLE" />
+ </root>
+</configuration>
=======================================
--- /dev/null
+++ /plugins/parancoe-plugin-tiles/src/test/resources/logback-test.xml Thu
Feb 28 09:41:36 2013
@@ -0,0 +1,32 @@
+<!--
+
+ Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Plugin Tiles.
+
+ 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.
+
+-->
+<configuration>
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}
- %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <logger name="org.parancoe" level="INFO"/>
+
+ <root level="ERROR">
+ <appender-ref ref="CONSOLE" />
+ </root>
+</configuration>
=======================================
--- /dev/null
+++ /plugins/parancoe-plugin-world/src/test/resources/logback-test.xml Thu
Feb 28 09:41:36 2013
@@ -0,0 +1,32 @@
+<!--
+
+ Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Plugin World.
+
+ 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.
+
+-->
+<configuration>
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}
- %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <logger name="org.parancoe" level="INFO"/>
+
+ <root level="ERROR">
+ <appender-ref ref="CONSOLE" />
+ </root>
+</configuration>
=======================================
--- /parancoe-web/src/test/resources/log4j.properties Sun Sep 21 14:08:50
2008
+++ /dev/null
@@ -1,8 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE
-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.logger.org.parancoe=INFO
-log4j.logger.org.parancoe.plugin.dwr=INFO
=======================================
---
/plugins/parancoe-plugin-configuration/src/test/resources/log4j.properties
Fri Mar 1 04:03:24 2013
+++ /dev/null
@@ -1,11 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE
-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.logger.org.parancoe=DEBUG
-log4j.logger.org.lambico=DEBUG
-log4j.logger.org.lambico.data=INFO
-log4j.logger.org.parancoe.plugin.configuration=DEBUG
-log4j.logger.org.apache.cxf=DEBUG
=======================================
--- /plugins/parancoe-plugin-security/src/test/resources/log4j.properties
Wed Aug 8 18:06:36 2007
+++ /dev/null
@@ -1,18 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE
-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.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
=======================================
---
/plugins/parancoe-plugin-springsecurity/src/test/resources/log4j.properties
Mon Jul 7 16:14:57 2008
+++ /dev/null
@@ -1,18 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE
-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.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
=======================================
--- /parancoe-core/pom.xml Wed Feb 27 08:46:53 2013
+++ /parancoe-core/pom.xml Thu Feb 28 09:41:36 2013
@@ -22,6 +22,12 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>commons-logging</artifactId>
+ <groupId>commons-logging</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
@@ -34,9 +40,25 @@
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>commons-logging</artifactId>
+ <groupId>commons-logging</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
</dependency>
<!-- MemoryAppender -->
<dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.0.9</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
@@ -66,8 +88,9 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ <version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
=======================================
--- /parancoe-core/src/main/java/org/parancoe/test/MailSenderMock.java Wed
Feb 27 08:46:53 2013
+++ /parancoe-core/src/main/java/org/parancoe/test/MailSenderMock.java Thu
Feb 28 09:41:36 2013
@@ -20,24 +20,20 @@
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.
+ * Mock implementation of JavaMailSender for testing porpouses.
*
* @author Enrico Giurin
* @author Lucio Benfante
- *
*/
public class MailSenderMock extends JavaMailSenderImpl {

- private static final Logger logger = LoggerFactory.getLogger(
- MailSenderMock.class);
+ private static final Logger logger =
LoggerFactory.getLogger(MailSenderMock.class);

@Override
- protected void doSend(MimeMessage[] mimeMessages, Object[]
originalMessages)
- throws MailException {
+ protected void doSend(MimeMessage[] mimeMessages, Object[]
originalMessages) {
if (mimeMessages != null) {
for (MimeMessage mimeMessage : mimeMessages) {
try {
=======================================
--- /parancoe-core/src/main/java/org/parancoe/util/MemoryAppender.java Sat
Sep 4 02:41:52 2010
+++ /parancoe-core/src/main/java/org/parancoe/util/MemoryAppender.java Thu
Feb 28 09:41:36 2013
@@ -26,6 +26,13 @@
import org.apache.log4j.WriterAppender;
import org.apache.log4j.spi.LoggingEvent;

+/**
+ * Log4J in memory log appender
+ *
+ * @author michele franzin <michele at franzin.net>
+ * @deprecated please use @{@link ch.qos.logback.core.read.MemoryAppender}
+ */
+@Deprecated
public class MemoryAppender extends WriterAppender {
private static StringWriter buffer = new StringWriter();
private static MemoryAppender instance;
@@ -75,6 +82,7 @@
* svuoto il log se è troppo grande
* in modo da non avere OutOfMemoryError
*/
+ @Override
public void append(LoggingEvent loggingEvent) {
if (getFullLog().length() >= getMaxBufferSize()) {
clean();
=======================================
--- /parancoe-web/pom.xml Wed Feb 27 08:46:53 2013
+++ /parancoe-web/pom.xml Thu Feb 28 09:41:36 2013
@@ -18,6 +18,12 @@
<dependency>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>commons-logging</artifactId>
+ <groupId>commons-logging</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
@@ -50,6 +56,12 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>commons-logging</artifactId>
+ <groupId>commons-logging</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
@@ -64,9 +76,9 @@
<artifactId>lambico-test</artifactId>
</dependency>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.17</version>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.0.9</version>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
@@ -78,11 +90,6 @@
<artifactId>commons-dbcp</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
<plugins>
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/ContextListener.java Wed
Feb 27 08:46:53 2013
+++ /parancoe-web/src/main/java/org/parancoe/web/ContextListener.java Thu
Feb 28 09:41:36 2013
@@ -17,6 +17,8 @@
*/
package org.parancoe.web;

+import ch.qos.logback.classic.spi.LoggerContextListener;
+import ch.qos.logback.core.MemoryAppender;
import java.util.Map;
import java.util.List;
import java.util.ArrayList;
@@ -27,7 +29,6 @@

import org.lambico.spring.dao.DaoUtils;
import org.parancoe.util.BaseConf;
-import org.parancoe.util.MemoryAppender;
import org.parancoe.web.plugin.PluginHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -40,35 +41,37 @@
* @author paolo...@seesaw.it
* @author <a href="mailto:lucio.b...@jugpadova.it">Lucio Benfante</a>
* @author Jacopo Murador <jacopo.murador at seesaw.it>
- * @version $Revision$
+ * @author michele franzin <michele at franzin.net>
*/
public class ContextListener implements ServletContextListener {
+
private static final Logger log =
LoggerFactory.getLogger(ContextListener.class);
protected ServletContext servletContext;
protected XmlWebApplicationContext applicationContext;
+ LoggerContextListener inMemoryLogger;

@Override
public void contextInitialized(ServletContextEvent evt) {
try {
this.servletContext = evt.getServletContext();

- MemoryAppender.clean();
+ MemoryAppender instance = MemoryAppender.getInstance();
+ instance.clearLogs();

log.info("loading custom Spring WebApplicationContext");
loadApplicationContext();
PluginHelper helper = new PluginHelper(applicationContext);
helper.initApplicationContextPlugins(evt); // deve essere DOPO
loadApplicationContext()
helper.invokePluginContextInitialized(evt);
- log.info("### Starting up Parancoe in " + BaseConf.getEnv()
+ " mode.");
+ log.info("### Starting up Parancoe in {} mode.",
BaseConf.getEnv());
} catch (Exception e) {
log.error("Error in base ContextListener.contextInitialized",
e);
}
}
-

/**
- * load the ApplicationContext mixing the base parancoe
- * files and the application specific configuration
+ * load the ApplicationContext mixing the base parancoe files and the
application specific
+ * configuration
*/
protected void loadApplicationContext() {
List<String> config = new ArrayList<String>();
@@ -85,7 +88,8 @@
ctx.setConfigLocations(config.toArray(new String[config.size()]));
ctx.refresh();

-
servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
ctx);
+
servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
+ ctx);
applicationContext = ctx;

populateDaoMap(ctx);
@@ -94,7 +98,10 @@
@Override
public void contextDestroyed(ServletContextEvent evt) {
new
PluginHelper(applicationContext).invokePluginContextDestroyed(evt);
- log.info("### Shutting down Parancoe in " + BaseConf.getEnv() + "
mode.");
+ log.info("### Shutting down Parancoe in {} mode.",
BaseConf.getEnv());
+
+ MemoryAppender instance = MemoryAppender.getInstance();
+ instance.stop();
}

/**
@@ -106,5 +113,4 @@
Map daos = DaoUtils.getDaos(ctx);
daoMap.putAll(daos);
}
-
}
=======================================
--- /plugins/parancoe-plugin-configuration/pom.xml Fri Mar 1 04:03:24 2013
+++ /plugins/parancoe-plugin-configuration/pom.xml Thu Feb 28 09:41:36 2013
@@ -20,11 +20,6 @@
</build>
<dependencies>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.17</version>
- </dependency>
- <dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>2.7.3</version>
@@ -40,10 +35,5 @@
<version>6.1.26</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
=======================================
--- /plugins/parancoe-plugin-dwr/pom.xml Fri Mar 1 04:03:24 2013
+++ /plugins/parancoe-plugin-dwr/pom.xml Thu Feb 28 09:41:36 2013
@@ -20,10 +20,5 @@
<artifactId>dwr</artifactId>
<version>3.0-M1-RCL4</version>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
=======================================
--- /plugins/parancoe-plugin-italy/pom.xml Fri Mar 1 04:03:24 2013
+++ /plugins/parancoe-plugin-italy/pom.xml Thu Feb 28 09:41:36 2013
@@ -18,11 +18,4 @@
<build>
<finalName>parancoe-plugin-italy</finalName>
</build>
- <dependencies>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
</project>
=======================================
--- /plugins/parancoe-plugin-sample/pom.xml Fri Mar 1 04:03:24 2013
+++ /plugins/parancoe-plugin-sample/pom.xml Thu Feb 28 09:41:36 2013
@@ -54,11 +54,4 @@
</plugin>
</plugins>
</build>
- <dependencies>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
</project>
=======================================
--- /plugins/parancoe-plugin-security/pom.xml Fri Mar 1 04:03:24 2013
+++ /plugins/parancoe-plugin-security/pom.xml Thu Feb 28 09:41:36 2013
@@ -24,7 +24,6 @@
<groupId>org.acegisecurity</groupId>
<artifactId>acegi-security</artifactId>
<version>1.0.7</version>
- <scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
@@ -50,12 +49,16 @@
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</exclusion>
+ <exclusion>
+ <artifactId>log4j</artifactId>
+ <groupId>log4j</groupId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
+ <artifactId>log4j-over-slf4j</artifactId>
+ <version>${parancoe.slf4j.version}</version>
</dependency>
</dependencies>
</project>
=======================================
--- /plugins/parancoe-plugin-springsecurity-evolution/pom.xml Fri Mar 1
04:03:24 2013
+++ /plugins/parancoe-plugin-springsecurity-evolution/pom.xml Thu Feb 28
09:41:36 2013
@@ -121,11 +121,6 @@
<version>${parancoe.springsecurity.version}</version>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
=======================================
--- /plugins/parancoe-plugin-springsecurity/pom.xml Fri Mar 1 04:03:24 2013
+++ /plugins/parancoe-plugin-springsecurity/pom.xml Thu Feb 28 09:41:36 2013
@@ -122,10 +122,5 @@
<artifactId>spring-security-config</artifactId>
<version>${parancoe.springsecurity.version}</version>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
=======================================
--- /plugins/parancoe-plugin-tiles/pom.xml Fri Mar 1 04:03:24 2013
+++ /plugins/parancoe-plugin-tiles/pom.xml Thu Feb 28 09:41:36 2013
@@ -24,11 +24,6 @@
</build>
<dependencies>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>2.2.2</version>
@@ -38,5 +33,10 @@
<artifactId>tiles-jsp</artifactId>
<version>2.2.2</version>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>${parancoe.slf4j.version}</version>
+ </dependency>
</dependencies>
</project>
=======================================
--- /plugins/parancoe-plugin-world/pom.xml Fri Mar 1 04:03:24 2013
+++ /plugins/parancoe-plugin-world/pom.xml Thu Feb 28 09:41:36 2013
@@ -16,11 +16,4 @@
<properties>
<main.basedir>${basedir}/..</main.basedir>
</properties>
- <dependencies>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
</project>
=======================================
--- /plugins/pom.xml Fri Mar 1 04:03:24 2013
+++ /plugins/pom.xml Thu Feb 28 09:41:36 2013
@@ -181,12 +181,6 @@
<groupId>org.parancoe</groupId>
<artifactId>parancoe-web</artifactId>
<scope>provided</scope>
- <exclusions>
- <exclusion>
- <artifactId>log4j</artifactId>
- <groupId>log4j</groupId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
@@ -232,16 +226,6 @@
<version>${parancoe.slf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${parancoe.slf4j.version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>${parancoe.slf4j.version}</version>
- </dependency>
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${parancoe.junit4.version}</version>
=======================================
--- /pom.xml Wed Feb 27 10:37:34 2013
+++ /pom.xml Thu Feb 28 09:41:36 2013
@@ -132,7 +132,7 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
+ <artifactId>jcl-over-slf4j</artifactId>
<version>${parancoe.slf4j.version}</version>
</dependency>
<dependency>

==============================================================================
Revision: 121fc19353e4
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 10:36:02 2013
Log: ARCHETYPES - refresh jar versions, ease dependencies & poms, move
log4j to slf4j, minor code cleanups
http://code.google.com/p/parancoe/source/detail?r=121fc19353e4

Modified:
/parancoe-advancedarchetype/pom.xml

/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-core/pom.xml

/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-core/src/main/java/core/dao/UserDao.java

/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-core/src/main/java/core/po/User.java

/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/web/ExceptionResolver.java

/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/web/controllers/AdminController.java

/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/web/controllers/HomeController.java

/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/web/controllers/SecureController.java

/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/WEB-INF/database.xml

/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/WEB-INF/parancoe-servlet.xml
/parancoe-advancedarchetype/src/main/resources/archetype-resources/pom.xml
/parancoe-pluginarchetype/pom.xml
/parancoe-pluginarchetype/src/main/resources/archetype-resources/pom.xml
/parancoe-webarchetype/pom.xml

=======================================
--- /parancoe-advancedarchetype/pom.xml Wed Apr 6 08:50:21 2011
+++ /parancoe-advancedarchetype/pom.xml Wed Feb 27 10:36:02 2013
@@ -65,18 +65,19 @@
<extension>
<groupId>org.apache.maven.archetype</groupId>
<artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-5</version>
+ <version>2.2</version>
</extension>
</extensions>
<plugins>
<plugin>
<artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-5</version>
+ <version>2.2</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
=======================================
---
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-core/pom.xml
Wed Apr 6 08:50:21 2011
+++
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-core/pom.xml
Wed Feb 27 10:36:02 2013
@@ -81,7 +81,7 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>hsqldb</groupId>
+ <groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>test</scope>
</dependency>
=======================================
---
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-core/src/main/java/core/dao/UserDao.java
Fri Sep 10 06:56:57 2010
+++
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-core/src/main/java/core/dao/UserDao.java
Wed Feb 27 10:36:02 2013
@@ -13,7 +13,7 @@
* The DAO interface for the UserProfile entity.
*
* @author <a href="mailto:enrico...@gmail.com">Enrico Giurin</a>
- * @author <a href="mailto:michele...@seesaw.it">Michele Franzin</a>
+ * @author michele franzin <michele at franzin.net>
* @version ${symbol_dollar}Revision: 2c4d46632a31 ${symbol_dollar}
*/
@Dao(entity = User.class)
=======================================
---
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-core/src/main/java/core/po/User.java
Fri Sep 10 06:56:57 2010
+++
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-core/src/main/java/core/po/User.java
Wed Feb 27 10:36:02 2013
@@ -25,7 +25,7 @@
* A PO for UserProfile table.
*
* @author <a href="mailto:enrico...@gmail.com">Enrico Giurin</a>
- * @author <a href="mailto:michele...@seesaw.it">Michele Franzin</a>
+ * @author michele franzin <michele at franzin.net>
* @author Lucio Benfante <lucio.b...@gmail.com>
* @version ${symbol_dollar}Revision${symbol_dollar}
*/
=======================================
---
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/web/ExceptionResolver.java
Fri Sep 10 06:56:57 2010
+++
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/web/ExceptionResolver.java
Wed Feb 27 10:36:02 2013
@@ -5,7 +5,6 @@

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.log4j.Logger;
import org.springframework.web.HttpSessionRequiredException;
import org.springframework.web.multipart.MultipartException;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
@@ -18,8 +17,7 @@
*/
public class ExceptionResolver extends org.parancoe.web.ExceptionResolver {

- private static final Logger logger =
- Logger.getLogger(ExceptionResolver.class);
+ private static final Logger logger =
LoggerFactory.getLogger(ExceptionResolver.class);
private CommonsMultipartResolver multipartResolver;

public CommonsMultipartResolver getMultipartResolver() {
=======================================
---
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/web/controllers/AdminController.java
Fri Sep 10 06:56:57 2010
+++
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/web/controllers/AdminController.java
Wed Feb 27 10:36:02 2013
@@ -10,7 +10,6 @@
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
import org.parancoe.util.MemoryAppender;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -20,7 +19,7 @@
@RequestMapping("/admin/*.html")
public class AdminController {

- private static final Logger logger =
Logger.getLogger(AdminController.class);
+ private static final Logger logger =
LoggerFactory.getLogger(AdminController.class);

@RequestMapping
public String index(HttpServletRequest req, HttpServletResponse res) {
=======================================
---
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/web/controllers/HomeController.java
Fri Sep 10 06:56:57 2010
+++
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/web/controllers/HomeController.java
Wed Feb 27 10:36:02 2013
@@ -8,7 +8,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

-import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@@ -17,7 +16,7 @@
@RequestMapping("/home/*.html")
public class HomeController {

- private static final Logger logger =
Logger.getLogger(HomeController.class);
+ private static final Logger logger =
LoggerFactory.getLogger(HomeController.class);

// EXAMPLE: the simplest possible action
@RequestMapping
=======================================
---
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/web/controllers/SecureController.java
Fri Sep 10 06:56:57 2010
+++
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/web/controllers/SecureController.java
Wed Feb 27 10:36:02 2013
@@ -6,8 +6,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

-import org.apache.log4j.Logger;
-
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@@ -21,7 +19,7 @@
@RequestMapping("/*.secure")
public class SecureController {

- private static Logger logger =
Logger.getLogger(SecureController.class);
+ private static Logger logger =
LoggerFactory.getLogger(SecureController.class);

@RequestMapping
public ModelAndView login(HttpServletRequest req, HttpServletResponse
res) {
=======================================
---
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/WEB-INF/database.xml
Fri Sep 10 06:56:57 2010
+++
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/WEB-INF/database.xml
Wed Feb 27 10:36:02 2013
@@ -6,7 +6,7 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:parancoe="http://www.parancoe.org/schema/parancoe"
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-2.5.xsd
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.parancoe.org/schema/parancoe
http://www.parancoe.org/schema/parancoe.xsd">

<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
=======================================
---
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/WEB-INF/parancoe-servlet.xml
Fri Mar 25 07:11:50 2011
+++
/parancoe-advancedarchetype/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/WEB-INF/parancoe-servlet.xml
Wed Feb 27 10:36:02 2013
@@ -9,8 +9,8 @@
xmlns:parancoe-web="http://www.parancoe.org/schema/parancoe-web"
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
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-2.5.xsd
- http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.parancoe.org/schema/parancoe
http://www.parancoe.org/schema/parancoe.xsd
http://www.parancoe.org/schema/parancoe-web
http://www.parancoe.org/schema/parancoe-web.xsd
http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd">
=======================================
---
/parancoe-advancedarchetype/src/main/resources/archetype-resources/pom.xml
Wed Apr 6 08:50:21 2011
+++
/parancoe-advancedarchetype/src/main/resources/archetype-resources/pom.xml
Wed Feb 27 10:36:02 2013
@@ -15,7 +15,7 @@
<main.basedir>${symbol_dollar}{basedir}</main.basedir>
<year>2011</year>
<app.parancoe.version>3.0-SNAPSHOT</app.parancoe.version>
- <app.lambico.version>1.0-SNAPSHOT</app.lambico.version>
+ <app.lambico.version>1.1-SNAPSHOT</app.lambico.version>

<app.springsecurity.version>3.0.5.RELEASE</app.springsecurity.version>
<app.hibernate.version>3.6.2.Final</app.hibernate.version>
<app.log4j.version>1.2.14</app.log4j.version>
@@ -195,7 +195,7 @@
<version>${symbol_dollar}{app.junit3.version}</version>
</dependency>
<dependency>
- <groupId>hsqldb</groupId>
+ <groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>${symbol_dollar}{app.hsqldb.version}</version>
</dependency>
@@ -207,7 +207,6 @@
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
@@ -238,7 +237,6 @@
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
- <version>1.2.2</version>
</dependency>
</dependencies>
</dependencyManagement>
=======================================
--- /parancoe-pluginarchetype/pom.xml Wed May 9 06:37:13 2012
+++ /parancoe-pluginarchetype/pom.xml Wed Feb 27 10:36:02 2013
@@ -53,6 +53,7 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
+ <version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
@@ -60,12 +61,21 @@
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
+ <version>2.4</version>
<configuration>
<descriptorRefs>
<descriptorRef>bin</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
</plugins>
<pluginManagement>
<plugins>
=======================================
---
/parancoe-pluginarchetype/src/main/resources/archetype-resources/pom.xml
Wed May 9 06:37:13 2012
+++
/parancoe-pluginarchetype/src/main/resources/archetype-resources/pom.xml
Wed Feb 27 10:36:02 2013
@@ -66,7 +66,6 @@
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
<scope>test</scope>
</dependency>
</dependencies>
=======================================
--- /parancoe-webarchetype/pom.xml Tue Sep 7 07:53:17 2010
+++ /parancoe-webarchetype/pom.xml Wed Feb 27 10:36:02 2013
@@ -45,15 +45,23 @@
<extension>
<groupId>org.apache.maven.archetype</groupId>
<artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-4</version>
+ <version>2.2</version>
</extension>
</extensions>
<plugins>
<plugin>
<artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-4</version>
+ <version>2.2</version>
<extensions>true</extensions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>

==============================================================================
Revision: 4a6a30c09ca6
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 11:10:45 2013
Log: delete WebUtils (name clash & is apache commons duplicate)
http://code.google.com/p/parancoe/source/detail?r=4a6a30c09ca6

Deleted:
/parancoe-web/src/main/java/org/parancoe/web/WebUtils.java

=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/WebUtils.java Sat Sep 4
02:41:52 2010
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web;
-
-public class WebUtils {
-
- public static String camelizeMethod(String rawMethodUrl) {
-
- if (rawMethodUrl == null || rawMethodUrl.length() == 0) {
- throw new IllegalArgumentException("rawMethodUrl cannot be
null or empty");
- }
-
- rawMethodUrl = rawMethodUrl.toLowerCase();
- String[] methodParts = rawMethodUrl.split("_");
-
- StringBuffer sb = new StringBuffer(methodParts[0]);
- for(int i = 1; i < methodParts.length; i++) {
- sb.append(methodParts[i].substring(0,1).toUpperCase());
- sb.append(methodParts[i].substring(1,methodParts[i].length()));
- }
-
- return sb.toString();
- }
-}

==============================================================================
Revision: eab80fc51cb0
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Tue Feb 26 02:51:02 2013
Log: added new jUnit4 test classes & listeners (deprecate old ones)
http://code.google.com/p/parancoe/source/detail?r=eab80fc51cb0

Added:

/parancoe-core/src/main/java/org/parancoe/test/junit4/AbstractContextTest.java
/parancoe-core/src/test/java/org/parancoe/core/ParancoeTest.java
/parancoe-core/src/test/java/org/parancoe/util/MockConf.java
/parancoe-core/src/test/resources/applicationContext-test.xml
/parancoe-core/src/test/resources/applicationContext.xml
/parancoe-core/src/test/resources/database-test.xml

/parancoe-web/src/main/java/org/parancoe/web/test/junit4/AbstractControllerTest.java

/parancoe-web/src/main/java/org/parancoe/web/test/junit4/AbstractPluginTest.java

/parancoe-web/src/main/java/org/parancoe/web/test/junit4/AbstractWebTest.java

/parancoe-web/src/main/java/org/parancoe/web/test/junit4/WebXmlContextLoader.java
/parancoe-web/src/main/webapp/WEB-INF/applicationContext.xml
/parancoe-web/src/main/webapp/WEB-INF/parancoe-servlet.xml
/parancoe-web/src/test/java/org/parancoe/web/AbstractContextTest.java
/parancoe-web/src/test/java/org/parancoe/web/tag/BaseTagTest.java
/parancoe-web/src/test/java/org/parancoe/web/test/MockController.java
/parancoe-web/src/test/java/org/parancoe/web/test/MockControllerTest.java
/parancoe-web/src/test/java/org/parancoe/web/test/MockModel.java
/parancoe-web/src/test/resources/applicationContext-test.xml
/parancoe-web/src/test/resources/database-test.xml
Deleted:
/parancoe-core/src/test/java/org/parancoe/core/SanityTest.java
/parancoe-core/src/test/java/org/parancoe/util/TestConf.java
/parancoe-core/src/test/resources/applicationContext_test.xml
/parancoe-web/src/test/java/org/parancoe/web/SanityTest.java

/parancoe-web/src/test/java/org/parancoe/web/test/controller/ForTestController.java

/parancoe-web/src/test/java/org/parancoe/web/test/controller/ForTestControllerModel.java

/parancoe-web/src/test/java/org/parancoe/web/test/controller/TestControllerTest.java
/parancoe-web/src/test/resources/spring-test.xml
Modified:
/parancoe-core/pom.xml
/parancoe-core/src/test/java/org/parancoe/core/BaseTest.java
/parancoe-web/src/main/java/org/parancoe/web/test/BaseTest.java
/parancoe-web/src/main/java/org/parancoe/web/test/ControllerTest.java
/parancoe-web/src/main/java/org/parancoe/web/test/PluginTest.java
/parancoe-web/src/main/java/org/parancoe/web/test/TagTest.java
/parancoe-web/src/test/java/org/parancoe/web/tag/MarkPositionTagTest.java
/parancoe-web/src/test/java/org/parancoe/web/tag/MarkedPositionTagTest.java
/parancoe-web/src/test/resources/logback-test.xml

=======================================
--- /dev/null
+++
/parancoe-core/src/main/java/org/parancoe/test/junit4/AbstractContextTest.java
Tue Feb 26 02:51:02 2013
@@ -0,0 +1,37 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Core.
+ *
+ * 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 org.parancoe.test.junit4;
+
+import org.lambico.test.spring.hibernate.junit4.AbstractBaseTest;
+import org.springframework.test.context.ContextConfiguration;
+
+/**
+ * A base class for Parancoe context tests.
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+@ContextConfiguration(inheritLocations = false,
+ locations = {"/org/lambico/spring/dao/hibernate/genericDao.xml",
+ "/org/lambico/spring/dao/hibernate/applicationContextBase.xml",
+ "/org/parancoe/core/applicationContextBase.xml",
+ "/applicationContext.xml",
+ "/database-test.xml",
+ "/applicationContext-test.xml"})
+public abstract class AbstractContextTest extends AbstractBaseTest {
+// TODO move to parancoe-test project
+}
=======================================
--- /dev/null
+++ /parancoe-core/src/test/java/org/parancoe/core/ParancoeTest.java Tue
Feb 26 02:51:02 2013
@@ -0,0 +1,40 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Core.
+ *
+ * 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 org.parancoe.core;
+
+import javax.annotation.Resource;
+import org.junit.Test;
+import org.parancoe.util.BaseConf;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * test everything has been loaded properly
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+public class ParancoeTest extends BaseTest {
+
+ @Resource
+ private BaseConf configuration;
+
+ @Test
+ public void sanity() {
+ assertThat(configuration, is(notNullValue()));
+ }
+}
=======================================
--- /dev/null
+++ /parancoe-core/src/test/java/org/parancoe/util/MockConf.java Tue Feb 26
02:51:02 2013
@@ -0,0 +1,25 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Core.
+ *
+ * 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 org.parancoe.util;
+
+/**
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+public class MockConf extends BaseConf {
+}
=======================================
--- /dev/null
+++ /parancoe-core/src/test/resources/applicationContext-test.xml Tue Feb
26 02:51:02 2013
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Core.
+
+ 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:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:lambico="http://www.lambico.org/schema/lambico"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
+ http://www.lambico.org/schema/lambico
http://www.lambico.org/schema/lambico.xsd">
+
+ <!-- Authomatic discovering of persistent classes -->
+ <lambico:discover-persistent-classes
basePackage="org.parancoe.persistence"/>
+ <!-- Authomatic DAO definition from persistent classes -->
+ <lambico:define-daos baseInterfacePackage="org.parancoe.persistence" />
+
+ <bean class="org.parancoe.util.MockConf" parent="abstractConf" />
+
+ <bean id="daoExceptionManager"
class="org.lambico.dao.BypassingExceptionManager"/>
+</beans>
=======================================
--- /dev/null
+++ /parancoe-core/src/test/resources/applicationContext.xml Tue Feb 26
02:51:02 2013
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Core.
+
+ 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: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">
+</beans>
=======================================
--- /dev/null
+++ /parancoe-core/src/test/resources/database-test.xml Tue Feb 26 02:51:02
2013
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Core.
+
+ 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:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:tx="http://www.springframework.org/schema/tx"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
+ http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">
+
+ <tx:annotation-driven/>
+
+ <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <!--property name="url"
value="jdbc:hsqldb:hsql://localhost/parancoe"/-->
+ <property name="url" value="jdbc:hsqldb:mem:parancoe"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </bean>
+
+ <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
parent="abstractSessionFactory">
+ <property name="hibernateProperties">
+ <props>
+ <prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
+ <prop key="hibernate.hbm2ddl.auto">update</prop>
+ <prop key="hibernate.show_sql">false</prop>
+ <prop key="hibernate.cache.use_query_cache">true</prop>
+ <prop
key="hibernate.cache.use_second_level_cache">true</prop>
+ <prop
key="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</prop>
+ <prop key="hibernate.generate_statistics">true</prop>
+ </props>
+ </property>
+ </bean>
+</beans>
=======================================
--- /dev/null
+++
/parancoe-web/src/main/java/org/parancoe/web/test/junit4/AbstractControllerTest.java
Tue Feb 26 02:51:02 2013
@@ -0,0 +1,74 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Web.
+ *
+ * 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 org.parancoe.web.test.junit4;
+
+import javax.servlet.http.HttpSession;
+import org.springframework.mock.web.MockHttpServletRequest;
+import org.springframework.mock.web.MockHttpServletResponse;
+import org.springframework.mock.web.MockMultipartHttpServletRequest;
+import org.springframework.test.context.transaction.AfterTransaction;
+import org.springframework.test.context.transaction.BeforeTransaction;
+
+/**
+ * E' la classe base per tutti i test di controller
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+public abstract class AbstractControllerTest extends AbstractWebTest {
+ // TODO move to parancoe-test project
+
+ protected MockMultipartHttpServletRequest multipartRequest;
+ protected MockHttpServletRequest request;
+ protected MockHttpServletResponse response;
+
+ @BeforeTransaction
+ public void prepareRequestAndResponse() {
+ resetRequestAndResponse();
+ }
+
+ @AfterTransaction
+ public void clearRequestAndResponse() {
+ multipartRequest = null;
+ request = null;
+ response = null;
+ }
+
+ /**
+ * Reset the request and the response, maintaining the same session.
Useful, for example, to
+ * call a post after calling the get of the form.
+ */
+ protected void resetRequestAndResponse() {
+ HttpSession httpSession = null;
+ // prepare the multipart request
+ if (multipartRequest != null) {
+ httpSession = multipartRequest.getSession();
+ }
+ multipartRequest = new MockMultipartHttpServletRequest();
+ multipartRequest.setSession(httpSession);
+ multipartRequest.setMethod("GET");
+ // preparing the normal request
+ if (request != null) {
+ httpSession = request.getSession();
+ }
+ request = new MockHttpServletRequest();
+ request.setSession(httpSession);
+ request.setMethod("GET");
+
+ response = new MockHttpServletResponse();
+ }
+}
=======================================
--- /dev/null
+++
/parancoe-web/src/main/java/org/parancoe/web/test/junit4/AbstractPluginTest.java
Tue Feb 26 02:51:02 2013
@@ -0,0 +1,38 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Web.
+ *
+ * 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 org.parancoe.web.test.junit4;
+
+import org.springframework.test.context.ContextConfiguration;
+
+/**
+ * E' la classe base per i test di plugins.
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+@ContextConfiguration(inheritLocations = false,
+ locations = {"/org/lambico/spring/dao/hibernate/genericDao.xml",
+ "/org/lambico/spring/dao/hibernate/applicationContextBase.xml",
+ "/org/parancoe/core/applicationContextBase.xml",
+ "/org/parancoe/web/parancoeBase.xml",
+ "/database-test.xml",
+ "classpath*:parancoe-plugin.xml",
+ "classpath*:applicationContext-plugin.xml",
+ "/applicationContext-test.xml"})
+public abstract class AbstractPluginTest extends AbstractWebTest {
+// TODO move to parancoe-test project
+}
=======================================
--- /dev/null
+++
/parancoe-web/src/main/java/org/parancoe/web/test/junit4/AbstractWebTest.java
Tue Feb 26 02:51:02 2013
@@ -0,0 +1,42 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Web.
+ *
+ * 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 org.parancoe.web.test.junit4;
+
+import org.parancoe.test.junit4.AbstractContextTest;
+import org.springframework.test.context.ContextConfiguration;
+
+/**
+ * E' la classe base per i test che necessitano del contesto web
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+@ContextConfiguration(inheritLocations = false,
+ locations = {"/org/lambico/spring/dao/hibernate/genericDao.xml",
+ "/org/lambico/spring/dao/hibernate/applicationContextBase.xml",
+ "/org/parancoe/core/applicationContextBase.xml",
+ "/org/parancoe/web/parancoeBase.xml",
+ "/database-test.xml",
+ "file:./src/main/webapp/WEB-INF/applicationContext.xml",
+ "file:./src/main/webapp/WEB-INF/parancoe-servlet.xml",
+ "classpath*:parancoe-plugin.xml",
+ "classpath*:applicationContext-plugin.xml",
+ "/applicationContext-test.xml"},
+ loader = org.parancoe.web.test.junit4.WebXmlContextLoader.class)
+public abstract class AbstractWebTest extends AbstractContextTest {
+// TODO move to parancoe-test project
+}
=======================================
--- /dev/null
+++
/parancoe-web/src/main/java/org/parancoe/web/test/junit4/WebXmlContextLoader.java
Tue Feb 26 02:51:02 2013
@@ -0,0 +1,84 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Web.
+ *
+ * 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 org.parancoe.web.test.junit4;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.support.BeanDefinitionReader;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.annotation.AnnotationConfigUtils;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.test.context.support.AbstractContextLoader;
+import org.springframework.util.StringUtils;
+import
org.springframework.web.context.support.GenericWebApplicationContext;
+
+/**
+ * Concrete implementation of {@link AbstractGenericContextLoader} which
reads
+ * bean definitions from XML resources. NB creates a {@link
GenericWebApplicationContext}
+ * suitable fot testing purposes.
+ *
+ * @see {@link GenericXmlContextLoader}.
+ * @author michele franzin <michele at franzin.net>
+ */
+public class WebXmlContextLoader extends AbstractContextLoader {
+
+ private static final Logger logger =
LoggerFactory.getLogger(WebXmlContextLoader.class);
+
+ /**
+ * Returns &quot;<code>-test.xml</code>&quot;.
+ */
+ @Override
+ public String getResourceSuffix() {
+ return "-test.xml";
+ }
+
+ /**
+ * Loads a Spring ApplicationContext from the supplied
+ * <code>locations</code>. and creates a standard {@link
GenericWebApplicationContext} instance.
+ *
+ * @return a new application context
+ * @see org.springframework.test.context.ContextLoader#loadContext
+ * @see GenericWebApplicationContext
+ * @see #createBeanDefinitionReader(GenericApplicationContext)
+ * @see BeanDefinitionReader
+ */
+ @Override
+ public final ConfigurableApplicationContext loadContext(String...
locations) throws Exception {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Loading ApplicationContext for locations [{}].",
+ StringUtils.arrayToCommaDelimitedString(locations));
+ }
+ GenericApplicationContext context = new
GenericWebApplicationContext();
+ createBeanDefinitionReader(context).loadBeanDefinitions(locations);
+ AnnotationConfigUtils.registerAnnotationConfigProcessors(context);
+ context.refresh();
+ context.registerShutdownHook();
+ return context;
+ }
+
+ /**
+ * Create a new {@link XmlBeanDefinitionReader}.
+ *
+ * @return a new XmlBeanDefinitionReader.
+ * @see XmlBeanDefinitionReader
+ */
+ private BeanDefinitionReader createBeanDefinitionReader(final
GenericApplicationContext context) {
+ return new XmlBeanDefinitionReader(context);
+ }
+}
=======================================
--- /dev/null
+++ /parancoe-web/src/main/webapp/WEB-INF/applicationContext.xml Tue Feb 26
02:51:02 2013
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Web.
+
+ 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: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">
+</beans>
=======================================
--- /dev/null
+++ /parancoe-web/src/main/webapp/WEB-INF/parancoe-servlet.xml Tue Feb 26
02:51:02 2013
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Web.
+
+ 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: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">
+</beans>
=======================================
--- /dev/null
+++ /parancoe-web/src/test/java/org/parancoe/web/AbstractContextTest.java
Tue Feb 26 02:51:02 2013
@@ -0,0 +1,67 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Web.
+ *
+ * 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 org.parancoe.web;
+
+import javax.servlet.ServletContext;
+import javax.servlet.jsp.PageContext;
+import org.parancoe.web.test.junit4.AbstractControllerTest;
+import org.springframework.mock.web.MockPageContext;
+import org.springframework.mock.web.MockServletContext;
+import org.springframework.test.context.transaction.AfterTransaction;
+import org.springframework.test.context.transaction.BeforeTransaction;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.servlet.support.JspAwareRequestContext;
+import org.springframework.web.servlet.support.RequestContext;
+import org.springframework.web.servlet.tags.RequestContextAwareTag;
+
+/**
+ * E' la classe base per tutti i test che necessitano i contesti (ad
esempio i tag)
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+public abstract class AbstractContextTest extends AbstractControllerTest {
+
+ protected ServletContext servletContext;
+ protected PageContext pageContext;
+ protected RequestContext requestContext;
+
+ @BeforeTransaction
+ public void prepareContexts() {
+ resetContexts();
+ }
+
+ @AfterTransaction
+ public void clearContexts() {
+ servletContext = null;
+ pageContext = null;
+ requestContext = null;
+ }
+
+ /**
+ * Reset all contexts.
+ */
+ protected void resetContexts() {
+ servletContext = new MockServletContext();
+
servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
+ applicationContext);
+ pageContext = new MockPageContext(servletContext, request,
response);
+ requestContext = new JspAwareRequestContext(pageContext);
+
pageContext.setAttribute(RequestContextAwareTag.REQUEST_CONTEXT_PAGE_ATTRIBUTE,
+ requestContext);
+ }
+}
=======================================
--- /dev/null
+++ /parancoe-web/src/test/java/org/parancoe/web/tag/BaseTagTest.java Tue
Feb 26 02:51:02 2013
@@ -0,0 +1,38 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Web.
+ *
+ * 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 org.parancoe.web.tag;
+
+import org.junit.Before;
+import org.parancoe.web.AbstractContextTest;
+import org.springframework.web.util.WebUtils;
+
+/**
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+public abstract class BaseTagTest extends AbstractContextTest {
+
+ @Before
+ public void setupRequestParams() {
+ request.setContextPath("/testctx");
+ request.setRequestURI("/testctx/test/request/uri");
+ request.setAttribute(WebUtils.FORWARD_REQUEST_URI_ATTRIBUTE,
+ "/testctx/test/forward/request/uri");
+ request.setQueryString("p1=v1&p2=v2&p3=v3");
+ }
+}
=======================================
--- /dev/null
+++ /parancoe-web/src/test/java/org/parancoe/web/test/MockController.java
Tue Feb 26 02:51:02 2013
@@ -0,0 +1,66 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Web.
+ *
+ * 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.
+ */
+// Copyright 2008 The Parancoe Team
+//
+// 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 org.parancoe.web.test;
+
+import javax.validation.Valid;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.SessionAttributes;
+import org.springframework.web.bind.support.SessionStatus;
+
+@Controller
+@RequestMapping("/test/controller.form")
+@SessionAttributes("something")
+public class MockController {
+
+ @RequestMapping(method = RequestMethod.GET)
+ public String form(@RequestParam("value") String value, Model model) {
+ MockModel tcm = new MockModel(value);
+ model.addAttribute("something", tcm);
+ return "test/form";
+ }
+
+ @RequestMapping(method = RequestMethod.POST)
+ public String submit(@ModelAttribute("something") @Valid MockModel tcm,
+ BindingResult result, SessionStatus status) {
+ if (result.hasErrors()) {
+ return "test/form";
+ }
+ // doing what you need with tcm and the other parameters
+ status.setComplete();
+ return "redirect:/test/done.html";
+ }
+}
=======================================
--- /dev/null
+++
/parancoe-web/src/test/java/org/parancoe/web/test/MockControllerTest.java
Tue Feb 26 02:51:02 2013
@@ -0,0 +1,105 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Web.
+ *
+ * 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 org.parancoe.web.test;
+
+import org.junit.Test;
+import org.parancoe.web.test.junit4.AbstractControllerTest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.servlet.HandlerAdapter;
+import org.springframework.web.servlet.ModelAndView;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.springframework.test.web.ModelAndViewAssert.*;
+
+/**
+ * A test for the TestController controller.
+ *
+ * It's mostly an integration test for the Parancoe controller stack,
including validation. And an
+ * example of how to write and test controllers.
+ *
+ * @author Lucio Benfante
+ * @author michele franzin <michele at franzin.net>
+ */
+public class MockControllerTest extends AbstractControllerTest {
+
+ @Autowired
+ private MockController controller;
+ @Autowired
+ private HandlerAdapter handler;
+
+ @Test
+ public void sanity() {
+ assertThat(controller, is(notNullValue()));
+ assertThat(handler, is(notNullValue()));
+ assertThat(handler.supports(controller), is(true));
+ }
+
+ @Test
+ public void submit() throws Exception {
+ getForm("initial value");
+ resetRequestAndResponse();
+ ModelAndView mv = postValue("modified value");
+
+ assertViewName(mv, "redirect:/test/done.html");
+ assertModelAttributeAvailable(mv, "something");
+ MockModel oSomething = (MockModel) mv.getModel().get("something");
+ assertThat(oSomething.getValue(), equalTo("modified value"));
+ assertThat("The something attribute should have been removed from
the session",
+ request.getSession().getAttribute("something"),
is(nullValue()));
+ }
+
+ @Test
+ public void updateFailedForValidation() throws Exception {
+ getForm("initial value");
+ resetRequestAndResponse();
+ ModelAndView mv = postValue(""); // not valid empty value
+ assertViewName(mv, "test/form");
+ assertThat("The something attribute shouldn't have been removed
from the session",
+ request.getSession().getAttribute("something"),
is(notNullValue()));
+ }
+
+ @Test
+ public void form() throws Exception {
+ ModelAndView mv = getForm("initial value");
+ assertModelAttributeAvailable(mv, "something");
+ Object oSomething = mv.getModel().get("something");
+ assertThat("The object is not of type TestControllerModel",
+ oSomething, is(instanceOf(MockModel.class)));
+ Object sSomething = request.getSession().getAttribute("something");
+ assertThat(sSomething, is(notNullValue()));
+ assertThat("The object is not of type TestControllerModel",
+ sSomething, is(instanceOf(MockModel.class)));
+ assertThat(oSomething, is(sameInstance(sSomething)));
+ assertThat(((MockModel) oSomething).getValue(), equalTo("initial
value"));
+ assertViewName(mv, "test/form");
+ }
+
+ private ModelAndView getForm(String value) throws Exception {
+ request.setMethod("GET");
+ request.setRequestURI("/test/controller.form");
+ request.setParameter("value", value);
+ return handler.handle(request, response, controller);
+ }
+
+ private ModelAndView postValue(String value) throws Exception {
+ request.setMethod("POST");
+ request.setRequestURI("/test/controller.form");
+ request.setParameter("value", value);
+ return handler.handle(request, response, controller);
+ }
+}
=======================================
--- /dev/null
+++ /parancoe-web/src/test/java/org/parancoe/web/test/MockModel.java Tue
Feb 26 02:51:02 2013
@@ -0,0 +1,53 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Web.
+ *
+ * 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 org.parancoe.web.test;
+
+import org.hibernate.validator.constraints.NotBlank;
+
+/**
+ * A simple bean used as model for testing a controller.
+ *
+ * @author Lucio
+ */
+public class MockModel {
+
+ @NotBlank
+ private String value;
+
+ public MockModel(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the value of value
+ *
+ * @return the value of value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Set the value of value
+ *
+ * @param value new value of value
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
=======================================
--- /dev/null
+++ /parancoe-web/src/test/resources/applicationContext-test.xml Tue Feb 26
02:51:02 2013
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Web.
+
+ 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:context="http://www.springframework.org/schema/context"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:lambico="http://www.lambico.org/schema/lambico"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
+ http://www.lambico.org/schema/lambico
http://www.lambico.org/schema/lambico.xsd">
+
+ <context:component-scan base-package="org.parancoe.web"/>
+
+ <!-- Authomatic discovering of persistent classes -->
+ <lambico:discover-persistent-classes basePackage="org.parancoe.web"/>
+</beans>
=======================================
--- /dev/null
+++ /parancoe-web/src/test/resources/database-test.xml Tue Feb 26 02:51:02
2013
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Web.
+
+ 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:context="http://www.springframework.org/schema/context"
+ 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.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+ <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:mem:test"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </bean>
+
+ <bean id="sessionFactory" parent="abstractSessionFactory">
+ <property name="hibernateProperties">
+ <props merge="true">
+ <prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
+ <prop key="hibernate.hbm2ddl.auto">create</prop>
+ <prop key="hibernate.show_sql">false</prop>
+ </props>
+ </property>
+ </bean>
+</beans>
=======================================
--- /parancoe-core/src/test/java/org/parancoe/core/SanityTest.java Fri Feb
22 04:36:16 2013
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.core;
-
-import javax.annotation.Resource;
-import org.parancoe.util.BaseConf;
-
-public class SanityTest extends BaseTest {
-
- @Resource
- private BaseConf developmentConfiguration;
-
- public void testSanity() {
- assertNotNull(developmentConfiguration);
- }
-
- @Override
- protected String[] getConfigLocations() {
- return new String[]{
- "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
- "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "classpath:org/parancoe/core/applicationContextBase.xml",
- "classpath:applicationContext_test.xml"
- };
- }
-}
=======================================
--- /parancoe-core/src/test/java/org/parancoe/util/TestConf.java Fri Feb 22
04:36:16 2013
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.util;
-
-/**
- *
- * @author michele franzin <michele at franzin.net>
- */
-public class TestConf extends BaseConf {
-}
=======================================
--- /parancoe-core/src/test/resources/applicationContext_test.xml Fri Feb
22 04:36:16 2013
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
-
- This file is part of Parancoe Core.
-
- 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:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:lambico="http://www.lambico.org/schema/lambico"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
- http://www.lambico.org/schema/lambico
http://www.lambico.org/schema/lambico.xsd">
-
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <!--property name="url"
value="jdbc:hsqldb:hsql://localhost/parancoe"/-->
- <property name="url" value="jdbc:hsqldb:mem:parancoe"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </bean>
-
- <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
parent="abstractSessionFactory">
- <property name="hibernateProperties">
- <props>
- <prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
- <prop key="hibernate.hbm2ddl.auto">update</prop>
- <prop key="hibernate.show_sql">false</prop>
- <prop key="hibernate.cache.use_query_cache">true</prop>
- <prop
key="hibernate.cache.use_second_level_cache">true</prop>
- <prop
key="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</prop>
- <prop key="hibernate.generate_statistics">true</prop>
- </props>
- </property>
- </bean>
-
- <context:component-scan
base-package="org.parancoe.persistence.dao.generic"/>
-
- <!-- Authomatic discovering of persistent classes -->
- <lambico:discover-persistent-classes
basePackage="org.parancoe.persistence"/>
- <!-- Authomatic DAO definition from persistent classes -->
- <lambico:define-daos baseInterfacePackage="org.parancoe.persistence" />
-
- <bean class="org.parancoe.util.TestConf" parent="abstractConf" />
-
- <bean id="daoExceptionManager"
class="org.lambico.dao.BypassingExceptionManager"/>
-</beans>
=======================================
--- /parancoe-web/src/test/java/org/parancoe/web/SanityTest.java Sat Sep 4
02:41:52 2010
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web;
-
-//import javax.annotation.Resource;
-//import org.parancoe.util.BaseConf;
-import org.parancoe.web.test.BaseTest;
-
-public class SanityTest extends BaseTest {
-
-// @Resource
-// private BaseConf developmentConfiguration;
-
- public void testSanity() throws Exception {
-// assertNotNull(developmentConfiguration);
- }
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{};
- }
-
- @Override
- protected String[] getConfigLocations() {
- return new String[]{
- "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
- "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "classpath:org/parancoe/web/parancoeBase.xml",
- "classpath:spring-test.xml"};
- }
-}
=======================================
---
/parancoe-web/src/test/java/org/parancoe/web/test/controller/ForTestController.java
Wed Feb 27 08:46:53 2013
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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.
- */
-
-// Copyright 2008 The Parancoe Team
-//
-// 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 org.parancoe.web.test.controller;
-
-
-
-import javax.validation.Valid;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.SessionAttributes;
-import org.springframework.web.bind.support.SessionStatus;
-
-@Controller
-@RequestMapping("/test/controller.form")
-@SessionAttributes("something")
-public class ForTestController {
-
- @RequestMapping(method = RequestMethod.GET)
- public String form(@RequestParam("value") String value,
- Model model) {
- ForTestControllerModel tcm = new ForTestControllerModel(value);
- model.addAttribute("something", tcm);
- return "test/form";
- }
-
- @RequestMapping(method = RequestMethod.POST)
- public String submit(@ModelAttribute("something") @Valid
ForTestControllerModel tcm,
- BindingResult result, SessionStatus status) {
- if (result.hasErrors()) {
- return "test/form";
- }
- // doing what you need with tcm and the other parameters
- status.setComplete();
- return "redirect:/test/done.html";
- }
-}
=======================================
---
/parancoe-web/src/test/java/org/parancoe/web/test/controller/ForTestControllerModel.java
Mon Feb 28 22:01:33 2011
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test.controller;
-
-import org.hibernate.validator.constraints.NotBlank;
-
-/**
- * A simple bean used as model for testing a controller.
- *
- * @author Lucio
- */
-public class ForTestControllerModel {
-
- @NotBlank
- private String value;
-
- public ForTestControllerModel(String value) {
- this.value = value;
- }
-
- /**
- * Get the value of value
- *
- * @return the value of value
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Set the value of value
- *
- * @param value new value of value
- */
- public void setValue(String value) {
- this.value = value;
- }
-}
=======================================
---
/parancoe-web/src/test/java/org/parancoe/web/test/controller/TestControllerTest.java
Mon Feb 28 22:01:33 2011
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test.controller;
-
-import org.parancoe.web.test.ControllerTest;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.servlet.HandlerAdapter;
-import org.springframework.web.servlet.ModelAndView;
-
-/**
- * A test for the TestController controller.
- *
- * It's mostly an integration test for the Parancoe controller stack,
including validation.
- * And an example of how to write and test controllers.
- *
- * @author Lucio Benfante
- */
-public class TestControllerTest extends ControllerTest {
-
- @Autowired
- private ForTestController controller;
- @Autowired
- private HandlerAdapter handler;
-
- public void testConfiguration() {
- assertNotNull(controller);
- assertNotNull(handler);
- }
-
- public void testSubmit() throws Exception {
- callForm("initial value");
- resetRequestAndResponse();
- req.setMethod("POST");
- req.setRequestURI("/test/controller.form");
- req.setParameter("value", "modified value");
- ModelAndView mv = handler.handle(req, res, controller);
- assertEquals("redirect:/test/done.html", mv.getViewName());
- Object oSomething = mv.getModel().get("something");
- assertNotNull(oSomething);
- assertEquals("modified value", ((ForTestControllerModel)
oSomething).
- getValue());
- Object sSomething = req.getSession().getAttribute("something");
- assertNull(
- "The something attribute should have been removed from the
session",
- sSomething);
- }
-
- public void testUpdateFailedForValidation() throws Exception {
- callForm("initial value");
- resetRequestAndResponse();
- req.setMethod("POST");
- req.setRequestURI("/test/controller.form");
- req.setParameter("value", ""); // not valid empty value
- ModelAndView mv = handler.handle(req, res, controller);
- assertEquals("test/form", mv.getViewName());
- Object sSomething = req.getSession().getAttribute("something");
- assertNotNull(
- "The something attribute shouldn't have been removed from
the session",
- sSomething);
- }
-
- public void testForm() throws Exception {
- ModelAndView mv = callForm("initial value");
- Object oSomething = mv.getModel().get("something");
- assertNotNull(oSomething);
- assertTrue("The object is not of type TestControllerModel",
- oSomething instanceof ForTestControllerModel);
- Object sSomething = req.getSession().getAttribute("something");
- assertNotNull(sSomething);
- assertTrue("The object is not of type TestControllerModel",
- sSomething instanceof ForTestControllerModel);
- assertSame(oSomething, sSomething);
- assertEquals("initial value", ((ForTestControllerModel)
oSomething).
- getValue());
- assertEquals("test/form", mv.getViewName());
- }
-
- private ModelAndView callForm(String value) throws Exception {
- req.setMethod("GET");
- req.setRequestURI("/test/controller.form");
- req.setParameter("value", value);
- ModelAndView mv = handler.handle(req, res, controller);
- this.endTransaction();
- this.startNewTransaction();
- return mv;
- }
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{};
- }
-
- @Override
- protected String[] getConfigLocations() {
- return new String[]{
- "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
- "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "classpath:org/parancoe/web/parancoeBase.xml",
- "classpath:spring-test.xml"};
- }
-}
=======================================
--- /parancoe-web/src/test/resources/spring-test.xml Sat Sep 4 02:41:52
2010
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
-
- This file is part of Parancoe Web.
-
- 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:context="http://www.springframework.org/schema/context"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:lambico="http://www.lambico.org/schema/lambico"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.lambico.org/schema/lambico
http://www.lambico.org/schema/lambico.xsd">
-
- <context:component-scan base-package="org.parancoe.web"/>
-
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:mem:test"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </bean>
-
- <bean id="sessionFactory" parent="abstractSessionFactory">
- <property name="hibernateProperties">
- <props merge="true">
- <prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
- <prop key="hibernate.hbm2ddl.auto">create</prop>
- <prop key="hibernate.show_sql">false</prop>
- </props>
- </property>
- </bean>
-
- <!-- Authomatic discovering of persistent classes -->
- <lambico:discover-persistent-classes basePackage="org.parancoe.web"/>
-
-</beans>
=======================================
--- /parancoe-core/pom.xml Thu Feb 28 09:41:36 2013
+++ /parancoe-core/pom.xml Tue Feb 26 02:51:02 2013
@@ -71,12 +71,11 @@
<version>1.4.5</version>
<scope>provided</scope>
</dependency>
- <!-- Tests dependencies -->
<dependency>
<groupId>org.lambico</groupId>
<artifactId>lambico-test</artifactId>
- <scope>test</scope>
</dependency>
+ <!-- Tests dependencies -->
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
=======================================
--- /parancoe-core/src/test/java/org/parancoe/core/BaseTest.java Fri Feb 22
04:36:16 2013
+++ /parancoe-core/src/test/java/org/parancoe/core/BaseTest.java Tue Feb 26
02:51:02 2013
@@ -17,19 +17,14 @@
*/
package org.parancoe.core;

-import org.lambico.test.spring.hibernate.DBTest;
+import org.lambico.test.spring.hibernate.junit4.FixtureSet;
import org.parancoe.persistence.po.hibernate.AuthorTC;
import org.parancoe.persistence.po.hibernate.BookTC;
+import org.parancoe.test.junit4.AbstractContextTest;

/**
- * A base class for Parancoe-core tests.
- *
- * @author lucio
+ * @author michele franzin <michele at franzin.net>
*/
-public abstract class BaseTest extends DBTest {
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{BookTC.class, AuthorTC.class};
- }
+@FixtureSet(modelClasses = {BookTC.class, AuthorTC.class})
+public abstract class BaseTest extends AbstractContextTest {
}
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/test/BaseTest.java Wed Feb
27 08:46:53 2013
+++ /parancoe-web/src/main/java/org/parancoe/web/test/BaseTest.java Tue Feb
26 02:51:02 2013
@@ -31,7 +31,10 @@
* Carica all'avvio tutti i bean configurati in modo da renderli
* disponibili ai test specifici senza la necessità di tirarli su di volta
in volta con
* getCtx().getBean()
+ *
+ * @deprecated please use {@link AbstractWebTest}
*/
+@Deprecated
public abstract class BaseTest extends DBTest {

// @Autowired
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/test/ControllerTest.java
Sat Sep 4 02:41:52 2010
+++ /parancoe-web/src/main/java/org/parancoe/web/test/ControllerTest.java
Tue Feb 26 02:51:02 2013
@@ -22,6 +22,12 @@
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockMultipartHttpServletRequest;

+/**
+ *
+ * @author michele franzin <michele at franzin.net>
+ * @deprecated please use {@link AbstractControllerTest}
+ */
+@Deprecated
public abstract class ControllerTest extends BaseTest {

protected MockMultipartHttpServletRequest mpReq;
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/test/PluginTest.java Wed
Feb 27 08:46:53 2013
+++ /parancoe-web/src/main/java/org/parancoe/web/test/PluginTest.java Tue
Feb 26 02:51:02 2013
@@ -32,7 +32,10 @@
* Carica all'avvio tutti i bean configurati in modo da renderli
* disponibili ai test specifici senza la necessità di tirarli su di volta
in volta con
* getCtx().getBean()
+ *
+ * @deprecated please use {@link AbstractPluginTest}
*/
+@Deprecated
public abstract class PluginTest extends DBTest {

@Resource
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/test/TagTest.java Wed Sep
26 06:28:00 2012
+++ /parancoe-web/src/main/java/org/parancoe/web/test/TagTest.java Tue Feb
26 02:51:02 2013
@@ -28,6 +28,10 @@
import org.springframework.web.servlet.tags.RequestContextAwareTag;
import org.springframework.web.util.WebUtils;

+/**
+ * @deprecated please use {@link AbstractContextTest}
+ */
+@Deprecated
public abstract class TagTest extends BaseTest {

protected MockMultipartHttpServletRequest mpReq;
=======================================
---
/parancoe-web/src/test/java/org/parancoe/web/tag/MarkPositionTagTest.java
Thu Sep 20 10:12:43 2012
+++
/parancoe-web/src/test/java/org/parancoe/web/tag/MarkPositionTagTest.java
Tue Feb 26 02:51:02 2013
@@ -17,54 +17,51 @@
*/
package org.parancoe.web.tag;

+import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.Tag;
-import org.parancoe.web.test.TagTest;
+import org.junit.Test;
import org.parancoe.web.util.MarkPositionHelper;
import org.springframework.mock.web.MockHttpServletResponse;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;

/**
*
* @author Lucio Benfante <lu...@benfante.com>
+ * @author michele franzin <michele at franzin.net>
*/
-public class MarkPositionTagTest extends TagTest {
+public class MarkPositionTagTest extends BaseTagTest {

- public void testDoStartTag() throws Exception {
- MarkPositionTag tag = new MarkPositionTag();
- tag.setPageContext(this.pc);
- String pathId = "testPathId";
- tag.setPathId(pathId);
+ @Test
+ public void doStartTag() throws Exception {
+ MarkPositionTag tag = buildMarkPositionTag("testPathId");
int result = tag.doStartTag();
- assertEquals(Tag.SKIP_BODY, result);
- String output =
((MockHttpServletResponse)this.pc.getResponse()).getContentAsString();
- assertEquals("", output);
- assertEquals("/test/forward/request/uri?p1=v1&p2=v2&p3=v3",
this.req.getSession().getAttribute(MarkPositionHelper.getSessionAttributeKey(pathId)));
+ assertThat(result, equalTo(Tag.SKIP_BODY));
+ String output = ((MockHttpServletResponse)
pageContext.getResponse()).getContentAsString();
+ assertThat(output, equalTo(""));
+ final String path = (String)
request.getSession().getAttribute(MarkPositionHelper.
+ getSessionAttributeKey("testPathId"));
+ assertThat(path,
equalTo("/test/forward/request/uri?p1=v1&p2=v2&p3=v3"));
}

- public void testDoStartTagWithAbsolute() throws Exception {
- MarkPositionTag tag = new MarkPositionTag();
- tag.setPageContext(this.pc);
+ @Test
+ public void doStartTagWithFullUrl() throws Exception {
+ MarkPositionTag tag = buildMarkPositionTag("testPathId");
tag.setUseFullUri(true);
- String pathId = "testPathId";
- tag.setPathId(pathId);
int result = tag.doStartTag();
- assertEquals(Tag.SKIP_BODY, result);
- String output =
((MockHttpServletResponse)this.pc.getResponse()).getContentAsString();
- assertEquals("", output);
-
assertEquals("http://localhost/testctx/test/forward/request/uri?p1=v1&p2=v2&p3=v3",
this.req.getSession().getAttribute(MarkPositionHelper.getSessionAttributeKey(pathId)));
- }
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{};
+ assertThat(result, equalTo(Tag.SKIP_BODY));
+ String output = ((MockHttpServletResponse)
pageContext.getResponse()).getContentAsString();
+ assertThat(output, equalTo(""));
+ final String path = (String)
request.getSession().getAttribute(MarkPositionHelper.
+ getSessionAttributeKey("testPathId"));
+ assertThat(path, equalTo(
+ "http://localhost/testctx/test/forward/request/uri?p1=v1&p2=v2&p3=v3"));
}

- @Override
- protected String[] getConfigLocations() {
- return new String[]{
- "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
- "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "classpath:org/parancoe/web/parancoeBase.xml",
- "classpath:spring-test.xml"};
+ private MarkPositionTag buildMarkPositionTag(String pathId) throws
JspException {
+ MarkPositionTag tag = new MarkPositionTag();
+ tag.setPageContext(pageContext);
+ tag.setPathId(pathId);
+ return tag;
}
-
}
=======================================
---
/parancoe-web/src/test/java/org/parancoe/web/tag/MarkedPositionTagTest.java
Thu Sep 20 10:12:43 2012
+++
/parancoe-web/src/test/java/org/parancoe/web/tag/MarkedPositionTagTest.java
Tue Feb 26 02:51:02 2013
@@ -20,51 +20,37 @@
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.Tag;
import org.junit.Test;
-import org.parancoe.web.test.TagTest;
import org.springframework.mock.web.MockHttpServletResponse;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;

/**
*
* @author Lucio Benfante <lu...@benfante.com>
+ * @author michele franzin <michele at franzin.net>
*/
-public class MarkedPositionTagTest extends TagTest {
+public class MarkedPositionTagTest extends BaseTagTest {

/**
* Test of doStartTagInternal method, of class MarkedPositionTag.
*/
@Test
- public void testDoStartTagInternal() throws Exception {
+ public void doStartTagInternal() throws Exception {
String pathId = "testPathId";
markPosition(pathId);
- resetRequestAndResponse();
MarkedPositionTag tag = new MarkedPositionTag();
- tag.setPageContext(this.pc);
+ tag.setPageContext(pageContext);
tag.setPathId(pathId);
int result = tag.doStartTag();
- assertEquals(Tag.EVAL_BODY_INCLUDE, result);
- String output =
((MockHttpServletResponse)this.pc.getResponse()).getContentAsString();
- assertEquals("/test/forward/request/uri?p1=v1&p2=v2&p3=v3",
output);
- }
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{};
- }
-
- @Override
- protected String[] getConfigLocations() {
- return new String[]{
- "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
- "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "classpath:org/parancoe/web/parancoeBase.xml",
- "classpath:spring-test.xml"};
+ assertThat(result, equalTo(Tag.EVAL_BODY_INCLUDE));
+ String output = ((MockHttpServletResponse)
pageContext.getResponse()).getContentAsString();
+ assertThat(output,
equalTo("/test/forward/request/uri?p1=v1&p2=v2&p3=v3"));
}

- private void markPosition(String pathId) throws JspException {
+ private int markPosition(String pathId) throws JspException {
MarkPositionTag tag = new MarkPositionTag();
- tag.setPageContext(this.pc);
+ tag.setPageContext(pageContext);
tag.setPathId(pathId);
- int result = tag.doStartTag();
+ return tag.doStartTag();
}
-
}
=======================================
--- /parancoe-web/src/test/resources/logback-test.xml Thu Feb 28 09:41:36
2013
+++ /parancoe-web/src/test/resources/logback-test.xml Tue Feb 26 02:51:02
2013
@@ -28,7 +28,6 @@
</appender>

<logger name="org.parancoe" level="INFO"/>
- <logger name="org.parancoe.plugin.dwr" level="INFO"/>

<root level="ERROR">
<appender-ref ref="CONSOLE" />

==============================================================================
Revision: b36902616982
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 11:26:14 2013
Log: EXAMPLES - license header update, basic persistence application +
basic web application (evolution) gets new jUnit4 test
http://code.google.com/p/parancoe/source/detail?r=b36902616982

Added:

/examples/basicPersistence/src/test/java/org/parancoe/example/test/ParancoeTest.java
/examples/basicPersistence/src/test/resources/applicationContext-test.xml
/examples/basicPersistence/src/test/resources/database-test.xml

/examples/basicWebAppEvolution/src/test/resources/applicationContext-test.xml
Deleted:
/examples/basicPersistence/src/main/resources/database.xml

/examples/basicPersistence/src/test/java/org/parancoe/example/test/SanityTest.java
/examples/basicPersistence/src/test/resources/database_test.xml
/examples/basicWebAppEvolution/src/test/resources/spring-test.xml
Modified:
/examples/basicPersistence/pom.xml
/examples/basicPersistence/src/main/assemblies/netbeans-run.xml

/examples/basicPersistence/src/main/java/org/parancoe/example/app/PopulateDatabase.java

/examples/basicPersistence/src/main/java/org/parancoe/example/app/UseBookDAO.java

/examples/basicPersistence/src/main/java/org/parancoe/example/bo/BookBO.java

/examples/basicPersistence/src/main/java/org/parancoe/example/bo/PersonBO.java

/examples/basicPersistence/src/main/java/org/parancoe/example/dao/BookDao.java

/examples/basicPersistence/src/main/java/org/parancoe/example/dao/PersonDao.java
/examples/basicPersistence/src/main/java/org/parancoe/example/po/Book.java

/examples/basicPersistence/src/main/java/org/parancoe/example/po/Person.java

/examples/basicPersistence/src/main/java/org/parancoe/example/util/ApplicationContextHolder.java
/examples/basicPersistence/src/main/resources/applicationContext.xml

/examples/basicPersistence/src/test/java/org/parancoe/example/bo/BookBOTest.java

/examples/basicPersistence/src/test/java/org/parancoe/example/dao/BookDaoTest.java

/examples/basicPersistence/src/test/java/org/parancoe/example/dao/PersonDaoTest.java

/examples/basicPersistence/src/test/java/org/parancoe/example/test/BaseTest.java
/examples/basicPersistence/src/test/resources/fixtures/Book.yml
/examples/basicPersistence/src/test/resources/fixtures/Person.yml
/examples/basicWebApp/pom.xml
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/Blos.java
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/Conf.java
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/Daos.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/PopulateInitialDataContextListener.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/ajaxblo/PersonBo.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/blo/PersonBo.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/blo/SampleBlo.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/AdminController.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/BasicPropertyEditorRegistrar.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/BasicWebAppBindingInitializer.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/HomeController.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/ItalyController.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/PeopleController.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/PeopleEditController.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/dao/PersonDao.java

/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/dao/SampleDao.java
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/po/Person.java
/examples/basicWebApp/src/main/resources/initialData/Authority.yml
/examples/basicWebApp/src/main/resources/initialData/User.yml
/examples/basicWebApp/src/main/webapp/META-INF/context.xml
/examples/basicWebApp/src/main/webapp/WEB-INF/applicationContext.xml
/examples/basicWebApp/src/main/webapp/WEB-INF/database.xml
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/404.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/500.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/accessDenied.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/acegilogin.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/admin/conf.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/admin/index.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/admin/logs.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/admin/spring.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/admin/system.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/common.jspf
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/debug.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/footer.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/genericError.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/head.jspf
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/header.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/italy/index.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/javascripts.jspf
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/language.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/meta.jspf
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/people/edit.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/people/list.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/people/show.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/stylesheets.jspf
/examples/basicWebApp/src/main/webapp/WEB-INF/jsp/welcome.jsp
/examples/basicWebApp/src/main/webapp/WEB-INF/parancoe-servlet.xml
/examples/basicWebApp/src/main/webapp/WEB-INF/web.xml
/examples/basicWebApp/src/main/webapp/WEB-INF/weblogic.xml
/examples/basicWebApp/src/main/webapp/index.jsp
/examples/basicWebApp/src/main/webapp/javascripts/effects.js
/examples/basicWebApp/src/main/webapp/javascripts/parancoe.js
/examples/basicWebApp/src/main/webapp/javascripts/prototype.js
/examples/basicWebApp/src/main/webapp/javascripts/scriptaculous.js
/examples/basicWebApp/src/main/webapp/logout.jsp
/examples/basicWebApp/src/main/webapp/logs.jsp
/examples/basicWebApp/src/main/webapp/stylesheets/default.css
/examples/basicWebApp/src/main/webapp/test.jsp

/examples/basicWebApp/src/test/java/org/parancoe/basicWebApp/ParancoeTest.java

/examples/basicWebApp/src/test/java/org/parancoe/basicWebApp/ValidationTest.java

/examples/basicWebApp/src/test/java/org/parancoe/basicWebApp/controllers/HomeControllerTest.java

/examples/basicWebApp/src/test/java/org/parancoe/basicWebApp/controllers/PeopleEditControllerTest.java
/examples/basicWebApp/src/test/resources/database-test.xml
/examples/basicWebApp/src/test/resources/fixtures/Person.yml
/examples/basicWebApp/src/test/resources/spring-test.xml
/examples/basicWebAppEvolution/pom.xml

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/Blos.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/Conf.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/Daos.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/PopulateInitialDataContextListener.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/ajaxblo/PersonBo.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/blo/PersonBo.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/blo/SampleBlo.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/AdminController.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/BasicPropertyEditorRegistrar.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/BasicWebAppBindingInitializer.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/HomeController.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/ItalyController.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/controllers/PersonController.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/dao/PersonDao.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/dao/SampleDao.java

/examples/basicWebAppEvolution/src/main/java/org/parancoe/basicwebappevolution/po/Person.java
/examples/basicWebAppEvolution/src/main/resources/initialData/Authority.yml
/examples/basicWebAppEvolution/src/main/resources/initialData/Group.yml
/examples/basicWebAppEvolution/src/main/resources/initialData/User.yml
/examples/basicWebAppEvolution/src/main/webapp/META-INF/context.xml

/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/applicationContext.xml
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/database.xml
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/404.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/500.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/admin/conf.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/admin/index.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/admin/logs.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/admin/spring.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/admin/system.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/common.jspf
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/debug.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/footer.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/genericError.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/head.jspf
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/header.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/italy/index.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/javascripts.jspf
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/language.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/meta.jspf
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/person/edit.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/person/list.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/person/show.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/stylesheets.jspf
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/jsp/welcome.jsp
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/log4j.properties
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/parancoe-servlet.xml
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/web.xml
/examples/basicWebAppEvolution/src/main/webapp/WEB-INF/weblogic.xml
/examples/basicWebAppEvolution/src/main/webapp/index.jsp
/examples/basicWebAppEvolution/src/main/webapp/javascripts/effects.js
/examples/basicWebAppEvolution/src/main/webapp/javascripts/parancoe.js
/examples/basicWebAppEvolution/src/main/webapp/javascripts/prototype.js
/examples/basicWebAppEvolution/src/main/webapp/javascripts/scriptaculous.js
/examples/basicWebAppEvolution/src/main/webapp/logout.jsp
/examples/basicWebAppEvolution/src/main/webapp/logs.jsp
/examples/basicWebAppEvolution/src/main/webapp/stylesheets/default.css
/examples/basicWebAppEvolution/src/main/webapp/test.jsp

/examples/basicWebAppEvolution/src/test/java/org/parancoe/basicwebappevolution/ParancoeTest.java

/examples/basicWebAppEvolution/src/test/java/org/parancoe/basicwebappevolution/controllers/HomeControllerTest.java

/examples/basicWebAppEvolution/src/test/java/org/parancoe/basicwebappevolution/controllers/PersonControllerTest.java
/examples/basicWebAppEvolution/src/test/resources/database-test.xml
/examples/basicWebAppEvolution/src/test/resources/fixtures/Person.yml
/examples/basicWebAppEvolution/src/test/resources/log4j.properties

=======================================
--- /dev/null
+++
/examples/basicPersistence/src/test/java/org/parancoe/example/test/ParancoeTest.java
Wed Feb 27 11:26:14 2013
@@ -0,0 +1,44 @@
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic Persistence.
+ *
+ * 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 org.parancoe.example.test;
+
+import javax.annotation.Resource;
+import org.parancoe.example.bo.PersonBO;
+import org.parancoe.example.dao.PersonDao;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;
+
+/**
+ * test everything has been loaded properly
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+public class ParancoeTest extends BaseTest {
+
+ @Resource
+ private PersonDao personDao;
+ @Resource
+ private PersonBO personBO;
+
+ @Test
+ public void sanity() {
+ assertThat(personBO, is(notNullValue()));
+ assertThat(personDao, is(notNullValue()));
+ }
+}
=======================================
--- /dev/null
+++
/examples/basicPersistence/src/test/resources/applicationContext-test.xml
Wed Feb 27 11:26:14 2013
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Example - Basic Persistence.
+
+ 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:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
+</beans>
=======================================
--- /dev/null
+++ /examples/basicPersistence/src/test/resources/database-test.xml Wed Feb
27 11:26:14 2013
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Example - Basic Persistence.
+
+ 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:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
+</beans>
=======================================
--- /dev/null
+++
/examples/basicWebAppEvolution/src/test/resources/applicationContext-test.xml
Wed Feb 27 11:26:14 2013
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Example - Basic WebApp Evolution.
+
+ 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: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">
+</beans>
=======================================
--- /examples/basicPersistence/src/main/resources/database.xml Wed Oct 8
01:20:52 2008
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright 2006 The Parancoe Team
-
-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:parancoe="http://www.parancoe.org/schema/parancoe"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.parancoe.org/schema/parancoe
http://www.parancoe.org/schema/parancoe.xsd
- http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
- http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
-
- <tx:annotation-driven/>
-
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:mem:exampleDB"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </bean>
-
- <bean id="sessionFactory" parent="abstractSessionFactory">
- <property name="hibernateProperties">
- <props merge="true">
- <prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
- <prop key="hibernate.hbm2ddl.auto">update</prop>
- </props>
- </property>
- <property name="eventListeners">
- <map>
- <entry key="merge">
- <bean
class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
- </entry>
- </map>
- </property>
- </bean>
-
-
-</beans>
=======================================
---
/examples/basicPersistence/src/test/java/org/parancoe/example/test/SanityTest.java
Wed Oct 8 01:20:52 2008
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.parancoe.example.test;
-
-import javax.annotation.Resource;
-import org.parancoe.example.bo.PersonBO;
-import org.parancoe.example.dao.PersonDao;
-
-/**
- * Sanity tests
- *
- * @author Lucio Benfante
- */
-public class SanityTest extends BaseTest{
- @Resource
- private PersonDao personDao;
- @Resource
- private PersonBO personBO;
-
- /**
- * Test the wiring of BO resources.
- */
- public void testBoResources() {
- assertNotNull(personBO);
- }
-
- /**
- * Test the wiring of DAO resources.
- */
- public void testDaoResources() {
- assertNotNull(personDao);
- }
-
-}
=======================================
--- /examples/basicPersistence/src/test/resources/database_test.xml Wed
Oct 8 01:20:52 2008
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright 2006 The Parancoe Team
-
-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:parancoe="http://www.parancoe.org/schema/parancoe"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.parancoe.org/schema/parancoe
http://www.parancoe.org/schema/parancoe.xsd
- http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
- http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
-
- <tx:annotation-driven/>
-
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:mem:exampleDB"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </bean>
-
- <bean id="sessionFactory" parent="abstractSessionFactory">
- <property name="hibernateProperties">
- <props merge="true">
- <prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
- <prop key="hibernate.hbm2ddl.auto">create</prop>
- </props>
- </property>
- <property name="eventListeners">
- <map>
- <entry key="merge">
- <bean
class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
- </entry>
- </map>
- </property>
- </bean>
-
-</beans>
=======================================
--- /examples/basicWebAppEvolution/src/test/resources/spring-test.xml Mon
Apr 2 20:46:07 2012
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- 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">
-</beans>
=======================================
--- /examples/basicPersistence/pom.xml Sun Feb 24 06:37:07 2013
+++ /examples/basicPersistence/pom.xml Wed Feb 27 11:26:14 2013
@@ -7,6 +7,11 @@
<name>Parancoe Example - Basic Persistence</name>
<version>3.0-SNAPSHOT</version>
<url>http://www.parancoe.org</url>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <main.basedir>${basedir}/../..</main.basedir>
+ <year>2006-2013</year>
+ </properties>
<repositories>
<repository>
<id>parancoe-org-repository</id>
@@ -37,9 +42,9 @@
<version>1.4</version>
</dependency>
<dependency>
- <groupId>org.lambico</groupId>
- <artifactId>lambico-test</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-test</artifactId>
+ <version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -69,6 +74,50 @@
<encoding>UTF-8</encoding>
</configuration>
</plugin>
+ <plugin>
+ <groupId>com.mycila.maven-license-plugin</groupId>
+ <artifactId>maven-license-plugin</artifactId>
+ <version>1.9.0</version>
+ <configuration>
+ <header>${main.basedir}/LICENSE_HEADER</header>
+ <strictCheck>true</strictCheck>
+ <aggregate>false</aggregate>
+ <excludes>
+ <exclude>target/**</exclude>
+ <exclude>m2-target/**</exclude>
+ <exclude>**/*.properties</exclude>
+ <exclude>LICENSE_HEADER</exclude>
+ <exclude>nb-configuration.xml</exclude>
+ <exclude>nbactions.xml</exclude>
+ <exclude>profiles.xml</exclude>
+ <exclude>.idea/**</exclude>
+ <exclude>.hgtags</exclude>
+ <exclude>.hgignore</exclude>
+ <exclude>catalog.xml</exclude>
+ <exclude>**/BUGS</exclude>
+ <exclude>**/LICENSE</exclude>
+ <exclude>**/TODO</exclude>
+ </excludes>
+ <properties>
+ <name>${project.name}</name>
+ <year>${year}</year>
+ <holder>The Parancoe Team</holder>
+ <contact>in...@parancoe.org</contact>
+ </properties>
+ <encoding>UTF-8</encoding>
+ <mapping>
+ <yml>SCRIPT_STYLE</yml>
+ <jspf>DYNASCRIPT_STYLE</jspf>
+ </mapping>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
=======================================
--- /examples/basicPersistence/src/main/assemblies/netbeans-run.xml Wed
Dec 6 01:45:37 2006
+++ /examples/basicPersistence/src/main/assemblies/netbeans-run.xml Wed Feb
27 11:26:14 2013
@@ -1,4 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Example - Basic Persistence.
+
+ 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.
+
+-->
<assembly>
<id>netbeans</id>
<includeBaseDirectory>false</includeBaseDirectory>
=======================================
---
/examples/basicPersistence/src/main/java/org/parancoe/example/app/PopulateDatabase.java
Wed Oct 8 01:20:52 2008
+++
/examples/basicPersistence/src/main/java/org/parancoe/example/app/PopulateDatabase.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic Persistence.
+ *
+ * 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 org.parancoe.example.app;

import org.parancoe.example.bo.PersonBO;
@@ -27,7 +31,7 @@

@Autowired
private PersonBO personBO;
-
+
public PopulateDatabase() {
ApplicationContextHolder.autowireBeanProperties(this);
}
=======================================
---
/examples/basicPersistence/src/main/java/org/parancoe/example/app/UseBookDAO.java
Wed Oct 8 01:20:52 2008
+++
/examples/basicPersistence/src/main/java/org/parancoe/example/app/UseBookDAO.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic Persistence.
+ *
+ * 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 org.parancoe.example.app;

import java.util.List;
=======================================
---
/examples/basicPersistence/src/main/java/org/parancoe/example/bo/BookBO.java
Mon Sep 22 03:20:18 2008
+++
/examples/basicPersistence/src/main/java/org/parancoe/example/bo/BookBO.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic Persistence.
+ *
+ * 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 org.parancoe.example.bo;

import javax.annotation.Resource;
@@ -43,7 +47,7 @@
* that had this book.
* @param BookTitle
*/
-
+
@Transactional()
public Person bookReturned(String author, String title)
{
=======================================
---
/examples/basicPersistence/src/main/java/org/parancoe/example/bo/PersonBO.java
Wed Oct 8 01:20:52 2008
+++
/examples/basicPersistence/src/main/java/org/parancoe/example/bo/PersonBO.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic Persistence.
+ *
+ * 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 org.parancoe.example.bo;

import java.text.ParseException;
=======================================
---
/examples/basicPersistence/src/main/java/org/parancoe/example/dao/BookDao.java
Thu Aug 26 09:01:23 2010
+++
/examples/basicPersistence/src/main/java/org/parancoe/example/dao/BookDao.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic Persistence.
+ *
+ * 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 org.parancoe.example.dao;

import java.util.List;
=======================================
---
/examples/basicPersistence/src/main/java/org/parancoe/example/dao/PersonDao.java
Thu Aug 26 09:01:23 2010
+++
/examples/basicPersistence/src/main/java/org/parancoe/example/dao/PersonDao.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic Persistence.
+ *
+ * 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 org.parancoe.example.dao;

import java.util.Date;
@@ -31,5 +35,5 @@
List<Person> findByLastName(String lastName);
List<Person> findByFirstNameAndLastName(String firstName, String
lastName);
List<Person> findByBirthDate(Date birthDate);
- List<Person> findByFirstName(String firstName);
+ List<Person> findByFirstName(String firstName);
}
=======================================
---
/examples/basicPersistence/src/main/java/org/parancoe/example/po/Book.java
Thu Aug 26 09:01:23 2010
+++
/examples/basicPersistence/src/main/java/org/parancoe/example/po/Book.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic Persistence.
+ *
+ * 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 org.parancoe.example.po;

import javax.persistence.ManyToOne;
@@ -33,11 +37,11 @@
private String author = null;
private String title = null;
private Person borrower = null;
-
+


/**
- *
+ *
*/
public Book() {
// TODO Auto-generated constructor stub
@@ -45,13 +49,13 @@
public Book(String author, String title) {
this(author, title, 0);
}
-
+
public Book(String author, String title, int numPages) {
this.author = author;
this.title = title;
this.numPages = numPages;
}
-
+
public String getAuthor() {
return author;
}
@@ -75,7 +79,7 @@
public void setTitle(String title) {
this.title = title;
}
-
+
@ManyToOne
@ForeignKey(name = "none")
public Person getBorrower() {
=======================================
---
/examples/basicPersistence/src/main/java/org/parancoe/example/po/Person.java
Thu Aug 26 09:01:23 2010
+++
/examples/basicPersistence/src/main/java/org/parancoe/example/po/Person.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic Persistence.
+ *
+ * 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 org.parancoe.example.po;

import java.util.Date;
=======================================
---
/examples/basicPersistence/src/main/java/org/parancoe/example/util/ApplicationContextHolder.java
Thu Aug 26 09:01:23 2010
+++
/examples/basicPersistence/src/main/java/org/parancoe/example/util/ApplicationContextHolder.java
Wed Feb 27 11:26:14 2013
@@ -1,3 +1,20 @@
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic Persistence.
+ *
+ * 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 org.parancoe.example.util;

import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
=======================================
--- /examples/basicPersistence/src/main/resources/applicationContext.xml
Thu Aug 26 09:01:23 2010
+++ /examples/basicPersistence/src/main/resources/applicationContext.xml
Wed Feb 27 11:26:14 2013
@@ -1,35 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright 2006 The Parancoe Team

-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
+ Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>

-http://www.apache.org/licenses/LICENSE-2.0
+ This file is part of Parancoe Example - Basic Persistence.

-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.
+ 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:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:lambico="http://www.lambico.org/schema/lambico"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:tx="http://www.springframework.org/schema/tx"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.lambico.org/schema/lambico
http://www.lambico.org/schema/lambico.xsd
- http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
-
-
- <context:component-scan
base-package="org.parancoe.persistence.dao.generic"/>
- <context:component-scan base-package="org.parancoe.example"/>
+ http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">
+
+ <tx:annotation-driven/>
+
+ <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:mem:exampleDB"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </bean>
+
+ <bean id="sessionFactory" parent="abstractSessionFactory">
+ <property name="hibernateProperties">
+ <props merge="true">
+ <prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
+ <prop key="hibernate.hbm2ddl.auto">update</prop>
+ </props>
+ </property>
+ <property name="eventListeners">
+ <map>
+ <entry key="merge">
+ <bean
class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <context:component-scan base-package="org.parancoe.example.bo"/>
<!-- Authomatic discovering of persistent classes -->
<lambico:discover-persistent-classes
basePackage="org.parancoe.example.po"/>
<!-- Authomatic DAO definition from persistent classes -->
<lambico:define-daos baseInterfacePackage="org.parancoe.example.dao" />
-
+
</beans>
=======================================
---
/examples/basicPersistence/src/test/java/org/parancoe/example/bo/BookBOTest.java
Fri Jul 4 06:20:24 2008
+++
/examples/basicPersistence/src/test/java/org/parancoe/example/bo/BookBOTest.java
Wed Feb 27 11:26:14 2013
@@ -1,29 +1,42 @@
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic Persistence.
+ *
+ * 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 org.parancoe.example.bo;

-import java.util.List;
-
-import org.parancoe.example.po.Book;
import org.parancoe.example.po.Person;
import org.parancoe.example.test.BaseTest;
import org.springframework.beans.factory.annotation.Autowired;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;

/**
*
* @author Enrico Giurin
*/
public class BookBOTest extends BaseTest {
-
+
@Autowired
private BookBO bookBO;
-
-
- public void testBookReturned()
- {
- Person p = bookBO.bookReturned("Doug Lea", "Concurrent programming in
java second edition");
- assertTrue(p.getFirstName().equals("Ugo"));
-
- }
-
-
-
+
+ @Test
+ public void bookReturned() {
+ Person p = bookBO.bookReturned("Doug Lea",
+ "Concurrent programming in java second edition");
+ assertThat(p.getFirstName(), equalTo("Ugo"));
+ }
}
=======================================
---
/examples/basicPersistence/src/test/java/org/parancoe/example/dao/BookDaoTest.java
Mon Sep 22 03:20:18 2008
+++
/examples/basicPersistence/src/test/java/org/parancoe/example/dao/BookDaoTest.java
Wed Feb 27 11:26:14 2013
@@ -1,37 +1,51 @@
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic Persistence.
+ *
+ * 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 org.parancoe.example.dao;

import java.util.List;

import javax.annotation.Resource;
import org.parancoe.example.po.Book;
-import org.parancoe.example.po.Person;
import org.parancoe.example.test.BaseTest;
-import org.springframework.beans.factory.annotation.Autowired;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.hasSize;
+import org.junit.Test;

/**
*
* @author Enrico Giurin
*/
public class BookDaoTest extends BaseTest {
-
+
@Resource
private BookDao bookDao;
-
-
- public void testAllBooksByBorrower() {
- List<Book> list = bookDao.allBooksByBorrower("Ugo", "Benfante");
- assertEquals(2, list.size());
+
+ @Test
+ public void allBooksByBorrower() {
+ List<Book> list = bookDao.allBooksByBorrower("Ugo", "Benfante");
+ assertThat(list, hasSize(2));
}
-
- public void testFindByAuthor() {
-
+
+ @Test
+ public void findByAuthor() {
List<Book> books = bookDao.findByAuthor("Doug Lea");
- assertEquals(1, books.size());
- assertEquals(books.get(0).getTitle(), "Concurrent programming in
java second edition");
-
+ assertThat(books, hasSize(1));
+ assertThat(books.get(0).getTitle(), equalTo("Concurrent
programming in java second edition"));
}
-
-
-
-
}
=======================================
---
/examples/basicPersistence/src/test/java/org/parancoe/example/dao/PersonDaoTest.java
Wed Oct 8 01:20:52 2008
+++
/examples/basicPersistence/src/test/java/org/parancoe/example/dao/PersonDaoTest.java
Wed Feb 27 11:26:14 2013
@@ -1,37 +1,58 @@
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic Persistence.
+ *
+ * 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 org.parancoe.example.dao;

import java.util.List;
import javax.annotation.Resource;
import org.parancoe.example.po.Person;
import org.parancoe.example.test.BaseTest;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.hasSize;
+import org.junit.Test;

/**
*
* @author lucio
*/
public class PersonDaoTest extends BaseTest {
-
+
@Resource
private PersonDao personDao;
-
+
/**
* Test of findByLastName method, of class PersonDao.
*/
- public void testFindByLastName() {
+ @Test
+ public void findByLastName() {
List<Person> people = personDao.findByLastName("Benfante");
- assertEquals(8, people.size());
- for (Person p: people) {
- assertEquals("Benfante", p.getLastName());
+ assertThat(people, hasSize(8));
+ for (Person p : people) {
+ assertThat(p.getLastName(), equalTo("Benfante"));
}
}

- public void testFindByFirstName() {
+ @Test
+ public void findByFirstName() {
List<Person> people = personDao.findByFirstName("Ugo");
- assertEquals(2, people.size());
- for (Person p: people) {
- assertEquals("Ugo", p.getFirstName());
- System.out.println(p);
+ assertThat(people, hasSize(2));
+ for (Person p : people) {
+ assertThat(p.getFirstName(), equalTo("Ugo"));
}
}
-
}
=======================================
---
/examples/basicPersistence/src/test/java/org/parancoe/example/test/BaseTest.java
Thu Aug 26 09:01:23 2010
+++
/examples/basicPersistence/src/test/java/org/parancoe/example/test/BaseTest.java
Wed Feb 27 11:26:14 2013
@@ -1,54 +1,32 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic Persistence.
+ *
+ * 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 org.parancoe.example.test;

-
-import org.lambico.test.spring.hibernate.DBTest;
+import org.lambico.test.spring.hibernate.junit4.FixtureSet;
import org.parancoe.example.po.Book;
import org.parancoe.example.po.Person;
+import org.parancoe.test.junit4.AbstractContextTest;

/**
* A base class for basic persistence example tests.
- *
+ *
* @author lucio
*/
-public abstract class BaseTest extends DBTest {
-
-// @SuppressWarnings(value = "unchecked")
-// protected ApplicationContext getTestContext() {
-// BeanFactoryLocator bfl = SingletonBeanFactoryLocator.getInstance(
-// "beanRefFactory_test.xml");
-// BeanFactoryReference bf =
bfl.useBeanFactory("org.parancoe.example");
-// ApplicationContext lctx = (ApplicationContext) bf.getFactory();
-// Map daoMap = (Map) lctx.getBean("daoMap");
-// Map ldaos = DaoUtils.getDaos(lctx);
-// daoMap.putAll(ldaos);
-// return lctx;
-// }
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{Person.class, Book.class};
- }
-
- @Override
- protected String[] getConfigLocations() {
- return new String[]{
- "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
- "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "classpath:database_test.xml",
- "classpath:applicationContext.xml"
- };
- }
+@FixtureSet(modelClasses = {Person.class, Book.class})
+public abstract class BaseTest extends AbstractContextTest {
}
=======================================
--- /examples/basicPersistence/src/test/resources/fixtures/Book.yml Tue
Jul 1 13:36:11 2008
+++ /examples/basicPersistence/src/test/resources/fixtures/Book.yml Wed Feb
27 11:26:14 2013
@@ -1,3 +1,21 @@
+#
+# Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+#
+# This file is part of Parancoe Example - Basic Persistence.
+#
+# 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.
+#
+
- &Book-Concurrent
author: "Doug Lea"
title: "Concurrent programming in java second edition"
=======================================
--- /examples/basicPersistence/src/test/resources/fixtures/Person.yml Sun
Feb 24 06:37:07 2013
+++ /examples/basicPersistence/src/test/resources/fixtures/Person.yml Wed
Feb 27 11:26:14 2013
@@ -1,3 +1,21 @@
+#
+# Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+#
+# This file is part of Parancoe Example - Basic Persistence.
+#
+# 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.
+#
+
- &Person-lucio
firstName: Lucio
lastName: Benfante
=======================================
--- /examples/basicWebApp/pom.xml Sun Feb 24 06:37:07 2013
+++ /examples/basicWebApp/pom.xml Wed Feb 27 11:26:14 2013
@@ -7,6 +7,11 @@
<version>3.0-SNAPSHOT</version>
<name>Parancoe Example - Basic WebApp</name>
<url>http://www.parancoe.org</url>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <main.basedir>${basedir}/../..</main.basedir>
+ <year>2006-2013</year>
+ </properties>
<build>
<finalName>basicWebApp</finalName>
<plugins>
@@ -40,6 +45,50 @@
<!--argLine>-Xmx512M</argLine-->
</configuration>
</plugin>
+ <plugin>
+ <groupId>com.mycila.maven-license-plugin</groupId>
+ <artifactId>maven-license-plugin</artifactId>
+ <version>1.9.0</version>
+ <configuration>
+ <header>${main.basedir}/LICENSE_HEADER</header>
+ <strictCheck>true</strictCheck>
+ <aggregate>false</aggregate>
+ <excludes>
+ <exclude>target/**</exclude>
+ <exclude>m2-target/**</exclude>
+ <exclude>**/*.properties</exclude>
+ <exclude>LICENSE_HEADER</exclude>
+ <exclude>nb-configuration.xml</exclude>
+ <exclude>nbactions.xml</exclude>
+ <exclude>profiles.xml</exclude>
+ <exclude>.idea/**</exclude>
+ <exclude>.hgtags</exclude>
+ <exclude>.hgignore</exclude>
+ <exclude>catalog.xml</exclude>
+ <exclude>**/BUGS</exclude>
+ <exclude>**/LICENSE</exclude>
+ <exclude>**/TODO</exclude>
+ </excludes>
+ <properties>
+ <name>${project.name}</name>
+ <year>${year}</year>
+ <holder>The Parancoe Team</holder>
+ <contact>in...@parancoe.org</contact>
+ </properties>
+ <encoding>UTF-8</encoding>
+ <mapping>
+ <yml>SCRIPT_STYLE</yml>
+ <jspf>DYNASCRIPT_STYLE</jspf>
+ </mapping>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<dependencyManagement>
@@ -171,5 +220,11 @@
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.2</version>
</dependency>
+ <dependency>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-test</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
=======================================
--- /examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/Blos.java
Tue Sep 23 13:50:22 2008
+++ /examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/Blos.java
Wed Feb 27 11:26:14 2013
@@ -1,23 +1,27 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp;

import org.parancoe.basicWebApp.blo.SampleBlo;
import org.parancoe.basicWebApp.blo.PersonBo;

public class Blos {
-
+
public SampleBlo sample;
public PersonBo person;

=======================================
--- /examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/Conf.java
Thu Feb 15 13:40:14 2007
+++ /examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/Conf.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp;

import org.parancoe.util.BaseConf;
=======================================
--- /examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/Daos.java
Thu Aug 26 09:01:23 2010
+++ /examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/Daos.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp;

import org.lambico.dao.DaoProvider;
@@ -25,5 +29,5 @@
* @version $Revision$
*/
public interface Daos extends DaoProvider {
- public PersonDao getPersonDao();
+ public PersonDao getPersonDao();
}
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/PopulateInitialDataContextListener.java
Thu Oct 16 04:41:19 2008
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/PopulateInitialDataContextListener.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2007-2008 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp;

import org.parancoe.plugins.security.Authority;
@@ -21,10 +25,10 @@
* @author jacopo
*/
public class PopulateInitialDataContextListener extends
org.parancoe.web.PopulateInitialDataContextListener {
-
+
public PopulateInitialDataContextListener() {
clazzToPopulate.add(Authority.class);
clazzToPopulate.add(User.class);
}
-
+
}
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/ajaxblo/PersonBo.java
Wed Oct 8 08:37:20 2008
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/ajaxblo/PersonBo.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2008 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp.ajaxblo;

import org.parancoe.basicWebApp.po.Person;
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/blo/PersonBo.java
Wed Oct 8 08:37:20 2008
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/blo/PersonBo.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2008 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp.blo;

import org.parancoe.basicWebApp.po.Person;
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/blo/SampleBlo.java
Thu Feb 15 13:40:14 2007
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/blo/SampleBlo.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp.blo;

public class SampleBlo {
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/AdminController.java
Sun Feb 24 06:37:07 2013
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/AdminController.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp.controllers;

import java.util.HashMap;
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/BasicPropertyEditorRegistrar.java
Thu May 24 13:24:02 2007
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/BasicPropertyEditorRegistrar.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp.controllers;

import java.text.SimpleDateFormat;
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/BasicWebAppBindingInitializer.java
Thu Oct 16 04:41:19 2008
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/BasicWebAppBindingInitializer.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp.controllers;

import java.text.SimpleDateFormat;
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/HomeController.java
Sun Feb 24 06:37:07 2013
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/HomeController.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2008 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp.controllers;

import java.util.*;
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/ItalyController.java
Sun Feb 24 06:37:07 2013
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/ItalyController.java
Wed Feb 27 11:26:14 2013
@@ -1,3 +1,20 @@
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp.controllers;

import org.springframework.web.servlet.ModelAndView;
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/PeopleController.java
Sun Feb 24 06:37:07 2013
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/PeopleController.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp.controllers;

import java.text.ParseException;
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/PeopleEditController.java
Sun Feb 24 06:37:07 2013
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/controllers/PeopleEditController.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2008 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp.controllers;

import javax.annotation.Resource;
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/dao/PersonDao.java
Thu Aug 26 09:01:23 2010
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/dao/PersonDao.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp.dao;

import org.parancoe.basicWebApp.po.Person;
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/dao/SampleDao.java
Thu Feb 15 13:40:14 2007
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/dao/SampleDao.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp.dao;

public class SampleDao {
=======================================
---
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/po/Person.java
Thu Aug 26 09:01:23 2010
+++
/examples/basicWebApp/src/main/java/org/parancoe/basicWebApp/po/Person.java
Wed Feb 27 11:26:14 2013
@@ -1,16 +1,20 @@
-// Copyright 2006-2007 The Parancoe Team
-//
-// 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.
+/**
+ * Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Example - Basic WebApp.
+ *
+ * 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 org.parancoe.basicWebApp.po;

import java.util.Date;
@@ -28,13 +32,13 @@

@javax.persistence.Entity()
public class Person extends EntityBase {
-
+
private boolean test = BaseConf.isDevelopment();
-
+
private String firstName;
-
+
private String lastName;
-
+
@DateTimeFormat(pattern="dd/MM/yyyy")
private Date birthDate;

@@ -82,11 +86,11 @@
public void setTest(boolean test){
this.test = test;
}
-
+
public boolean isTest(){
return test;
}
-
+
@Override
public String toString() {
return firstName + " " + lastName + " nato il " + birthDate ;
=======================================
--- /examples/basicWebApp/src/main/resources/initialData/Authority.yml Tue
Sep 23 13:50:22 2008
+++ /examples/basicWebApp/src/main/resources/initialData/Authority.yml Wed
Feb 27 11:26:14 2013
@@ -1,3 +1,21 @@
+#
+# Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+#
+# This file is part of Parancoe Example - Basic WebApp.
+#
+# 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.
+#
+
- &Authority-parancoe
role: ROLE_PARANCOE
- &Authority-admin
=======================================
--- /examples/basicWebApp/src/main/resources/initialData/User.yml Tue Sep
23 13:50:22 2008
+++ /examples/basicWebApp/src/main/resources/initialData/User.yml Wed Feb
27 11:26:14 2013
@@ -1,3 +1,21 @@
+#
+# Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+#
+# This file is part of Parancoe Example - Basic WebApp.
+#
+# 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.
+#
+
- &User-parancoe
username: parancoe
password: parancoe
=======================================
--- /examples/basicWebApp/src/main/webapp/META-INF/context.xml Thu Aug 26
09:01:23 2010
+++ /examples/basicWebApp/src/main/webapp/META-INF/context.xml Wed Feb 27
11:26:14 2013
@@ -1,4 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Example - Basic WebApp.
+
+ 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.
+
+-->
<Context path="/basicWebApp" reloadable="true">
<Resource auth="Container" driverClassName="org.hsqldb.jdbcDriver"
maxActive="3" name="jdbc/dataSource" password=""
type="javax.sql.DataSource" url="jdbc:hsqldb:mem:parancoe" username="sa"/>
</Context>
=======================================
--- /examples/basicWebApp/src/main/webapp/WEB-INF/applicationContext.xml
Sun Feb 24 06:37:07 2013
+++ /examples/basicWebApp/src/main/webapp/WEB-INF/applicationContext.xml
Wed Feb 27 11:26:14 2013
@@ -1,4 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Example - Basic WebApp.
+
+ 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:context="http://www.springframework.org/schema/context"
xmlns:lambico="http://www.lambico.org/schema/lambico"
=======================================
--- /examples/basicWebApp/src/main/webapp/WEB-INF/database.xml Sun Feb 24
06:37:07 2013
+++ /examples/basicWebApp/src/main/webapp/WEB-INF/database.xml Wed Feb 27
11:26:14 2013
@@ -1,4 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Example - Basic WebApp.
+
+ 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:parancoe="http://www.parancoe.org/schema/parancoe"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
=======================================
--- /examples/basicWebApp/src/main/webapp/WEB-INF/jsp/404.jsp Tue Jan 16
13:38:29 2007
+++ /examples/basicWebApp/src/main/webapp/WEB-INF/jsp/404.jsp Wed Feb 27
11:26:14 2013
@@ -1,3 +1,22 @@
+<%--
+
+ Copyright (C) 2006-2013 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Example - Basic WebApp.
+
+ 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.
+
+--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="common.jspf" %>
=======================================
***Additional files exist in this changeset.***

==============================================================================
Revision: 04cccafa4317
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 09:47:35 2013
Log: remove unused mapping files from example applications
http://code.google.com/p/parancoe/source/detail?r=04cccafa4317

Deleted:
/examples/basicWebApp/src/main/resources/hibernate-mappings.cfg.xml

/examples/basicWebAppEvolution/src/main/resources/hibernate-mappings.cfg.xml

=======================================
--- /examples/basicWebApp/src/main/resources/hibernate-mappings.cfg.xml Thu
May 10 00:46:22 2007
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-configuration PUBLIC
-"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-
-<hibernate-configuration>
- <session-factory>
- <!-- No more required
- <mapping class="org.parancoe.basicWebApp.po.Person"/>
- <mapping class="org.parancoe.persistence.security.UserProfile"/>
- <mapping class="org.parancoe.persistence.security.Authorities"/>
- -->
- </session-factory>
-</hibernate-configuration>
=======================================
---
/examples/basicWebAppEvolution/src/main/resources/hibernate-mappings.cfg.xml
Mon Apr 2 20:46:07 2012
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-configuration PUBLIC
-"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-
-<hibernate-configuration>
- <session-factory>
- <!-- No more required
- <mapping class="org.parancoe.basicWebApp.po.Person"/>
- <mapping class="org.parancoe.persistence.security.UserProfile"/>
- <mapping class="org.parancoe.persistence.security.Authorities"/>
- -->
- </session-factory>
-</hibernate-configuration>

==============================================================================
Revision: ece9c2598f70
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 09:48:50 2013
Log: plugins gets new jUnit4 tests
http://code.google.com/p/parancoe/source/detail?r=ece9c2598f70

Added:

/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/ParancoeTest.java

/plugins/parancoe-plugin-configuration/src/test/resources/applicationContext-test.xml
/plugins/parancoe-plugin-configuration/src/test/resources/database-test.xml
Deleted:

/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/SanityTest.java
/plugins/parancoe-plugin-configuration/src/test/resources/spring-test.xml
Modified:
/plugins/parancoe-plugin-configuration/pom.xml

/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/BaseTest.java

/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/CategoryDaoTest.java

/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/PropertyDaoTest.java

/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/RestServicesTest.java

/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/TestContextListener.java
/plugins/parancoe-plugin-configuration/src/test/resources/logback-test.xml
/plugins/parancoe-plugin-security/src/test/resources/logback-test.xml

/plugins/parancoe-plugin-springsecurity-evolution/src/test/resources/spring-test.xml
/plugins/pom.xml

=======================================
--- /dev/null
+++
/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/ParancoeTest.java
Wed Feb 27 09:48:50 2013
@@ -0,0 +1,57 @@
+/**
+ * Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Plugin Configuration.
+ *
+ * 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 org.parancoe.plugin.configuration;
+
+import org.parancoe.plugin.configuration.dao.CategoryDao;
+import org.parancoe.plugin.configuration.dao.PropertyDao;
+import org.parancoe.web.plugin.WebPlugin;
+import org.parancoe.web.test.junit4.AbstractPluginTest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;
+
+/**
+ * test everything has been loaded properly
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+public class ParancoeTest extends AbstractPluginTest {
+
+ @Autowired
+ @Qualifier("parancoe-plugin-configurationPluginConfig")
+ private WebPlugin plugin;
+ @Autowired
+ private InitializerContextListener sampleContextListener;
+ @Autowired
+ private SampleInterceptor sampleInterceptor;
+ @Autowired
+ private CategoryDao categoryDao;
+ @Autowired
+ private PropertyDao propertyDao;
+
+ @Test
+ public void sanity() {
+ assertThat(plugin, is(notNullValue()));
+ assertThat(sampleContextListener, is(notNullValue()));
+ assertThat(sampleInterceptor, is(notNullValue()));
+ assertThat(categoryDao, is(notNullValue()));
+ assertThat(propertyDao, is(notNullValue()));
+ }
+}
=======================================
--- /dev/null
+++
/plugins/parancoe-plugin-configuration/src/test/resources/applicationContext-test.xml
Wed Feb 27 09:48:50 2013
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Plugin Configuration.
+
+ 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:context="http://www.springframework.org/schema/context"
+ 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.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
+ http://www.lambico.org/schema/lambico
http://www.lambico.org/schema/lambico.xsd">
+
+</beans>
+
=======================================
--- /dev/null
+++
/plugins/parancoe-plugin-configuration/src/test/resources/database-test.xml
Wed Feb 27 09:48:50 2013
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Plugin Configuration.
+
+ 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:context="http://www.springframework.org/schema/context"
+ 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.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+ <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:mem:test"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </bean>
+
+ <bean id="sessionFactory" parent="abstractSessionFactory">
+ <property name="eventListeners">
+ <map>
+ <entry key="merge">
+ <bean
class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
+ </entry>
+ </map>
+ </property>
+ <property name="hibernateProperties">
+ <props merge="true">
+ <prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect
+ </prop>
+ <prop key="hibernate.hbm2ddl.auto">create
+ </prop>
+ <prop key="hibernate.show_sql">false
+ </prop>
+ </props>
+ </property>
+ </bean>
+</beans>
+
=======================================
---
/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/SanityTest.java
Thu May 3 06:29:42 2012
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Plugin Configuration.
- *
- * 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 org.parancoe.plugin.configuration;
-
-import org.parancoe.plugin.configuration.dao.CategoryDao;
-import org.parancoe.plugin.configuration.dao.PropertyDao;
-import org.parancoe.web.plugin.WebPlugin;
-import org.parancoe.web.test.PluginTest;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-
-public class SanityTest extends PluginTest {
-
- @Autowired
- @Qualifier("parancoe-plugin-configurationPluginConfig")
- private WebPlugin plugin;
-
- @Autowired
- private InitializerContextListener sampleContextListener;
-
- @Autowired
- private SampleInterceptor sampleInterceptor;
-
- @Autowired
- private CategoryDao categoryDao;
- @Autowired
- private PropertyDao propertyDao;
-
- /* test everything has been loaded properly */
- public void testSanity() {
- assertNotNull(plugin);
- assertNotNull(sampleContextListener);
- assertNotNull(sampleInterceptor);
- assertNotNull(categoryDao);
- assertNotNull(propertyDao);
- }
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{};
- }
-
-}
=======================================
---
/plugins/parancoe-plugin-configuration/src/test/resources/spring-test.xml
Mon Oct 29 01:24:47 2012
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
-
- This file is part of Parancoe Plugin Configuration.
-
- 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:context="http://www.springframework.org/schema/context"
- 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.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.lambico.org/schema/lambico
http://www.lambico.org/schema/lambico.xsd">
-
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:mem:test"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </bean>
-
- <bean id="sessionFactory" parent="abstractSessionFactory">
- <property name="eventListeners">
- <map>
- <entry key="merge">
- <bean
class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
- </entry>
- </map>
- </property>
- <property name="hibernateProperties">
- <props merge="true">
- <prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect
- </prop>
- <prop key="hibernate.hbm2ddl.auto">create
- </prop>
- <prop key="hibernate.show_sql">true
- </prop>
- </props>
- </property>
- </bean>
-</beans>
-
=======================================
--- /plugins/parancoe-plugin-configuration/pom.xml Thu Feb 28 09:41:36 2013
+++ /plugins/parancoe-plugin-configuration/pom.xml Wed Feb 27 09:48:50 2013
@@ -35,5 +35,11 @@
<version>6.1.26</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ <version>1.3</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
=======================================
---
/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/BaseTest.java
Mon Apr 30 00:39:28 2012
+++
/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/BaseTest.java
Wed Feb 27 09:48:50 2013
@@ -17,15 +17,11 @@
*/
package org.parancoe.plugin.configuration;

+import org.lambico.test.spring.hibernate.junit4.FixtureSet;
import org.parancoe.plugin.configuration.po.Category;
import org.parancoe.plugin.configuration.po.Property;
-import org.parancoe.web.test.PluginTest;
+import org.parancoe.web.test.junit4.AbstractPluginTest;

-public abstract class BaseTest extends PluginTest {
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{Category.class, Property.class};
- }
-
+@FixtureSet(modelClasses = {Category.class, Property.class})
+public abstract class BaseTest extends AbstractPluginTest {
}
=======================================
---
/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/CategoryDaoTest.java
Thu May 3 06:29:42 2012
+++
/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/CategoryDaoTest.java
Wed Feb 27 09:48:50 2013
@@ -21,26 +21,33 @@
import org.parancoe.plugin.configuration.dao.CategoryDao;
import org.parancoe.plugin.configuration.po.Category;
import org.springframework.beans.factory.annotation.Autowired;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
+import org.junit.Test;

public class CategoryDaoTest extends BaseTest {
-
+
@Autowired
private CategoryDao categoryDao;
-
- public void testFindAll() {
+
+ @Test
+ public void findAll() {
List<Category> results = categoryDao.findAll();
- assertSize(2, results);
+ assertThat(results, hasSize(2));
}

- public void testFindAllOrdered() {
+ @Test
+ public void findAllOrdered() {
List<Category> results = categoryDao.findByOrderByName();
- assertSize(2, results);
+ assertThat(results, hasSize(2));
}
-
- public void testFindByName() {
+
+ @Test
+ public void findByName() {
Category result = categoryDao.findByName("first_category");
- assertNotNull(result);
- assertEquals("first_category", result.getName());
- assertSize(1, result.getProperties());
+ assertThat(result, is(notNullValue()));
+ assertThat(result.getName(), equalTo("first_category"));
+ assertThat(result.getProperties(), hasSize(1));
}
}
=======================================
---
/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/PropertyDaoTest.java
Mon Apr 30 00:39:28 2012
+++
/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/PropertyDaoTest.java
Wed Feb 27 09:48:50 2013
@@ -28,6 +28,11 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.hibernate3.HibernateTemplate;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
+import static org.hamcrest.number.BigDecimalCloseTo.closeTo;
+import org.junit.Test;

public class PropertyDaoTest extends BaseTest {

@@ -36,72 +41,81 @@
@Autowired
private CategoryDao categoryDao;

- public void testFindAll() {
+ @Test
+ public void findAll() {
List<Property> results = propertyDao.findAll();
- assertSize(5, results);
+ assertThat(results, hasSize(5));
}

- public void testFindByNameAndCategoryId() {
+ @Test
+ public void findByNameAndCategoryId() {
Category category = categoryDao.findByName("first_category");
Property property =
propertyDao.findByNameAndCategoryId("first_property",
category.getId());
- assertNotNull(property);
- assertEquals("first_property", property.getName());
- assertEquals(category.getId(), property.getCategory().getId());
- assertEquals(PropertyType.STRING, property.getType());
- assertEquals("first value", property.getValue());
+ assertThat(property, is(notNullValue()));
+ assertThat(property.getName(), equalTo("first_property"));
+ assertThat(property.getCategory().getId(),
equalTo(category.getId()));
+ assertThat(property.getType(), equalTo(PropertyType.STRING));
+ assertThat(property.getValue(), equalTo("first value"));
}

- public void testFindIntegerProperty() {
+ @Test
+ public void findIntegerProperty() {
Category category = categoryDao.findByName("second_category");
Property property =
propertyDao.findByNameAndCategoryId("integer_property",
category.getId());
- assertEquals(PropertyType.INTEGER, property.getType());
- assertEquals(Integer.valueOf("10"), property.getValueAsInteger());
+ assertThat(property.getType(), equalTo(PropertyType.INTEGER));
+ assertThat(property.getValueAsInteger(),
equalTo(Integer.valueOf("10")));
}

- public void testFindBooleanProperty() {
+ @Test
+ public void findBooleanProperty() {
Category category = categoryDao.findByName("second_category");
Property property =
propertyDao.findByNameAndCategoryId("boolean_property",
category.getId());
- assertEquals(PropertyType.BOOLEAN, property.getType());
- assertEquals(Boolean.TRUE, property.getValueAsBoolean());
+ assertThat(property.getType(), equalTo(PropertyType.BOOLEAN));
+ assertThat(property.getValueAsBoolean(), equalTo(Boolean.TRUE));
}

- public void testFindRealProperty() {
+ @Test
+ public void findRealProperty() {
Category category = categoryDao.findByName("second_category");
Property property =
propertyDao.findByNameAndCategoryId("real_property",
category.getId());
- assertEquals(PropertyType.REAL, property.getType());
- assertEquals(new BigDecimal(
+ assertThat(property.getType(), equalTo(PropertyType.REAL));
+ assertThat(property.getValueAsReal(), closeTo(new BigDecimal(
"3.141592653589793238462643383279502884197169399375105820974944592"),
- property.getValueAsReal());
+ BigDecimal.ZERO));
}

- public void testFindTextProperty() {
+ @Test
+ public void findTextProperty() {
Category category = categoryDao.findByName("second_category");
Property property =
propertyDao.findByNameAndCategoryId("text_property",
category.getId());
- assertEquals(PropertyType.TEXT, property.getType());
- assertEquals("Here you can have a very long text.",
property.getTypedValue());
+ assertThat(property.getType(), equalTo(PropertyType.TEXT));
+ assertThat(property.getTypedValue().toString(), equalTo(
+ "Here you can have a very long text."));
}
-
- public void testSetStringValue() {
+
+ @Test
+ public void setStringValue() {
Category category = categoryDao.findByName("first_category");
Property property =
propertyDao.findByNameAndCategoryId("first_property",
category.getId());
String newValue = "A new value";
property.setTypedValue(newValue);
- assertSame(newValue, property.getValue());
+ assertThat(property.getValue(), is(sameInstance(newValue)));
Property oldObject = property;
fixAndClearSession(property);
property =
propertyDao.findByNameAndCategoryId("first_property",
category.getId());
- assertNotSame(oldObject, property);
- assertEquals(newValue, property.getTypedValue());
+ assertThat(property, is(not(sameInstance(oldObject))));
+ assertThat(property.getTypedValue().toString(), equalTo(newValue));
}

- public void testSetIntegerValue() {
+ @Test
+ public void setIntegerValue() {
Category category = categoryDao.findByName("second_category");
String propertyName = "integer_property";
Property property =
@@ -111,10 +125,11 @@
fixAndClearSession(property);
property =
propertyDao.findByNameAndCategoryId(propertyName,
category.getId());
- assertEquals(newValue, property.getValueAsInteger());
+ assertThat(property.getValueAsInteger(), equalTo(newValue));
}

- public void testSetRealValue() {
+ @Test
+ public void setRealValue() {
Category category = categoryDao.findByName("second_category");
String propertyName = "real_property";
Property property =
@@ -124,10 +139,11 @@
fixAndClearSession(property);
property =
propertyDao.findByNameAndCategoryId(propertyName,
category.getId());
- assertEquals(newValue, property.getValueAsReal());
+ assertThat(property.getValueAsReal(), equalTo(newValue));
}

- public void testSetBooleanValue() {
+ @Test
+ public void setBooleanValue() {
Category category = categoryDao.findByName("second_category");
String propertyName = "boolean_property";
Property property =
@@ -137,10 +153,11 @@
fixAndClearSession(property);
property =
propertyDao.findByNameAndCategoryId(propertyName,
category.getId());
- assertEquals(newValue, property.getValueAsBoolean());
+ assertThat(property.getValueAsBoolean(), equalTo(newValue));
}

- public void testSetTextValue() {
+ @Test
+ public void setTextValue() {
Category category = categoryDao.findByName("second_category");
String propertyName = "text_property";
Property property =
@@ -150,13 +167,12 @@
fixAndClearSession(property);
property =
propertyDao.findByNameAndCategoryId(propertyName,
category.getId());
- assertEquals(newValue, property.getValue());
+ assertThat(property.getValue(), equalTo(newValue));
}
-
+
private void fixAndClearSession(Property property) throws
DataAccessException {
propertyDao.store(property);
- HibernateTemplate hibernateTemplate =
- ((HibernateGenericDao)propertyDao).getHibernateTemplate();
+ HibernateTemplate hibernateTemplate = ((HibernateGenericDao)
propertyDao).getHibernateTemplate();
hibernateTemplate.flush();
hibernateTemplate.evict(property);
}
=======================================
---
/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/RestServicesTest.java
Mon Oct 29 01:24:47 2012
+++
/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/RestServicesTest.java
Wed Feb 27 09:48:50 2013
@@ -17,49 +17,39 @@
*/
package org.parancoe.plugin.configuration;

-
-import java.util.List;
-import junit.framework.Assert;
-
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.junit.runner.RunWith;
import org.parancoe.plugin.configuration.bo.ConfigurationService;
-import org.parancoe.plugin.configuration.po.Category;
import org.parancoe.plugin.configuration.po.Property;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
+import org.parancoe.web.test.junit4.AbstractPluginTest;
+import
org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;

/**
* Test CXF REST services
*
* @author Arjun Dhar
*/
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = {
- "classpath:org/parancoe/plugin/configuration/rest-test-client.xml"
-})
-public class RestServicesTest {
+@ContextConfiguration(locations =
{"/org/parancoe/plugin/configuration/rest-test-client.xml"})
+public class RestServicesTest extends AbstractJUnit4SpringContextTests {

- private static Logger log =
LoggerFactory.getLogger(RestServicesTest.class);
private static SelfServer server;
-
@Autowired
@Qualifier("testclient")
protected ConfigurationService proxy;
-
@Autowired
@Qualifier("testclientxml")
protected ConfigurationService proxyXml;
-
+
@BeforeClass
public static void startServer() throws Exception {
- /* please note, in actuality, for multiple tests you will have
+ /* please note, in actuality, for multiple tests you will have
to ensure a single version of the server is running only.

For each test case, it will invoke start and will give an error.
@@ -74,63 +64,62 @@
}

@Test
- public void testGetPropertyByCategoryAndName() throws Exception {
+ public void getPropertyByCategoryAndName() throws Exception {
Property property =
proxy.getProperty("first_category", "first_property");
- Assert.assertNotNull(property);
- Assert.assertEquals("first_property", property.getName());
- Assert.assertEquals("first_category",
property.getCategory().getName());
+ assertThat(property, is(notNullValue()));
+ assertThat(property.getName(), equalTo("first_property"));
+ assertThat(property.getCategory().getName(),
equalTo("first_category"));
}
-
+
@Test
- public void testGetPropertyById() throws Exception {
+ public void getPropertyById() throws Exception {
Property startProperty =
proxy.getProperty("first_category", "first_property");
Property property = proxy.getProperty(startProperty.getId());
- Assert.assertNotNull(property);
- Assert.assertEquals(startProperty.getId(), property.getId());
+ assertThat(property, is(notNullValue()));
+ assertThat(property.getId(), equalTo(startProperty.getId()));
}

@Test
- public void testLoadCategories() throws Exception {
+ public void loadCategories() throws Exception {
ConfigurationCollection configuration = proxy.getConfiguration();
- Assert.assertNotNull(configuration.getCategories());
- Assert.assertEquals(2, configuration.getCategories().size());
+ assertThat(configuration.getCategories(), is(notNullValue()));
+ assertThat(configuration.getCategories(), hasSize(2));
}

@Test
- public void testGetProperties() throws Exception {
+ public void getProperties() throws Exception {
PropertyCollection properties =
proxy.getProperties("first_category");
- Assert.assertNotNull(properties.getProperties());
- Assert.assertEquals(2, properties.getProperties().size());
+ assertThat(properties.getProperties(), is(notNullValue()));
+ assertThat(properties.getProperties(), hasSize(2));
}
-
+
@Test
- public void testXmlGetPropertyByCategoryAndName() throws Exception {
+ public void xmlGetPropertyByCategoryAndName() throws Exception {
Property property =
proxyXml.getProperty("first_category", "first_property");
- Assert.assertNotNull(property);
- Assert.assertEquals("first_property", property.getName());
- Assert.assertEquals("first_category",
property.getCategory().getName());
+ assertThat(property, is(notNullValue()));
+ assertThat(property.getName(), equalTo("first_property"));
+ assertThat(property.getCategory().getName(),
equalTo("first_category"));
}
-
+
@Test
- public void testXmlGetPropertyById() throws Exception {
+ public void xmlGetPropertyById() throws Exception {
Property startProperty =
proxyXml.getProperty("first_category", "first_property");
Property property = proxyXml.getProperty(startProperty.getId());
- Assert.assertNotNull(property);
- Assert.assertEquals(startProperty.getId(), property.getId());
+ assertThat(property, is(notNullValue()));
+ assertThat(property.getId(), equalTo(startProperty.getId()));
}

@Test
- public void testXmlLoadCategories() throws Exception {
+ public void xmlLoadCategories() throws Exception {
ConfigurationCollection categories = proxyXml.getConfiguration();
- Assert.assertNotNull(categories.getCategories());
- Assert.assertEquals(2, categories.getCategories().size());
+ assertThat(categories.getCategories(), is(notNullValue()));
+ assertThat(categories.getCategories(), hasSize(2));
}

@Test
- public void testXmlGetProperties() throws Exception {
+ public void xmlGetProperties() throws Exception {
PropertyCollection properties =
proxyXml.getProperties("first_category");
- Assert.assertNotNull(properties.getProperties());
- Assert.assertEquals(2, properties.getProperties().size());
+ assertThat(properties.getProperties(), is(notNullValue()));
+ assertThat(properties.getProperties(), hasSize(2));
}
-
}
=======================================
---
/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/TestContextListener.java
Mon Oct 29 01:24:47 2012
+++
/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/TestContextListener.java
Wed Feb 27 09:48:50 2013
@@ -37,7 +37,8 @@

config.add("classpath:org/lambico/spring/dao/hibernate/genericDao.xml");

config.add("classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml");
config.add("classpath:org/parancoe/web/parancoeBase.xml");
- config.add("classpath:spring-test.xml");
+ config.add("classpath:database-test.xml");
+ config.add("classpath:applicationContext-test.xml");
config.add("classpath*:parancoe-plugin.xml");
config.add("classpath*:applicationContext-plugin.xml");

config.add("classpath:org/parancoe/plugin/configuration/restful-services.xml");
@@ -51,6 +52,6 @@

populateDaoMap(ctx);
}
-
-
+
+
}
=======================================
---
/plugins/parancoe-plugin-configuration/src/test/resources/logback-test.xml
Thu Feb 28 09:41:36 2013
+++
/plugins/parancoe-plugin-configuration/src/test/resources/logback-test.xml
Wed Feb 27 09:48:50 2013
@@ -27,11 +27,7 @@
<MaxSize>100</MaxSize>
</appender>

- <logger name="org.parancoe" level="DEBUG"/>
- <logger name="org.lambico" level="DEBUG"/>
- <logger name="org.lambico.data" level="INFO"/>
- <logger name="org.parancoe.plugin.configuration" level="DEBUG"/>
- <logger name="org.apache.cxf" level="DEBUG"/>
+ <logger name="org.parancoe" level="INFO"/>

<root level="ERROR">
<appender-ref ref="CONSOLE" />
=======================================
--- /plugins/parancoe-plugin-security/src/test/resources/logback-test.xml
Thu Feb 28 09:41:36 2013
+++ /plugins/parancoe-plugin-security/src/test/resources/logback-test.xml
Wed Feb 27 09:48:50 2013
@@ -25,7 +25,6 @@
</appender>

<logger name="org.parancoe" level="INFO"/>
- <logger name="org.parancoe.plugin.dwr" level="INFO"/>

<root level="ERROR">
<appender-ref ref="CONSOLE" />
=======================================
---
/plugins/parancoe-plugin-springsecurity-evolution/src/test/resources/spring-test.xml
Fri Mar 1 04:03:24 2013
+++
/plugins/parancoe-plugin-springsecurity-evolution/src/test/resources/spring-test.xml
Wed Feb 27 09:48:50 2013
@@ -50,7 +50,7 @@
</prop>
<prop key="hibernate.hbm2ddl.auto">create
</prop>
- <prop key="hibernate.show_sql">true</prop>
+ <prop key="hibernate.show_sql">false</prop>
</props>
</property>
</bean>
=======================================
--- /plugins/pom.xml Thu Feb 28 09:41:36 2013
+++ /plugins/pom.xml Wed Feb 27 09:48:50 2013
@@ -11,10 +11,11 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<main.basedir>${basedir}</main.basedir>
<year>2006-2012</year>
- <parancoe.web.version>3.0-SNAPSHOT</parancoe.web.version>
+ <parancoe.app.version>3.0-SNAPSHOT</parancoe.app.version>
<parancoe.slf4j.version>1.7.2</parancoe.slf4j.version>
<parancoe.junit4.version>4.11</parancoe.junit4.version>
<parancoe.hsqldb.version>2.2.9</parancoe.hsqldb.version>
+ <parancoe.servlet-api.version>2.4</parancoe.servlet-api.version>

<!-- NetBeans IDE properties -->

<org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
@@ -188,6 +189,11 @@
<scope>provided</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>
@@ -203,12 +209,17 @@
<dependency>
<groupId>org.parancoe</groupId>
<artifactId>parancoe-web</artifactId>
- <version>${parancoe.web.version}</version>
+ <version>${parancoe.app.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-test</artifactId>
+ <version>${parancoe.app.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
- <version>2.4</version>
+ <version>${parancoe.servlet-api.version}</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>

==============================================================================
Revision: 56d96fbe29ad
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Thu Feb 28 12:58:30 2013
Log: moved all test related stuff in parancoe-test project
http://code.google.com/p/parancoe/source/detail?r=56d96fbe29ad

Added:
/parancoe-core/src/main/java/org/parancoe/test/LoggingMailSender.java
/parancoe-test/pom.xml

/parancoe-test/src/main/java/org/parancoe/test/InspectableTestMailSender.java

/parancoe-test/src/main/java/org/parancoe/test/junit4/AbstractContextTest.java
/parancoe-test/src/main/java/org/parancoe/web/test/BaseTest.java
/parancoe-test/src/main/java/org/parancoe/web/test/ControllerTest.java
/parancoe-test/src/main/java/org/parancoe/web/test/PluginTest.java
/parancoe-test/src/main/java/org/parancoe/web/test/TagTest.java

/parancoe-test/src/main/java/org/parancoe/web/test/junit4/AbstractControllerTest.java

/parancoe-test/src/main/java/org/parancoe/web/test/junit4/AbstractJspTest.java

/parancoe-test/src/main/java/org/parancoe/web/test/junit4/AbstractPluginTest.java

/parancoe-test/src/main/java/org/parancoe/web/test/junit4/AbstractWebTest.java

/parancoe-test/src/main/java/org/parancoe/web/test/junit4/WebXmlContextLoader.java
Deleted:

/parancoe-core/src/main/java/org/parancoe/test/InspectableTestMailSender.java
/parancoe-core/src/main/java/org/parancoe/test/MailSenderMock.java

/parancoe-core/src/main/java/org/parancoe/test/junit4/AbstractContextTest.java
/parancoe-web/src/main/java/org/parancoe/web/test/BaseTest.java
/parancoe-web/src/main/java/org/parancoe/web/test/ControllerTest.java
/parancoe-web/src/main/java/org/parancoe/web/test/PluginTest.java
/parancoe-web/src/main/java/org/parancoe/web/test/TagTest.java

/parancoe-web/src/main/java/org/parancoe/web/test/junit4/AbstractControllerTest.java

/parancoe-web/src/main/java/org/parancoe/web/test/junit4/AbstractPluginTest.java

/parancoe-web/src/main/java/org/parancoe/web/test/junit4/AbstractWebTest.java

/parancoe-web/src/main/java/org/parancoe/web/test/junit4/WebXmlContextLoader.java
/parancoe-web/src/test/java/org/parancoe/web/AbstractContextTest.java
Modified:
/.hgignore

/examples/basicWebAppEvolution/src/test/java/org/parancoe/basicwebappevolution/controllers/HomeControllerTest.java

/examples/basicWebAppEvolution/src/test/java/org/parancoe/basicwebappevolution/controllers/PersonControllerTest.java
/parancoe-core/pom.xml
/parancoe-web/pom.xml
/parancoe-web/src/test/java/org/parancoe/web/tag/BaseTagTest.java
/parancoe-web/src/test/resources/logback-test.xml
/pom.xml

=======================================
--- /dev/null
+++ /parancoe-core/src/main/java/org/parancoe/test/LoggingMailSender.java
Thu Feb 28 12:58:30 2013
@@ -0,0 +1,56 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Core.
+ *
+ * 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 org.parancoe.test;
+
+import javax.mail.Message;
+import javax.mail.internet.MimeMessage;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.mail.javamail.JavaMailSenderImpl;
+
+/**
+ * Fake sender that logs and discard emails
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+public class LoggingMailSender extends JavaMailSenderImpl {
+
+ private static final Logger logger =
LoggerFactory.getLogger(LoggingMailSender.class);
+
+ @Override
+ protected void doSend(MimeMessage[] mimeMessages, Object[]
originalMessages) {
+ if (mimeMessages != null) {
+ for (MimeMessage mimeMessage : mimeMessages) {
+ try {
+ logger.info("from: {}", (Object[])
mimeMessage.getFrom());
+ logger.info("to: {}", (Object[])
mimeMessage.getRecipients(
+ Message.RecipientType.TO));
+ logger.info("cc: {}", (Object[])
mimeMessage.getRecipients(
+ Message.RecipientType.CC));
+ logger.info("bcc: {}", (Object[])
mimeMessage.getRecipients(
+ Message.RecipientType.BCC));
+ logger.info("subject: {}", mimeMessage.getSubject());
+ logger.info("content: {}",
mimeMessage.getContent().toString());
+ logger.info("content type: {}",
mimeMessage.getContentType());
+ } catch (Exception ex) {
+ logger.error("Can't get message content", ex);
+ }
+ }
+ }
+ }
+}
=======================================
--- /dev/null
+++ /parancoe-test/pom.xml Thu Feb 28 12:58:30 2013
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>parancoe</artifactId>
+ <groupId>org.parancoe</groupId>
+ <version>3.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-test</artifactId>
+ <name>Parancoe Test</name>
+ <version>3.0-SNAPSHOT</version>
+ <url>http://www.parancoe.org</url>
+ <properties>
+ <main.basedir>${basedir}/..</main.basedir>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.lambico</groupId>
+ <artifactId>lambico-test</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${parancoe.servlet-api.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>${parancoe.jsp-api.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <!-- InspectableTestMailSender -->
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4.5</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
=======================================
--- /dev/null
+++
/parancoe-test/src/main/java/org/parancoe/test/InspectableTestMailSender.java
Thu Feb 28 12:58:30 2013
@@ -0,0 +1,49 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Test.
+ *
+ * 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 org.parancoe.test;
+
+import javax.mail.internet.MimeMessage;
+import org.springframework.mail.MailException;
+import org.springframework.mail.javamail.JavaMailSenderImpl;
+
+/**
+ * Inspectable mock implementation of JavaMailSender for testing porpouses.
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+public class InspectableTestMailSender extends JavaMailSenderImpl {
+
+ private MimeMessage[] messages = new MimeMessage[0];
+
+ @Override
+ protected void doSend(MimeMessage[] mimeMessages, Object[]
originalMessages)
+ throws MailException {
+ if (mimeMessages != null) {
+ messages = new MimeMessage[mimeMessages.length];
+ System.arraycopy(mimeMessages, 0, messages, 0,
mimeMessages.length);
+ }
+ }
+
+ public void clearMessages() {
+ messages = new MimeMessage[0];
+ }
+
+ public MimeMessage[] getMessages() {
+ return messages;
+ }
+}
=======================================
--- /dev/null
+++
/parancoe-test/src/main/java/org/parancoe/test/junit4/AbstractContextTest.java
Thu Feb 28 12:58:30 2013
@@ -0,0 +1,36 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Test.
+ *
+ * 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 org.parancoe.test.junit4;
+
+import org.lambico.test.spring.hibernate.junit4.AbstractBaseTest;
+import org.springframework.test.context.ContextConfiguration;
+
+/**
+ * A base class for Parancoe context tests.
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+@ContextConfiguration(inheritLocations = false,
+ locations = {"/org/lambico/spring/dao/hibernate/genericDao.xml",
+ "/org/lambico/spring/dao/hibernate/applicationContextBase.xml",
+ "/org/parancoe/core/applicationContextBase.xml",
+ "/applicationContext.xml",
+ "/database-test.xml",
+ "/applicationContext-test.xml"})
+public abstract class AbstractContextTest extends AbstractBaseTest {
+}
=======================================
--- /dev/null
+++ /parancoe-test/src/main/java/org/parancoe/web/test/BaseTest.java Thu
Feb 28 12:58:30 2013
@@ -0,0 +1,90 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Test.
+ *
+ * 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 org.parancoe.web.test;
+
+import java.io.File;
+import java.io.IOException;
+import org.lambico.test.spring.hibernate.DBTest;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.core.io.FileSystemResourceLoader;
+import org.springframework.mock.web.MockServletContext;
+import org.springframework.web.context.ContextLoader;
+import org.springframework.web.context.WebApplicationContext;
+
+/**
+ * E' la classe base per tutti i test.
+ * Carica all'avvio tutti i bean configurati in modo da renderli
+ * disponibili ai test specifici senza la necessità di tirarli su di volta
in volta con
+ * getCtx().getBean()
+ *
+ * @deprecated please use {@link AbstractWebTest}
+ */
+@Deprecated
+public abstract class BaseTest extends DBTest {
+
+// @Autowired
+// protected BaseConf conf;
+
+ @Override
+ protected String[] getConfigLocations() {
+ String parancoeServlet = null;
+ String applicationContext = null;
+ try {
+ parancoeServlet =
+ new
File("./src/main/webapp/WEB-INF/parancoe-servlet.xml").getCanonicalPath();
+ applicationContext =
+ new
File("./src/main/webapp/WEB-INF/applicationContext.xml").getCanonicalPath();
+ } catch (IOException ex) {
+ throw new RuntimeException("Unable to get parancoe-servlet",
ex);
+ }
+ return new String[]{
+ "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
+ "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
+ "classpath:org/parancoe/core/applicationContextBase.xml",
+ "classpath:org/parancoe/web/parancoeBase.xml", "classpath:database-test.xml",
+ "file:" + applicationContext, "file:" +
parancoeServlet,
+ "classpath*:applicationContext-plugin.xml", "classpath*:parancoe-plugin.xml", "classpath:spring-test.xml"
+ };
+ }
+
+ @Override
+ protected ConfigurableApplicationContext
createApplicationContext(String[] locations) {
+ FileSystemResourceLoader rl = new FileSystemResourceLoader();
+ MockServletContext servletContext = new MockServletContext(rl);
+ servletContext.setMinorVersion(4);
+ servletContext.registerContext("/test", servletContext);
+ servletContext.setServletContextName("/test");
+
servletContext.addInitParameter(ContextLoader.CONFIG_LOCATION_PARAM,
+ arrayToString(locations));
+ ContextLoader loader = new ContextLoader();
+ WebApplicationContext context =
loader.initWebApplicationContext(servletContext);
+ return (ConfigurableApplicationContext) context;
+ }
+
+ private String arrayToString(String[] locations) {
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < locations.length - 1; i++) {
+ sb.append(locations[i]).append(',');
+ }
+ if (locations.length > 0) {
+ sb.append(locations[locations.length - 1]);
+ }
+ return sb.toString();
+ }
+
+}
=======================================
--- /dev/null
+++ /parancoe-test/src/main/java/org/parancoe/web/test/ControllerTest.java
Thu Feb 28 12:58:30 2013
@@ -0,0 +1,73 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Test.
+ *
+ * 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 org.parancoe.web.test;
+
+import javax.servlet.http.HttpSession;
+import org.springframework.mock.web.MockHttpServletRequest;
+import org.springframework.mock.web.MockHttpServletResponse;
+import org.springframework.mock.web.MockMultipartHttpServletRequest;
+
+/**
+ *
+ * @author michele franzin <michele at franzin.net>
+ * @deprecated please use {@link AbstractControllerTest}
+ */
+@Deprecated
+public abstract class ControllerTest extends BaseTest {
+
+ protected MockMultipartHttpServletRequest mpReq;
+ protected MockHttpServletRequest req;
+ protected MockHttpServletResponse res;
+
+ @Override
+ public void onSetUpBeforeTransaction() throws Exception {
+ super.onSetUpBeforeTransaction();
+ resetRequestAndResponse();
+ }
+
+ @Override
+ public void onTearDownAfterTransaction() throws Exception {
+ super.onTearDownAfterTransaction();
+ mpReq = null;
+ req = null;
+ res = null;
+ }
+
+ /**
+ * Reset the request and the response, maintaining the same session.
+ * Useful, for example, to call a post after calling the get of the
form.
+ */
+ protected void resetRequestAndResponse() {
+ HttpSession httpSession = null;
+ // preparing the multipart request
+ if (mpReq != null) {
+ httpSession = mpReq.getSession();
+ }
+ mpReq = new MockMultipartHttpServletRequest();
+ mpReq.setSession(httpSession);
+ mpReq.setMethod("GET");
+ // preparing the normal request
+ if (req != null) {
+ httpSession = req.getSession();
+ }
+ req = new MockHttpServletRequest();
+ req.setSession(httpSession);
+ req.setMethod("GET");
+ res = new MockHttpServletResponse();
+ }
+}
=======================================
--- /dev/null
+++ /parancoe-test/src/main/java/org/parancoe/web/test/PluginTest.java Thu
Feb 28 12:58:30 2013
@@ -0,0 +1,65 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Test.
+ *
+ * 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 org.parancoe.web.test;
+
+import javax.annotation.Resource;
+import javax.servlet.ServletContext;
+import javax.sql.DataSource;
+import org.lambico.test.spring.hibernate.DBTest;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.core.io.FileSystemResourceLoader;
+import org.springframework.mock.web.MockServletContext;
+import org.springframework.web.context.support.XmlWebApplicationContext;
+
+/**
+ * E' la classe base per tutti i test dei plugin.
+ * Carica all'avvio tutti i bean configurati in modo da renderli
+ * disponibili ai test specifici senza la necessità di tirarli su di volta
in volta con
+ * getCtx().getBean()
+ *
+ * @deprecated please use {@link AbstractPluginTest}
+ */
+@Deprecated
+public abstract class PluginTest extends DBTest {
+
+ @Resource
+ protected DataSource dataSource;
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[] {
+ "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
+ "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
+ "classpath:org/parancoe/web/parancoeBase.xml",
+ "classpath:spring-test.xml",
+ "classpath*:parancoe-plugin.xml",
+ "classpath*:applicationContext-plugin.xml"};
+ }
+
+ @Override
+ protected ConfigurableApplicationContext
createApplicationContext(String[] locations) {
+ FileSystemResourceLoader rl = new FileSystemResourceLoader();
+ ServletContext servletContext = new MockServletContext(rl);
+ XmlWebApplicationContext context = new XmlWebApplicationContext();
+ context.setServletContext(servletContext);
+ context.setConfigLocations(locations);
+ context.refresh();
+ return context;
+ }
+
+}
=======================================
--- /dev/null
+++ /parancoe-test/src/main/java/org/parancoe/web/test/TagTest.java Thu Feb
28 12:58:30 2013
@@ -0,0 +1,89 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Test.
+ *
+ * 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 org.parancoe.web.test;
+
+import javax.servlet.http.HttpSession;
+import org.springframework.mock.web.MockHttpServletRequest;
+import org.springframework.mock.web.MockHttpServletResponse;
+import org.springframework.mock.web.MockMultipartHttpServletRequest;
+import org.springframework.mock.web.MockPageContext;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.servlet.support.JspAwareRequestContext;
+import org.springframework.web.servlet.support.RequestContext;
+import org.springframework.web.servlet.tags.RequestContextAwareTag;
+import org.springframework.web.util.WebUtils;
+
+/**
+ * @deprecated please use {@link AbstractContextTest}
+ */
+@Deprecated
+public abstract class TagTest extends BaseTest {
+
+ protected MockMultipartHttpServletRequest mpReq;
+ protected MockHttpServletRequest req;
+ protected MockHttpServletResponse res;
+ protected MockPageContext pc;
+ protected RequestContext rc;
+
+ @Override
+ public void onSetUpBeforeTransaction() throws Exception {
+ super.onSetUpBeforeTransaction();
+ resetRequestAndResponse();
+ }
+
+ @Override
+ public void onTearDownAfterTransaction() throws Exception {
+ super.onTearDownAfterTransaction();
+ mpReq = null;
+ req = null;
+ res = null;
+ pc = null;
+ }
+
+ /**
+ * Reset the request and the response, maintaining the same session.
Useful, for example, to
+ * call a post after calling the get of the form.
+ */
+ protected void resetRequestAndResponse() {
+ HttpSession httpSession = null;
+ // preparing the multipart request
+ if (mpReq != null) {
+ httpSession = mpReq.getSession();
+ }
+ mpReq = new MockMultipartHttpServletRequest();
+ mpReq.setSession(httpSession);
+ mpReq.setMethod("GET");
+ // preparing the normal request
+ if (req != null) {
+ httpSession = req.getSession();
+ }
+ req = new MockHttpServletRequest();
+ req.setSession(httpSession);
+ req.setMethod("GET");
+ req.setContextPath("/testctx");
+ req.setRequestURI("/testctx/test/request/uri");
+
req.setAttribute(WebUtils.FORWARD_REQUEST_URI_ATTRIBUTE, "/testctx/test/forward/request/uri");
+ req.setQueryString("p1=v1&p2=v2&p3=v3");
+ res = new MockHttpServletResponse();
+ pc = new MockPageContext(((WebApplicationContext)
this.getApplicationContext()).
+ getServletContext(), req, res);
+ rc = new JspAwareRequestContext(pc);
+
pc.setAttribute(RequestContextAwareTag.REQUEST_CONTEXT_PAGE_ATTRIBUTE, rc);
+ }
+
+}
=======================================
--- /dev/null
+++
/parancoe-test/src/main/java/org/parancoe/web/test/junit4/AbstractControllerTest.java
Thu Feb 28 12:58:30 2013
@@ -0,0 +1,73 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Test.
+ *
+ * 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 org.parancoe.web.test.junit4;
+
+import javax.servlet.http.HttpSession;
+import org.springframework.mock.web.MockHttpServletRequest;
+import org.springframework.mock.web.MockHttpServletResponse;
+import org.springframework.mock.web.MockMultipartHttpServletRequest;
+import org.springframework.test.context.transaction.AfterTransaction;
+import org.springframework.test.context.transaction.BeforeTransaction;
+
+/**
+ * E' la classe base per tutti i test di controller
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+public abstract class AbstractControllerTest extends AbstractWebTest {
+
+ protected MockMultipartHttpServletRequest multipartRequest;
+ protected MockHttpServletRequest request;
+ protected MockHttpServletResponse response;
+
+ @BeforeTransaction
+ public void prepareRequestAndResponse() {
+ resetRequestAndResponse();
+ }
+
+ @AfterTransaction
+ public void clearRequestAndResponse() {
+ multipartRequest = null;
+ request = null;
+ response = null;
+ }
+
+ /**
+ * Reset the request and the response, maintaining the same session.
Useful, for example, to
+ * call a post after calling the get of the form.
+ */
+ protected void resetRequestAndResponse() {
+ HttpSession httpSession = null;
+ // prepare the multipart request
+ if (multipartRequest != null) {
+ httpSession = multipartRequest.getSession();
+ }
+ multipartRequest = new MockMultipartHttpServletRequest();
+ multipartRequest.setSession(httpSession);
+ multipartRequest.setMethod("GET");
+ // preparing the normal request
+ if (request != null) {
+ httpSession = request.getSession();
+ }
+ request = new MockHttpServletRequest();
+ request.setSession(httpSession);
+ request.setMethod("GET");
+
+ response = new MockHttpServletResponse();
+ }
+}
=======================================
--- /dev/null
+++
/parancoe-test/src/main/java/org/parancoe/web/test/junit4/AbstractJspTest.java
Thu Feb 28 12:58:30 2013
@@ -0,0 +1,63 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Test.
+ *
+ * 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 org.parancoe.web.test.junit4;
+
+import javax.servlet.ServletContext;
+import javax.servlet.jsp.PageContext;
+import org.parancoe.web.test.junit4.AbstractControllerTest;
+import org.springframework.mock.web.MockPageContext;
+import org.springframework.mock.web.MockServletContext;
+import org.springframework.test.context.transaction.AfterTransaction;
+import org.springframework.test.context.transaction.BeforeTransaction;
+import org.springframework.web.context.WebApplicationContext;
+import
org.springframework.web.context.support.GenericWebApplicationContext;
+import org.springframework.web.servlet.support.JspAwareRequestContext;
+import org.springframework.web.servlet.support.RequestContext;
+import org.springframework.web.servlet.tags.RequestContextAwareTag;
+
+/**
+ * E' la classe base per tutti i test che necessitano di contesti (ad
esempio i tag)
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+public abstract class AbstractJspTest extends AbstractControllerTest {
+
+ protected PageContext pageContext;
+ protected RequestContext requestContext;
+
+ @BeforeTransaction
+ public void prepareContexts() {
+ resetContexts();
+ }
+
+ @AfterTransaction
+ public void clearContexts() {
+ pageContext = null;
+ requestContext = null;
+ }
+
+ /**
+ * Reset all contexts.
+ */
+ protected void resetContexts() {
+ GenericWebApplicationContext context =
(GenericWebApplicationContext) applicationContext;
+ ServletContext servletContext = context.getServletContext();
+ pageContext = new MockPageContext(servletContext, request,
response);
+ requestContext = new JspAwareRequestContext(pageContext);
+
pageContext.setAttribute(RequestContextAwareTag.REQUEST_CONTEXT_PAGE_ATTRIBUTE,
+ requestContext);
+ }
+}
=======================================
--- /dev/null
+++
/parancoe-test/src/main/java/org/parancoe/web/test/junit4/AbstractPluginTest.java
Thu Feb 28 12:58:30 2013
@@ -0,0 +1,37 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Test.
+ *
+ * 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 org.parancoe.web.test.junit4;
+
+import org.springframework.test.context.ContextConfiguration;
+
+/**
+ * E' la classe base per i test di plugins.
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+@ContextConfiguration(inheritLocations = false,
+ locations = {"/org/lambico/spring/dao/hibernate/genericDao.xml",
+ "/org/lambico/spring/dao/hibernate/applicationContextBase.xml",
+ "/org/parancoe/core/applicationContextBase.xml",
+ "/org/parancoe/web/parancoeBase.xml",
+ "/database-test.xml",
+ "classpath*:parancoe-plugin.xml",
+ "classpath*:applicationContext-plugin.xml",
+ "/applicationContext-test.xml"})
+public abstract class AbstractPluginTest extends AbstractWebTest {
+}
=======================================
--- /dev/null
+++
/parancoe-test/src/main/java/org/parancoe/web/test/junit4/AbstractWebTest.java
Thu Feb 28 12:58:30 2013
@@ -0,0 +1,41 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Test.
+ *
+ * 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 org.parancoe.web.test.junit4;
+
+import org.parancoe.test.junit4.AbstractContextTest;
+import org.springframework.test.context.ContextConfiguration;
+
+/**
+ * E' la classe base per i test che necessitano del contesto web
+ *
+ * @author michele franzin <michele at franzin.net>
+ */
+@ContextConfiguration(inheritLocations = false,
+ locations = {"/org/lambico/spring/dao/hibernate/genericDao.xml",
+ "/org/lambico/spring/dao/hibernate/applicationContextBase.xml",
+ "/org/parancoe/core/applicationContextBase.xml",
+ "/org/parancoe/web/parancoeBase.xml",
+ "/database-test.xml",
+ "file:./src/main/webapp/WEB-INF/applicationContext.xml",
+ "file:./src/main/webapp/WEB-INF/parancoe-servlet.xml",
+ "classpath*:parancoe-plugin.xml",
+ "classpath*:applicationContext-plugin.xml",
+ "/applicationContext-test.xml"},
+ loader = org.parancoe.web.test.junit4.WebXmlContextLoader.class)
+public abstract class AbstractWebTest extends AbstractContextTest {
+}
=======================================
--- /dev/null
+++
/parancoe-test/src/main/java/org/parancoe/web/test/junit4/WebXmlContextLoader.java
Thu Feb 28 12:58:30 2013
@@ -0,0 +1,90 @@
+/**
+ * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
+ *
+ * This file is part of Parancoe Test.
+ *
+ * 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 org.parancoe.web.test.junit4;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.support.BeanDefinitionReader;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.annotation.AnnotationConfigUtils;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.mock.web.MockServletContext;
+import org.springframework.test.context.support.AbstractContextLoader;
+import org.springframework.util.StringUtils;
+import org.springframework.web.context.WebApplicationContext;
+import
org.springframework.web.context.support.GenericWebApplicationContext;
+
+/**
+ * Concrete implementation of {@link AbstractGenericContextLoader} which
reads bean definitions from
+ * XML resources. NB creates a {@link GenericWebApplicationContext}
suitable fot testing purposes.
+ *
+ * @see {@link GenericXmlContextLoader}.
+ * @author michele franzin <michele at franzin.net>
+ */
+public class WebXmlContextLoader extends AbstractContextLoader {
+
+ private static final Logger logger =
LoggerFactory.getLogger(WebXmlContextLoader.class);
+
+ /**
+ * Returns &quot;
+ * <code>-test.xml</code>&quot;.
+ */
+ @Override
+ public String getResourceSuffix() {
+ return "-test.xml";
+ }
+
+ /**
+ * Loads a Spring ApplicationContext from the supplied
+ * <code>locations</code>. and creates a standard {@link
GenericWebApplicationContext} instance.
+ *
+ * @return a new application context
+ * @see org.springframework.test.context.ContextLoader#loadContext
+ * @see GenericWebApplicationContext
+ * @see #createBeanDefinitionReader(GenericApplicationContext)
+ * @see BeanDefinitionReader
+ */
+ @Override
+ public final ConfigurableApplicationContext loadContext(String...
locations) throws Exception {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Loading ApplicationContext for locations [{}].",
+ StringUtils.arrayToCommaDelimitedString(locations));
+ }
+ GenericWebApplicationContext context = new
GenericWebApplicationContext();
+ createBeanDefinitionReader(context).loadBeanDefinitions(locations);
+ MockServletContext servletContext = new MockServletContext();
+ servletContext.setAttribute(
+
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, context);
+ context.setServletContext(servletContext);
+ AnnotationConfigUtils.registerAnnotationConfigProcessors(context);
+ context.refresh();
+ context.registerShutdownHook();
+ return context;
+ }
+
+ /**
+ * Create a new {@link XmlBeanDefinitionReader}.
+ *
+ * @return a new XmlBeanDefinitionReader.
+ * @see XmlBeanDefinitionReader
+ */
+ private BeanDefinitionReader createBeanDefinitionReader(final
GenericApplicationContext context) {
+ return new XmlBeanDefinitionReader(context);
+ }
+}
=======================================
---
/parancoe-core/src/main/java/org/parancoe/test/InspectableTestMailSender.java
Wed Feb 27 08:46:53 2013
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.test;
-
-import javax.mail.internet.MimeMessage;
-import org.springframework.mail.MailException;
-import org.springframework.mail.javamail.JavaMailSenderImpl;
-
-/**
- * Inspectable mock implementation of JavaMailSender for testing porpouses.
- *
- * @author michele franzin <michele at franzin.net>
- */
-public class InspectableTestMailSender extends JavaMailSenderImpl {
-
- private MimeMessage[] messages = new MimeMessage[0];
-
- @Override
- protected void doSend(MimeMessage[] mimeMessages, Object[]
originalMessages)
- throws MailException {
- if (mimeMessages != null) {
- messages = new MimeMessage[mimeMessages.length];
- System.arraycopy(mimeMessages, 0, messages, 0,
mimeMessages.length);
- }
- }
-
- public void clearMessages() {
- messages = new MimeMessage[0];
- }
-
- public MimeMessage[] getMessages() {
- return messages;
- }
-}
=======================================
--- /parancoe-core/src/main/java/org/parancoe/test/MailSenderMock.java Thu
Feb 28 09:41:36 2013
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.test;
-
-import javax.mail.internet.MimeMessage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.mail.javamail.JavaMailSenderImpl;
-
-/**
- * Mock implementation of JavaMailSender for testing porpouses.
- *
- * @author Enrico Giurin
- * @author Lucio Benfante
- */
-public class MailSenderMock extends JavaMailSenderImpl {
-
- private static final Logger logger =
LoggerFactory.getLogger(MailSenderMock.class);
-
- @Override
- protected void doSend(MimeMessage[] mimeMessages, Object[]
originalMessages) {
- 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());
- }
- }
- }
-}
=======================================
---
/parancoe-core/src/main/java/org/parancoe/test/junit4/AbstractContextTest.java
Tue Feb 26 02:51:02 2013
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.test.junit4;
-
-import org.lambico.test.spring.hibernate.junit4.AbstractBaseTest;
-import org.springframework.test.context.ContextConfiguration;
-
-/**
- * A base class for Parancoe context tests.
- *
- * @author michele franzin <michele at franzin.net>
- */
-@ContextConfiguration(inheritLocations = false,
- locations = {"/org/lambico/spring/dao/hibernate/genericDao.xml",
- "/org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "/org/parancoe/core/applicationContextBase.xml",
- "/applicationContext.xml",
- "/database-test.xml",
- "/applicationContext-test.xml"})
-public abstract class AbstractContextTest extends AbstractBaseTest {
-// TODO move to parancoe-test project
-}
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/test/BaseTest.java Tue Feb
26 02:51:02 2013
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test;
-
-import java.io.File;
-import java.io.IOException;
-import org.lambico.test.spring.hibernate.DBTest;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.core.io.FileSystemResourceLoader;
-import org.springframework.mock.web.MockServletContext;
-import org.springframework.web.context.ContextLoader;
-import org.springframework.web.context.WebApplicationContext;
-
-/**
- * E' la classe base per tutti i test.
- * Carica all'avvio tutti i bean configurati in modo da renderli
- * disponibili ai test specifici senza la necessità di tirarli su di volta
in volta con
- * getCtx().getBean()
- *
- * @deprecated please use {@link AbstractWebTest}
- */
-@Deprecated
-public abstract class BaseTest extends DBTest {
-
-// @Autowired
-// protected BaseConf conf;
-
- @Override
- protected String[] getConfigLocations() {
- String parancoeServlet = null;
- String applicationContext = null;
- try {
- parancoeServlet =
- new
File("./src/main/webapp/WEB-INF/parancoe-servlet.xml").getCanonicalPath();
- applicationContext =
- new
File("./src/main/webapp/WEB-INF/applicationContext.xml").getCanonicalPath();
- } catch (IOException ex) {
- throw new RuntimeException("Unable to get parancoe-servlet",
ex);
- }
- return new String[]{
- "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
- "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "classpath:org/parancoe/core/applicationContextBase.xml",
- "classpath:org/parancoe/web/parancoeBase.xml", "classpath:database-test.xml",
- "file:" + applicationContext, "file:" +
parancoeServlet,
- "classpath*:applicationContext-plugin.xml", "classpath*:parancoe-plugin.xml", "classpath:spring-test.xml"
- };
- }
-
- @Override
- protected ConfigurableApplicationContext
createApplicationContext(String[] locations) {
- FileSystemResourceLoader rl = new FileSystemResourceLoader();
- MockServletContext servletContext = new MockServletContext(rl);
- servletContext.setMinorVersion(4);
- servletContext.registerContext("/test", servletContext);
- servletContext.setServletContextName("/test");
-
servletContext.addInitParameter(ContextLoader.CONFIG_LOCATION_PARAM,
- arrayToString(locations));
- ContextLoader loader = new ContextLoader();
- WebApplicationContext context =
loader.initWebApplicationContext(servletContext);
- return (ConfigurableApplicationContext) context;
- }
-
- private String arrayToString(String[] locations) {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < locations.length - 1; i++) {
- sb.append(locations[i]).append(',');
- }
- if (locations.length > 0) {
- sb.append(locations[locations.length - 1]);
- }
- return sb.toString();
- }
-
-}
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/test/ControllerTest.java
Tue Feb 26 02:51:02 2013
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test;
-
-import javax.servlet.http.HttpSession;
-import org.springframework.mock.web.MockHttpServletRequest;
-import org.springframework.mock.web.MockHttpServletResponse;
-import org.springframework.mock.web.MockMultipartHttpServletRequest;
-
-/**
- *
- * @author michele franzin <michele at franzin.net>
- * @deprecated please use {@link AbstractControllerTest}
- */
-@Deprecated
-public abstract class ControllerTest extends BaseTest {
-
- protected MockMultipartHttpServletRequest mpReq;
- protected MockHttpServletRequest req;
- protected MockHttpServletResponse res;
-
- @Override
- public void onSetUpBeforeTransaction() throws Exception {
- super.onSetUpBeforeTransaction();
- resetRequestAndResponse();
- }
-
- @Override
- public void onTearDownAfterTransaction() throws Exception {
- super.onTearDownAfterTransaction();
- mpReq = null;
- req = null;
- res = null;
- }
-
- /**
- * Reset the request and the response, maintaining the same session.
- * Useful, for example, to call a post after calling the get of the
form.
- */
- protected void resetRequestAndResponse() {
- HttpSession httpSession = null;
- // preparing the multipart request
- if (mpReq != null) {
- httpSession = mpReq.getSession();
- }
- mpReq = new MockMultipartHttpServletRequest();
- mpReq.setSession(httpSession);
- mpReq.setMethod("GET");
- // preparing the normal request
- if (req != null) {
- httpSession = req.getSession();
- }
- req = new MockHttpServletRequest();
- req.setSession(httpSession);
- req.setMethod("GET");
- res = new MockHttpServletResponse();
- }
-}
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/test/PluginTest.java Tue
Feb 26 02:51:02 2013
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test;
-
-import javax.annotation.Resource;
-import javax.servlet.ServletContext;
-import javax.sql.DataSource;
-import org.lambico.test.spring.hibernate.DBTest;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.core.io.FileSystemResourceLoader;
-import org.springframework.mock.web.MockServletContext;
-import org.springframework.web.context.support.XmlWebApplicationContext;
-
-/**
- * E' la classe base per tutti i test dei plugin.
- * Carica all'avvio tutti i bean configurati in modo da renderli
- * disponibili ai test specifici senza la necessità di tirarli su di volta
in volta con
- * getCtx().getBean()
- *
- * @deprecated please use {@link AbstractPluginTest}
- */
-@Deprecated
-public abstract class PluginTest extends DBTest {
-
- @Resource
- protected DataSource dataSource;
-
- @Override
- protected String[] getConfigLocations() {
- return new String[] {
- "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
- "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "classpath:org/parancoe/web/parancoeBase.xml",
- "classpath:spring-test.xml",
- "classpath*:parancoe-plugin.xml",
- "classpath*:applicationContext-plugin.xml"};
- }
-
- @Override
- protected ConfigurableApplicationContext
createApplicationContext(String[] locations) {
- FileSystemResourceLoader rl = new FileSystemResourceLoader();
- ServletContext servletContext = new MockServletContext(rl);
- XmlWebApplicationContext context = new XmlWebApplicationContext();
- context.setServletContext(servletContext);
- context.setConfigLocations(locations);
- context.refresh();
- return context;
- }
-
-}
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/test/TagTest.java Tue Feb
26 02:51:02 2013
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test;
-
-import javax.servlet.http.HttpSession;
-import org.springframework.mock.web.MockHttpServletRequest;
-import org.springframework.mock.web.MockHttpServletResponse;
-import org.springframework.mock.web.MockMultipartHttpServletRequest;
-import org.springframework.mock.web.MockPageContext;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.servlet.support.JspAwareRequestContext;
-import org.springframework.web.servlet.support.RequestContext;
-import org.springframework.web.servlet.tags.RequestContextAwareTag;
-import org.springframework.web.util.WebUtils;
-
-/**
- * @deprecated please use {@link AbstractContextTest}
- */
-@Deprecated
-public abstract class TagTest extends BaseTest {
-
- protected MockMultipartHttpServletRequest mpReq;
- protected MockHttpServletRequest req;
- protected MockHttpServletResponse res;
- protected MockPageContext pc;
- protected RequestContext rc;
-
- @Override
- public void onSetUpBeforeTransaction() throws Exception {
- super.onSetUpBeforeTransaction();
- resetRequestAndResponse();
- }
-
- @Override
- public void onTearDownAfterTransaction() throws Exception {
- super.onTearDownAfterTransaction();
- mpReq = null;
- req = null;
- res = null;
- pc = null;
- }
-
- /**
- * Reset the request and the response, maintaining the same session.
Useful, for example, to
- * call a post after calling the get of the form.
- */
- protected void resetRequestAndResponse() {
- HttpSession httpSession = null;
- // preparing the multipart request
- if (mpReq != null) {
- httpSession = mpReq.getSession();
- }
- mpReq = new MockMultipartHttpServletRequest();
- mpReq.setSession(httpSession);
- mpReq.setMethod("GET");
- // preparing the normal request
- if (req != null) {
- httpSession = req.getSession();
- }
- req = new MockHttpServletRequest();
- req.setSession(httpSession);
- req.setMethod("GET");
- req.setContextPath("/testctx");
- req.setRequestURI("/testctx/test/request/uri");
-
req.setAttribute(WebUtils.FORWARD_REQUEST_URI_ATTRIBUTE, "/testctx/test/forward/request/uri");
- req.setQueryString("p1=v1&p2=v2&p3=v3");
- res = new MockHttpServletResponse();
- pc = new MockPageContext(((WebApplicationContext)
this.getApplicationContext()).
- getServletContext(), req, res);
- rc = new JspAwareRequestContext(pc);
-
pc.setAttribute(RequestContextAwareTag.REQUEST_CONTEXT_PAGE_ATTRIBUTE, rc);
- }
-
-}
=======================================
---
/parancoe-web/src/main/java/org/parancoe/web/test/junit4/AbstractControllerTest.java
Tue Feb 26 02:51:02 2013
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test.junit4;
-
-import javax.servlet.http.HttpSession;
-import org.springframework.mock.web.MockHttpServletRequest;
-import org.springframework.mock.web.MockHttpServletResponse;
-import org.springframework.mock.web.MockMultipartHttpServletRequest;
-import org.springframework.test.context.transaction.AfterTransaction;
-import org.springframework.test.context.transaction.BeforeTransaction;
-
-/**
- * E' la classe base per tutti i test di controller
- *
- * @author michele franzin <michele at franzin.net>
- */
-public abstract class AbstractControllerTest extends AbstractWebTest {
- // TODO move to parancoe-test project
-
- protected MockMultipartHttpServletRequest multipartRequest;
- protected MockHttpServletRequest request;
- protected MockHttpServletResponse response;
-
- @BeforeTransaction
- public void prepareRequestAndResponse() {
- resetRequestAndResponse();
- }
-
- @AfterTransaction
- public void clearRequestAndResponse() {
- multipartRequest = null;
- request = null;
- response = null;
- }
-
- /**
- * Reset the request and the response, maintaining the same session.
Useful, for example, to
- * call a post after calling the get of the form.
- */
- protected void resetRequestAndResponse() {
- HttpSession httpSession = null;
- // prepare the multipart request
- if (multipartRequest != null) {
- httpSession = multipartRequest.getSession();
- }
- multipartRequest = new MockMultipartHttpServletRequest();
- multipartRequest.setSession(httpSession);
- multipartRequest.setMethod("GET");
- // preparing the normal request
- if (request != null) {
- httpSession = request.getSession();
- }
- request = new MockHttpServletRequest();
- request.setSession(httpSession);
- request.setMethod("GET");
-
- response = new MockHttpServletResponse();
- }
-}
=======================================
---
/parancoe-web/src/main/java/org/parancoe/web/test/junit4/AbstractPluginTest.java
Tue Feb 26 02:51:02 2013
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test.junit4;
-
-import org.springframework.test.context.ContextConfiguration;
-
-/**
- * E' la classe base per i test di plugins.
- *
- * @author michele franzin <michele at franzin.net>
- */
-@ContextConfiguration(inheritLocations = false,
- locations = {"/org/lambico/spring/dao/hibernate/genericDao.xml",
- "/org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "/org/parancoe/core/applicationContextBase.xml",
- "/org/parancoe/web/parancoeBase.xml",
- "/database-test.xml",
- "classpath*:parancoe-plugin.xml",
- "classpath*:applicationContext-plugin.xml",
- "/applicationContext-test.xml"})
-public abstract class AbstractPluginTest extends AbstractWebTest {
-// TODO move to parancoe-test project
-}
=======================================
---
/parancoe-web/src/main/java/org/parancoe/web/test/junit4/AbstractWebTest.java
Tue Feb 26 02:51:02 2013
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test.junit4;
-
-import org.parancoe.test.junit4.AbstractContextTest;
-import org.springframework.test.context.ContextConfiguration;
-
-/**
- * E' la classe base per i test che necessitano del contesto web
- *
- * @author michele franzin <michele at franzin.net>
- */
-@ContextConfiguration(inheritLocations = false,
- locations = {"/org/lambico/spring/dao/hibernate/genericDao.xml",
- "/org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "/org/parancoe/core/applicationContextBase.xml",
- "/org/parancoe/web/parancoeBase.xml",
- "/database-test.xml",
- "file:./src/main/webapp/WEB-INF/applicationContext.xml",
- "file:./src/main/webapp/WEB-INF/parancoe-servlet.xml",
- "classpath*:parancoe-plugin.xml",
- "classpath*:applicationContext-plugin.xml",
- "/applicationContext-test.xml"},
- loader = org.parancoe.web.test.junit4.WebXmlContextLoader.class)
-public abstract class AbstractWebTest extends AbstractContextTest {
-// TODO move to parancoe-test project
-}
=======================================
---
/parancoe-web/src/main/java/org/parancoe/web/test/junit4/WebXmlContextLoader.java
Tue Feb 26 02:51:02 2013
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test.junit4;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.support.BeanDefinitionReader;
-import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.annotation.AnnotationConfigUtils;
-import org.springframework.context.support.GenericApplicationContext;
-import org.springframework.test.context.support.AbstractContextLoader;
-import org.springframework.util.StringUtils;
-import
org.springframework.web.context.support.GenericWebApplicationContext;
-
-/**
- * Concrete implementation of {@link AbstractGenericContextLoader} which
reads
- * bean definitions from XML resources. NB creates a {@link
GenericWebApplicationContext}
- * suitable fot testing purposes.
- *
- * @see {@link GenericXmlContextLoader}.
- * @author michele franzin <michele at franzin.net>
- */
-public class WebXmlContextLoader extends AbstractContextLoader {
-
- private static final Logger logger =
LoggerFactory.getLogger(WebXmlContextLoader.class);
-
- /**
- * Returns &quot;<code>-test.xml</code>&quot;.
- */
- @Override
- public String getResourceSuffix() {
- return "-test.xml";
- }
-
- /**
- * Loads a Spring ApplicationContext from the supplied
- * <code>locations</code>. and creates a standard {@link
GenericWebApplicationContext} instance.
- *
- * @return a new application context
- * @see org.springframework.test.context.ContextLoader#loadContext
- * @see GenericWebApplicationContext
- * @see #createBeanDefinitionReader(GenericApplicationContext)
- * @see BeanDefinitionReader
- */
- @Override
- public final ConfigurableApplicationContext loadContext(String...
locations) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("Loading ApplicationContext for locations [{}].",
- StringUtils.arrayToCommaDelimitedString(locations));
- }
- GenericApplicationContext context = new
GenericWebApplicationContext();
- createBeanDefinitionReader(context).loadBeanDefinitions(locations);
- AnnotationConfigUtils.registerAnnotationConfigProcessors(context);
- context.refresh();
- context.registerShutdownHook();
- return context;
- }
-
- /**
- * Create a new {@link XmlBeanDefinitionReader}.
- *
- * @return a new XmlBeanDefinitionReader.
- * @see XmlBeanDefinitionReader
- */
- private BeanDefinitionReader createBeanDefinitionReader(final
GenericApplicationContext context) {
- return new XmlBeanDefinitionReader(context);
- }
-}
=======================================
--- /parancoe-web/src/test/java/org/parancoe/web/AbstractContextTest.java
Tue Feb 26 02:51:02 2013
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web;
-
-import javax.servlet.ServletContext;
-import javax.servlet.jsp.PageContext;
-import org.parancoe.web.test.junit4.AbstractControllerTest;
-import org.springframework.mock.web.MockPageContext;
-import org.springframework.mock.web.MockServletContext;
-import org.springframework.test.context.transaction.AfterTransaction;
-import org.springframework.test.context.transaction.BeforeTransaction;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.servlet.support.JspAwareRequestContext;
-import org.springframework.web.servlet.support.RequestContext;
-import org.springframework.web.servlet.tags.RequestContextAwareTag;
-
-/**
- * E' la classe base per tutti i test che necessitano i contesti (ad
esempio i tag)
- *
- * @author michele franzin <michele at franzin.net>
- */
-public abstract class AbstractContextTest extends AbstractControllerTest {
-
- protected ServletContext servletContext;
- protected PageContext pageContext;
- protected RequestContext requestContext;
-
- @BeforeTransaction
- public void prepareContexts() {
- resetContexts();
- }
-
- @AfterTransaction
- public void clearContexts() {
- servletContext = null;
- pageContext = null;
- requestContext = null;
- }
-
- /**
- * Reset all contexts.
- */
- protected void resetContexts() {
- servletContext = new MockServletContext();
-
servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
- applicationContext);
- pageContext = new MockPageContext(servletContext, request,
response);
- requestContext = new JspAwareRequestContext(pageContext);
-
pageContext.setAttribute(RequestContextAwareTag.REQUEST_CONTEXT_PAGE_ATTRIBUTE,
- requestContext);
- }
-}
=======================================
--- /.hgignore Mon Oct 29 01:32:48 2012
+++ /.hgignore Thu Feb 28 12:58:30 2013
@@ -23,6 +23,7 @@
^parancoe-pluginarchetype/target
^parancoe-reference-guide/target
^parancoe-validator/target
+^parancoe-test/target
\.orig\..*$
\.orig$
\.chg\..*$
=======================================
---
/examples/basicWebAppEvolution/src/test/java/org/parancoe/basicwebappevolution/controllers/HomeControllerTest.java
Wed Feb 27 11:26:14 2013
+++
/examples/basicWebAppEvolution/src/test/java/org/parancoe/basicwebappevolution/controllers/HomeControllerTest.java
Thu Feb 28 12:58:30 2013
@@ -17,6 +17,7 @@
*/
package org.parancoe.basicwebappevolution.controllers;

+import javax.annotation.Resource;
import org.junit.Test;
import org.parancoe.web.test.junit4.AbstractControllerTest;
import org.springframework.web.servlet.ModelAndView;
@@ -33,9 +34,9 @@
*/
public class HomeControllerTest extends AbstractControllerTest {

- @Autowired
+ @Resource
private HomeController controller;
- @Autowired
+ @Resource(name
= "org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0")
private HandlerAdapter handler;

@Test
=======================================
---
/examples/basicWebAppEvolution/src/test/java/org/parancoe/basicwebappevolution/controllers/PersonControllerTest.java
Wed Feb 27 11:26:14 2013
+++
/examples/basicWebAppEvolution/src/test/java/org/parancoe/basicwebappevolution/controllers/PersonControllerTest.java
Thu Feb 28 12:58:30 2013
@@ -18,17 +18,18 @@
package org.parancoe.basicwebappevolution.controllers;

import java.util.List;
+import javax.annotation.Resource;
import org.junit.Test;
import org.lambico.test.spring.hibernate.junit4.FixtureSet;
import org.parancoe.basicwebappevolution.dao.PersonDao;
import org.parancoe.basicwebappevolution.po.Person;
-import org.parancoe.web.test.junit4.AbstractControllerTest;
import org.springframework.web.servlet.HandlerAdapter;
import org.springframework.web.servlet.ModelAndView;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
import static org.hamcrest.collection.IsEmptyCollection.empty;
+import org.parancoe.web.test.junit4.AbstractControllerTest;
import org.springframework.beans.factory.annotation.Autowired;
import static org.springframework.test.web.ModelAndViewAssert.*;

@@ -40,11 +41,11 @@
@FixtureSet(modelClasses = {Person.class})
public class PersonControllerTest extends AbstractControllerTest {

- @Autowired
+ @Resource
private PersonController controller;
- @Autowired
+ @Resource(name
= "org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0")
private HandlerAdapter handler;
- @Autowired
+ @Resource
private PersonDao personDao;

@Test
=======================================
--- /parancoe-core/pom.xml Tue Feb 26 02:51:02 2013
+++ /parancoe-core/pom.xml Thu Feb 28 12:58:30 2013
@@ -64,18 +64,19 @@
<version>1.2.17</version>
<scope>provided</scope>
</dependency>
- <!-- InspectableTestMailSender & MailSenderMock -->
+ <!-- LoggingMailSender -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.5</version>
<scope>provided</scope>
</dependency>
+ <!-- Tests dependencies -->
<dependency>
- <groupId>org.lambico</groupId>
- <artifactId>lambico-test</artifactId>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-test</artifactId>
+ <scope>test</scope>
</dependency>
- <!-- Tests dependencies -->
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
=======================================
--- /parancoe-web/pom.xml Thu Feb 28 09:41:36 2013
+++ /parancoe-web/pom.xml Thu Feb 28 12:58:30 2013
@@ -34,13 +34,13 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
- <version>2.4</version>
+ <version>${parancoe.servlet-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
- <version>2.0</version>
+ <version>${parancoe.jsp-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -72,8 +72,9 @@
<artifactId>lambico-pump</artifactId>
</dependency>
<dependency>
- <groupId>org.lambico</groupId>
- <artifactId>lambico-test</artifactId>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-test</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
=======================================
--- /parancoe-web/src/test/java/org/parancoe/web/tag/BaseTagTest.java Tue
Feb 26 02:51:02 2013
+++ /parancoe-web/src/test/java/org/parancoe/web/tag/BaseTagTest.java Thu
Feb 28 12:58:30 2013
@@ -18,14 +18,14 @@
package org.parancoe.web.tag;

import org.junit.Before;
-import org.parancoe.web.AbstractContextTest;
+import org.parancoe.web.test.junit4.AbstractJspTest;
import org.springframework.web.util.WebUtils;

/**
*
* @author michele franzin <michele at franzin.net>
*/
-public abstract class BaseTagTest extends AbstractContextTest {
+public abstract class BaseTagTest extends AbstractJspTest {

@Before
public void setupRequestParams() {
=======================================
--- /parancoe-web/src/test/resources/logback-test.xml Tue Feb 26 02:51:02
2013
+++ /parancoe-web/src/test/resources/logback-test.xml Thu Feb 28 12:58:30
2013
@@ -27,8 +27,6 @@
<MaxSize>100</MaxSize>
</appender>

- <logger name="org.parancoe" level="INFO"/>
-
<root level="ERROR">
<appender-ref ref="CONSOLE" />
<appender-ref ref="MEMORY" />
=======================================
--- /pom.xml Thu Feb 28 09:41:36 2013
+++ /pom.xml Thu Feb 28 12:58:30 2013
@@ -13,6 +13,7 @@
<module>parancoe-core</module>
<module>parancoe-yaml</module>
<module>parancoe-validator</module>
+ <module>parancoe-test</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -24,6 +25,8 @@
<parancoe.slf4j.version>1.7.2</parancoe.slf4j.version>
<parancoe.junit4.version>4.11</parancoe.junit4.version>
<parancoe.hsqldb.version>2.2.9</parancoe.hsqldb.version>
+ <parancoe.servlet-api.version>2.4</parancoe.servlet-api.version>
+ <parancoe.jsp-api.version>2.0</parancoe.jsp-api.version>

<!-- NetBeans IDE properties -->

<org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
@@ -56,6 +59,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-test</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>

==============================================================================
Revision: e6b592dd62de
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Wed Feb 27 11:11:54 2013
Log: delete legacy util methods (strings, camel-case, utf-8, String IO)
http://code.google.com/p/parancoe/source/detail?r=e6b592dd62de

Deleted:
/parancoe-core/src/main/java/org/parancoe/util/Utils.java
/parancoe-core/src/test/java/org/parancoe/util/UtilsTest.java
/parancoe-core/src/test/resources/testdata/UTF8WithPreamble.txt
/parancoe-core/src/test/resources/testdata/UTF8WithoutPreamble.txt

=======================================
--- /parancoe-core/src/main/java/org/parancoe/util/Utils.java Fri Feb 22
04:36:16 2013
+++ /dev/null
@@ -1,244 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.ArrayUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-/**
- * @author Paolo Dona paolo...@seesaw.it
- * @author michele franzin <michele at franzin.net>
- * @author Andrea Nasato <mailto:andrea...@jugpadova.it/>
- * @deprecated please use apache commons
- */
-@Deprecated
-public class Utils {
-
- private static final Logger logger =
LoggerFactory.getLogger(Utils.class);
-
- private static final byte[] UTF8_PREAMBLE =
- new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF};
-
- private static final String UTF8_UNICODE_PREAMBLE = "";
-
- @SuppressWarnings(value = "unchecked")
- public static List<String> convertToNameValueList(Map map) {
- return convertToNameValueList(map, false);
- }
-
- @SuppressWarnings(value = "unchecked")
- public static List<String> convertToNameValueList(Map map, boolean
urlEncode) {
- List<String> result = new ArrayList<String>();
- for (String key : (Iterable<String>) map.keySet()) {
- Object tmp = map.get(key);
- if (tmp instanceof String[]) {
- String[] values = (String[]) tmp;
- for (String value : values) {
- if (urlEncode) {
- try {
- result.add(key + "=" +
-
java.net.URLEncoder.encode(value, "UTF-8"));
- } catch (UnsupportedEncodingException ex) {
- logger.warn("Your OS doesn't support UTF-8, so
we can encode",
- ex);
- result.add(key + "=" + value);
- }
- } else {
- result.add(key + "=" + value);
- }
- }
- } else if (tmp instanceof String) {
- String value = (String) tmp;
- if (urlEncode) {
- try {
- result.add(key + "=" +
-
java.net.URLEncoder.encode(value, "UTF-8"));
- } catch (UnsupportedEncodingException ex) {
- logger.warn("Your OS doesn't support UTF-8, so we
can encode",
- ex);
- result.add(key + "=" + value);
- }
- } else {
- result.add(key + "=" + value);
- }
- }
- }
- return result;
- }
-
- /**
- * Carica un file binario dal classpath
- *
- * @param classpathResource
- * @return
- */
- public static byte[] loadBinary(String classpathResource) {
- return loadBinary(new ClassPathResource(classpathResource));
- }
-
- public static byte[] loadBinary(Resource classpathResource) {
- InputStream stream = null;
- try {
- return unsafeLoadBinary(stream =
classpathResource.getInputStream());
- } catch (IOException e) {
- throw new RuntimeException("Impossibile caricare la risorsa
binaria '" +
- classpathResource.getDescription() + "' dal
classpath.");
- } finally {
- IOUtils.closeQuietly(stream);
- }
- }
-
- protected static byte[] unsafeLoadBinary(InputStream stream) throws
IOException {
- return IOUtils.toByteArray(stream);
- }
-
- /**
- * Carica un file testuale dal classpath.<br/> NB: UTF-8 header are
- * removed!
- *
- * @param classpathResource
- * file relative path
- * @return textual content of resource file
- */
- public static String loadString(String classpathResource) {
- return loadString(new ClassPathResource(classpathResource));
- }
-
- public static String loadString(Resource classpathResource) {
- InputStream stream = null;
- try {
- return unsafeLoadString(stream =
classpathResource.getInputStream());
- } catch (IOException e) {
- throw new RuntimeException("Impossibile caricare la risorsa
testuale '" +
- classpathResource.getDescription() + "' dal
classpath.");
- } finally {
- IOUtils.closeQuietly(stream);
- }
- }
-
- protected static String unsafeLoadString(InputStream stream) throws
IOException {
- byte[] byteResult =
- IOUtils.toByteArray(stream);
- return stripUTF8preamble(new String(byteResult, "UTF-8"));
- }
-
- /**
- * Rimuove il preambolo UTF se presente nella stringa<br/>NB: la
convesione
- * in array di byte e sucessivo strip della stringa non funziona
- * correttamente perch&agrave;
- * <code>new String(UTF8_PREAMBLE).getBytes() != UTF8_PREAMBLE</code>;
- * alcune info qui:
- *
http://mail.python.org/pipermail/python-list/2004-February/250798.html
- */
- public static String stripUTF8preamble(String s) throws
UnsupportedEncodingException {
- if (hasUTF8preamble(s)) {
- logger.debug("Rimosso header UTF-8 dalla stringa");
- return s.substring(1);
- }
- return s;
- }
-
- /**
- * rimuove i 3 bytes di preambolo dagli UTF se presenti
- */
- public static byte[] stripUTF8preamble(byte[] b) {
- if (hasUTF8preamble(b)) {
- logger.debug("Rimosso header UTF-8 dall'array");
- b = ArrayUtils.subarray(b, 3, b.length);
- }
- return b;
- }
-
- public static boolean hasUTF8preamble(byte[] b) {
- return b[0] == UTF8_PREAMBLE[0] && b[1] == UTF8_PREAMBLE[1] &&
- b[2] == UTF8_PREAMBLE[2];
- }
-
- public static boolean hasUTF8preamble(String s) {
- return s.startsWith(UTF8_UNICODE_PREAMBLE);
- }
-
- /**
- * Return an array containing all the substrings of
- * <code>camelString</code>, according to this rule: divide
<code>camelString</code>
- * into tokens with every token starting from a capital letter to
another.
- *
- * Some examples:
- * <ol>
- * <li>'MyCamelString' gives: {my,camel,string}</li>
- * <li>'myFantasticCamelString' gives:
{my,fantastic,camel,string}</li>
- * <li>'MYCAMELSTRING' gives: {m,y,c,a,m,e,l,s,t,r,i,n,g}</li>
- * </ol>
- *
- */
- public static String[] uncamelize(String camelString) {
-
- if (camelString == null || camelString.trim().equals("")) {
- throw new IllegalArgumentException("camelString cannot be null
or empty");
- }
- List<Integer> idxList = new ArrayList<Integer>();
- List<String> strList = new ArrayList<String>();
-
- //\p{Lu} is the unicode pattern for capital letters
- Pattern p = Pattern.compile("\\p{Lu}");
- Matcher m = p.matcher(camelString);
-
- //find all occurences of an uppercase letter and put their
position on a list
- while (m.find()) {
- idxList.add(m.start());
- }
-
- // no upper case found: we return the entire word
- if (idxList.isEmpty()) {
- return new String[]{camelString};
- }
-
- Integer[] idx = idxList.toArray(new Integer[idxList.size() - 1]);
-
- for (int i = 0; i < idx.length; i++) {
-
- //if the first character of camelString is lower case,
- //substring from 0 to index[1]
- if (i == 0 && idx[i] > 0) {
- strList.add(camelString.substring(0,
idx[i]).toLowerCase());
- }
-
- //the last part of the word hasn't got an end guard
- if (i == idx.length - 1) {
- strList.add(camelString.substring(idx[i],
camelString.length()).toLowerCase());
- } else {
- strList.add(camelString.substring(idx[i], idx[i +
1]).toLowerCase());
- }
- }
-
- return strList.toArray(new String[strList.size() - 1]);
- }
-
-}
=======================================
--- /parancoe-core/src/test/java/org/parancoe/util/UtilsTest.java Fri Feb
22 04:36:16 2013
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.util;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.parancoe.util.Utils;
-
-public class UtilsTest extends TestCase {
-
- public void testConvertToNameValueList() {
- Map<String, String> input = new HashMap<String, String>();
- input.put("A", "B");
- input.put("C", "D");
- input.put("E", "F");
- List<String> expected = new ArrayList<String>();
- // changed add order in the list
- expected.add("E=F");
- expected.add("A=B");
- expected.add("C=D");
-
-
assertTrue(expected.containsAll(Utils.convertToNameValueList(input)));
- }
-
- public void testBinaryStripUTF8preamble() {
- byte[] stringWithPreamble =
Utils.loadBinary("testdata/UTF8WithPreamble.txt");
- byte[] stringWithoutPreamble =
Utils.loadBinary("testdata/UTF8WithoutPreamble.txt");
-
- assertTrue(Utils.hasUTF8preamble(stringWithPreamble));
- assertFalse(Utils.hasUTF8preamble(stringWithoutPreamble));
-
- byte[] stripped = Utils.stripUTF8preamble(stringWithPreamble);
- assertFalse(Utils.hasUTF8preamble(stripped));
- assertEquals(stringWithPreamble.length, stripped.length + 3);
- }
-
- public void testStringStripUTF8preamble() throws Exception {
- String stringWithPreamble =
Utils.loadString("testdata/UTF8WithPreamble.txt");
- String stringWithoutPreamble =
Utils.loadString("testdata/UTF8WithoutPreamble.txt");
-
- assertFalse(Utils.hasUTF8preamble(stringWithPreamble));
- assertFalse(Utils.hasUTF8preamble(stringWithoutPreamble));
- }
-}
=======================================
--- /parancoe-core/src/test/resources/testdata/UTF8WithPreamble.txt Sat Jun
23 06:52:59 2007
+++ /dev/null
@@ -1,2 +0,0 @@
-Questo è un file UTF8 con preambolo
-òàùèì
=======================================
--- /parancoe-core/src/test/resources/testdata/UTF8WithoutPreamble.txt Sat
Jun 23 06:52:59 2007
+++ /dev/null
@@ -1,2 +0,0 @@
-Questo è un file UTF8 senza preambolo
-òàùèì

==============================================================================
Revision: 08d2aec46b38
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Thu Mar 7 22:53:54 2013
Log: upgrade to hibernate v3.6.10.Final
http://code.google.com/p/parancoe/source/detail?r=08d2aec46b38

Modified:
/pom.xml

=======================================
--- /pom.xml Thu Feb 28 12:58:30 2013
+++ /pom.xml Thu Mar 7 22:53:54 2013
@@ -21,7 +21,7 @@
<year>2006-2010</year>
<parancoe.lambico.version>1.1-SNAPSHOT</parancoe.lambico.version>
<parancoe.spring.version>3.0.7.RELEASE</parancoe.spring.version>
-
<parancoe.hibernate.version>3.6.7.Final</parancoe.hibernate.version>
+
<parancoe.hibernate.version>3.6.10.Final</parancoe.hibernate.version>
<parancoe.slf4j.version>1.7.2</parancoe.slf4j.version>
<parancoe.junit4.version>4.11</parancoe.junit4.version>
<parancoe.hsqldb.version>2.2.9</parancoe.hsqldb.version>

==============================================================================
Revision: 4225dc4cae17
Branch: default
Author: Michele Franzin <michele...@gmail.com>
Date: Thu Mar 7 22:55:53 2013
Log: license formatting
http://code.google.com/p/parancoe/source/detail?r=4225dc4cae17

Modified:

/parancoe-test/src/main/java/org/parancoe/web/test/junit4/AbstractJspTest.java

=======================================
---
/parancoe-test/src/main/java/org/parancoe/web/test/junit4/AbstractJspTest.java
Thu Feb 28 12:58:30 2013
+++
/parancoe-test/src/main/java/org/parancoe/web/test/junit4/AbstractJspTest.java
Thu Mar 7 22:55:53 2013
@@ -3,15 +3,17 @@
*
* This file is part of Parancoe Test.
*
- * 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
+ * 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
+ * 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.
+ * 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 org.parancoe.web.test.junit4;


==============================================================================
Revision: 43b03b02f832
Branch: default
Author: lucio.benfante <lucio.b...@gmail.com>
Date: Mon Mar 18 04:01:08 2013
Log: Merged Franzin's updates. Moved to 3.1 version.
http://code.google.com/p/parancoe/source/detail?r=43b03b02f832

Added:
/examples/basicWebApp/src/main/resources/logback.xml
/parancoe-test/pom.xml

/plugins/parancoe-plugin-configuration/src/test/resources/database-test-server.xml
Deleted:
/examples/basicPersistence/src/main/resources/log4j.properties

/examples/basicPersistence/src/test/java/org/parancoe/example/test/SanityTest.java
/examples/basicPersistence/src/test/resources/database_test.xml
/examples/basicPersistence/src/test/resources/log4j.properties
/examples/basicWebApp/src/main/resources/hibernate-mappings.cfg.xml

/examples/basicWebAppEvolution/src/main/resources/hibernate-mappings.cfg.xml
/examples/basicWebAppEvolution/src/test/resources/spring-test.xml

/parancoe-core/src/main/java/org/parancoe/test/InspectableTestMailSender.java
/parancoe-core/src/main/java/org/parancoe/test/MailSenderMock.java
/parancoe-core/src/main/java/org/parancoe/util/FixtureHelper.java
/parancoe-core/src/main/java/org/parancoe/util/Utils.java
/parancoe-core/src/test/java/org/parancoe/persistence/dao/TestDaos.java

/parancoe-core/src/test/java/org/parancoe/persistence/dao/generic/EntityTCDao.java

/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/EntityTC.java
/parancoe-core/src/test/java/org/parancoe/persistence/util/BaseTest.java
/parancoe-core/src/test/java/org/parancoe/persistence/util/DemoBean.java

/parancoe-core/src/test/java/org/parancoe/persistence/util/FixtureHelperTest.java
/parancoe-core/src/test/java/org/parancoe/persistence/util/UtilsTest.java
/parancoe-core/src/test/java/org/parancoe/test/ManyToManyFixturesTest.java
/parancoe-core/src/test/resources/applicationContext_test.xml
/parancoe-core/src/test/resources/beanRefFactory_test.xml
/parancoe-core/src/test/resources/fixtures.jar
/parancoe-core/src/test/resources/fixtures/CachedEntityTC.yml
/parancoe-core/src/test/resources/fixtures/DemoBean.yml
/parancoe-core/src/test/resources/fixtures/EntityTC.yml
/parancoe-core/src/test/resources/fixtures/String.yml
/parancoe-core/src/test/resources/testdata/UTF8WithPreamble.txt
/parancoe-core/src/test/resources/testdata/UTF8WithoutPreamble.txt
/parancoe-web/src/main/java/org/parancoe/web/WebUtils.java
/parancoe-web/src/main/java/org/parancoe/web/test/BaseTest.java
/parancoe-web/src/main/java/org/parancoe/web/test/ControllerTest.java
/parancoe-web/src/main/java/org/parancoe/web/test/PluginTest.java
/parancoe-web/src/main/java/org/parancoe/web/test/TagTest.java
/parancoe-web/src/test/java/org/parancoe/web/SanityTest.java

/parancoe-web/src/test/java/org/parancoe/web/test/controller/ForTestController.java

/parancoe-web/src/test/java/org/parancoe/web/test/controller/ForTestControllerModel.java

/parancoe-web/src/test/java/org/parancoe/web/test/controller/TestControllerTest.java
/parancoe-web/src/test/resources/log4j.properties
/parancoe-web/src/test/resources/spring-test.xml
/parancoe-yaml/BUGS
/parancoe-yaml/TODO

/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/SanityTest.java
/plugins/parancoe-plugin-configuration/src/test/resources/log4j.properties
/plugins/parancoe-plugin-configuration/src/test/resources/spring-test.xml
/plugins/parancoe-plugin-dwr/src/test/resources/log4j.properties
/plugins/parancoe-plugin-security/src/test/resources/log4j.properties

/plugins/parancoe-plugin-springsecurity-evolution/src/test/resources/log4j.properties
/plugins/parancoe-plugin-springsecurity/src/test/resources/log4j.properties
/plugins/parancoe-plugin-tiles/src/test/resources/log4j.properties
/plugins/parancoe-plugin-world/src/test/resources/log4j.properties
Modified:
/examples/basicPersistence/pom.xml

/examples/basicPersistence/src/main/java/org/parancoe/example/util/ApplicationContextHolder.java
/examples/basicWebApp/pom.xml
/parancoe-core/pom.xml
/parancoe-validator/pom.xml
/parancoe-web/pom.xml
/plugins/parancoe-plugin-configuration/pom.xml

/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/RestServicesTest.java

/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/TestContextListener.java
/plugins/parancoe-plugin-dwr/pom.xml
/plugins/parancoe-plugin-italy/pom.xml
/plugins/parancoe-plugin-sample/pom.xml
/plugins/parancoe-plugin-security/pom.xml
/plugins/parancoe-plugin-springsecurity-evolution/pom.xml
/plugins/parancoe-plugin-springsecurity/pom.xml
/plugins/parancoe-plugin-tiles/pom.xml
/plugins/parancoe-plugin-world/pom.xml
/plugins/pom.xml
/pom.xml

=======================================
--- /dev/null
+++ /examples/basicWebApp/src/main/resources/logback.xml Mon Mar 18
04:01:08 2013
@@ -0,0 +1,36 @@
+<!--
+
+ Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Plugin Configuration.
+
+ 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.
+
+-->
+<configuration>
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}
- %msg%n</pattern>
+ </encoder>
+ </appender>
+ <appender name="MEMORY" class="ch.qos.logback.core.MemoryAppender">
+ <MaxSize>100</MaxSize>
+ </appender>
+
+ <logger name="org.parancoe" level="INFO"/>
+
+ <root level="ERROR">
+ <appender-ref ref="CONSOLE" />
+ <appender-ref ref="MEMORY" />
+ </root>
+</configuration>
=======================================
--- /dev/null
+++ /parancoe-test/pom.xml Mon Mar 18 04:01:08 2013
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>parancoe</artifactId>
+ <groupId>org.parancoe</groupId>
+ <version>3.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.parancoe</groupId>
+ <artifactId>parancoe-test</artifactId>
+ <name>Parancoe Test</name>
+ <version>3.1-SNAPSHOT</version>
+ <url>http://www.parancoe.org</url>
+ <properties>
+ <main.basedir>${basedir}/..</main.basedir>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.lambico</groupId>
+ <artifactId>lambico-test</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${parancoe.servlet-api.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>${parancoe.jsp-api.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <!-- InspectableTestMailSender -->
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4.5</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
=======================================
--- /dev/null
+++
/plugins/parancoe-plugin-configuration/src/test/resources/database-test-server.xml
Mon Mar 18 04:01:08 2013
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
+
+ This file is part of Parancoe Plugin Configuration.
+
+ 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:context="http://www.springframework.org/schema/context"
+ 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.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+ <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:mem:test_server"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </bean>
+
+ <bean id="sessionFactory" parent="abstractSessionFactory">
+ <property name="eventListeners">
+ <map>
+ <entry key="merge">
+ <bean
class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
+ </entry>
+ </map>
+ </property>
+ <property name="hibernateProperties">
+ <props merge="true">
+ <prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect
+ </prop>
+ <prop key="hibernate.hbm2ddl.auto">create
+ </prop>
+ <prop key="hibernate.show_sql">false
+ </prop>
+ </props>
+ </property>
+ </bean>
+</beans>
+
=======================================
--- /examples/basicPersistence/src/main/resources/log4j.properties Thu Dec
13 01:46:21 2007
+++ /dev/null
@@ -1,8 +0,0 @@
-log4j.rootLogger=INFO, A1
-log4j.appender.A1=org.apache.log4j.ConsoleAppender
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-
-# Print the date in ISO 8601 format
-log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
-
-log4j.logger.org.parancoe=INFO
=======================================
---
/examples/basicPersistence/src/test/java/org/parancoe/example/test/SanityTest.java
Wed Oct 8 01:20:52 2008
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.parancoe.example.test;
-
-import javax.annotation.Resource;
-import org.parancoe.example.bo.PersonBO;
-import org.parancoe.example.dao.PersonDao;
-
-/**
- * Sanity tests
- *
- * @author Lucio Benfante
- */
-public class SanityTest extends BaseTest{
- @Resource
- private PersonDao personDao;
- @Resource
- private PersonBO personBO;
-
- /**
- * Test the wiring of BO resources.
- */
- public void testBoResources() {
- assertNotNull(personBO);
- }
-
- /**
- * Test the wiring of DAO resources.
- */
- public void testDaoResources() {
- assertNotNull(personDao);
- }
-
-}
=======================================
--- /examples/basicPersistence/src/test/resources/database_test.xml Wed
Oct 8 01:20:52 2008
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright 2006 The Parancoe Team
-
-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:parancoe="http://www.parancoe.org/schema/parancoe"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.parancoe.org/schema/parancoe
http://www.parancoe.org/schema/parancoe.xsd
- http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
- http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
-
- <tx:annotation-driven/>
-
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:mem:exampleDB"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </bean>
-
- <bean id="sessionFactory" parent="abstractSessionFactory">
- <property name="hibernateProperties">
- <props merge="true">
- <prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
- <prop key="hibernate.hbm2ddl.auto">create</prop>
- </props>
- </property>
- <property name="eventListeners">
- <map>
- <entry key="merge">
- <bean
class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
- </entry>
- </map>
- </property>
- </bean>
-
-</beans>
=======================================
--- /examples/basicPersistence/src/test/resources/log4j.properties Tue Jul
1 09:17:56 2008
+++ /dev/null
@@ -1,7 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE
-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.logger.org.parancoe=INFO
=======================================
--- /examples/basicWebApp/src/main/resources/hibernate-mappings.cfg.xml Thu
May 10 00:46:22 2007
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-configuration PUBLIC
-"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-
-<hibernate-configuration>
- <session-factory>
- <!-- No more required
- <mapping class="org.parancoe.basicWebApp.po.Person"/>
- <mapping class="org.parancoe.persistence.security.UserProfile"/>
- <mapping class="org.parancoe.persistence.security.Authorities"/>
- -->
- </session-factory>
-</hibernate-configuration>
=======================================
---
/examples/basicWebAppEvolution/src/main/resources/hibernate-mappings.cfg.xml
Mon Apr 2 20:46:07 2012
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-configuration PUBLIC
-"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-
-<hibernate-configuration>
- <session-factory>
- <!-- No more required
- <mapping class="org.parancoe.basicWebApp.po.Person"/>
- <mapping class="org.parancoe.persistence.security.UserProfile"/>
- <mapping class="org.parancoe.persistence.security.Authorities"/>
- -->
- </session-factory>
-</hibernate-configuration>
=======================================
--- /examples/basicWebAppEvolution/src/test/resources/spring-test.xml Mon
Apr 2 20:46:07 2012
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- 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">
-</beans>
=======================================
---
/parancoe-core/src/main/java/org/parancoe/test/InspectableTestMailSender.java
Mon Jan 9 16:58:34 2012
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.test;
-
-import javax.mail.internet.MimeMessage;
-import org.apache.log4j.Logger;
-import org.springframework.mail.MailException;
-import org.springframework.mail.javamail.JavaMailSenderImpl;
-
-/**
- * Inspectable mock implementation of JavaMailSender for test porpouse.
- *
- * @author Michele Franzin
- */
-public class InspectableTestMailSender extends JavaMailSenderImpl {
-
- private static final Logger logger =
Logger.getLogger(InspectableTestMailSender.class);
- private MimeMessage[] messages = new MimeMessage[0];
-
- @Override
- protected void doSend(MimeMessage[] mimeMessages, Object[]
originalMessages)
- throws MailException {
- if (mimeMessages != null) {
- messages = new MimeMessage[mimeMessages.length];
- System.arraycopy(mimeMessages, 0, messages, 0,
mimeMessages.length);
- }
- }
-
- public void clearMessages() {
- messages = new MimeMessage[0];
- }
-
- public MimeMessage[] getMessages() {
- return messages;
- }
-}
=======================================
--- /parancoe-core/src/main/java/org/parancoe/test/MailSenderMock.java Sat
Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.test;
-
-import javax.mail.internet.MimeMessage;
-import org.apache.log4j.Logger;
-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 MailSenderMock extends JavaMailSenderImpl {
-
- private static final Logger logger = Logger.getLogger(
- MailSenderMock.class);
-
- @Override
- protected void doSend(MimeMessage[] mimeMessages, Object[]
originalMessages)
- throws MailException {
- if (mimeMessages != null) {
- for (MimeMessage mimeMessage : mimeMessages) {
- try {
- logger.info(mimeMessage.getContent());
- } catch (Exception ex) {
- logger.error("Can't get message content", ex);
- }
- }
- }
- if (originalMessages != null) {
- for (Object o : originalMessages) {
- logger.info(o);
- }
- }
- }
-}
=======================================
--- /parancoe-core/src/main/java/org/parancoe/util/FixtureHelper.java Thu
Jan 26 20:49:06 2012
+++ /dev/null
@@ -1,239 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.util;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.ArrayUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
-import org.parancoe.yaml.Yaml;
-import org.springframework.core.io.ClassPathResource;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.lambico.dao.generic.GenericDaoBase;
-import org.lambico.dao.spring.hibernate.HibernateGenericDao;
-
-/**
- * @author Paolo Dona paolo...@seesaw.it
- * @author Michele Franzin michele...@seesaw.it
- */
-public class FixtureHelper {
-
- private final static Logger logger =
Logger.getLogger(FixtureHelper.class);
-
- private final static Pattern headerMatch = Pattern.compile(
- "^-\\s??(\\S*)\\s*?$", Pattern.MULTILINE);
-
- private final static Pattern lineMatch = Pattern.compile("^(.+)$",
- Pattern.MULTILINE);
-
- /**
- * Gets file name of a fixture fragment related to a model.
- */
- public static String getFixtureFileName(Class model) {
- return model.getSimpleName() + ".yml";
- }
-
- /**
- * Gets id of dao related to a model.
- * <p/>
- * *WARNING*: strong condition on the DAO id (entity_name+Dao) For
retriving
- * a dao for an entity it's better something like: <code>
- * DaoProvider daos = (DaoProvider)ctx.getBean(DAO_PROVIDER_ID);
- * GenericDao dao = (GenericDao)daos.getDao(clazz);
- * </code>
- * <p/>
- * The DAO_PROVIDER_ID usually is "daos".
- */
- public static String getFixtureDaoId(Class model) {
- return StringUtils.uncapitalize(model.getSimpleName()) + "Dao";
- }
-
- /**
- * Gets id of dao related to a model.
- * <p/>
- * *WARNING*: strong condition on the DAO id (entity_name+Dao) For
retriving
- * a dao for an entity it's better something like: <code>
- * DaoProvider daos = (DaoProvider)ctx.getBean(DAO_PROVIDER_ID);
- * GenericDao dao = (GenericDao)daos.getDao(clazz);
- * </code>
- * <p/>
- * The DAO_PROVIDER_ID usually is "daos".
- */
- public static String getFixtureBusinessDaoId(Class model) {
- return StringUtils.uncapitalize(model.getSimpleName())
+ "BusinessDao";
- }
-
- /**
- * Gets human readable name of a model.
- */
- public static String getModelName(Class model) {
- return model.getSimpleName();
- }
-
- /**
- * @param classpathResource dir relative path
- */
- public static Map<Class, Object[]> loadFixturesFromResource(
- final String classpathResource, final Set<Class> models) {
- return loadFixturesFromResource(
- new ClassPathResource(classpathResource), models);
- }
-
- public static Map<Class, Object[]> loadFixturesFromResource(
- final ClassPathResource fixtureDir, final Set<Class> models) {
- LinkedHashMap<Class, Object[]> fixtures = new LinkedHashMap<Class,
Object[]>(
- models.size());
- String fixtureFileName = null;
- StringBuffer sb = new StringBuffer();
- for (Class model : models) {
- fixtureFileName = fixtureDir.getPath() +
getFixtureFileName(model);
- InputStream stream = null;
- try {
- String content = loadFixtureStringForClass(
- stream = new ClassPathResource(fixtureFileName)
- .getInputStream(), model);
- if (StringUtils.isNotBlank(content)) {
- sb.append(content);
- sb.append(IOUtils.LINE_SEPARATOR);
- // Mantiene l'ordine di inserimento
- fixtures.put(model, null);
- } else {
- logger.warn("No fixture for "
- + getModelName(model) + " in the file '"
- + fixtureFileName + "' ?");
- }
- } catch (FileNotFoundException e) {
- logger.warn("Fixture file not found for "
- + getModelName(model) + ", did you create the
file '"
- + fixtureFileName + "' ?");
- } catch (IOException e) {
- logger.error("Loading of fixtures failed for "
- + getModelName(model), e);
- } finally {
- IOUtils.closeQuietly(stream);
- }
- }
-
- if (sb.length() == 0) {
- sb.append("--- !java.lang.Object[] []" +
IOUtils.LINE_SEPARATOR);
- } else {
- sb.insert(0, "--- !java.lang.Object[]" +
IOUtils.LINE_SEPARATOR);
- }
-
- sb.append("...");
- sb.append(IOUtils.LINE_SEPARATOR);
-
- if (logger.isDebugEnabled()) {
- logger
- .debug("### Start of Yaml generated merging the
fixtures ###\n"
- + sb.toString()
- + "\n### End of Yaml generated merging the
fixtures ###");
- }
-
- // Debug file output
- // try {
- // FileUtils.writeStringToFile(new File("dump.yml"), sb.toString(),
- // "UTF-8");
- // } catch (IOException e) {
- // e.printStackTrace();
- // }
-
- // Se il documento è vuoto, yaml ritorna un'HashMap
- Object any = Yaml.load(sb.toString());
-
- if (any instanceof Object[]) {
- Object[] fixtureObjects = (Object[]) any;
- for (Object fixtureObject : fixtureObjects) {
- Object[] objects = (Object[]) fixtureObject;
- // null safe handling
- if (!ArrayUtils.isEmpty(objects)) {
- fixtures.put(objects[0].getClass(), objects);
- }
- }
- }
- return fixtures;
- }
-
- /**
- * ritorna il contenuto del file <Class>.yml
- */
- private static String loadFixtureStringForClass(InputStream stream,
- Class model) throws
IOException {
- String fixtureString = Utils.unsafeLoadString(stream);
- // Add fixture class into header
- Matcher matcher = headerMatch.matcher(fixtureString);
- // Il replace del $ serve alla regex nel caso di inner classes
- fixtureString = matcher.replaceAll("- $1 !"
- + model.getName().replace("$", "\\$"));
- // Indent lines
- matcher = lineMatch.matcher(fixtureString);
- fixtureString = matcher.replaceAll(" $1");
- // aggiungo l'header (Array di oggetti <Class>)
- return "- !" + model.getName() + "[]" + IOUtils.LINE_SEPARATOR
- + fixtureString;
- }
-
- @SuppressWarnings("unchecked")
- public static void populateDbForModel(Class model, Object[] fixtures,
- GenericDaoBase dao) {
- logger.debug("Populating table for " + getModelName(model));
- if (fixtures == null) {
- logger.warn("No fixture for " + getModelName(model)
- + ", did you create the file '" +
getFixtureFileName(model)
- + "'?");
- return;
- }
- try {
- for (Object entity : fixtures) {
- dao.store(entity);
- ((HibernateGenericDao)dao).getHibernateTemplate().flush();
- }
- } catch (Exception e) {
- logger.error("Error populating rows in " + getModelName(model)
- + " table", e);
- }
- }
-
- @SuppressWarnings("unchecked")
- public static void eraseDbForModel(Class model, GenericDaoBase dao) {
- logger.debug("Erasing table for " + getModelName(model));
- try {
- // List rows = dao.findAll();
- // for (Object o : rows) {
- // dao.delete(o);
- // }
- if (dao == null) {
- throw new IllegalArgumentException("Dao associated to " +
model.getName() + " PO is null!");
- }
- int deleted =
((HibernateGenericDao)dao).getHibernateTemplate().bulkUpdate("DELETE FROM "
+
org.hibernate.cfg.DefaultComponentSafeNamingStrategy.INSTANCE.tableName(model.getSimpleName()));
-// deleteAll();
- } catch (Exception e) {
- logger.error("Error deleting rows in " + getModelName(model)
- + " table", e);
- }
- }
-
-}
=======================================
--- /parancoe-core/src/main/java/org/parancoe/util/Utils.java Sat Sep 4
02:41:52 2010
+++ /dev/null
@@ -1,242 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.ArrayUtils;
-import org.apache.log4j.Logger;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-/**
- * @author Paolo Dona paolo...@seesaw.it
- * @author Michele Franzin paolo...@seesaw.it
- * @author Andrea Nasato <mailto:andrea...@jugpadova.it/>
- */
-public class Utils {
-
- private static final Logger logger =
- Logger.getLogger(Utils.class);
-
- private static final byte[] UTF8_PREAMBLE =
- new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF};
-
- private static final String UTF8_UNICODE_PREAMBLE = "";
-
- @SuppressWarnings(value = "unchecked")
- public static List<String> convertToNameValueList(Map map) {
- return convertToNameValueList(map, false);
- }
-
- @SuppressWarnings(value = "unchecked")
- public static List<String> convertToNameValueList(Map map, boolean
urlEncode) {
- List<String> result = new ArrayList<String>();
- for (String key : (Iterable<String>) map.keySet()) {
- Object tmp = map.get(key);
- if (tmp instanceof String[]) {
- String[] values = (String[]) tmp;
- for (String value : values) {
- if (urlEncode) {
- try {
- result.add(key + "=" +
-
java.net.URLEncoder.encode(value, "UTF-8"));
- } catch (UnsupportedEncodingException ex) {
- logger.warn("Your OS doesn't support UTF-8, so
we can encode",
- ex);
- result.add(key + "=" + value);
- }
- } else {
- result.add(key + "=" + value);
- }
- }
- } else if (tmp instanceof String) {
- String value = (String) tmp;
- if (urlEncode) {
- try {
- result.add(key + "=" +
-
java.net.URLEncoder.encode(value, "UTF-8"));
- } catch (UnsupportedEncodingException ex) {
- logger.warn("Your OS doesn't support UTF-8, so we
can encode",
- ex);
- result.add(key + "=" + value);
- }
- } else {
- result.add(key + "=" + value);
- }
- }
- }
- return result;
- }
-
- /**
- * Carica un file binario dal classpath
- *
- * @param classpathResource
- * @return
- */
- public static byte[] loadBinary(String classpathResource) {
- return loadBinary(new ClassPathResource(classpathResource));
- }
-
- public static byte[] loadBinary(Resource classpathResource) {
- InputStream stream = null;
- try {
- return unsafeLoadBinary(stream =
classpathResource.getInputStream());
- } catch (IOException e) {
- throw new RuntimeException("Impossibile caricare la risorsa
binaria '" +
- classpathResource.getDescription() + "' dal
classpath.");
- } finally {
- IOUtils.closeQuietly(stream);
- }
- }
-
- protected static byte[] unsafeLoadBinary(InputStream stream) throws
IOException {
- return IOUtils.toByteArray(stream);
- }
-
- /**
- * Carica un file testuale dal classpath.<br/> NB: UTF-8 header are
- * removed!
- *
- * @param classpathResource
- * file relative path
- * @return textual content of resource file
- */
- public static String loadString(String classpathResource) {
- return loadString(new ClassPathResource(classpathResource));
- }
-
- public static String loadString(Resource classpathResource) {
- InputStream stream = null;
- try {
- return unsafeLoadString(stream =
classpathResource.getInputStream());
- } catch (IOException e) {
- throw new RuntimeException("Impossibile caricare la risorsa
testuale '" +
- classpathResource.getDescription() + "' dal
classpath.");
- } finally {
- IOUtils.closeQuietly(stream);
- }
- }
-
- protected static String unsafeLoadString(InputStream stream) throws
IOException {
- byte[] byteResult =
- IOUtils.toByteArray(stream);
- return stripUTF8preamble(new String(byteResult, "UTF-8"));
- }
-
- /**
- * Rimuove il preambolo UTF se presente nella stringa<br/>NB: la
convesione
- * in array di byte e sucessivo strip della stringa non funziona
- * correttamente perch&agrave;
- * <code>new String(UTF8_PREAMBLE).getBytes() != UTF8_PREAMBLE</code>;
- * alcune info qui:
- *
http://mail.python.org/pipermail/python-list/2004-February/250798.html
- */
- public static String stripUTF8preamble(String s) throws
UnsupportedEncodingException {
- if (hasUTF8preamble(s)) {
- logger.debug("Rimosso header UTF-8 dalla stringa");
- return s.substring(1);
- }
- return s;
- }
-
- /**
- * rimuove i 3 bytes di preambolo dagli UTF se presenti
- */
- public static byte[] stripUTF8preamble(byte[] b) {
- if (hasUTF8preamble(b)) {
- logger.debug("Rimosso header UTF-8 dall'array");
- b = ArrayUtils.subarray(b, 3, b.length);
- }
- return b;
- }
-
- public static boolean hasUTF8preamble(byte[] b) {
- return b[0] == UTF8_PREAMBLE[0] && b[1] == UTF8_PREAMBLE[1] &&
- b[2] == UTF8_PREAMBLE[2];
- }
-
- public static boolean hasUTF8preamble(String s) {
- return s.startsWith(UTF8_UNICODE_PREAMBLE);
- }
-
- /**
- * Return an array containing all the substrings of
- * <code>camelString</code>, according to this rule: divide
<code>camelString</code>
- * into tokens with every token starting from a capital letter to
another.
- *
- * Some examples:
- * <ol>
- * <li>'MyCamelString' gives: {my,camel,string}</li>
- * <li>'myFantasticCamelString' gives:
{my,fantastic,camel,string}</li>
- * <li>'MYCAMELSTRING' gives: {m,y,c,a,m,e,l,s,t,r,i,n,g}</li>
- * </ol>
- *
- */
- public static String[] uncamelize(String camelString) {
-
- if (camelString == null || camelString.trim().equals("")) {
- throw new IllegalArgumentException("camelString cannot be null
or empty");
- }
- List<Integer> idxList = new ArrayList<Integer>();
- List<String> strList = new ArrayList<String>();
-
- //\p{Lu} is the unicode pattern for capital letters
- Pattern p = Pattern.compile("\\p{Lu}");
- Matcher m = p.matcher(camelString);
-
- //find all occurences of an uppercase letter and put their
position on a list
- while (m.find()) {
- idxList.add(m.start());
- }
-
- // no upper case found: we return the entire word
- if (idxList.size() == 0) {
- return new String[]{camelString};
- }
-
- Integer[] idx = idxList.toArray(new Integer[idxList.size() - 1]);
-
- for (int i = 0; i < idx.length; i++) {
-
- //if the first character of camelString is lower case,
- //substring from 0 to index[1]
- if (i == 0 && idx[i] > 0) {
- strList.add(camelString.substring(0,
idx[i]).toLowerCase());
- }
-
- //the last part of the word hasn't got an end guard
- if (i == idx.length - 1) {
- strList.add(camelString.substring(idx[i],
camelString.length()).toLowerCase());
- } else {
- strList.add(camelString.substring(idx[i], idx[i +
1]).toLowerCase());
- }
- }
-
- return strList.toArray(new String[strList.size() - 1]);
- }
-
-}
=======================================
--- /parancoe-core/src/test/java/org/parancoe/persistence/dao/TestDaos.java
Sat Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.persistence.dao;
-
-import org.lambico.dao.DaoProvider;
-import org.parancoe.persistence.dao.generic.EntityTCDao;
-
-/**
- * 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>.
- *
- * @author <a href="mailto:lucio.b...@jugpadova.it">Lucio Benfante</a>
- * @author Federico Russo <chicc...@gmail.com>
- * @version $Revision$
- */
-public interface TestDaos extends DaoProvider {
-
- public EntityTCDao getEntityTCDao();
-
-}
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/dao/generic/EntityTCDao.java
Sat Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.persistence.dao.generic;
-
-import java.util.List;
-import org.lambico.dao.generic.Compare;
-import org.lambico.dao.generic.CompareType;
-import org.lambico.dao.generic.Dao;
-import org.lambico.dao.generic.FirstResult;
-import org.lambico.dao.generic.GenericDao;
-import org.lambico.dao.generic.MaxResults;
-
-import org.parancoe.persistence.po.hibernate.EntityTC;
-
-/**
- * A DAO to be used for the tests of the generic DAO.
- *
- * @author <a href="mailto:lu...@benfante.com">Lucio Benfante</a>
- * @version $Revision$
- */
-@Dao(entity=EntityTC.class)
-public interface EntityTCDao extends GenericDao<EntityTC, Long> {
- List<EntityTC> findByFieldOne(String value);
- List<EntityTC> findByFieldTwo(String value);
- List<EntityTC> findByFieldThree(@Compare(CompareType.ILIKE) String
value);
- List<EntityTC> findByFieldOneAndFieldTwo(String one, String two);
- List<EntityTC> findByOrderByFieldOne();
- List<EntityTC> findByOrderByFieldTwo();
- List<EntityTC> findByOrderByFieldOneAndFieldTwo();
- EntityTC findByFieldOneOrderByFieldTwo(String one);
- List<EntityTC> findByOrderByFieldOne(@FirstResult int firstResult,
@MaxResults int maxResults);
- List<EntityTC> searchAllOrderByFieldOne(@FirstResult int firstResult,
@MaxResults int maxResults);
- Long countByFieldOne(String value);
- Long maxByFieldOne(String value);
-}
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/po/hibernate/EntityTC.java
Sat Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.persistence.po.hibernate;
-
-import javax.persistence.Entity;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import org.lambico.po.hibernate.EntityBase;
-
-/**
- * An persistent object to be used for the tests of the generic DAO.
- *
- * @author <a href="mailto:lu...@benfante.com">Lucio Benfante</a>
- * @version $Revision$
- */
-@Entity()
-@NamedQueries({
-@NamedQuery(name="EntityTC.findByFieldOne", query="from EntityTC where
fieldOne = ?"),
-@NamedQuery(name="EntityTC.searchAllOrderByFieldOne", query="from EntityTC
order by fieldOne"),
-@NamedQuery(name="EntityTC.countByFieldOne", query="select count(etc) from
EntityTC etc where etc.fieldOne = ?"),
-@NamedQuery(name="EntityTC.maxByFieldOne", query="select
max(etc.numericField) from EntityTC etc where etc.fieldOne = ?")})
-public class EntityTC extends EntityBase {
- private String fieldOne;
- private String fieldTwo;
- private String fieldThree;
- private Long numericField;
-
- /**
- * Creates a new instance of EntityTC
- */
- public EntityTC() {
- }
-
- public String getFieldOne() {
- return fieldOne;
- }
-
- public void setFieldOne(String fieldOne) {
- this.fieldOne = fieldOne;
- }
-
- public String getFieldTwo() {
- return fieldTwo;
- }
-
- public void setFieldTwo(String fieldTwo) {
- this.fieldTwo = fieldTwo;
- }
-
- public String getFieldThree() {
- return fieldThree;
- }
-
- public void setFieldThree(String fieldThree) {
- this.fieldThree = fieldThree;
- }
-
- public Long getNumericField() {
- return numericField;
- }
-
- public void setNumericField(Long numericField) {
- this.numericField = numericField;
- }
-
-}
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/util/BaseTest.java
Sat Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.persistence.util;
-
-import org.lambico.test.spring.hibernate.DBTest;
-import org.parancoe.persistence.po.hibernate.AuthorTC;
-import org.parancoe.persistence.po.hibernate.BookTC;
-import org.parancoe.persistence.po.hibernate.EntityTC;
-
-/**
- * A base class for Parancoe-core tests.
- *
- * @author lucio
- */
-public abstract class BaseTest extends DBTest {
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{EntityTC.class, AuthorTC.class, BookTC.class};
- }
-}
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/util/DemoBean.java
Sat Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.persistence.util;
-
-public class DemoBean {
- public String nome;
-
- private Long id;
-
- public DemoBean() {
- super();
- }
-
- public DemoBean(String nome, Long id) {
- this.nome = nome;
- this.id = id;
- }
-
- public Long getId() {
- return id;
- }
-
- public void setId(Long value) {
- this.id = value;
- }
-
- @Override
- public String toString() {
- return "nome=" + nome + ", id=" + id;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if ((obj == null) || (obj.getClass() != this.getClass()))
- return false;
- // object must be DemoBean at this point
- DemoBean test = (DemoBean) obj;
- return (id == test.getId() || (id != null && id.equals(test.id)))
- && (nome == test.nome || (nome != null &&
nome.equals(test.nome)));
- }
-
- @Override
- public int hashCode() {
- int hash = 0;
- if (id != null) {
- hash += id.hashCode();
- }
- if (nome != null) {
- hash += nome.hashCode();
- }
- return hash == 0 ? super.hashCode() : hash;
- }
-}
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/util/FixtureHelperTest.java
Sat Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,149 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.persistence.util;
-
-import java.math.BigDecimal;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-import org.lambico.test.spring.hibernate.DBTest;
-
-import org.parancoe.persistence.po.hibernate.AuthorTC;
-import org.parancoe.persistence.po.hibernate.BookTC;
-import org.parancoe.util.FixtureHelper;
-import org.springframework.util.CollectionUtils;
-
-/**
- * @author <a href="mailto:michele...@seesaw.it">Michele Franzin</a>
- * @version $Revision$
- */
-public class FixtureHelperTest extends DBTest {
-
- private DemoBean[] expected;
-
- @Override
- public void onSetUpBeforeTransaction() throws Exception {
- super.onSetUpBeforeTransaction();
- expected = new DemoBean[5];
- expected[0] = new DemoBean("first one", new Long(356));
- expected[1] = new DemoBean("Demo 1", new Long(6789));
- expected[2] = new DemoBean("àèéìòù", new Long(-980000));
- expected[3] = new DemoBean("Demo3", new Long(98000));
- expected[4] = new DemoBean("Demo#2", new Long(-9800));
- }
-
- @SuppressWarnings("unchecked")
- public void testShouldNotFailWrongFixtureDir() throws Exception {
- Set<Class> models = new LinkedHashSet<Class>(
- CollectionUtils.arrayToList(new Class[]{DemoBean.class}));
- Map<Class, Object[]> result =
FixtureHelper.loadFixturesFromResource(
- "nonExistant/", models);
- assertTrue("Le fixture non sono vuote", result.isEmpty());
- }
-
- @SuppressWarnings("unchecked")
- public void testShouldNotFailIfMissingFixtureFile() throws Exception {
- Set<Class> models = new LinkedHashSet<Class>(
- CollectionUtils.arrayToList(new
Class[]{BigDecimal.class}));
- Map<Class, Object[]> result =
FixtureHelper.loadFixturesFromResource(
- "fixtures/", models);
- assertTrue("Le fixture non sono vuote", result.isEmpty());
- }
-
- public void testShouldNotFailIfEmptyDocs() throws Exception {
- Map<Class, Object[]> result =
FixtureHelper.loadFixturesFromResource(
- "emptyDir/", new LinkedHashSet<Class>());
- assertTrue("Le fixture non sono vuote", result.isEmpty());
- }
-
- public void testJarLoading() throws Exception {
- // TODO Testare il caricamento di una risorsa nei JAR
- }
-
- // TODO Completare il test
- // public void testStripUTF8preamble() {
- // byte[] stringWithPreamble = Utils
- // .loadBinary("testdata/UTF8WithPreamble.txt");
- // byte[] stringWithoutPreamble = Utils
- // .loadBinary("testdata/UTF8WithoutPreamble.txt");
- //
- // assertTrue(FixtureHelper.hasUTF8preamble(stringWithPreamble));
- // assertFalse(FixtureHelper.hasUTF8preamble(stringWithoutPreamble));
- //
- // byte[] stripped =
FixtureHelper.stripUTF8preamble(stringWithPreamble);
- // assertFalse(FixtureHelper.hasUTF8preamble(stripped));
- // assertEquals(stringWithPreamble.length, stripped.length + 3);
- // }
- // TODO Completare il test
- // public void testPrependUTF8preamble() {
- // byte[] stringWithoutPreamble = Utils
- // .loadBinary("testdata/UTF8WithoutPreamble.txt");
- // byte[] preambled = FixtureHelper
- // .prependUTF8preamble(stringWithoutPreamble);
- // assertTrue(FixtureHelper.hasUTF8preamble(preambled));
- // assertEquals(stringWithoutPreamble.length + 3, preambled.length);
- // }
- @SuppressWarnings("unchecked")
- public void testBeanLoading() throws Exception {
- Set<Class> models = new LinkedHashSet<Class>(
- CollectionUtils.arrayToList(new Class[]{DemoBean.class}));
- Map<Class, Object[]> objects =
FixtureHelper.loadFixturesFromResource(
- "fixtures/", models);
- assertNotNull("Non ha ritornato la mappa di fixtures", objects);
- assertEquals("Non carica tutti i beans", 1, objects.size());
- assertTrue("Non crea istanze di " +
DemoBean.class.getCanonicalName(),
- objects.containsKey(DemoBean.class));
- DemoBean[] result = (DemoBean[]) objects.get(DemoBean.class);
- assertEquals("Non carica tutti i beans", 5, result.length);
- for (int i = 0; i < 5; i++) {
- assertEquals("Non ha caricato correttamente il beans numero "
+ i,
- expected[i], result[i]);
- }
- }
-
- public void testBookLoading() {
- Set<Class> models = new LinkedHashSet<Class>(
- CollectionUtils.arrayToList(new Class[]{AuthorTC.class,
- BookTC.class
- }));
- Map<Class, Object[]> objects =
FixtureHelper.loadFixturesFromResource(
- "fixtures/", models);
- assertNotNull("Non ha ritornato la mappa di fixtures", objects);
- assertEquals(2, objects.size());
- assertEquals(3, objects.get(BookTC.class).length);
- assertEquals(4, objects.get(AuthorTC.class).length);
- assertBookAuthorsAreIdentical(objects.get(BookTC.class),
objects.get(
- AuthorTC.class));
- }
-
- private void assertBookAuthorsAreIdentical(Object[] books, Object[]
authors) {
- for (int i = 0; i < books.length; i++) {
- BookTC currentBook = (BookTC) books[i];
- for (AuthorTC author : currentBook.getAuthors()) {
- boolean found = false;
- for (int j = 0; j < authors.length; j++) {
- if (author == authors[j]) {
- found = true;
- break;
- }
- }
- assertTrue("The book author is not in the author array",
found);
- }
- }
- }
-}
=======================================
---
/parancoe-core/src/test/java/org/parancoe/persistence/util/UtilsTest.java
Sat Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.persistence.util;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.parancoe.util.Utils;
-
-public class UtilsTest extends TestCase {
-
- public void testConvertToNameValueList() {
- Map<String, String> input = new HashMap<String, String>();
- input.put("A", "B");
- input.put("C", "D");
- input.put("E", "F");
- List<String> expected = new ArrayList<String>();
- // changed add order in the list
- expected.add("E=F");
- expected.add("A=B");
- expected.add("C=D");
-
-
assertTrue(expected.containsAll(Utils.convertToNameValueList(input)));
- }
-
- public void testBinaryStripUTF8preamble() {
- byte[] stringWithPreamble =
Utils.loadBinary("testdata/UTF8WithPreamble.txt");
- byte[] stringWithoutPreamble =
Utils.loadBinary("testdata/UTF8WithoutPreamble.txt");
-
- assertTrue(Utils.hasUTF8preamble(stringWithPreamble));
- assertFalse(Utils.hasUTF8preamble(stringWithoutPreamble));
-
- byte[] stripped = Utils.stripUTF8preamble(stringWithPreamble);
- assertFalse(Utils.hasUTF8preamble(stripped));
- assertEquals(stringWithPreamble.length, stripped.length + 3);
- }
-
- public void testStringStripUTF8preamble() throws Exception {
- String stringWithPreamble =
Utils.loadString("testdata/UTF8WithPreamble.txt");
- String stringWithoutPreamble =
Utils.loadString("testdata/UTF8WithoutPreamble.txt");
-
- assertFalse(Utils.hasUTF8preamble(stringWithPreamble));
- assertFalse(Utils.hasUTF8preamble(stringWithoutPreamble));
- }
-}
=======================================
---
/parancoe-core/src/test/java/org/parancoe/test/ManyToManyFixturesTest.java
Sat Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Core.
- *
- * 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 org.parancoe.test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.Resource;
-import org.parancoe.persistence.po.hibernate.AuthorTC;
-import org.parancoe.persistence.po.hibernate.AuthorTCDao;
-import org.parancoe.persistence.po.hibernate.BookTC;
-import org.parancoe.persistence.po.hibernate.BookTCDao;
-import org.parancoe.persistence.util.BaseTest;
-
-/**
- * Tests fixture load with M:N relationships
- *
- * @author <a href="mailto:michele...@seesaw.it">Michele Franzin</a>
- * @author Jacopo Murador <jacopo.murador at seesaw.it>
- * @version $Revision$
- */
-public class ManyToManyFixturesTest extends BaseTest {
-
- @Resource
- protected AuthorTCDao authorTCDao = null;
-
- @Resource
- protected BookTCDao bookTCDao = null;
-
-
- public void testDaoExists() {
- assertNotNull("Author dao variable not setted", authorTCDao);
- assertNotNull("Book dao variable not setted", bookTCDao);
- }
-
- // FIXME fails in call with other ones
- public void _testAllSize() {
- assertSize(4, authorTCDao.findAll());
- assertSize(3, bookTCDao.findAll());
- }
-
- // FIXME fails in call with other ones
- public void _testFixturesLoad() {
- List<AuthorTC> authors = authorTCDao.findByName("joe");
- assertSize(1, authors);
- assertSize(2, authors.get(0).getBooks());
- List<BookTC> books = bookTCDao.findByTitle("Java manual");
- assertSize(1, books);
- assertSize(3, books.get(0).getAuthors());
- books = bookTCDao.findByTitle("Mr. Bean");
- assertSize(1, books);
- assertSize(2, books.get(0).getAuthors());
- }
-
- // FIXME fails in call with other ones
- public void _testRelationSanity() {
- BookTC book1 = new BookTC();
- book1.setTitle("title1");
- bookTCDao.store(book1);
- BookTC book2 = new BookTC();
- book2.setTitle("title2");
- bookTCDao.store(book2);
-
- AuthorTC author1 = new AuthorTC();
- author1.setName("name1");
- List<BookTC> bookList = new ArrayList<BookTC>();
- bookList.add(book1);
- bookList.add(book2);
- author1.setBooks(bookList);
- authorTCDao.store(author1);
-
- AuthorTC author2 = new AuthorTC();
- author2.setName("name2");
- bookList.clear();
- bookList.add(book2);
- author2.setBooks(bookList);
- authorTCDao.store(author2);
-
- authorTCDao.deleteAll();
- bookTCDao.deleteAll();
-
- List<AuthorTC> authors = authorTCDao.findByName("name1");
- assertSize(1, authors);
- assertSize(2, authors.get(0).getBooks());
- List<BookTC> books = bookTCDao.findByTitle("title2");
- assertSize(1, books);
- assertSize(2, books.get(0).getAuthors());
-
- authorTCDao.deleteAll();
- bookTCDao.deleteAll();
- }
-}
=======================================
--- /parancoe-core/src/test/resources/applicationContext_test.xml Sat Sep
4 02:41:52 2010
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
-
- This file is part of Parancoe Core.
-
- 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:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:lambico="http://www.lambico.org/schema/lambico"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
- http://www.lambico.org/schema/lambico
http://www.lambico.org/schema/lambico.xsd">
-
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <!--property name="url"
value="jdbc:hsqldb:hsql://localhost/parancoe"/-->
- <property name="url" value="jdbc:hsqldb:mem:parancoe"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </bean>
-
- <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
parent="abstractSessionFactory">
- <property name="hibernateProperties">
- <props>
- <prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
- <prop key="hibernate.hbm2ddl.auto">update</prop>
- <prop key="hibernate.show_sql">false</prop>
- <prop key="hibernate.cache.use_query_cache">true</prop>
- <prop
key="hibernate.cache.use_second_level_cache">true</prop>
- <prop
key="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</prop>
- <prop key="hibernate.generate_statistics">true</prop>
- </props>
- </property>
- </bean>
-
- <context:component-scan
base-package="org.parancoe.persistence.dao.generic"/>
-
- <!-- Authomatic discovering of persistent classes -->
- <lambico:discover-persistent-classes
basePackage="org.parancoe.persistence"/>
- <!-- Authomatic DAO definition from persistent classes -->
- <lambico:define-daos baseInterfacePackage="org.parancoe.persistence" />
-
- <bean id="daos" parent="abstractDaoProvider">
- <property name="proxyInterfaces">
- <value>org.parancoe.persistence.dao.TestDaos</value>
- </property>
- <property name="target">
- <bean parent="genericDaoProvider"/>
- </property>
- </bean>
-
- <bean id="daoExceptionManager"
class="org.lambico.dao.BypassingExceptionManager"/>
-
-</beans>
=======================================
--- /parancoe-core/src/test/resources/beanRefFactory_test.xml Sat Sep 4
02:41:52 2010
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
-
- Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
-
- This file is part of Parancoe Core.
-
- 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.
-
--->
-
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD
BEAN//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
-<beans>
- <bean id="org.parancoe.persistence"
-
class="org.springframework.context.support.ClassPathXmlApplicationContext">
- <constructor-arg>
- <list>
-
<value>org/parancoe/persistence/dao/generic/genericDao.xml</value>
-
<value>org/parancoe/persistence/applicationContextBase.xml</value>
- <value>applicationContext_test.xml</value>
- </list>
- </constructor-arg>
- </bean>
-</beans>
=======================================
--- /parancoe-core/src/test/resources/fixtures.jar Sat Jun 23 06:52:59 2007
+++ /dev/null
@@ -1,14 +0,0 @@
-PK ReÂ6vF7Ü— þ
- DemoBean.yaml] ± ‚0 Ew’þÃ
-&n
- E`Æop&´J ZBkü
-GMœÜœß YHlÀ7½÷rν X hÓË
-ñY ÖÁh OO%*dûܯžÙà¨
-Ò Ü”ë`‡¦•–E ¶Bö& 3š9£ö7Ò Šò—pòª¹:4ºíÌèíE5ÝéAOzÑ›>ANÊBîBK¶Àëé^qYà8Âü |
ep } PK
- ` J3 META-INF/PK
- 8ŒÂ63É ßZ Z META-INF/MANIFEST.MFManifest-Version: 1.0
-Created-By: 1.6.0_01-b06 (Sun Microsystems Inc.)
-Built-By: MichelePK ReÂ6vF7Ü— þ
- DemoBean.yamlPK
- ` J3 íAÂ META-INF/PK
- 8ŒÂ63É ßZ Z
é META-INF/MANIFEST.MFPK ´ u
=======================================
--- /parancoe-core/src/test/resources/fixtures/CachedEntityTC.yml Sat Sep
4 02:41:52 2010
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
-#
-# This file is part of Parancoe Core.
-#
-# 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.
-#
-
--
- fieldOne: "one1"
- fieldTwo: "two5"
- fieldThree: "Three1"
- numericField: 1
--
- fieldOne: "one2"
- fieldTwo: "two4"
- fieldThree: "Three2"
- numericField: 2
--
- fieldOne: "one3"
- fieldTwo: "two3"
- fieldThree: "Three3"
- numericField: 3
--
- fieldOne: "one4"
- fieldTwo: "two2"
- fieldThree: "Three4"
- numericField: 4
--
- fieldOne: "one3"
- fieldTwo: "two1"
- fieldThree: "7hree5"
- numericField: 5
-
=======================================
--- /parancoe-core/src/test/resources/fixtures/DemoBean.yml Sat Sep 4
02:41:52 2010
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
-#
-# This file is part of Parancoe Core.
-#
-# 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.
-#
-
--
- nome: "first one"
- id: 356
-
-# Ending with spaces
-- &demo1
- nome: "Demo 1"
- id: 6789
-
-# Without anchor
--
- nome: "àèéìòù"
- id: -980000
-
-- &demo3
- nome: "Demo3"
- id: 98000
-
-- &demo2
- nome: "Demo#2"
- id: -9800
=======================================
--- /parancoe-core/src/test/resources/fixtures/EntityTC.yml Sat Sep 4
02:41:52 2010
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
-#
-# This file is part of Parancoe Core.
-#
-# 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.
-#
-
--
- fieldOne: "one1"
- fieldTwo: "two5"
- fieldThree: "Three1"
- numericField: 1
--
- fieldOne: "one2"
- fieldTwo: "two4"
- fieldThree: "Three2"
- numericField: 2
--
- fieldOne: "one3"
- fieldTwo: "two3"
- fieldThree: "Three3"
- numericField: 3
--
- fieldOne: "one4"
- fieldTwo: "two2"
- fieldThree: "Three4"
- numericField: 4
--
- fieldOne: "one3"
- fieldTwo: "two1"
- fieldThree: "7hree5"
- numericField: 5
=======================================
--- /parancoe-core/src/test/resources/fixtures/String.yml Sat Sep 4
02:41:52 2010
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
-#
-# This file is part of Parancoe Core.
-#
-# 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.
-#
-
--
- Questo è un file UTF8 con preambolo
--
- òàùèì
=======================================
--- /parancoe-core/src/test/resources/testdata/UTF8WithPreamble.txt Sat Jun
23 06:52:59 2007
+++ /dev/null
@@ -1,2 +0,0 @@
-Questo è un file UTF8 con preambolo
-òàùèì
=======================================
--- /parancoe-core/src/test/resources/testdata/UTF8WithoutPreamble.txt Sat
Jun 23 06:52:59 2007
+++ /dev/null
@@ -1,2 +0,0 @@
-Questo è un file UTF8 senza preambolo
-òàùèì
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/WebUtils.java Sat Sep 4
02:41:52 2010
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web;
-
-public class WebUtils {
-
- public static String camelizeMethod(String rawMethodUrl) {
-
- if (rawMethodUrl == null || rawMethodUrl.length() == 0) {
- throw new IllegalArgumentException("rawMethodUrl cannot be
null or empty");
- }
-
- rawMethodUrl = rawMethodUrl.toLowerCase();
- String[] methodParts = rawMethodUrl.split("_");
-
- StringBuffer sb = new StringBuffer(methodParts[0]);
- for(int i = 1; i < methodParts.length; i++) {
- sb.append(methodParts[i].substring(0,1).toUpperCase());
- sb.append(methodParts[i].substring(1,methodParts[i].length()));
- }
-
- return sb.toString();
- }
-}
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/test/BaseTest.java Wed Sep
26 06:28:00 2012
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test;
-
-import java.io.File;
-import java.io.IOException;
-import org.apache.log4j.Logger;
-import org.lambico.test.spring.hibernate.DBTest;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.core.io.FileSystemResourceLoader;
-import org.springframework.mock.web.MockServletContext;
-import org.springframework.web.context.ContextLoader;
-import org.springframework.web.context.WebApplicationContext;
-
-/**
- * E' la classe base per tutti i test.
- * Carica all'avvio tutti i bean configurati in modo da renderli
- * disponibili ai test specifici senza la necessità di tirarli su di volta
in volta con
- * getCtx().getBean()
- */
-public abstract class BaseTest extends DBTest {
-
- private static final Logger log = Logger.getLogger(BaseTest.class);
-// @Autowired
-// protected BaseConf conf;
-
- @Override
- protected String[] getConfigLocations() {
- String parancoeServlet = null;
- String applicationContext = null;
- try {
- parancoeServlet =
- new
File("./src/main/webapp/WEB-INF/parancoe-servlet.xml").getCanonicalPath();
- applicationContext =
- new
File("./src/main/webapp/WEB-INF/applicationContext.xml").getCanonicalPath();
- } catch (IOException ex) {
- throw new RuntimeException("Unable to get parancoe-servlet",
ex);
- }
- return new String[]{
- "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
- "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "classpath:org/parancoe/core/applicationContextBase.xml",
- "classpath:org/parancoe/web/parancoeBase.xml", "classpath:database-test.xml",
- "file:" + applicationContext, "file:" +
parancoeServlet,
- "classpath*:applicationContext-plugin.xml", "classpath*:parancoe-plugin.xml", "classpath:spring-test.xml"
- };
- }
-
- @Override
- protected ConfigurableApplicationContext createApplicationContext(
- String[] locations) {
- FileSystemResourceLoader rl = new FileSystemResourceLoader();
- MockServletContext servletContext = new MockServletContext(rl);
- servletContext.setMinorVersion(4);
- servletContext.registerContext("/test", servletContext);
- servletContext.setServletContextName("/test");
-
servletContext.addInitParameter(ContextLoader.CONFIG_LOCATION_PARAM,
- arrayToString(locations));
- ContextLoader loader = new ContextLoader();
- WebApplicationContext context =
loader.initWebApplicationContext(servletContext);
- return (ConfigurableApplicationContext) context;
- }
-
- private String arrayToString(String[] locations) {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < locations.length - 1; i++) {
- sb.append(locations[i]).append(',');
- }
- if (locations.length > 0) {
- sb.append(locations[locations.length - 1]);
- }
- return sb.toString();
- }
-
-}
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/test/ControllerTest.java
Sat Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test;
-
-import javax.servlet.http.HttpSession;
-import org.springframework.mock.web.MockHttpServletRequest;
-import org.springframework.mock.web.MockHttpServletResponse;
-import org.springframework.mock.web.MockMultipartHttpServletRequest;
-
-public abstract class ControllerTest extends BaseTest {
-
- protected MockMultipartHttpServletRequest mpReq;
- protected MockHttpServletRequest req;
- protected MockHttpServletResponse res;
-
- @Override
- public void onSetUpBeforeTransaction() throws Exception {
- super.onSetUpBeforeTransaction();
- resetRequestAndResponse();
- }
-
- @Override
- public void onTearDownAfterTransaction() throws Exception {
- super.onTearDownAfterTransaction();
- mpReq = null;
- req = null;
- res = null;
- }
-
- /**
- * Reset the request and the response, maintaining the same session.
- * Useful, for example, to call a post after calling the get of the
form.
- */
- protected void resetRequestAndResponse() {
- HttpSession httpSession = null;
- // preparing the multipart request
- if (mpReq != null) {
- httpSession = mpReq.getSession();
- }
- mpReq = new MockMultipartHttpServletRequest();
- mpReq.setSession(httpSession);
- mpReq.setMethod("GET");
- // preparing the normal request
- if (req != null) {
- httpSession = req.getSession();
- }
- req = new MockHttpServletRequest();
- req.setSession(httpSession);
- req.setMethod("GET");
- res = new MockHttpServletResponse();
- }
-}
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/test/PluginTest.java Sat
Sep 4 02:41:52 2010
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test;
-
-import javax.annotation.Resource;
-import javax.servlet.ServletContext;
-import org.apache.log4j.Logger;
-import javax.sql.DataSource;
-import org.lambico.test.spring.hibernate.DBTest;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.core.io.FileSystemResourceLoader;
-import org.springframework.mock.web.MockServletContext;
-import org.springframework.web.context.support.XmlWebApplicationContext;
-
-/**
- * E' la classe base per tutti i test dei plugin.
- * Carica all'avvio tutti i bean configurati in modo da renderli
- * disponibili ai test specifici senza la necessità di tirarli su di volta
in volta con
- * getCtx().getBean()
- */
-public abstract class PluginTest extends DBTest {
-
- private static final Logger log = Logger.getLogger(PluginTest.class);
-
- @Resource
- protected DataSource dataSource;
-
- @Override
- protected String[] getConfigLocations() {
- return new String[] {
- "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
- "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "classpath:org/parancoe/web/parancoeBase.xml",
- "classpath:spring-test.xml",
- "classpath*:parancoe-plugin.xml",
- "classpath*:applicationContext-plugin.xml"};
- }
-
- @Override
- protected ConfigurableApplicationContext createApplicationContext(
- String[] locations) {
- FileSystemResourceLoader rl = new FileSystemResourceLoader();
- ServletContext servletContext = new MockServletContext(rl);
- XmlWebApplicationContext context = new XmlWebApplicationContext();
- context.setServletContext(servletContext);
- context.setConfigLocations(locations);
- context.refresh();
- return context;
- }
-
-}
=======================================
--- /parancoe-web/src/main/java/org/parancoe/web/test/TagTest.java Wed Sep
26 06:28:00 2012
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test;
-
-import javax.servlet.http.HttpSession;
-import org.springframework.mock.web.MockHttpServletRequest;
-import org.springframework.mock.web.MockHttpServletResponse;
-import org.springframework.mock.web.MockMultipartHttpServletRequest;
-import org.springframework.mock.web.MockPageContext;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.servlet.support.JspAwareRequestContext;
-import org.springframework.web.servlet.support.RequestContext;
-import org.springframework.web.servlet.tags.RequestContextAwareTag;
-import org.springframework.web.util.WebUtils;
-
-public abstract class TagTest extends BaseTest {
-
- protected MockMultipartHttpServletRequest mpReq;
- protected MockHttpServletRequest req;
- protected MockHttpServletResponse res;
- protected MockPageContext pc;
- protected RequestContext rc;
-
- @Override
- public void onSetUpBeforeTransaction() throws Exception {
- super.onSetUpBeforeTransaction();
- resetRequestAndResponse();
- }
-
- @Override
- public void onTearDownAfterTransaction() throws Exception {
- super.onTearDownAfterTransaction();
- mpReq = null;
- req = null;
- res = null;
- pc = null;
- }
-
- /**
- * Reset the request and the response, maintaining the same session.
Useful, for example, to
- * call a post after calling the get of the form.
- */
- protected void resetRequestAndResponse() {
- HttpSession httpSession = null;
- // preparing the multipart request
- if (mpReq != null) {
- httpSession = mpReq.getSession();
- }
- mpReq = new MockMultipartHttpServletRequest();
- mpReq.setSession(httpSession);
- mpReq.setMethod("GET");
- // preparing the normal request
- if (req != null) {
- httpSession = req.getSession();
- }
- req = new MockHttpServletRequest();
- req.setSession(httpSession);
- req.setMethod("GET");
- req.setContextPath("/testctx");
- req.setRequestURI("/testctx/test/request/uri");
-
req.setAttribute(WebUtils.FORWARD_REQUEST_URI_ATTRIBUTE, "/testctx/test/forward/request/uri");
- req.setQueryString("p1=v1&p2=v2&p3=v3");
- res = new MockHttpServletResponse();
- pc = new MockPageContext(((WebApplicationContext)
this.getApplicationContext()).
- getServletContext(), req, res);
- rc = new JspAwareRequestContext(pc);
-
pc.setAttribute(RequestContextAwareTag.REQUEST_CONTEXT_PAGE_ATTRIBUTE, rc);
- }
-
-}
=======================================
--- /parancoe-web/src/test/java/org/parancoe/web/SanityTest.java Sat Sep 4
02:41:52 2010
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web;
-
-//import javax.annotation.Resource;
-//import org.parancoe.util.BaseConf;
-import org.parancoe.web.test.BaseTest;
-
-public class SanityTest extends BaseTest {
-
-// @Resource
-// private BaseConf developmentConfiguration;
-
- public void testSanity() throws Exception {
-// assertNotNull(developmentConfiguration);
- }
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{};
- }
-
- @Override
- protected String[] getConfigLocations() {
- return new String[]{
- "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
- "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "classpath:org/parancoe/web/parancoeBase.xml",
- "classpath:spring-test.xml"};
- }
-}
=======================================
---
/parancoe-web/src/test/java/org/parancoe/web/test/controller/ForTestController.java
Mon Feb 28 22:01:33 2011
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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.
- */
-
-// Copyright 2008 The Parancoe Team
-//
-// 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 org.parancoe.web.test.controller;
-
-
-
-import javax.validation.Valid;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.SessionAttributes;
-import org.springframework.web.bind.support.SessionStatus;
-
-@Controller
-@RequestMapping("/test/controller.form")
-@SessionAttributes("something")
-public class ForTestController {
-
- private static final Logger logger =
Logger.getLogger(ForTestController.class);
-
- @RequestMapping(method = RequestMethod.GET)
- public String form(@RequestParam("value") String value,
- Model model) {
- ForTestControllerModel tcm = new ForTestControllerModel(value);
- model.addAttribute("something", tcm);
- return "test/form";
- }
-
- @RequestMapping(method = RequestMethod.POST)
- public String submit(@ModelAttribute("something") @Valid
ForTestControllerModel tcm,
- BindingResult result, SessionStatus status) {
- if (result.hasErrors()) {
- return "test/form";
- }
- // doing what you need with tcm and the other parameters
- status.setComplete();
- return "redirect:/test/done.html";
- }
-}
=======================================
---
/parancoe-web/src/test/java/org/parancoe/web/test/controller/ForTestControllerModel.java
Mon Feb 28 22:01:33 2011
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test.controller;
-
-import org.hibernate.validator.constraints.NotBlank;
-
-/**
- * A simple bean used as model for testing a controller.
- *
- * @author Lucio
- */
-public class ForTestControllerModel {
-
- @NotBlank
- private String value;
-
- public ForTestControllerModel(String value) {
- this.value = value;
- }
-
- /**
- * Get the value of value
- *
- * @return the value of value
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Set the value of value
- *
- * @param value new value of value
- */
- public void setValue(String value) {
- this.value = value;
- }
-}
=======================================
---
/parancoe-web/src/test/java/org/parancoe/web/test/controller/TestControllerTest.java
Mon Feb 28 22:01:33 2011
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Web.
- *
- * 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 org.parancoe.web.test.controller;
-
-import org.parancoe.web.test.ControllerTest;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.servlet.HandlerAdapter;
-import org.springframework.web.servlet.ModelAndView;
-
-/**
- * A test for the TestController controller.
- *
- * It's mostly an integration test for the Parancoe controller stack,
including validation.
- * And an example of how to write and test controllers.
- *
- * @author Lucio Benfante
- */
-public class TestControllerTest extends ControllerTest {
-
- @Autowired
- private ForTestController controller;
- @Autowired
- private HandlerAdapter handler;
-
- public void testConfiguration() {
- assertNotNull(controller);
- assertNotNull(handler);
- }
-
- public void testSubmit() throws Exception {
- callForm("initial value");
- resetRequestAndResponse();
- req.setMethod("POST");
- req.setRequestURI("/test/controller.form");
- req.setParameter("value", "modified value");
- ModelAndView mv = handler.handle(req, res, controller);
- assertEquals("redirect:/test/done.html", mv.getViewName());
- Object oSomething = mv.getModel().get("something");
- assertNotNull(oSomething);
- assertEquals("modified value", ((ForTestControllerModel)
oSomething).
- getValue());
- Object sSomething = req.getSession().getAttribute("something");
- assertNull(
- "The something attribute should have been removed from the
session",
- sSomething);
- }
-
- public void testUpdateFailedForValidation() throws Exception {
- callForm("initial value");
- resetRequestAndResponse();
- req.setMethod("POST");
- req.setRequestURI("/test/controller.form");
- req.setParameter("value", ""); // not valid empty value
- ModelAndView mv = handler.handle(req, res, controller);
- assertEquals("test/form", mv.getViewName());
- Object sSomething = req.getSession().getAttribute("something");
- assertNotNull(
- "The something attribute shouldn't have been removed from
the session",
- sSomething);
- }
-
- public void testForm() throws Exception {
- ModelAndView mv = callForm("initial value");
- Object oSomething = mv.getModel().get("something");
- assertNotNull(oSomething);
- assertTrue("The object is not of type TestControllerModel",
- oSomething instanceof ForTestControllerModel);
- Object sSomething = req.getSession().getAttribute("something");
- assertNotNull(sSomething);
- assertTrue("The object is not of type TestControllerModel",
- sSomething instanceof ForTestControllerModel);
- assertSame(oSomething, sSomething);
- assertEquals("initial value", ((ForTestControllerModel)
oSomething).
- getValue());
- assertEquals("test/form", mv.getViewName());
- }
-
- private ModelAndView callForm(String value) throws Exception {
- req.setMethod("GET");
- req.setRequestURI("/test/controller.form");
- req.setParameter("value", value);
- ModelAndView mv = handler.handle(req, res, controller);
- this.endTransaction();
- this.startNewTransaction();
- return mv;
- }
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{};
- }
-
- @Override
- protected String[] getConfigLocations() {
- return new String[]{
- "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
- "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "classpath:org/parancoe/web/parancoeBase.xml",
- "classpath:spring-test.xml"};
- }
-}
=======================================
--- /parancoe-web/src/test/resources/log4j.properties Sun Sep 21 14:08:50
2008
+++ /dev/null
@@ -1,8 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE
-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.logger.org.parancoe=INFO
-log4j.logger.org.parancoe.plugin.dwr=INFO
=======================================
--- /parancoe-web/src/test/resources/spring-test.xml Sat Sep 4 02:41:52
2010
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2006-2010 The Parancoe Team <in...@parancoe.org>
-
- This file is part of Parancoe Web.
-
- 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:context="http://www.springframework.org/schema/context"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:lambico="http://www.lambico.org/schema/lambico"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.lambico.org/schema/lambico
http://www.lambico.org/schema/lambico.xsd">
-
- <context:component-scan base-package="org.parancoe.web"/>
-
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:mem:test"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </bean>
-
- <bean id="sessionFactory" parent="abstractSessionFactory">
- <property name="hibernateProperties">
- <props merge="true">
- <prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
- <prop key="hibernate.hbm2ddl.auto">create</prop>
- <prop key="hibernate.show_sql">false</prop>
- </props>
- </property>
- </bean>
-
- <!-- Authomatic discovering of persistent classes -->
- <lambico:discover-persistent-classes basePackage="org.parancoe.web"/>
-
-</beans>
=======================================
--- /parancoe-yaml/BUGS Sat Jun 23 06:52:59 2007
+++ /dev/null
@@ -1,3 +0,0 @@
-# MICHELE :
-- Non funziona con le inner classes !!
-- Se il documento è vuoto non ritorna il tipo indicato nella prima riga ma
un'hashmap
=======================================
--- /parancoe-yaml/TODO Sat Jun 23 06:52:59 2007
+++ /dev/null
@@ -1,32 +0,0 @@
-# MICHELE :
-- Rendere customizzabile la dimensione del circula buffer
-
-# ORIGINALI :
-
-- hanging bug with large files(done)
-- references(done)
-- special handling of classes (done)
-- remove unnecessary output of properties(done)
-- Array handling(done)
-- convert RuntimeExceptions to YmlParserExceptions(done)
-- simple values(done)
-- licensing(done)
-- additional test cases(done)
-- streams(done)
-- same line mapping?(done)
-- multi-line strings and non-quoted strings(done)
-- more readable date handling(done)
-- date to handle exact millisecond(done)
-- better logging and error messages(partial)
-- enums(done)
-- allow mapping of class names(done)
-- jyaml config file(done)
-- string references no need to preserve(done)
-- 1.4 compatibility(done, thanks to Retrotranslator)
-- refactoring (renaming from yml to yaml and YamlConfig, Yaml, and
YamlOperations) (done)
-- documentation
-- get config file from resource classpath(done)
-- redesign special treatment
-- inline maps and complex objects for keys
-- large file bug
-- non-ascii characters
=======================================
---
/plugins/parancoe-plugin-configuration/src/test/java/org/parancoe/plugin/configuration/SanityTest.java
Thu May 3 06:29:42 2012
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
- *
- * This file is part of Parancoe Plugin Configuration.
- *
- * 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 org.parancoe.plugin.configuration;
-
-import org.parancoe.plugin.configuration.dao.CategoryDao;
-import org.parancoe.plugin.configuration.dao.PropertyDao;
-import org.parancoe.web.plugin.WebPlugin;
-import org.parancoe.web.test.PluginTest;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-
-public class SanityTest extends PluginTest {
-
- @Autowired
- @Qualifier("parancoe-plugin-configurationPluginConfig")
- private WebPlugin plugin;
-
- @Autowired
- private InitializerContextListener sampleContextListener;
-
- @Autowired
- private SampleInterceptor sampleInterceptor;
-
- @Autowired
- private CategoryDao categoryDao;
- @Autowired
- private PropertyDao propertyDao;
-
- /* test everything has been loaded properly */
- public void testSanity() {
- assertNotNull(plugin);
- assertNotNull(sampleContextListener);
- assertNotNull(sampleInterceptor);
- assertNotNull(categoryDao);
- assertNotNull(propertyDao);
- }
-
- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{};
- }
-
-}
=======================================
---
/plugins/parancoe-plugin-configuration/src/test/resources/log4j.properties
Mon Oct 29 01:24:47 2012
+++ /dev/null
@@ -1,10 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE
-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.logger.org.parancoe=DEBUG
-log4j.logger.org.lambico=DEBUG
-log4j.logger.org.parancoe.plugin.configuration=DEBUG
-log4j.logger.org.apache.cxf=DEBUG
=======================================
---
/plugins/parancoe-plugin-configuration/src/test/resources/spring-test.xml
Mon Oct 29 01:24:47 2012
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2006-2012 The Parancoe Team <in...@parancoe.org>
-
- This file is part of Parancoe Plugin Configuration.
-
- 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:context="http://www.springframework.org/schema/context"
- 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.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.lambico.org/schema/lambico
http://www.lambico.org/schema/lambico.xsd">
-
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:mem:test"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </bean>
-
- <bean id="sessionFactory" parent="abstractSessionFactory">
- <property name="eventListeners">
- <map>
- <entry key="merge">
- <bean
class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
- </entry>
- </map>
- </property>
- <property name="hibernateProperties">
- <props merge="true">
- <prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect
- </prop>
- <prop key="hibernate.hbm2ddl.auto">create
- </prop>
- <prop key="hibernate.show_sql">true
- </prop>
- </props>
- </property>
- </bean>
-</beans>
-
=======================================
--- /plugins/parancoe-plugin-dwr/src/test/resources/log4j.properties Thu
Jun 26 07:34:26 2008
+++ /dev/null
@@ -1,8 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE
-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.logger.org.parancoe=INFO
-log4j.logger.org.parancoe.plugin.dwr=INFO
=======================================
--- /plugins/parancoe-plugin-security/src/test/resources/log4j.properties
Wed Aug 8 18:06:36 2007
+++ /dev/null
@@ -1,18 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE
-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.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
=======================================
---
/plugins/parancoe-plugin-springsecurity-evolution/src/test/resources/log4j.properties
Wed Jan 18 09:35:16 2012
+++ /dev/null
@@ -1,9 +0,0 @@
-log4j.rootLogger=ERROR, CONSOLE
-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.logger.org.parancoe.plugins.securityevolution=DEBUG
-log4j.logger.org.parancoe=INFO
-log4j.logger.com.mycompany.testapp=INFO
=======================================
***Additional files exist in this changeset.***
Reply all
Reply to author
Forward
0 new messages