Skip to content

Commit

Permalink
merge spring-data-jpa
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Eichar committed Nov 7, 2013
1 parent 56660ea commit e550470
Show file tree
Hide file tree
Showing 3,557 changed files with 381,140 additions and 54,188 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
25 changes: 21 additions & 4 deletions .gitignore
@@ -1,17 +1,20 @@

.DS_Store
.checkstyle
*.iml
web/src/main/webapp/WEB-INF/data/config/schema_plugins/*/schematron/schematron*.xsl
web/src/main/webapp/WEB-INF/data/config/schemaplugin-uri-catalog.xml
web/src/main/webapp/WEB-INF/classes/JZKitConfig.xml
web/src/main/webapp/scripts/lib/*
web/src/main/webapp/images/logos/*
web/src/main/webapp/images/statTmp
web/logs/
web/jcs_caching/
geonetwork*.db
geonetwork-*
web/geonetwork*.db
/geonetwork*
changes-*
web/coverage.ec
*/target/
*/.externalToolBuilders
web/src/main/webapp/data/
web/src/main/webapp/WEB-INF/lucene/
web/src/main/webapp/WEB-INF/metadata_subversion/
Expand All @@ -31,10 +34,24 @@ web-client/src/main/resources/apps/html5ui/js/App-mini.js
*.iml
.idea/
eclipse/
web/src/main/webapp/WEB-INF/data/data
web/src/main/webapp/WEB-INF/data/data/metadata_data
web/src/main/webapp/WEB-INF/data/data/metadata_subversion
web/src/main/webapp/WEB-INF/data/data/resources
web/src/main/webapp/WEB-INF/data/index
web-itest/jcs_caching
bin/config_delawen.sh
web-client/src/main/resources/apps/geocatch/js/App-mini.js
web/dev-config/log4j-delawen.cfg

datadir/
*.factorypath
web/src/main/webapp/WEB-INF/data/removed/
web/.springBeans
web/images/
*.launch
idea/
web/src/main/webapp/WEB-INF/data/0*
jcs_caching/
web-ui/src/main/resources/catalog/lib/gn*.min.js
web-ui/src/main/resources/catalog/style/gn*.css
web-ui/src/main/resources/catalog/style/gn.css
50 changes: 47 additions & 3 deletions README.md
@@ -1,5 +1,4 @@
Features
--------
# Features

* Immediate search access to local and distributed geospatial catalogues
* Up- and downloading of data, graphics, documents, pdf files and any other content type
Expand All @@ -8,4 +7,49 @@ Features
* Scheduled harvesting and synchronization of metadata between distributed catalogs
* Support for OGC-CSW 2.0.2 ISO Profile, OAI-PMH, Z39.50 protocols
* Fine-grained access control with group and user management
* Multi-lingual user interface
* Multi-lingual user interface

# Documentation

User documentation is in the docs submodule in the current repository and is compiled into html pages during a release for publishing on
a website.

Developer documentation is also in the docs submodule but is being migrated out of that project into the Readme files in each module
in the project. General documentation for the project as a whole is in this Readme and module specific documentation can be found in
each module (assuming there is module specific documentation required).

# Software Development

Instructions for setting up a development environment/building Geonetwork/compiling user documentation/making a release see:
[Software Development Documentation](/software_development/)

# Testing

With regards to testing Geonetwork is a standard Java project and primarily depends on JUnit for testing. However there is a very important
issue to consider when writing JUnit tests in Geonetwork and that is the separation between unit tests and integration tests

* *Unit Tests* - In Geonetwork unit tests should be very very quick to execute and not start up any subsystems of the application in order to keep
the execution time of the unit tests very short. Integration tests do not require super classes and any assistance methods can be static
imports, for example statically importing org.junit.Assert or org.junit.Assume or org.fao.geonet.Assert.
* *Integration Tests* - Integration Test typically start much or all of Geonetwork as part of the test and will take longer to run than
a unit test. However, even though the tests take longer they should still be implemented in such a way to be as efficient as possible.
Starting Geonetwork in a way that isolates each integration test from each other integration test is non-trivial. Because of this
there are `abstract` super classes to assist with this. Many modules have module specific Abstract classes. For example at the time
that this is being written `domain`, `core`, `harvesters` and `services` modules all have module specific super classes that need to
be used. (`harvesting` has 2 superclasses depending on what is to be tested.)
The easiest way to learn how to implement an integration test is to search for other integration tests in the same module as the class
you want to test. The following list provides a few tips:
* *IMPORTANT*: All Integrations tests *must* end in IntegrationTest. The build system assumes all tests ending in IntegrationTest is
an integration test and runs them in a build phase after unit tests. All other tests are assumed to be unit tests.
* Prefer unit tests over Integration Tests because they are faster.
* Search the current module for IntegrationTest to find tests to model your integration test against
* This you might want integration tests for are:
* Services: If the service already exists and you quick need to write a test to debug/fix its behaviour.
If you are writing a new service it is better to use Mockito to mock the dependencies of the service so the test is
a unit test.
* Harvesters
* A behaviour that crosses much of the full system

*org.fao.geonet.utils.GeonetHttpRequestFactory*: When making Http requests you should use org.fao.geonet.utils.GeonetHttpRequestFactory instead
of directly using HttpClient. This is because there are mock instances of org.fao.geonet.utils.GeonetHttpRequestFactory that can
be used to mock responses when performing tests.
28 changes: 18 additions & 10 deletions bin/start.ps1
@@ -1,3 +1,7 @@
param (
[string]$mode = "build"
)

$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
. "$scriptPath\config.ps1"

Expand All @@ -14,16 +18,20 @@ if (!(test-path Env:\JREBEL_HOME)) {
echo "Env:JREBEL_HOME is found. Configuring JRebel. JREBEL_OPTS = $JREBEL_OPTS"
}

$Env:MAVEN_OPTS=""

cmd /c "cd $JEEVES_DIR && mvn install $args"
if ($mode -eq "build") {
$Env:MAVEN_OPTS=""

#if ( ]; then
# echo "[FAILURE] [deploy] Failed to execute 'jeeves' correctly"
# exit -1
#fi
cmd /c "cd $scriptPath\..\common && mvn install $args"
cmd /c "cd $scriptPath\..\domain && mvn install $args"
cmd /c "cd $JEEVES_DIR && mvn install $args"
cmd /c "cd $scriptPath\..\core && mvn install $args"
cmd /c "cd $scriptPath\..\csw-server && mvn install $args"
cmd /c "cd $scriptPath\..\healthmonitor && mvn install $args"
cmd /c "cd $scriptPath\..\harvesters && mvn install $args"
cmd /c "cd $scriptPath\..\services && mvn install $args"
}

$Env:MAVEN_OPTS="$JREBEL_OPTS $DEBUG $OVERRIDES $MEMORY -Dgeonetwork.dir=$DATA_DIR $LOGGING -Dfile.encoding=UTF8"
$Env:MAVEN_OPTS="$JREBEL_OPTS $DEBUG $OVERRIDES $MEMORY -Dgeonetwork.dir=$DATA_DIR -Dfile.encoding=UTF8"

cmd /c "cd $WEB_DIR && mvn jetty:run -Penv-dev -Pwidgets $args"
cd $scriptPath
cmd /c "cd $WEB_DIR && mvn jetty:run -Penv-inspire $args"
cd $scriptPath
2 changes: 2 additions & 0 deletions cachingxslt/README.md
@@ -0,0 +1,2 @@
The cachingxslt module contains an XSLT parser that will cache the compiled XSLT Style sheet to improve the performance of performing
XSLT transformations.
52 changes: 37 additions & 15 deletions cachingxslt/pom.xml
Expand Up @@ -19,19 +19,41 @@
<description>
Caching xslt project.
</description>

<licenses>
<license>
<name>General Public License (GPL)</name>
<url>http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<dependencies>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>saxon</artifactId>
</dependency>
</dependencies>

<licenses>
<license>
<name>General Public License (GPL)</name>
<url>http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<dependencies>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>saxon</artifactId>
</dependency>
</dependencies>

<profiles>
<profile>
<id>run-static-analysis</id>
<activation>
<property>
<name>!skipTests</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties>
<rootProjectDir>${basedir}/..</rootProjectDir>
</properties>
</project>
Expand Up @@ -29,13 +29,13 @@ public class CachingTransformerFactory extends TransformerFactoryImpl
private static Map<String, TemplatesCacheEntry> templatesCache = new HashMap<String, TemplatesCacheEntry>();

/** Factory logger. */
protected static Logger logger =
protected static final Logger logger =
Logger.getLogger(CachingTransformerFactory.class);

/** Active readers count. */
protected static int activeReaders = 0;
static int activeReaders = 0;
/** Active writers count. */
protected static int activeWriters = 0;
static int activeWriters = 0;

/**
* Clear the stylesheet cache. This is not part of the
Expand Down Expand Up @@ -215,7 +215,7 @@ protected synchronized void afterWrite()
/**
* Private class to hold templates cache entry.
*/
private class TemplatesCacheEntry
private static final class TemplatesCacheEntry
{
/** When was the cached entry last modified. */
private long lastModified;
Expand Down
3 changes: 3 additions & 0 deletions code_quality/README.md
@@ -0,0 +1,3 @@
The files in this directory are used for configuring IDEs or are used by the build tool to make certain code quality checks.

For example findbugs-ecludes is used by both the build tool's findbugs implementation as well as IDES for running findbugs.
6 changes: 3 additions & 3 deletions code_quality/checkstyle_checks.xml
Expand Up @@ -32,7 +32,7 @@
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<module name="AvoidStarImport"/>
<!--<module name="AvoidStarImport"/>-->
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
Expand All @@ -47,7 +47,7 @@
<property name="tokens" value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS"/>
</module>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<!--<module name="OperatorWrap"/>-->
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
Expand All @@ -72,7 +72,7 @@
</module>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="DesignForExtension"/>
<!--<module name="DesignForExtension"/>-->
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
Expand Down
14 changes: 13 additions & 1 deletion code_quality/checkstyle_suppressions.xml
Expand Up @@ -7,5 +7,17 @@
<suppressions>
<suppress files=".*Test.*\.java" checks="[a-zA-Z0-9]*"/>
<suppress files=".*DummyGraph\.java" checks="[a-zA-Z0-9]*"/>
<suppress files=".*" checks="[a-zA-Z0-9]*"/>
<suppress files="core/.*" checks="[a-zA-Z0-9]*"/>
<suppress files="cachingxslt/.*" checks="[a-zA-Z0-9]*"/>
<suppress files="csw-server/.*" checks="[a-zA-Z0-9]*"/>
<suppress files="dummy-api/.*" checks="[a-zA-Z0-9]*"/>
<suppress files="harvesters/.*" checks="[a-zA-Z0-9]*"/>
<suppress files="health-monitor/.*" checks="[a-zA-Z0-9]*"/>
<suppress files="jeeves/.*" checks="[a-zA-Z0-9]*"/>
<suppress files="oaipmh/.*" checks="[a-zA-Z0-9]*"/>
<suppress files="services/.*" checks="[a-zA-Z0-9]*"/>
<suppress files="web-app/.*" checks="[a-zA-Z0-9]*"/>
<suppress files="common/.*" checks="[a-zA-Z0-9]*"/>
<suppress files="domain/.*_.java" checks="[a-zA-Z0-9]*"/>
<suppress files="domain/.*" checks="DesignForExtension"/>
</suppressions>
40 changes: 27 additions & 13 deletions code_quality/findbugs-excludes.xml
Expand Up @@ -7,7 +7,17 @@
<Match>
<Class name="~.*\..*Test" />
</Match>


<!-- Domain Exceptions -->
<Match>
<Class name="~org\.fao\.geonet\.domain\.\S+_$" />
</Match>
<!-- Oaipmh Exceptions -->
<Match>
<Class name="org.fao.oaipmh.util.ISODate" />
<Bug pattern="REC_CATCH_EXCEPTION" />
</Match>

<!-- Jeeves Exceptions -->
<Match>
<Class name="jeeves.server.JeevesEngine" />
Expand Down Expand Up @@ -72,6 +82,10 @@
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
<Method name="processCQLTermNode"/>
</Match>
<Match>
<Class name="de.fzi.dbs.xml.transform.CachingTransformerFactory" />
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
</Match>
<Match>
<Class name="org.fao.geonet.services.metadata.BatchVersion" />
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
Expand All @@ -82,25 +96,25 @@
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
<Method name="serviceSpecificExec"/>
</Match>
<Match>
<Bug pattern="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE" />
</Match>

<Match>
<Or>
<Class name="org.fao.geonet.services.extent.ExtentManager" />
<Class name="org.fao.geonet.services.extent.Update" />
</Or>
<Bug pattern="LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE " />
</Match>
<Match>
<Class name="org.fao.geonet.DatabaseMigration" />
<Bug pattern="SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE" />
<Method name="newLookup"/>
</Match>
<Match>
<Bug pattern="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE" />
</Match>
<Match>
<Class name="org.fao.geonet.services.ownership.OwnershipUtils$1" />
</Match>


<!-- The following bugs are hard to fix should be fixed because they can cause problems in servers with multiple geonetworks running -->
<Match>
<Or>
<Class name="org.fao.geonet.kernel.search.LuceneSearcher" />
<Class name="org.fao.geonet.kernel.search.spatial.SpatialIndexWriter" />
<Class name="org.fao.geonet.kernel.search.SearchManager" />
<Class name="org.fao.geonet.services.extent.ExtentManager" />
</Or>
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD" />
</Match>
Expand Down
2 changes: 2 additions & 0 deletions common/README.md
@@ -0,0 +1,2 @@
The common module contains very basic utilities that are useful for all projects. For example utilities for assisting with parsing
and encoding XML or making HTTP requests.

0 comments on commit e550470

Please sign in to comment.