Topia-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
April 2014
- 7 participants
- 73 discussions
04 May '14
See <http://ci.nuiton.org/jenkins/job/topia-nightly/31/changes>
Changes:
[bleny] fixes #3181 introduce topia-service-flyway
[bleny] fixes #3181
------------------------------------------
[...truncated 2537 lines...]
[INFO] Installing <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-migra…> to /var/local/forge/data/nuiton.org/maven/repository/org/nuiton/topia/topia-service-migration/3.0-SNAPSHOT/topia-service-migration-3.0-SNAPSHOT-javadoc.jar
[INFO] Installing <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-migra…> to /var/local/forge/data/nuiton.org/maven/repository/org/nuiton/topia/topia-service-migration/3.0-SNAPSHOT/topia-service-migration-3.0-SNAPSHOT.jar.asc
[INFO] Installing <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-migra…> to /var/local/forge/data/nuiton.org/maven/repository/org/nuiton/topia/topia-service-migration/3.0-SNAPSHOT/topia-service-migration-3.0-SNAPSHOT.pom.asc
[INFO] Installing <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-migra…> to /var/local/forge/data/nuiton.org/maven/repository/org/nuiton/topia/topia-service-migration/3.0-SNAPSHOT/topia-service-migration-3.0-SNAPSHOT-third-party.properties.asc
[INFO] Installing <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-migra…> to /var/local/forge/data/nuiton.org/maven/repository/org/nuiton/topia/topia-service-migration/3.0-SNAPSHOT/topia-service-migration-3.0-SNAPSHOT-sources.jar.asc
[INFO] Installing <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-migra…> to /var/local/forge/data/nuiton.org/maven/repository/org/nuiton/topia/topia-service-migration/3.0-SNAPSHOT/topia-service-migration-3.0-SNAPSHOT-javadoc.jar.asc
[JENKINS] Archiving disabled
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ToPIA :: Flyway integration service 3.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ topia-service-flyway ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ topia-service-flyway ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:check-auto-container (check-central-safe) @ topia-service-flyway ---
[INFO] Will use repository http://repo1.maven.org/maven2/
[INFO] Will use repository http://maven.nuiton.org/central-releases
[INFO] 42 dependencies to check.
[INFO] 42 artifact(s) resolved by repository http://repo1.maven.org/maven2/ in 151.798ms
[INFO] All dependencies are safe.
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ topia-service-flyway ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-redmine-login) @ topia-service-flyway ---
[INFO] Exporting server [redmine-forge.nuiton.org] privateKey in ${redmine.apiKey}
[INFO]
[INFO] --- license-maven-plugin:1.6:update-project-license (attach-licenses) @ topia-service-flyway ---
[INFO] Will create or update license file [lgpl_v3] to <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO]
[INFO] --- license-maven-plugin:1.6:add-third-party (attach-licenses) @ topia-service-flyway ---
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/antlr/a…
[INFO] Downloading: http://repo.maven.apache.org/maven2/antlr/antlr/2.7.7/antlr-2.7.7-third-par…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/com/goo…
[INFO] Downloading: http://repo.maven.apache.org/maven2/com/google/guava/guava/16.0.1/guava-16.…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/com/goo…
[INFO] Downloading: http://repo.maven.apache.org/maven2/com/googlecode/flyway/flyway-core/2.3/f…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/com/h2d…
[INFO] Downloading: http://repo.maven.apache.org/maven2/com/h2database/h2/1.3.176/h2-1.3.176-th…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/net/sf/…
[INFO] Downloading: http://repo.maven.apache.org/maven2/net/sf/ehcache/ehcache-core/2.4.3/ehcac…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/apa…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.3.2/…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/hib…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/hibernate/hibernate-core/4.3.5.Fina…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/hib…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/hibernate/hibernate-ehcache/4.3.5.F…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/hib…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/hibernate/common/hibernate-commons-…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/hib…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/hibernate/javax/persistence/hiberna…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/jav…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/javassist/javassist/3.18.1-GA/javas…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/jbo…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/jandex/1.1.0.Final/jandex-1.1…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/jbo…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/logging/jboss-logging/3.1.3.G…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/jbo…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/logging/jboss-logging-annotat…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/jbo…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/spec/javax/transaction/jboss-…
[INFO] Detects third party descriptor /var/local/forge/data/nuiton.org/maven/repository/org/nuiton/nuiton-utils/3.0-rc-2/nuiton-utils-3.0-rc-2-third-party.properties
[INFO] Load missing file /var/local/forge/data/nuiton.org/maven/repository/org/nuiton/nuiton-utils/3.0-rc-2/nuiton-utils-3.0-rc-2-third-party.properties
[INFO] Detects third party descriptor <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-junit/src/lic…>
[INFO] Load missing file <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-junit/src/lic…>
[INFO] Missing file <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…> is up-to-date.
[INFO] Writing third-party file to <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO] Regenerate missing license file <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO] Will attach third party file from <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ topia-service-flyway ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO] Copying 2 resources
[INFO]
[INFO] --- license-maven-plugin:1.6:update-file-header (update-file-header) @ topia-service-flyway ---
[WARNING] The extension xsl is already accepted for comment style xml
[INFO] Will search files to update from root <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO] Will search files to update from root <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO] - adding license header on file <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO] - adding license header on file <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO] - adding license header on file <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO] - adding license header on file <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO] Scan 4 files header done in 3.109ms.
[INFO]
* add header on 4 files.
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ topia-service-flyway ---
[INFO] Compiling 4 source files to <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[WARNING] <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>: <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…> uses unchecked or unsafe operations.
[WARNING] <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- animal-sniffer-maven-plugin:1.10:check (default) @ topia-service-flyway ---
[INFO] Checking unresolved references to org.codehaus.mojo.signature:java16:1.1
[INFO]
[INFO] --- jredmine-maven-plugin:1.8.1:generate-changes (jredmine-generate-changes) @ topia-service-flyway ---
[INFO] Skipping goal (runOnce flag is on, and was already executed).
[INFO]
[INFO] --- maven-antrun-plugin:1.7:run (generate-surefire-workdir) @ topia-service-flyway ---
[INFO] Executing tasks
main:
[mkdir] Created dir: <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO] Executed tasks
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ topia-service-flyway ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ topia-service-flyway ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ topia-service-flyway ---
[INFO] No tests to run.
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ topia-service-flyway ---
[INFO] Building jar: <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO]
[INFO] >>> maven-source-plugin:2.2.1:jar (attach-sources) @ topia-service-flyway >>>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ topia-service-flyway ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:check-auto-container (check-central-safe) @ topia-service-flyway ---
[INFO] Will use repository http://repo1.maven.org/maven2/
[INFO] Will use repository http://maven.nuiton.org/central-releases
[INFO] Skipping goal (runOnce flag is on and goal was already executed).
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ topia-service-flyway ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-redmine-login) @ topia-service-flyway ---
[INFO] Skipping goal (runOnce flag is on and goal was already executed).
[WARNING] Failed to getClass for org.apache.maven.plugin.source.SourceJarMojo
[INFO]
[INFO] <<< maven-source-plugin:2.2.1:jar (attach-sources) @ topia-service-flyway <<<
[INFO]
[INFO] --- maven-source-plugin:2.2.1:jar (attach-sources) @ topia-service-flyway ---
[INFO] Building jar: <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO]
[INFO] --- maven-javadoc-plugin:2.9.1:jar (attach-javadocs) @ topia-service-flyway ---
[INFO] Building jar: <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/topia-service-flywa…>
[INFO]
[INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ topia-service-flyway ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-pgp-passphrase) @ topia-service-flyway ---
[INFO] Exporting server [gpg-signer] username in ${gpg.keyname}
[INFO] Exporting server [gpg-signer] password in ${gpg.passphrase}
[INFO]
[INFO] --- helper-maven-plugin:2.1:collect-files (collect-build-artifacts) @ topia-service-flyway ---
[INFO] Loaded <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/target/collect-arti…>
[INFO] Copying topia-service-flyway-3.0-SNAPSHOT.jar to <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/target/collect/org.…>
[INFO] Copying THIRD-PARTY.properties to <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/target/collect/org.…>
[INFO] Copying topia-service-flyway-3.0-SNAPSHOT-sources.jar to <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/target/collect/org.…>
[INFO] Copying topia-service-flyway-3.0-SNAPSHOT-javadoc.jar to <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/target/collect/org.…>
[INFO]
[INFO] --- helper-maven-plugin:2.1:collect-files (collect-build-attachements) @ topia-service-flyway ---
[WARNING] Skipping goal (No file to collect).
[INFO]
[INFO] --- maven-gpg-plugin:1.5:sign (sign-artifacts) @ topia-service-flyway ---
[INFO]
[INFO] --- maven-dependency-plugin:2.8:analyze-only (analyze) @ topia-service-flyway ---
[INFO] Used declared dependencies found:
[INFO] org.nuiton.topia:topia-persistence:jar:3.0-SNAPSHOT:compile
[INFO] org.apache.commons:commons-lang3:jar:3.3.2:compile
[INFO] com.google.guava:guava:jar:16.0.1:compile
[INFO] commons-logging:commons-logging:jar:1.1.3:compile
[INFO] com.googlecode.flyway:flyway-core:jar:2.3:compile
[WARNING] Unused declared dependencies found:
[WARNING] org.nuiton:nuiton-utils:jar:3.0-rc-2:compile
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] ToPIA ............................................. SUCCESS [ 19.392 s]
[INFO] ToPIA :: Persistence .............................. SUCCESS [ 17.201 s]
[INFO] ToPIA :: JUnit .................................... SUCCESS [ 3.891 s]
[INFO] ToPIA :: Templates ................................ SUCCESS [ 7.767 s]
[INFO] ToPIA :: IT ....................................... SUCCESS [01:10 min]
[INFO] ToPIA :: Service Replication ...................... SUCCESS [ 34.677 s]
[INFO] ToPIA :: Service Migration ........................ SUCCESS [ 3.937 s]
[INFO] ToPIA :: Flyway integration service ............... FAILURE [ 6.616 s]
[INFO] ToPIA :: Service Csv .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:47 min
[INFO] Finished at: 2014-05-01T00:47:46+01:00
[INFO] Final Memory: 115M/711M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:analyze-only (analyze) on project topia-service-flyway: Dependency problems found -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:analyze-only (analyze) on project topia-service-flyway: Dependency problems found
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.MojoExecutionException: Dependency problems found
at org.apache.maven.plugin.dependency.analyze.AbstractAnalyzeMojo.execute(AbstractAnalyzeMojo.java:188)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 30 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :topia-service-flyway
Sending e-mails to: topia-commits(a)list.nuiton.org leny(a)codelutin.com
channel stopped
Skipping sonar analysis due to bad build status FAILURE
1
3
Build failed in Jenkins: topia-nightly » ToPIA :: Flyway integration service #31
by admin+ci-nuiton.org@codelutin.com 04 May '14
by admin+ci-nuiton.org@codelutin.com 04 May '14
04 May '14
See <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
Changes:
[bleny] fixes #3181 introduce topia-service-flyway
------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ToPIA :: Flyway integration service 3.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ topia-service-flyway ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ topia-service-flyway ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:check-auto-container (check-central-safe) @ topia-service-flyway ---
[INFO] Will use repository http://repo1.maven.org/maven2/
[INFO] Will use repository http://maven.nuiton.org/central-releases
[INFO] 42 dependencies to check.
[INFO] 42 artifact(s) resolved by repository http://repo1.maven.org/maven2/ in 151.798ms
[INFO] All dependencies are safe.
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ topia-service-flyway ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-redmine-login) @ topia-service-flyway ---
[INFO] Exporting server [redmine-forge.nuiton.org] privateKey in ${redmine.apiKey}
[INFO]
[INFO] --- license-maven-plugin:1.6:update-project-license (attach-licenses) @ topia-service-flyway ---
[INFO] Will create or update license file [lgpl_v3] to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO]
[INFO] --- license-maven-plugin:1.6:add-third-party (attach-licenses) @ topia-service-flyway ---
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/antlr/a…
[INFO] Downloading: http://repo.maven.apache.org/maven2/antlr/antlr/2.7.7/antlr-2.7.7-third-par…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/com/goo…
[INFO] Downloading: http://repo.maven.apache.org/maven2/com/google/guava/guava/16.0.1/guava-16.…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/com/goo…
[INFO] Downloading: http://repo.maven.apache.org/maven2/com/googlecode/flyway/flyway-core/2.3/f…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/com/h2d…
[INFO] Downloading: http://repo.maven.apache.org/maven2/com/h2database/h2/1.3.176/h2-1.3.176-th…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/net/sf/…
[INFO] Downloading: http://repo.maven.apache.org/maven2/net/sf/ehcache/ehcache-core/2.4.3/ehcac…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/apa…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.3.2/…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/hib…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/hibernate/hibernate-core/4.3.5.Fina…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/hib…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/hibernate/hibernate-ehcache/4.3.5.F…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/hib…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/hibernate/common/hibernate-commons-…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/hib…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/hibernate/javax/persistence/hiberna…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/jav…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/javassist/javassist/3.18.1-GA/javas…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/jbo…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/jandex/1.1.0.Final/jandex-1.1…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/jbo…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/logging/jboss-logging/3.1.3.G…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/jbo…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/logging/jboss-logging-annotat…
[INFO] Downloading: http://nexus.nuiton.org/nexus/content/repositories/central-releases/org/jbo…
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/spec/javax/transaction/jboss-…
[INFO] Detects third party descriptor /var/local/forge/data/nuiton.org/maven/repository/org/nuiton/nuiton-utils/3.0-rc-2/nuiton-utils-3.0-rc-2-third-party.properties
[INFO] Load missing file /var/local/forge/data/nuiton.org/maven/repository/org/nuiton/nuiton-utils/3.0-rc-2/nuiton-utils-3.0-rc-2-third-party.properties
[INFO] Detects third party descriptor /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-junit/src/license/THIRD-PARTY.properties
[INFO] Load missing file /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-junit/src/license/THIRD-PARTY.properties
[INFO] Missing file <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…> is up-to-date.
[INFO] Writing third-party file to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO] Regenerate missing license file <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO] Will attach third party file from <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ topia-service-flyway ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO] Copying 2 resources
[INFO]
[INFO] --- license-maven-plugin:1.6:update-file-header (update-file-header) @ topia-service-flyway ---
[WARNING] The extension xsl is already accepted for comment style xml
[INFO] Will search files to update from root <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO] Will search files to update from root <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO] - adding license header on file <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO] - adding license header on file <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO] - adding license header on file <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO] - adding license header on file <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO] Scan 4 files header done in 3.109ms.
[INFO]
* add header on 4 files.
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ topia-service-flyway ---
[INFO] Compiling 4 source files to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[WARNING] <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>: <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…> uses unchecked or unsafe operations.
[WARNING] <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- animal-sniffer-maven-plugin:1.10:check (default) @ topia-service-flyway ---
[INFO] Checking unresolved references to org.codehaus.mojo.signature:java16:1.1
[INFO]
[INFO] --- jredmine-maven-plugin:1.8.1:generate-changes (jredmine-generate-changes) @ topia-service-flyway ---
[INFO] Skipping goal (runOnce flag is on, and was already executed).
[INFO]
[INFO] --- maven-antrun-plugin:1.7:run (generate-surefire-workdir) @ topia-service-flyway ---
[INFO] Executing tasks
main:
[mkdir] Created dir: <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO] Executed tasks
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ topia-service-flyway ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ topia-service-flyway ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ topia-service-flyway ---
[INFO] No tests to run.
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ topia-service-flyway ---
[INFO] Building jar: <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO]
[INFO] >>> maven-source-plugin:2.2.1:jar (attach-sources) @ topia-service-flyway >>>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ topia-service-flyway ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:check-auto-container (check-central-safe) @ topia-service-flyway ---
[INFO] Will use repository http://repo1.maven.org/maven2/
[INFO] Will use repository http://maven.nuiton.org/central-releases
[INFO] Skipping goal (runOnce flag is on and goal was already executed).
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ topia-service-flyway ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-redmine-login) @ topia-service-flyway ---
[INFO] Skipping goal (runOnce flag is on and goal was already executed).
[WARNING] Failed to getClass for org.apache.maven.plugin.source.SourceJarMojo
[INFO]
[INFO] <<< maven-source-plugin:2.2.1:jar (attach-sources) @ topia-service-flyway <<<
[INFO]
[INFO] --- maven-source-plugin:2.2.1:jar (attach-sources) @ topia-service-flyway ---
[INFO] Building jar: <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO]
[INFO] --- maven-javadoc-plugin:2.9.1:jar (attach-javadocs) @ topia-service-flyway ---
[INFO] Building jar: <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-servi…>
[INFO]
[INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ topia-service-flyway ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-pgp-passphrase) @ topia-service-flyway ---
[INFO] Exporting server [gpg-signer] username in ${gpg.keyname}
[INFO] Exporting server [gpg-signer] password in ${gpg.passphrase}
[INFO]
[INFO] --- helper-maven-plugin:2.1:collect-files (collect-build-artifacts) @ topia-service-flyway ---
[INFO] Loaded /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/target/collect-artifacts.txt
[INFO] Copying topia-service-flyway-3.0-SNAPSHOT.jar to /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/target/collect/org.nuiton.topia--topia-service-flyway/topia-service-flyway-3.0-SNAPSHOT.jar
[INFO] Copying THIRD-PARTY.properties to /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/target/collect/org.nuiton.topia--topia-service-flyway/THIRD-PARTY.properties
[INFO] Copying topia-service-flyway-3.0-SNAPSHOT-sources.jar to /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/target/collect/org.nuiton.topia--topia-service-flyway/topia-service-flyway-3.0-SNAPSHOT-sources.jar
[INFO] Copying topia-service-flyway-3.0-SNAPSHOT-javadoc.jar to /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/target/collect/org.nuiton.topia--topia-service-flyway/topia-service-flyway-3.0-SNAPSHOT-javadoc.jar
[INFO]
[INFO] --- helper-maven-plugin:2.1:collect-files (collect-build-attachements) @ topia-service-flyway ---
[WARNING] Skipping goal (No file to collect).
[INFO]
[INFO] --- maven-gpg-plugin:1.5:sign (sign-artifacts) @ topia-service-flyway ---
[INFO]
[INFO] --- maven-dependency-plugin:2.8:analyze-only (analyze) @ topia-service-flyway ---
[INFO] Used declared dependencies found:
[INFO] org.nuiton.topia:topia-persistence:jar:3.0-SNAPSHOT:compile
[INFO] org.apache.commons:commons-lang3:jar:3.3.2:compile
[INFO] com.google.guava:guava:jar:16.0.1:compile
[INFO] commons-logging:commons-logging:jar:1.1.3:compile
[INFO] com.googlecode.flyway:flyway-core:jar:2.3:compile
[WARNING] Unused declared dependencies found:
[WARNING] org.nuiton:nuiton-utils:jar:3.0-rc-2:compile
[JENKINS] Archiving disabled
1
3
r3089 - in trunk: . topia-service-flyway topia-service-flyway/src topia-service-flyway/src/main topia-service-flyway/src/main/java topia-service-flyway/src/main/java/org topia-service-flyway/src/main/java/org/nuiton topia-service-flyway/src/main/java/org/nuiton/topia topia-service-flyway/src/main/java/org/nuiton/topia/flyway
by bleny@users.nuiton.org 30 Apr '14
by bleny@users.nuiton.org 30 Apr '14
30 Apr '14
Author: bleny
Date: 2014-04-30 15:56:22 +0200 (Wed, 30 Apr 2014)
New Revision: 3089
Url: http://forge.nuiton.org/projects/topia/repository/revisions/3089
Log:
fixes #3181 introduce topia-service-flyway
Added:
trunk/topia-service-flyway/
trunk/topia-service-flyway/LICENSE.txt
trunk/topia-service-flyway/README.txt
trunk/topia-service-flyway/pom.xml
trunk/topia-service-flyway/src/
trunk/topia-service-flyway/src/main/
trunk/topia-service-flyway/src/main/java/
trunk/topia-service-flyway/src/main/java/org/
trunk/topia-service-flyway/src/main/java/org/nuiton/
trunk/topia-service-flyway/src/main/java/org/nuiton/topia/
trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/
trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayJdbcMigration.java
trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayMigrationInfoProvider.java
trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayService.java
trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayServiceImpl.java
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-04-30 11:17:38 UTC (rev 3088)
+++ trunk/pom.xml 2014-04-30 13:56:22 UTC (rev 3089)
@@ -207,6 +207,7 @@
<module>topia-it</module>
<module>topia-service-replication</module>
<module>topia-service-migration</module>
+ <module>topia-service-flyway</module>
<module>topia-service-csv</module>
</modules>
@@ -326,6 +327,12 @@
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>com.googlecode.flyway</groupId>
+ <artifactId>flyway-core</artifactId>
+ <version>2.3</version>
+ </dependency>
+
<!-- hibernate-core only include api, need implementation,
binding with log4j will be used
-->
Property changes on: trunk/topia-service-flyway
___________________________________________________________________
Added: svn:ignore
+ *.ipr
*.iws
.classpath
*.iml
.project
target
.settings
.idea
atlassian-ide-plugin.xml
Copied: trunk/topia-service-flyway/LICENSE.txt (from rev 3088, trunk/topia-service-migration/LICENSE.txt)
===================================================================
--- trunk/topia-service-flyway/LICENSE.txt (rev 0)
+++ trunk/topia-service-flyway/LICENSE.txt 2014-04-30 13:56:22 UTC (rev 3089)
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
Added: trunk/topia-service-flyway/README.txt
===================================================================
Added: trunk/topia-service-flyway/pom.xml
===================================================================
--- trunk/topia-service-flyway/pom.xml (rev 0)
+++ trunk/topia-service-flyway/pom.xml 2014-04-30 13:56:22 UTC (rev 3089)
@@ -0,0 +1,92 @@
+<?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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.nuiton</groupId>
+ <artifactId>topia</artifactId>
+ <version>3.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.nuiton.topia</groupId>
+ <artifactId>topia-service-flyway</artifactId>
+ <name>ToPIA :: Flyway integration service</name>
+ <description>Integration between topia and Flyway database migration framework</description>
+
+ <dependencies>
+
+ <!-- Sibling dependencies -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>topia-persistence</artifactId>
+ <version>${project.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>topia-junit</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-utils</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.googlecode.flyway</groupId>
+ <artifactId>flyway-core</artifactId>
+ </dependency>
+
+ <!-- Depencies for test-->
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <resources>
+
+ <resource>
+ <directory>${maven.src.dir}/main/resources</directory>
+ <includes>
+ <include>**/*.hbm.xml</include>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+
+ </resources>
+ <plugins>
+
+ </plugins>
+ </build>
+
+</project>
+
Property changes on: trunk/topia-service-flyway/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayJdbcMigration.java
===================================================================
--- trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayJdbcMigration.java (rev 0)
+++ trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayJdbcMigration.java 2014-04-30 13:56:22 UTC (rev 3089)
@@ -0,0 +1,12 @@
+package org.nuiton.topia.flyway;
+
+import com.googlecode.flyway.core.api.migration.jdbc.JdbcMigration;
+
+/**
+ * Just an interface renaming so you don't need to add flyway as dependency and risk a version conflict.
+ *
+ * @since 3.0
+ */
+public interface TopiaFlywayJdbcMigration extends JdbcMigration {
+
+}
Added: trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayMigrationInfoProvider.java
===================================================================
--- trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayMigrationInfoProvider.java (rev 0)
+++ trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayMigrationInfoProvider.java 2014-04-30 13:56:22 UTC (rev 3089)
@@ -0,0 +1,12 @@
+package org.nuiton.topia.flyway;
+
+import com.googlecode.flyway.core.api.migration.MigrationInfoProvider;
+
+/**
+ * Just an interface renaming so you don't need to add flyway as dependency and risk a version conflict.
+ *
+ * @since 3.0
+ */
+public interface TopiaFlywayMigrationInfoProvider extends MigrationInfoProvider {
+
+}
Added: trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayService.java
===================================================================
--- trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayService.java (rev 0)
+++ trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayService.java 2014-04-30 13:56:22 UTC (rev 3089)
@@ -0,0 +1,19 @@
+package org.nuiton.topia.flyway;
+
+import org.nuiton.topia.persistence.TopiaService;
+
+/**
+ * Integrates Topia with <a href="http://flywaydb.org/">Flyway database migration framework</a>.
+ *
+ * @since 3.0
+ */
+public interface TopiaFlywayService extends TopiaService {
+
+ /**
+ * If you want flyway to init with an already existing DB, you must use
+ * this configuration and give, as value the version of the already
+ * existing schema.
+ */
+ public static final String FLYWAY_INIT_VERSION = "flyway.initVersion";
+
+}
Added: trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayServiceImpl.java
===================================================================
--- trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayServiceImpl.java (rev 0)
+++ trunk/topia-service-flyway/src/main/java/org/nuiton/topia/flyway/TopiaFlywayServiceImpl.java 2014-04-30 13:56:22 UTC (rev 3089)
@@ -0,0 +1,215 @@
+package org.nuiton.topia.flyway;
+
+import com.google.common.collect.ImmutableSet;
+import com.googlecode.flyway.core.Flyway;
+import com.googlecode.flyway.core.util.Location;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.TopiaApplicationContext;
+import org.nuiton.topia.persistence.TopiaException;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Implementation for {@link org.nuiton.topia.flyway.TopiaFlywayService}.
+ *
+ * @since 3.0
+ */
+public class TopiaFlywayServiceImpl implements TopiaFlywayService {
+
+ private static final Log log = LogFactory.getLog(TopiaFlywayServiceImpl.class);
+
+ /**
+ * Value for {@link #FLYWAY_INIT_VERSION} configuration parameter.
+ */
+ protected String flywayInitVersion = null;
+
+ @Override
+ public void setConfiguration(Map<String, String> serviceConfiguration) {
+ // set flywayInitVersion is provided
+ if (serviceConfiguration.containsKey(FLYWAY_INIT_VERSION)) {
+ flywayInitVersion = serviceConfiguration.get(FLYWAY_INIT_VERSION);
+ if (StringUtils.isBlank(flywayInitVersion)) {
+ throw new IllegalArgumentException("'" + flywayInitVersion + "' must not be empty");
+ }
+ }
+ }
+
+ @Override
+ public Class<?>[] getPersistenceClasses() {
+ return new Class<?>[0];
+ }
+
+ @Override
+ public void preInit(TopiaApplicationContext topiaApplicationContext) {
+
+ if (log.isInfoEnabled()) {
+ log.info("init flyway service");
+ }
+
+ Flyway flyway = new Flyway();
+
+ setDataSource(flyway, topiaApplicationContext);
+
+ setLocations(flyway, topiaApplicationContext);
+
+ doExtraConfiguration(flyway, topiaApplicationContext);
+
+ if (isSchemaEmpty(flyway, topiaApplicationContext)) {
+
+ createSchema(flyway, topiaApplicationContext);
+
+ } else {
+
+ migrateSchema(flyway, topiaApplicationContext);
+
+ }
+
+ }
+
+ /**
+ * Define flyway database credentials.
+ *
+ * This implementation search for parameters given in
+ * {@link org.nuiton.topia.persistence.TopiaApplicationContext#getConfiguration()}. We use
+ * the same credentials to migrate the database as the one used when we use it.
+ */
+ protected void setDataSource(Flyway flyway, TopiaApplicationContext topiaApplicationContext) {
+
+ Map<String, String> configuration = topiaApplicationContext.getConfiguration();
+
+ String url = configuration.get("hibernate.connection.url");
+ String user = configuration.get("hibernate.connection.username");
+ String password = configuration.get("hibernate.connection.password");
+
+ flyway.setDataSource(url, user, password);
+
+ }
+
+ /**
+ * Define where Flyway should look for migrations.
+ *
+ * This implementation search for *.sql migration files in "db/migration" resources directory
+ * and for JDBC migrations in package.to.ApplicationContext<strong>.migration</strong> package.
+ */
+ protected void setLocations(Flyway flyway, TopiaApplicationContext topiaApplicationContext) {
+
+ String classpathMigrationPackage = topiaApplicationContext.getClass().getPackage().getName() + ".migration";
+ ImmutableSet<String> defaultLocations = ImmutableSet.of("db/migration", classpathMigrationPackage);
+
+ // detects migrations and configure flyway locations
+ Set<String> locations = new LinkedHashSet<String>();
+ for (String defaultLocation : defaultLocations) {
+ if (log.isInfoEnabled()) {
+ log.info("will search for migration in location " + defaultLocation);
+ }
+ try {
+ Location location = new Location(defaultLocation);
+ Enumeration<URL> resources = Thread.currentThread().getContextClassLoader().getResources(location.getPath());
+ if (resources.hasMoreElements()) {
+ locations.add(defaultLocation);
+ if (log.isInfoEnabled()) {
+ log.info("migrations found in " + defaultLocation);
+ }
+ } else {
+ if (log.isInfoEnabled()) {
+ log.info("no migration found in " + defaultLocation);
+ }
+ }
+ } catch (IOException e) {
+ throw new TopiaException(e);
+ }
+ }
+
+ String[] locationsArray = locations.toArray(new String[locations.size()]);
+ flyway.setLocations(locationsArray);
+ }
+
+ /**
+ * Opened hook to override in a sub-class.
+ */
+ protected void doExtraConfiguration(Flyway flyway, TopiaApplicationContext topiaApplicationContext) {
+
+ }
+
+ /**
+ * Check if schema exists. If true is returned, we won't use any migrations and just create shema
+ * according to model. If false, a schema already exists and an migration should be tried.
+ */
+ protected boolean isSchemaEmpty(Flyway flyway, TopiaApplicationContext topiaApplicationContext) {
+
+ boolean schemaEmpty = topiaApplicationContext.isSchemaEmpty();
+
+ return schemaEmpty;
+
+ }
+
+ protected void createSchema(Flyway flyway, TopiaApplicationContext topiaApplicationContext) {
+
+ String initVersion = topiaApplicationContext.getModelVersion();
+
+ if (log.isInfoEnabled()) {
+ log.info("schema is empty, ignore migrations and let topia create schema");
+ }
+
+ topiaApplicationContext.createSchema();
+
+ if (log.isInfoEnabled()) {
+ log.info("init flyway to version " + initVersion);
+ }
+
+ flyway.setInitVersion(initVersion);
+ flyway.setInitDescription("schema creation called on application context by topia flyway service");
+ flyway.init();
+
+ }
+
+ protected void migrateSchema(Flyway flyway, TopiaApplicationContext topiaApplicationContext) {
+
+ if (flywayInitVersion == null) {
+ if (log.isDebugEnabled()) {
+ log.debug("schema exists, no flywayInitVersion found, let suppose flyway is already initialized");
+ }
+ // if flyway is not initialized, we will get
+// Grave: Exception sending context initialized event to listener instance of class fr.ifremer.wao.web.WaoApplicationListener
+// com.googlecode.flyway.core.api.FlywayException: Found non-empty schema "public" without metadata table! Use init() or set initOnMigrate to true to initialize the metadata table.
+// at com.googlecode.flyway.core.Flyway$1.execute(Flyway.java:848)
+// at com.googlecode.flyway.core.Flyway$1.execute(Flyway.java:819)
+// at com.googlecode.flyway.core.Flyway.execute(Flyway.java:1200)
+// at com.googlecode.flyway.core.Flyway.migrate(Flyway.java:819)
+
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("schema exists, will ask flyway to init if necessary to version " + flywayInitVersion);
+ }
+ flyway.setInitOnMigrate(true);
+ flyway.setInitVersion(flywayInitVersion);
+ }
+
+ String targetVersion = topiaApplicationContext.getModelVersion();
+
+ if (log.isInfoEnabled()) {
+ log.info("schema exists, will run flyway migration up to target version " + targetVersion);
+ }
+
+ flyway.setTarget(targetVersion);
+
+ if (log.isInfoEnabled()) {
+ log.info("run flyway migration");
+ }
+
+ flyway.migrate();
+ }
+
+ @Override
+ public void postInit(TopiaApplicationContext applicationContext) {
+ // nothing to do
+ }
+
+}
1
0
Author: bleny
Date: 2014-04-30 13:17:38 +0200 (Wed, 30 Apr 2014)
New Revision: 3088
Url: http://forge.nuiton.org/projects/topia/repository/revisions/3088
Log:
fixes #3181
Added:
trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/
trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/
trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MyFirstTopiaService.java
trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MyFirstTopiaServiceImpl.java
trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MySecondTopiaService.java
trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MySecondTopiaServiceImpl.java
trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/TopiaServiceSupportImplTest.java
Removed:
trunk/topia-it/src/test/java/org/nuiton/topia/it/legacy/topiatest/service/
Modified:
trunk/pom.xml
trunk/topia-persistence/pom.xml
trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaService.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaApplicationContext.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/TopiaServiceSupportImpl.java
trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaServiceSupport.java
trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java
trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationService.java
trunk/topia-service-replication/src/main/java/org/nuiton/topia/replication/TopiaReplicationService.java
trunk/topia-service-replication/src/main/java/org/nuiton/topia/replication/TopiaReplicationServiceImpl.java
trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/AbstractTopiaReplicationServiceTest.java
trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplAllTest.java
trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplTest.java
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-04-27 15:39:03 UTC (rev 3087)
+++ trunk/pom.xml 2014-04-30 11:17:38 UTC (rev 3088)
@@ -248,6 +248,7 @@
<sl4jVersion>1.7.7</sl4jVersion>
<h2Version>1.3.176</h2Version>
<hamcrestVersion>1.3</hamcrestVersion>
+ <mockitoVersion>1.9.5</mockitoVersion>
</properties>
@@ -355,6 +356,13 @@
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>${mockitoVersion}</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
</dependencyManagement>
Modified: trunk/topia-persistence/pom.xml
===================================================================
--- trunk/topia-persistence/pom.xml 2014-04-27 15:39:03 UTC (rev 3087)
+++ trunk/topia-persistence/pom.xml 2014-04-30 11:17:38 UTC (rev 3088)
@@ -114,6 +114,11 @@
</dependency>
<dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>test</scope>
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaService.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaService.java 2014-04-27 15:39:03 UTC (rev 3087)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaService.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -24,30 +24,18 @@
* #L%
*/
-import org.nuiton.topia.persistence.internal.AbstractTopiaApplicationContext;
+import java.util.Map;
/**
- * Used to implement a service for Topia. You have to provide a static property called SERVICE_NAME that identify the
- * service:
- * <p/>
- * <li>public static final String SERVICE_NAME = "monservice";
- * <p/>
- * The value of this attribute need to be returned when using {@link #getServiceName()} method.
- * <p/>
- * Created: 8 oct. 06 17:15:52
+ * Used to implement a service for Topia.
*
- * @author poussin <poussin(a)codelutin.com>
+ * A TopiaService is started at the very beginning of the {@link org.nuiton.topia.persistence.TopiaApplicationContext}
+ * startup and provides user extra operations not available in the topia core such as migrations,
+ * replication, IO, etc.
*/
public interface TopiaService {
- /**
- * Return the name of the service, this name need to match with
- * configuration file, for example for index service, we need to have :
- * "topia.service.index" and this method will returned "index".
- *
- * @return the service name
- */
- String getServiceName();
+ void setConfiguration(Map<String, String> serviceConfiguration);
/**
* Retrieve entities of this service needed for persistence.
@@ -62,7 +50,7 @@
* @param context
* @return true if service need to be activated or not
*/
- boolean preInit(AbstractTopiaApplicationContext context);
+ void preInit(TopiaApplicationContext context);
/**
* Initiliaze the service after create the {@code context}.
@@ -70,6 +58,6 @@
* @param context
* @return true if service need to be activated or not
*/
- boolean postInit(TopiaApplicationContext context);
+ void postInit(TopiaApplicationContext context);
}
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaApplicationContext.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaApplicationContext.java 2014-04-27 15:39:03 UTC (rev 3087)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/AbstractTopiaApplicationContext.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -37,10 +37,11 @@
import org.nuiton.topia.persistence.TopiaApplicationContext;
import org.nuiton.topia.persistence.TopiaApplicationContextCache;
import org.nuiton.topia.persistence.TopiaConfigurationConstants;
+import org.nuiton.topia.persistence.TopiaEntity;
import org.nuiton.topia.persistence.TopiaException;
-import org.nuiton.topia.persistence.TopiaNotFoundException;
+import org.nuiton.topia.persistence.TopiaIdFactory;
import org.nuiton.topia.persistence.TopiaPersistenceContext;
-import org.nuiton.topia.persistence.internal.support.TopiaServiceSupportImpl;
+import org.nuiton.topia.persistence.TopiaService;
import org.nuiton.topia.persistence.event.TopiaEntitiesVetoable;
import org.nuiton.topia.persistence.event.TopiaEntityListener;
import org.nuiton.topia.persistence.event.TopiaEntityVetoable;
@@ -48,12 +49,10 @@
import org.nuiton.topia.persistence.event.TopiaTransactionListener;
import org.nuiton.topia.persistence.event.TopiaTransactionVetoable;
import org.nuiton.topia.persistence.internal.support.TopiaFiresSupport;
-import org.nuiton.topia.persistence.TopiaService;
+import org.nuiton.topia.persistence.internal.support.TopiaServiceSupportImpl;
import org.nuiton.topia.persistence.support.TopiaListenableSupport;
import org.nuiton.topia.persistence.support.TopiaServiceSupport;
import org.nuiton.topia.persistence.util.TopiaUtil;
-import org.nuiton.topia.persistence.TopiaEntity;
-import org.nuiton.topia.persistence.TopiaIdFactory;
import java.beans.PropertyChangeListener;
import java.util.Collections;
@@ -262,21 +261,17 @@
}
@Override
- public <E extends TopiaService> boolean serviceEnabled(Class<E> interfaceService) {
- return topiaServiceSupport.serviceEnabled(interfaceService);
+ public Map<String, TopiaService> getServices() {
+ return topiaServiceSupport.getServices();
}
@Override
- public <E extends TopiaService> E getService(Class<E> interfaceService) throws TopiaNotFoundException {
- return topiaServiceSupport.getService(interfaceService);
+ public <T extends TopiaService> Map<String, T> getServices(Class<T> interfaceService) {
+ // XXX brendan 30/04/14 cast ???
+ return (Map<String, T>) topiaServiceSupport.getServices();
}
@Override
- public Map<String, TopiaService> getServices() {
- return topiaServiceSupport.getServices();
- }
-
- @Override
public List<Class<?>> getPersistenceClasses() {
return getHibernateProvider().getPersistentClasses();
}
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/TopiaServiceSupportImpl.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/TopiaServiceSupportImpl.java 2014-04-27 15:39:03 UTC (rev 3087)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/internal/support/TopiaServiceSupportImpl.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -24,19 +24,22 @@
* #L%
*/
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Map;
-
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.persistence.TopiaNotFoundException;
+import org.nuiton.topia.persistence.TopiaException;
import org.nuiton.topia.persistence.TopiaService;
-
-import com.google.common.collect.ImmutableMap;
import org.nuiton.topia.persistence.internal.AbstractTopiaApplicationContext;
import org.nuiton.topia.persistence.support.TopiaServiceSupport;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
/**
* FIXME AThimel 11/10/13 All this life-cycle has to be reviewed
*
@@ -47,133 +50,108 @@
private static final Log log = LogFactory.getLog(TopiaServiceSupportImpl.class);
protected ImmutableMap<String, TopiaService> services;
- protected AbstractTopiaApplicationContext applicationContext;
- public TopiaServiceSupportImpl(AbstractTopiaApplicationContext applicationContext) {
- this.applicationContext = applicationContext;
- this.services = loadServices(applicationContext.getConfiguration());
+ protected AbstractTopiaApplicationContext topiaApplicationContext;
+
+ public TopiaServiceSupportImpl(AbstractTopiaApplicationContext topiaApplicationContext) {
+ this.topiaApplicationContext = topiaApplicationContext;
+ this.services = loadServices(topiaApplicationContext.getConfiguration());
}
public void init() {
preInitServices(this.services);
- applicationContext.getHibernateProvider().getHibernateConfiguration(); // force mapping loading
+ topiaApplicationContext.getHibernateProvider().getHibernateConfiguration(); // force mapping loading
postInitServices(this.services);
}
protected void preInitServices(Map<String, TopiaService> services) {
for (TopiaService service : services.values()) {
- if (!service.preInit(applicationContext)) {
- log.warn(String.format("The service named '%1$s' could not be post-initialized (service not activated)",
- service.getServiceName()));
- }
+ service.preInit(topiaApplicationContext);
}
}
protected void postInitServices(Map<String, TopiaService> services) {
for (TopiaService service : services.values()) {
- if (!service.postInit(applicationContext)) {
- log.warn(String.format("The service named '%1$s' could not be pre-initialized (service not activated)",
- service.getServiceName()));
- }
+ service.postInit(topiaApplicationContext);
}
}
- /**
- * Retrieve service name using SERVICE_NAME static field on service
- * interface.
- *
- * @param interfaceService class of the service
- * @param <E> type of the service that extends {@link
- * TopiaService}
- * @return the service name
- * @throws IllegalAccessException if field SERVICE_NAME can't be accessed
- * @throws NoSuchFieldException if no field SERVICE_NAME is defined
- */
- protected <E extends TopiaService> String getServiceName(
- Class<E> interfaceService)
- throws IllegalAccessException, NoSuchFieldException {
- Field f = interfaceService.getField("SERVICE_NAME");
- String name = (String) f.get(null);
- return name;
- }
-
- protected String getProperExceptionMessage(Throwable eee) {
- return eee.getClass().getSimpleName() + " : " + eee.getMessage();
- }
-
protected ImmutableMap<String, TopiaService> loadServices(ImmutableMap<String, String> configuration) {
- Map<String, TopiaService> result = new HashMap<String, TopiaService>();
// recherche des services present dans la config
- for (String key : configuration.keySet()) {
- if (key.matches("^topia\\.service\\.\\w+$")) {
- String serviceClass = configuration.get(key);
- try {
- Class<?> forName = Class.forName(serviceClass);
- Object newInstance = forName.getConstructor().newInstance();
- TopiaService service = (TopiaService) newInstance;
- if (key.equals("topia.service." + service.getServiceName())) {
- result.put(service.getServiceName(), service);
- log.info(String.format("Service '%1$s' loaded (implementation %2$s)",
- key, serviceClass));
- } else {
- log.warn(String.format("The service with key '%1$s' has a different name '%2$s'! (service not activated)",
- key, service.getServiceName()));
+ Map<String, TopiaService> services = new HashMap<String, TopiaService>();
+ Map<String, Map<String, String>> servicesConfigurations = new HashMap<String, Map<String, String>>();
+ for (Map.Entry<String, String> entry : configuration.entrySet()) {
+ String prefixedConfigurationKey = entry.getKey();
+ String configurationValue = entry.getValue();
+ if (prefixedConfigurationKey.startsWith("topia.service.")) {
+ String configurationKey = StringUtils.removeStart(prefixedConfigurationKey, "topia.service.");
+ String[] split = StringUtils.split(configurationKey, '.');
+ Preconditions.checkState(split.length > 0, "'" + prefixedConfigurationKey + "' is not a valid configuration key");
+ String serviceName = split[0];
+ if (split.length == 1) {
+ // service declaration instantiate it
+ try {
+ Class<?> forName = Class.forName(configurationValue);
+ Object newInstance = forName.getConstructor().newInstance();
+ TopiaService service = (TopiaService) newInstance;
+ services.put(serviceName, service);
+ if (log.isInfoEnabled()) {
+ log.info("instantiated service " + serviceName + ": " + service);
+ }
+ } catch (ClassNotFoundException e) {
+ throw new TopiaException("unable to find topia service class " + configurationValue, e);
+ } catch (InstantiationException e) {
+ throw new TopiaException("unable to instantiate class " + configurationValue, e);
+ } catch (IllegalAccessException e) {
+ throw new TopiaException("unable to instantiate class " + configurationValue, e);
+ } catch (InvocationTargetException e) {
+ throw new TopiaException("unable to instantiate class " + configurationValue, e);
+ } catch (NoSuchMethodException e) {
+ throw new TopiaException("unable to instantiate class " + configurationValue, e);
}
- } catch (Throwable eee) {
- String message =
- String.format("The service %1$s of type %2$s was not found.",
- key, serviceClass);
- if (log.isDebugEnabled()) {
- log.debug(message, eee);
- } else if (log.isErrorEnabled()) {
- log.error(message);
+ } else {
+ // service configuration, save it to push it back later
+ Map<String, String> serviceConfiguration = servicesConfigurations.get(serviceName);
+ if (serviceConfiguration == null) {
+ serviceConfiguration = new LinkedHashMap<String, String>();
+ servicesConfigurations.put(serviceName, serviceConfiguration);
}
+ String serviceConfigurationKey = StringUtils.removeStart(configurationKey, serviceName + ".");
+ serviceConfiguration.put(serviceConfigurationKey, configurationValue);
}
}
}
- return ImmutableMap.copyOf(result);
- }
-
-
- @Override
- public <E extends TopiaService> boolean serviceEnabled(Class<E> interfaceService) {
- boolean result = false;
- try {
- String name = getServiceName(interfaceService);
- result = getServices().containsKey(name);
- } catch (Exception eee) {
- String format = "The service named '%1$s' could not be found for following reason: %2$s";
- String message = String.format(format, interfaceService, getProperExceptionMessage(eee));
- if (log.isDebugEnabled()) {
- log.debug(message, eee);
- } else if (log.isWarnEnabled()) {
- log.warn(message);
+ // configure services
+ for (Map.Entry<String, TopiaService> entry : services.entrySet()) {
+ String serviceName = entry.getKey();
+ TopiaService service = entry.getValue();
+ Map<String, String> serviceConfiguration = servicesConfigurations.get(serviceName);
+ if (serviceConfiguration == null) {
+ serviceConfiguration = Collections.emptyMap();
}
+ if (log.isInfoEnabled()) {
+ log.info("for service " + serviceName + ", will set configuration " + serviceConfiguration);
+ }
+ service.setConfiguration(serviceConfiguration);
}
- return result;
+ return ImmutableMap.copyOf(services);
}
@Override
- public <E extends TopiaService> E getService(Class<E> interfaceService) throws TopiaNotFoundException {
- E result;
- try {
- String name = getServiceName(interfaceService);
- result = (E) getServices().get(name);
- } catch (Exception eee) {
- String format = "Could not retreave service %1$s for following reason: %2$s";
- String message = String.format(format, interfaceService, getProperExceptionMessage(eee));
- throw new TopiaNotFoundException(message, eee);
- }
- if (result == null) {
- String message = String.format("The service %1$s was not found.", interfaceService);
- throw new TopiaNotFoundException(message);
- }
- return result;
- }
-
- @Override
public Map<String, TopiaService> getServices() {
return services;
}
+ @Override
+ public <T extends TopiaService> Map<String, T> getServices(Class<T> interfaceService) {
+ Map<String, T> result = new LinkedHashMap<String, T>();
+ for (Map.Entry<String, TopiaService> entry : services.entrySet()) {
+ String serviceName = entry.getKey();
+ TopiaService service = entry.getValue();
+ if (interfaceService.isAssignableFrom(service.getClass())) {
+ result.put(serviceName, (T) service);
+ }
+ }
+ return result;
+ }
}
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaServiceSupport.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaServiceSupport.java 2014-04-27 15:39:03 UTC (rev 3087)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/support/TopiaServiceSupport.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -24,11 +24,10 @@
* #L%
*/
-import java.util.Map;
-
-import org.nuiton.topia.persistence.TopiaNotFoundException;
import org.nuiton.topia.persistence.TopiaService;
+import java.util.Map;
+
/**
* This API provides methods to manipulate services
*
@@ -38,28 +37,14 @@
public interface TopiaServiceSupport {
/**
- * Return true if specific service is available.
- *
- * @param interfaceService fqn of the service
- * @return the service
+ * The list of registered services. The map key is the service name, and the value is the service instance.
*/
- <E extends TopiaService> boolean serviceEnabled(Class<E> interfaceService);
+ Map<String, TopiaService> getServices();
/**
- * Return the service. This service must be valid with public static final
- * SERVICE_NAME property.
- *
- * @param interfaceService class of the service
- * @return the service
- * @throws TopiaNotFoundException if service can't be retrieved
+ * Same as {@link #getServices()} but returns only services that implements
+ * given contract (or is instance of given class).
*/
- <E extends TopiaService> E getService(Class<E> interfaceService) throws TopiaNotFoundException;
+ <T extends TopiaService> Map<String, T> getServices(Class<T> interfaceService);
- /**
- * The list of registered services. The map key is the service name, and the value is the service instance.
- *
- * @return a map with {serviceName, serviceInstance} values
- */
- Map<String, TopiaService> getServices();
-
}
Added: trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MyFirstTopiaService.java
===================================================================
--- trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MyFirstTopiaService.java (rev 0)
+++ trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MyFirstTopiaService.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -0,0 +1,7 @@
+package org.nuiton.topia.persistence.internal.support;
+
+import org.nuiton.topia.persistence.TopiaService;
+
+public interface MyFirstTopiaService extends TopiaService {
+
+}
Added: trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MyFirstTopiaServiceImpl.java
===================================================================
--- trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MyFirstTopiaServiceImpl.java (rev 0)
+++ trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MyFirstTopiaServiceImpl.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -0,0 +1,45 @@
+package org.nuiton.topia.persistence.internal.support;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.TopiaApplicationContext;
+
+import java.util.Map;
+
+public class MyFirstTopiaServiceImpl implements MyFirstTopiaService {
+
+ private static final Log log = LogFactory.getLog(MyFirstTopiaServiceImpl.class);
+
+ protected Map<String, String> serviceConfiguration;
+
+ public Map<String, String> getServiceConfiguration() {
+ return serviceConfiguration;
+ }
+
+ @Override
+ public void setConfiguration(Map<String, String> serviceConfiguration) {
+ this.serviceConfiguration = serviceConfiguration;
+ if (log.isDebugEnabled()) {
+ log.debug("configuration is " + serviceConfiguration);
+ }
+ }
+
+ @Override
+ public Class<?>[] getPersistenceClasses() {
+ return new Class<?>[0];
+ }
+
+ @Override
+ public void preInit(TopiaApplicationContext context) {
+ if (log.isDebugEnabled()) {
+ log.debug("");
+ }
+ }
+
+ @Override
+ public void postInit(TopiaApplicationContext context) {
+ if (log.isDebugEnabled()) {
+ log.debug("");
+ }
+ }
+}
Added: trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MySecondTopiaService.java
===================================================================
--- trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MySecondTopiaService.java (rev 0)
+++ trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MySecondTopiaService.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -0,0 +1,7 @@
+package org.nuiton.topia.persistence.internal.support;
+
+import org.nuiton.topia.persistence.TopiaService;
+
+public interface MySecondTopiaService extends TopiaService {
+
+}
Added: trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MySecondTopiaServiceImpl.java
===================================================================
--- trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MySecondTopiaServiceImpl.java (rev 0)
+++ trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/MySecondTopiaServiceImpl.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -0,0 +1,38 @@
+package org.nuiton.topia.persistence.internal.support;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.TopiaApplicationContext;
+
+import java.util.Map;
+
+public class MySecondTopiaServiceImpl implements MySecondTopiaService {
+
+ private static final Log log = LogFactory.getLog(MySecondTopiaServiceImpl.class);
+
+ @Override
+ public void setConfiguration(Map<String, String> serviceConfiguration) {
+ if (log.isDebugEnabled()) {
+ log.debug("configuration is " + serviceConfiguration);
+ }
+ }
+
+ @Override
+ public Class<?>[] getPersistenceClasses() {
+ return new Class<?>[0];
+ }
+
+ @Override
+ public void preInit(TopiaApplicationContext context) {
+ if (log.isDebugEnabled()) {
+ log.debug("");
+ }
+ }
+
+ @Override
+ public void postInit(TopiaApplicationContext context) {
+ if (log.isDebugEnabled()) {
+ log.debug("");
+ }
+ }
+}
Added: trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/TopiaServiceSupportImplTest.java
===================================================================
--- trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/TopiaServiceSupportImplTest.java (rev 0)
+++ trunk/topia-persistence/src/test/java/org/nuiton/topia/persistence/internal/support/TopiaServiceSupportImplTest.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -0,0 +1,57 @@
+package org.nuiton.topia.persistence.internal.support;
+
+import com.google.common.collect.ImmutableMap;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.nuiton.topia.persistence.TopiaService;
+import org.nuiton.topia.persistence.internal.AbstractTopiaApplicationContext;
+
+import java.util.Map;
+
+public class TopiaServiceSupportImplTest {
+
+ protected TopiaServiceSupportImpl topiaServiceSupport;
+
+ protected ImmutableMap<String, String> configuration;
+ @Before
+ public void setUp() {
+ String myFistTopiaServiceImplFqn = MyFirstTopiaServiceImpl.class.getName();
+ String mySecondTopiaServiceImplFqn = MySecondTopiaServiceImpl.class.getName();
+ configuration = ImmutableMap.<String, String>builder()
+ .put("topia.service.myService1", myFistTopiaServiceImplFqn)
+ .put("topia.service.myService1.myConfigurationKey1", "myConfigurationValue1")
+ .put("topia.service.myService2", mySecondTopiaServiceImplFqn)
+ .build();
+
+ AbstractTopiaApplicationContext topiaApplicationContextMock = Mockito.mock(AbstractTopiaApplicationContext.class);
+ Mockito.when(topiaApplicationContextMock.getConfiguration()).thenReturn(configuration);
+ topiaServiceSupport = new TopiaServiceSupportImpl(topiaApplicationContextMock);
+ }
+
+ @Test
+ public void testLoadServices() {
+
+ ImmutableMap<String, TopiaService> services = topiaServiceSupport.loadServices(configuration);
+
+ Assert.assertEquals(2, services.size());
+
+ TopiaService myService1 = services.get("myService1");
+
+ Assert.assertTrue(myService1 instanceof MyFirstTopiaServiceImpl);
+
+ Assert.assertEquals("myConfigurationValue1",
+ ((MyFirstTopiaServiceImpl) myService1).getServiceConfiguration().get("myConfigurationKey1"));
+
+ }
+
+ @Test
+ public void testGetServices() {
+
+ Map<String, MySecondTopiaService> services = topiaServiceSupport.getServices(MySecondTopiaService.class);
+ Assert.assertEquals(1, services.size());
+
+ }
+
+}
Modified: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java
===================================================================
--- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java 2014-04-27 15:39:03 UTC (rev 3087)
+++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -53,6 +53,7 @@
import java.util.Arrays;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
import java.util.SortedSet;
import java.util.TreeSet;
@@ -105,7 +106,7 @@
protected AbstractTopiaMigrationCallback callback;
/** topia root context (initialise en pre-init) */
- protected AbstractTopiaApplicationContext applicationContext;
+ protected TopiaApplicationContext applicationContext;
/** Un drapeau pour savoir si le service a bien ete initialise (i.e a bien fini la methode preInit) */
protected boolean init;
@@ -183,32 +184,12 @@
};
}
- //--------------------------------------------------------------------------
- //-- TopiaService implementation
- //--------------------------------------------------------------------------
-
@Override
- public Class<?>[] getPersistenceClasses() {
- return new Class<?>[]{TMSVersion.class};
- }
+ public void setConfiguration(Map<String, String> serviceConfiguration) {
- @Override
- public String getServiceName() {
- return SERVICE_NAME;
- }
-
- @Override
- public boolean preInit(AbstractTopiaApplicationContext context) {
- applicationContext = context;
-
Properties config = new Properties();
- config.putAll(applicationContext.getConfiguration());
+ config.putAll(serviceConfiguration);
- String callbackStr = getSafeParameter(config, MIGRATION_CALLBACK);
- if (log.isDebugEnabled()) {
- log.debug("Use callback - " + callbackStr);
- }
-
migrateOnInit = Boolean.valueOf(config.getProperty(MIGRATION_MIGRATE_ON_INIT, String.valueOf(Boolean.TRUE)));
if (log.isDebugEnabled()) {
log.debug("Migrate on init - " + migrateOnInit);
@@ -223,14 +204,40 @@
if (log.isDebugEnabled()) {
log.debug("Show progression - " + showProgression);
}
+
+ String callbackStr = getSafeParameter(config, MIGRATION_CALLBACK);
+ if (log.isDebugEnabled()) {
+ log.debug("Use callback - " + callbackStr);
+ }
+
// enregistrement du callback
try {
Class<?> clazz = Class.forName(callbackStr);
callback = (AbstractTopiaMigrationCallback) clazz.newInstance();
- } catch (Exception e) {
- log.error("Could not instantiate CallbackHandler [" + callbackStr + "]", e);
+ } catch (ClassNotFoundException e) {
+ throw new TopiaException("unable to find callback class " + callbackStr, e);
+ } catch (InstantiationException e) {
+ throw new TopiaException("unable to instantiate callback " + callbackStr, e);
+ } catch (IllegalAccessException e) {
+ throw new TopiaException("unable to instantiate callback " + callbackStr, e);
}
+ }
+
+ //--------------------------------------------------------------------------
+ //-- TopiaService implementation
+ //--------------------------------------------------------------------------
+
+ @Override
+ public Class<?>[] getPersistenceClasses() {
+ return new Class<?>[]{TMSVersion.class};
+ }
+
+ @Override
+ public void preInit(TopiaApplicationContext context) {
+
+ applicationContext = context;
+
// creation de la configuration hibernate ne concernant que l'entite Version
// afin de pouvoir creer la table via un schemaExport si necessaire
@@ -268,13 +275,11 @@
log.debug("Service [" + this + "] skip migration on init as required");
}
}
- return true;
}
@Override
- public boolean postInit(TopiaApplicationContext context) {
+ public void postInit(TopiaApplicationContext context) {
// nothing to do in post-init
- return true;
}
public void doMigrateSchema() throws MigrationServiceException {
@@ -621,8 +626,9 @@
try {
boolean result;
// get db real hibernate configuration
+ // XXX brendan 30/04/14 cast show a design smell
HibernateProvider hibernateProvider =
- applicationContext.getHibernateProvider();
+ ((AbstractTopiaApplicationContext) applicationContext).getHibernateProvider();
result = TopiaUtil.isSchemaEmpty(hibernateProvider.getHibernateConfiguration());
return result;
Modified: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationService.java
===================================================================
--- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationService.java 2014-04-27 15:39:03 UTC (rev 3087)
+++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationService.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -37,23 +37,18 @@
*/
public interface TopiaMigrationService extends TopiaService {
- /** Nom du service */
- String SERVICE_NAME = "migration";
-
- /** Nom du service topia */
- String TOPIA_SERVICE_NAME = "topia.service.migration";
-
/** Pour spécifier dans la configuration le callback a utiliser */
- String MIGRATION_CALLBACK = "topia.service.migration.callback";
+ String MIGRATION_CALLBACK = "callback";
- /** Un drapeau pour indiquer si on doit lancer le service au demarrage */
- String MIGRATION_MIGRATE_ON_INIT = "topia.service.migration.no.migrate.on.init";
+ // FIXME brendan 30/04/14 poor name, change it to "migrateOnInit"
+ String MIGRATION_MIGRATE_ON_INIT = "no.migrate.on.init";
/** Pour afficher les requetes sql executees */
- String MIGRATION_SHOW_SQL = "topia.service.migration.showSql";
+ String MIGRATION_SHOW_SQL = "showSql";
/** Pour afficher la progression des requetes sql executees */
- String MIGRATION_SHOW_PROGRESSION = "topia.service.migration.showProgression";
+ String MIGRATION_SHOW_PROGRESSION = "showProgression";
boolean migrateSchema() throws MigrationServiceException;
+
}
Modified: trunk/topia-service-replication/src/main/java/org/nuiton/topia/replication/TopiaReplicationService.java
===================================================================
--- trunk/topia-service-replication/src/main/java/org/nuiton/topia/replication/TopiaReplicationService.java 2014-04-27 15:39:03 UTC (rev 3087)
+++ trunk/topia-service-replication/src/main/java/org/nuiton/topia/replication/TopiaReplicationService.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -50,16 +50,6 @@
public interface TopiaReplicationService extends TopiaService {
/**
- * Nom du service
- */
- String SERVICE_NAME = "replication";
-
- /**
- * Nom du service topia
- */
- String TOPIA_SERVICE_NAME = "topia.service.replication";
-
- /**
* Obtains the {@code model builder} use to creat the replication's model.
*
* @return the model builder
Modified: trunk/topia-service-replication/src/main/java/org/nuiton/topia/replication/TopiaReplicationServiceImpl.java
===================================================================
--- trunk/topia-service-replication/src/main/java/org/nuiton/topia/replication/TopiaReplicationServiceImpl.java 2014-04-27 15:39:03 UTC (rev 3087)
+++ trunk/topia-service-replication/src/main/java/org/nuiton/topia/replication/TopiaReplicationServiceImpl.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -26,18 +26,18 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.persistence.internal.AbstractTopiaApplicationContext;
import org.nuiton.topia.persistence.TopiaApplicationContext;
+import org.nuiton.topia.persistence.TopiaEntity;
+import org.nuiton.topia.persistence.TopiaEntityEnum;
import org.nuiton.topia.persistence.TopiaException;
import org.nuiton.topia.persistence.TopiaPersistenceContext;
-import org.nuiton.topia.persistence.TopiaEntity;
-import org.nuiton.topia.persistence.TopiaEntityEnum;
import org.nuiton.topia.persistence.util.TopiaEntityHelper;
import org.nuiton.topia.replication.model.ReplicationModel;
import org.nuiton.topia.replication.model.ReplicationNode;
import org.nuiton.topia.replication.model.ReplicationOperationDef;
import java.util.List;
+import java.util.Map;
/**
* Implantation du service de replication.
@@ -66,8 +66,12 @@
//--------------------------------------------------------------------------
@Override
- public String getServiceName() {
- return SERVICE_NAME;
+ public void setConfiguration(Map<String, String> serviceConfiguration) {
+ if ( ! serviceConfiguration.isEmpty()) {
+ if (log.isWarnEnabled()) {
+ log.warn("no configuration expected for replication service");
+ }
+ }
}
@Override
@@ -77,13 +81,12 @@
}
@Override
- public boolean preInit(AbstractTopiaApplicationContext context) {
- // nothing to init
- return true;
+ public void preInit(TopiaApplicationContext context) {
+ // nothing to do
}
@Override
- public boolean postInit(TopiaApplicationContext context) {
+ public void postInit(TopiaApplicationContext context) {
// set the incoming root context from topia
this.context = context;
//TODO avoir un objet pour lire les contrainte de resolution de cycle
@@ -93,7 +96,6 @@
// Cela permet de traiter plus de cas...
//Properties prop = context.getConfig();
- return true;
}
//--------------------------------------------------------------------------
Modified: trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/AbstractTopiaReplicationServiceTest.java
===================================================================
--- trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/AbstractTopiaReplicationServiceTest.java 2014-04-27 15:39:03 UTC (rev 3087)
+++ trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/AbstractTopiaReplicationServiceTest.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -24,16 +24,17 @@
* #L%
*/
+import com.google.common.base.Function;
import org.apache.commons.logging.Log;
import org.junit.Assert;
import org.nuiton.topia.it.legacy.TopiaItLegacyTopiaApplicationContext;
import org.nuiton.topia.persistence.TopiaApplicationContext;
-import org.nuiton.topia.persistence.TopiaDaoSupplier;
-import org.nuiton.topia.persistence.TopiaException;
-import org.nuiton.topia.persistence.TopiaPersistenceContext;
import org.nuiton.topia.persistence.TopiaDao;
+import org.nuiton.topia.persistence.TopiaDaoSupplier;
import org.nuiton.topia.persistence.TopiaEntity;
import org.nuiton.topia.persistence.TopiaEntityEnum;
+import org.nuiton.topia.persistence.TopiaException;
+import org.nuiton.topia.persistence.TopiaPersistenceContext;
import org.nuiton.topia.persistence.util.EntityOperator;
import org.nuiton.topia.persistence.util.EntityOperatorStore;
import org.nuiton.topia.persistence.util.TopiaEntityHelper;
@@ -52,8 +53,6 @@
import java.util.Properties;
import java.util.Set;
-import com.google.common.base.Function;
-
/**
* TopiaReplicationServiceImplTest.
* <p/>
@@ -111,7 +110,7 @@
sourcePC = sourceContext.newPersistenceContext();
- service = (TopiaReplicationService) sourceContext.getService(TopiaReplicationService.class);
+ service = sourceContext.getServices(TopiaReplicationService.class).get("replication");
}
public void tearDown() throws Exception {
Modified: trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplAllTest.java
===================================================================
--- trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplAllTest.java 2014-04-27 15:39:03 UTC (rev 3087)
+++ trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplAllTest.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -285,7 +285,7 @@
// config.setProperty("hibernate.connection.username", "sa");
// config.setProperty("hibernate.connection.password", "");
- config.setProperty(TopiaReplicationServiceImpl.TOPIA_SERVICE_NAME, TopiaReplicationServiceImpl.class.getName());
+ config.setProperty("topia.service.replication", TopiaReplicationServiceImpl.class.getName());
return config;
}
Modified: trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplTest.java
===================================================================
--- trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplTest.java 2014-04-27 15:39:03 UTC (rev 3087)
+++ trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplTest.java 2014-04-30 11:17:38 UTC (rev 3088)
@@ -447,7 +447,7 @@
// config.setProperty("hibernate.connection.username", "sa");
// config.setProperty("hibernate.connection.password", "");
- config.setProperty(TopiaReplicationServiceImpl.TOPIA_SERVICE_NAME, TopiaReplicationServiceImpl.class.getName());
+ config.setProperty("topia.service.replication", TopiaReplicationServiceImpl.class.getName());
return config;
}
1
0
27 Apr '14
See <http://ci.nuiton.org/jenkins/job/topia-nightly/25/changes>
Changes:
[Tony CHEMIT] fixes #3174
------------------------------------------
Started by an SCM change
Building in workspace <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/>
Reverting <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk> to depth infinity with ignoreExternals: false
Updating https://svn.nuiton.org/topia/trunk at revision '2014-04-26T00:45:49.069 +0200'
U topia-templates/src/main/java/org/nuiton/topia/templates/EntityTransformer.java
U topia-templates/src/main/java/org/nuiton/topia/templates/EntityHibernateMappingGenerator.java
U topia-templates/src/main/java/org/nuiton/topia/templates/TopiaGeneratorUtil.java
U topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java
At revision 3081
Parsing POMs
[trunk] $ /opt/jdk7/bin/java -Dsettings.security=/var/local/forge/data/nuiton.org/maven/settings-security.xml -Djava.awt.headless=true -cp /var/local/forge/data/nuiton.org/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.5.jar:/opt/maven3/boot/plexus-classworlds-2.5.1.jar:/opt/maven3/conf/logging jenkins.maven3.agent.Maven31Main /opt/maven3 /var/local/forge/exec/tomcat-nuiton.org/webapps/jenkins/WEB-INF/lib/remoting-2.36.jar /var/local/forge/data/nuiton.org/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.5.jar /var/local/forge/data/nuiton.org/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.5.jar 48778
<===[JENKINS REMOTING CAPACITY]===> channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/pom.xml> -s /var/local/forge/data/nuiton.org/maven/settings.xml -e -U clean install -DperformRelease
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] ToPIA
[INFO] ToPIA :: Persistence
[INFO] ToPIA :: JUnit
[INFO] ToPIA :: Templates
[INFO] ToPIA :: IT
[INFO] ToPIA :: Service Replication
[INFO] ToPIA :: Service Migration
[INFO] ToPIA :: Service Csv
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ToPIA 3.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ topia ---
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/target>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ topia ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:check-auto-container (check-central-safe) @ topia ---
[INFO] Will use repository http://repo1.maven.org/maven2/
[INFO] Will use repository http://maven.nuiton.org/central-releases
[INFO] 14 dependencies to check.
[INFO] 14 artifact(s) resolved by repository http://repo1.maven.org/maven2/ in 2.364s
[INFO] All dependencies are safe.
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ topia ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-redmine-login) @ topia ---
[INFO] Exporting server [redmine-forge.nuiton.org] privateKey in ${redmine.apiKey}
[INFO]
[INFO] --- license-maven-plugin:1.6:update-project-license (attach-licenses) @ topia ---
[INFO]
[INFO] --- license-maven-plugin:1.6:add-third-party (attach-licenses) @ topia ---
[WARNING] The goal is skip due to packaging 'pom'
[INFO]
[INFO] --- license-maven-plugin:1.6:update-file-header (update-file-header) @ topia ---
[WARNING] The extension xsl is already accepted for comment style xml
[INFO] Will search files to update from root <http://ci.nuiton.org/jenkins/job/topia-nightly/ws/trunk/src>
[INFO] Scan 19 files header done in 96.737ms.
[INFO] All files are up-to-date.
[INFO]
[INFO] --- animal-sniffer-maven-plugin:1.10:check (default) @ topia ---
[INFO] Checking unresolved references to org.codehaus.mojo.signature:java16:1.1
[INFO]
[INFO] --- jredmine-maven-plugin:1.8.1:generate-changes (jredmine-generate-changes) @ topia ---
[INFO] release project ToPIA
[INFO] release version 3.0
[INFO] release date Sat Apr 26 00:47:22 CEST 2014
[INFO] release user CI Release Manager
[ERROR] (RedmineClient:491) - Error = <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>503 Service Temporarily Unavailable</title>
</head><body>
<h1>Service Temporarily Unavailable</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
<hr>
<address>Apache/2.2.16 (Debian) Server at forge.nuiton.org Port 80</address>
</body></html>
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] ToPIA ............................................. FAILURE [02:32 min]
[INFO] ToPIA :: Persistence .............................. SKIPPED
[INFO] ToPIA :: JUnit .................................... SKIPPED
[INFO] ToPIA :: Templates ................................ SKIPPED
[INFO] ToPIA :: IT ....................................... SKIPPED
[INFO] ToPIA :: Service Replication ...................... SKIPPED
[INFO] ToPIA :: Service Migration ........................ SKIPPED
[INFO] ToPIA :: Service Csv .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:34 min
[INFO] Finished at: 2014-04-26T00:48:28+01:00
[INFO] Final Memory: 25M/244M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.nuiton.jredmine:jredmine-maven-plugin:1.8.1:generate-changes (jredmine-generate-changes) on project topia: could not obtain issues for reason could not obtain datas of type class org.nuiton.jredmine.model.Issue for reason Got error code <503:Service Temporarily Unavailable> on http://forge.nuiton.org/jredmine/get_version_issues.xml/topia?version_name=… -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.nuiton.jredmine:jredmine-maven-plugin:1.8.1:generate-changes (jredmine-generate-changes) on project topia: could not obtain issues for reason could not obtain datas of type class org.nuiton.jredmine.model.Issue for reason Got error code <503:Service Temporarily Unavailable> on http://forge.nuiton.org/jredmine/get_version_issues.xml/topia?version_name=…
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.MojoExecutionException: could not obtain issues for reason could not obtain datas of type class org.nuiton.jredmine.model.Issue for reason Got error code <503:Service Temporarily Unavailable> on http://forge.nuiton.org/jredmine/get_version_issues.xml/topia?version_name=…
at org.nuiton.jredmine.plugin.GenerateChangesMojo.doAction(GenerateChangesMojo.java:558)
at org.nuiton.plugin.AbstractPlugin.execute(AbstractPlugin.java:132)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 30 more
Caused by: org.nuiton.jredmine.service.RedmineServiceException: could not obtain datas of type class org.nuiton.jredmine.model.Issue for reason Got error code <503:Service Temporarily Unavailable> on http://forge.nuiton.org/jredmine/get_version_issues.xml/topia?version_name=…
at org.nuiton.jredmine.service.AbstractRedmineService.executeRequestAndReturnDatas(AbstractRedmineService.java:107)
at org.nuiton.jredmine.service.DefaultRedmineService.getIssues(DefaultRedmineService.java:220)
at org.nuiton.jredmine.plugin.IssuesCollector.collect(IssuesCollector.java:120)
at org.nuiton.jredmine.plugin.GenerateChangesMojo.doAction(GenerateChangesMojo.java:554)
... 33 more
Caused by: java.io.IOException: Got error code <503:Service Temporarily Unavailable> on http://forge.nuiton.org/jredmine/get_version_issues.xml/topia?version_name=…
at org.nuiton.jredmine.client.RedmineClient$AbstractRedmineResponseHandler.checkResponse(RedmineClient.java:492)
at org.nuiton.jredmine.client.RedmineClient$RedmineArrayResponseHandler.handleResponse(RedmineClient.java:548)
at org.nuiton.jredmine.client.RedmineClient$RedmineArrayResponseHandler.handleResponse(RedmineClient.java:538)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:218)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:160)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:136)
at org.nuiton.jredmine.client.RedmineClient.executeRequests(RedmineClient.java:208)
at org.nuiton.jredmine.service.AbstractRedmineService.executeRequestAndReturnDatas(AbstractRedmineService.java:104)
... 36 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Sending e-mails to: topia-commits(a)list.nuiton.org
channel stopped
Skipping sonar analysis due to bad build status FAILURE
1
4
r3087 - trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util
by tchemit@users.nuiton.org 27 Apr '14
by tchemit@users.nuiton.org 27 Apr '14
27 Apr '14
Author: tchemit
Date: 2014-04-27 17:39:03 +0200 (Sun, 27 Apr 2014)
New Revision: 3087
Url: http://forge.nuiton.org/projects/topia/repository/revisions/3087
Log:
fix serialization issue
Modified:
trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/TopiaH2Util.java
Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/TopiaH2Util.java
===================================================================
--- trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/TopiaH2Util.java 2014-04-27 13:36:11 UTC (rev 3086)
+++ trunk/topia-persistence/src/main/java/org/nuiton/topia/persistence/util/TopiaH2Util.java 2014-04-27 15:39:03 UTC (rev 3087)
@@ -141,7 +141,7 @@
/**
* Exception only used within TopiaH2Util
*/
- private class TopiaH2UtilException extends TopiaException {
+ private static class TopiaH2UtilException extends TopiaException {
private static final long serialVersionUID = -7874205136201318340L;
1
0
r3086 - in trunk/topia-templates/src: main/java/org/nuiton/topia/templates main/resources/META-INF/services test/java/org/nuiton/topia/templates
by tchemit@users.nuiton.org 27 Apr '14
by tchemit@users.nuiton.org 27 Apr '14
27 Apr '14
Author: tchemit
Date: 2014-04-27 15:36:11 +0200 (Sun, 27 Apr 2014)
New Revision: 3086
Url: http://forge.nuiton.org/projects/topia/repository/revisions/3086
Log:
fixes #3177: Use eugene 2.9 new Stereotype and TagValue API
Added:
trunk/topia-templates/src/main/resources/META-INF/services/org.nuiton.eugene.models.stereotype.StereotypeDefinitionProvider
trunk/topia-templates/src/main/resources/META-INF/services/org.nuiton.eugene.models.tagvalue.TagValueDefinitionProvider
trunk/topia-templates/src/test/java/org/nuiton/topia/templates/TopiaStereoTypesTest.java
trunk/topia-templates/src/test/java/org/nuiton/topia/templates/TopiaTagValuesTest.java
Removed:
trunk/topia-templates/src/main/resources/META-INF/services/org.nuiton.eugene.metas.ModelPropertiesProvider
trunk/topia-templates/src/test/java/org/nuiton/topia/templates/TopiaModelPropertiesProviderTest.java
Modified:
trunk/topia-templates/src/main/java/org/nuiton/topia/templates/ApplicationContextTransformer.java
trunk/topia-templates/src/main/java/org/nuiton/topia/templates/DAOHelperTransformer.java
trunk/topia-templates/src/main/java/org/nuiton/topia/templates/DTOTransformer.java
trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityDTOTransformer.java
trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityDaoTransformer.java
trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityEnumTransformer.java
trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityHibernateMappingGenerator.java
trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityTransformer.java
trunk/topia-templates/src/main/java/org/nuiton/topia/templates/PersistenceContextTransformer.java
trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaGeneratorUtil.java
trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaModelPropertiesProvider.java
trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaStereoTypes.java
trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java
Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/ApplicationContextTransformer.java
===================================================================
--- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/ApplicationContextTransformer.java 2014-04-27 06:22:24 UTC (rev 3085)
+++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/ApplicationContextTransformer.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -80,7 +80,7 @@
String className) {
// try to find a super class by tag-value
- String superClass = TopiaGeneratorUtil.getApplicationContextSuperClassTagValue(model);
+ String superClass = TopiaTagValues.getApplicationContextSuperClassTagValue(model);
if (superClass == null) {
@@ -111,7 +111,7 @@
String entityEnumName = modelName + "EntityEnum";
boolean generateOperator =
- TopiaGeneratorUtil.shouldGenerateOperatorForDAOHelper(model);
+ TopiaTagValues.getGenerateOperatorForDAOHelperTagValue(model);
addImport(output, TopiaEntity.class);
Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/DAOHelperTransformer.java
===================================================================
--- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/DAOHelperTransformer.java 2014-04-27 06:22:24 UTC (rev 3085)
+++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/DAOHelperTransformer.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -77,7 +77,7 @@
TopiaGeneratorUtil.getEntityClasses(model, true);
boolean generateOperator =
- TopiaGeneratorUtil.shouldGenerateOperatorForDAOHelper(model);
+ TopiaTagValues.getGenerateOperatorForDAOHelperTagValue(model);
// boolean generateStandaloneEnum =
// TopiaGeneratorUtil.shouldGenerateStandaloneEnumForDAOHelper(model);
Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/DTOTransformer.java
===================================================================
--- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/DTOTransformer.java 2014-04-27 06:22:24 UTC (rev 3085)
+++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/DTOTransformer.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -31,7 +31,7 @@
import org.nuiton.eugene.GeneratorUtil;
import org.nuiton.eugene.java.JavaGeneratorUtil;
import org.nuiton.eugene.java.ObjectModelTransformerToJava;
-import org.nuiton.eugene.metas.TagValues;
+import org.nuiton.eugene.models.tagvalue.TagValues;
import org.nuiton.eugene.models.object.*;
import java.beans.PropertyChangeListener;
@@ -61,7 +61,7 @@
@Override
public void transformFromClass(ObjectModelClass clazz) {
- if (!TopiaGeneratorUtil.hasDtoStereotype(clazz)) {
+ if (!TopiaStereoTypes.hasDtoStereotype(clazz)) {
return;
}
String clazzName = clazz.getName();
@@ -83,7 +83,7 @@
addInterface(result, Serializable.class);
for (ObjectModelInterface parentInterface : clazz.getInterfaces()) {
- if (TopiaGeneratorUtil.hasDtoStereotype(parentInterface)) {
+ if (TopiaStereoTypes.hasDtoStereotype(parentInterface)) {
addInterface(result, parentInterface.getName() + "DTO");
} else {
addInterface(result, parentInterface.getName());
@@ -175,7 +175,7 @@
if (TopiaGeneratorUtil.hasDocumentation(attr)) {
setDocumentation(attr2, attr.getDocumentation());
}
- String annotation = TopiaGeneratorUtil.getAnnotationTagValue(attr);
+ String annotation = TopiaTagValues.getAnnotationTagValue(attr);
if (StringUtils.isNotEmpty(annotation)) {
addAnnotation(result, attr2, annotation);
}
@@ -455,7 +455,7 @@
public boolean isDTO(String type) {
ObjectModelClassifier clazz = model.getClassifier(type);
- return clazz != null && TopiaGeneratorUtil.hasDtoStereotype(clazz);
+ return clazz != null && TopiaStereoTypes.hasDtoStereotype(clazz);
}
Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityDTOTransformer.java
===================================================================
--- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityDTOTransformer.java 2014-04-27 06:22:24 UTC (rev 3085)
+++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityDTOTransformer.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -28,7 +28,7 @@
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.nuiton.eugene.GeneratorUtil;
import org.nuiton.eugene.java.ObjectModelTransformerToJava;
-import org.nuiton.eugene.metas.TagValues;
+import org.nuiton.eugene.models.tagvalue.TagValues;
import org.nuiton.eugene.models.object.ObjectModelAssociationClass;
import org.nuiton.eugene.models.object.ObjectModelAttribute;
import org.nuiton.eugene.models.object.ObjectModelClass;
@@ -42,7 +42,6 @@
import java.io.Serializable;
import static org.nuiton.topia.templates.TopiaGeneratorUtil.hasUnidirectionalRelationOnAbstractType;
-import static org.nuiton.topia.templates.TopiaGeneratorUtil.shouldGenerateDTOTopiaIdTagValue;
/*{generator option: parentheses = false}*/
@@ -104,7 +103,7 @@
addAttribute(result, "serialVersionUID", "long", svUID, ObjectModelJavaModifier.FINAL, ObjectModelJavaModifier.PUBLIC, ObjectModelJavaModifier.STATIC);
}
- boolean generateDTOId = shouldGenerateDTOTopiaIdTagValue(clazz, model);
+ boolean generateDTOId = TopiaTagValues.shouldGenerateDTOTopiaIdTagValue(clazz, model);
if (generateDTOId) {
addAttribute(result, "topiaId", "String");
}
@@ -149,7 +148,7 @@
setDocumentation(attr2, attr.getDocumentation());
}
- String annotation = TopiaGeneratorUtil.getAnnotationTagValue(attr);
+ String annotation = TopiaTagValues.getAnnotationTagValue(attr);
if (!StringUtils.isEmpty(annotation)) {
addAnnotation(result, attr2, annotation);
}
@@ -178,7 +177,7 @@
protected void addOperations(ObjectModelClass result,ObjectModelClass clazz) {
- boolean generateDTOId = shouldGenerateDTOTopiaIdTagValue(clazz, model);
+ boolean generateDTOId = TopiaTagValues.shouldGenerateDTOTopiaIdTagValue(clazz, model);
ObjectModelOperation op;
if (generateDTOId) {
op = addOperation(result, "setTopiaId", "void", ObjectModelJavaModifier.PUBLIC);
Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityDaoTransformer.java
===================================================================
--- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityDaoTransformer.java 2014-04-27 06:22:24 UTC (rev 3085)
+++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityDaoTransformer.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -126,7 +126,7 @@
Collection<ObjectModelOperation> daoOperations =
new HashSet<ObjectModelOperation>();
for (ObjectModelOperation op : entity.getOperations()) {
- if (TopiaGeneratorUtil.hasDaoStereotype(op)) {
+ if (TopiaStereoTypes.hasDaoStereotype(op)) {
daoOperations.add(op);
}
}
@@ -141,7 +141,7 @@
@Override
public void transformFromInterface(ObjectModelInterface interfacez) {
- if (!TopiaGeneratorUtil.hasDaoStereotype(interfacez)) {
+ if (!TopiaStereoTypes.hasDaoStereotype(interfacez)) {
return;
}
@@ -385,7 +385,7 @@
}
}
if (superClassName == null) {
- superClassName = TopiaGeneratorUtil.getDaoSuperClassTagValue(clazz, model);
+ superClassName = TopiaTagValues.getDaoSuperClassTagValue(clazz, model);
if (superClassName == null) {
superClassName = TopiaGeneratorUtil.getParentDaoFqn(this, model);
addImport(daoAbstractClass, superClassName);
Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityEnumTransformer.java
===================================================================
--- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityEnumTransformer.java 2014-04-27 06:22:24 UTC (rev 3085)
+++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityEnumTransformer.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -69,7 +69,7 @@
String entityEnumName = TopiaGeneratorUtil.getEntityEnumName(model);
boolean generateOperator =
- TopiaGeneratorUtil.shouldGenerateOperatorForDAOHelper(model);
+ TopiaTagValues.getGenerateOperatorForDAOHelperTagValue(model);
generateEntityEnum(packageName, entityEnumName, generateOperator);
Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityHibernateMappingGenerator.java
===================================================================
--- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityHibernateMappingGenerator.java 2014-04-27 06:22:24 UTC (rev 3085)
+++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityHibernateMappingGenerator.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -28,6 +28,7 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.eugene.EugeneStereoTypes;
import org.nuiton.eugene.java.JavaGeneratorUtil;
import org.nuiton.eugene.models.object.ObjectModelAssociationClass;
import org.nuiton.eugene.models.object.ObjectModelAttribute;
@@ -119,13 +120,13 @@
String clazzFQN = input.getQualifiedName();
String optionalAttributes = "";
- String schema = TopiaGeneratorUtil.getDbSchemaNameTagValue(input, model);
+ String schema = TopiaTagValues.getDbSchemaNameTagValue(input, model);
if (schema != null) {
optionalAttributes += "schema=\"" + schema + "\" ";
}
//On précise au proxy de quelle interface hérite l'objet
- String proxyTagValue = TopiaGeneratorUtil.getProxyInterfaceTagValue(input, model);
+ String proxyTagValue = TopiaTagValues.getProxyInterfaceTagValue(input, model);
if (StringUtils.isEmpty(proxyTagValue) || !proxyTagValue.equals("none")) {
optionalAttributes += "proxy=\"" + clazzFQN + "\" ";
}
@@ -138,7 +139,7 @@
log.debug("superClass for " + input.getQualifiedName() + " is " + superClassname);
}
String superClassDOType = TopiaGeneratorUtil.getDOType(superClassname, model);
- inheritanceStrategy = TopiaGeneratorUtil.getInheritanceStrategyTagValue(superClass);
+ inheritanceStrategy = TopiaGeneratorUtil.getInheritanceStrategy(superClass);
if ("joined-subclass".equals(inheritanceStrategy) || "union-subclass".equals(inheritanceStrategy)) {
optionalAttributes += "table=\"" + tableName + "\"";
}
@@ -159,7 +160,7 @@
}*/
// cas où on defini la super class, il faut un discriminator seulement dans le cas de
// la strategy subclass
- String currentInheritanceStrategy = TopiaGeneratorUtil.getInheritanceStrategyTagValue(input);
+ String currentInheritanceStrategy = TopiaGeneratorUtil.getInheritanceStrategy(input);
if ("subclass".equals(currentInheritanceStrategy)) {
/*{ <discriminator column="topiaDiscriminator" type="string" />
}*/
@@ -167,7 +168,7 @@
// on detecte les attributs des clef metiers
for (ObjectModelAttribute attr : input.getAttributes()) {
- if (TopiaGeneratorUtil.isNaturalId(attr)) {
+ if (TopiaTagValues.getNaturalIdTagValue(attr)) {
// attribut metier
naturalAttributes.add(attr);
} else {
@@ -177,7 +178,7 @@
}
if (!naturalAttributes.isEmpty()) {
// generation de la clef metier
- boolean mutable = TopiaGeneratorUtil.isNaturalIdMutable(input);
+ boolean mutable = TopiaTagValues.getNaturalIdMutableTagValue(input);
String mutableStr = mutable ? " mutable=\"true\"" : "";
if (log.isDebugEnabled()) {
log.debug("natural-id detected for class " + input.getName() + " (" + mutableStr + ") attributes : " + naturalAttributes);
@@ -226,8 +227,8 @@
continue;
}
- String indexForeignKeys =
- TopiaGeneratorUtil.getIndexForeignKeys(attribute, model);
+ String indexForeignKeys =
+ TopiaTagValues.getIndexForeignKeysTagValue(attribute, model);
if (StringUtils.isEmpty(indexForeignKeys) || !Boolean.valueOf(indexForeignKeys)) {
@@ -255,7 +256,7 @@
}
// add schema if exist (http://nuiton.org/issues/2052)
- String schema = TopiaGeneratorUtil.getDbSchemaNameTagValue(clazz, model);
+ String schema = TopiaTagValues.getDbSchemaNameTagValue(clazz, model);
if (StringUtils.isNotEmpty(schema)) {
tableName = schema + "." + tableName;
}
@@ -320,7 +321,7 @@
String notNull = " " + generateFromTagValue(HIBERNATE_ATTRIBUTE_NOT_NULL, "true"); // AThimel 14/03/2014 I think both assoc class participants must always be not-null
String attrName = getName(attr, true);
String attrType = getType(clazz, attr, true);
- String lazy = generateFromTagValue(HIBERNATE_ATTRIBUTE_LAZY, TopiaGeneratorUtil.getLazyTagValue(attr));
+ String lazy = generateFromTagValue(HIBERNATE_ATTRIBUTE_LAZY, TopiaTagValues.getLazyTagValue(attr));
String attrColumn = TopiaGeneratorUtil.getDbName(attr);
/*{<%=prefix%> <many-to-one name="<%=attrName%>" class="<%=attrType%>" <%=lazy%>column="<%=attrColumn%>" node="<%=attrName%>/@topiaId" <%=notNull%>/>
}*/
@@ -366,14 +367,14 @@
}
String type = attr.getType();
- String attrType = TopiaGeneratorUtil.getHibernateAttributeType(attr, clazz, model);
+ String attrType = TopiaTagValues.getHibernateAttributeType(attr, clazz, model);
if (StringUtils.isNotEmpty(attrType)) {
// tag value detected of the attribute
type = attrType;
} else {
// old code
- attrType = TopiaGeneratorUtil.getTypeTagValue(attr);
+ attrType = TopiaTagValues.getTypeTagValue(attr);
if (StringUtils.isNotEmpty(attrType)) {
// tag value detected of the attribute
@@ -433,7 +434,7 @@
String attrType = getType(clazz, attr);
String accessField = "field";
- String tagValue = TopiaGeneratorUtil.getAccessTagValue(attr);
+ String tagValue = TopiaTagValues.getAccessTagValue(attr);
if (StringUtils.isNotEmpty(tagValue)) {
accessField = tagValue;
}
@@ -448,7 +449,7 @@
attrType = attrType.trim().substring(0, attrType.trim().length()-2);
String optionalAttributes = "";
- String schema = TopiaGeneratorUtil.getDbSchemaNameTagValue(attr, model);
+ String schema = TopiaTagValues.getDbSchemaNameTagValue(attr, model);
if (schema != null) {
optionalAttributes += generateFromTagValue(HIBERNATE_ATTRIBUTE_SCHEMA, schema);
// optionalAttributes += "schema=\"" + schema + "\" ";
@@ -474,12 +475,12 @@
// optionalAttributes += "index=\"" + indexName + "\"";
}
- if (TopiaGeneratorUtil.hasUniqueStereotype(attr)) {
+ if (EugeneStereoTypes.hasUniqueStereotype(attr)) {
// the trim method is called on optionalAttributes after this set to suppress unusual space if no index is set on this attribute
optionalAttributes += generateFromTagValue(HIBERNATE_ATTRIBUTE_UNIQUE, "true");
// optionalAttributes += " unique=\"true\"";
}
- optionalAttributes += generateFromTagValue(HIBERNATE_ATTRIBUTE_NOT_NULL, TopiaGeneratorUtil.getNotNullTagValue(attr));
+ optionalAttributes += generateFromTagValue(HIBERNATE_ATTRIBUTE_NOT_NULL, TopiaTagValues.getNotNullTagValue(attr));
/*{<%=prefix%> <property name="<%=attrName%>" access="<%=accessField%>"}*/
if ( ! attrIsEnumeration) {
/*{ type="<%=attrType%>"}*/
@@ -495,7 +496,7 @@
String defaultValue = attr.getDefaultValue().trim();
columnAttributes.put(HIBERNATE_ATTRIBUTE_DEFAULT, defaultValue);
}
- String sqlType = TopiaGeneratorUtil.getSqlTypeTagValue(attr);
+ String sqlType = TopiaTagValues.getSqlTypeTagValue(attr);
if (!StringUtils.isEmpty(sqlType)) {
// an specific sql type was specified for the attribute, use it
@@ -503,7 +504,7 @@
}
// add length attribute if required
- String lengthTagValue = TopiaGeneratorUtil.getLengthTagValue(attr);
+ String lengthTagValue = TopiaTagValues.getLengthTagValue(attr);
if (!StringUtils.isEmpty(lengthTagValue)) {
optionalAttributes += generateFromTagValue(HIBERNATE_ATTRIBUTE_LENGTH, lengthTagValue);
@@ -533,7 +534,7 @@
// if the user tuned the model to use name instead of
// ordinal to store the values, we must add a clause
- boolean useEnumerationName = TopiaGeneratorUtil.hasUseEnumerationNameTagValue(clazz, attr, model);
+ boolean useEnumerationName = TopiaTagValues.hasUseEnumerationNameTagValue(attr, clazz, model);
if (useEnumerationName) {
String enumSQLType = String.valueOf(Types.VARCHAR);
/*{
@@ -612,16 +613,16 @@
String attrName = getName(attr); // ???
String attrType = getType(clazz, attr);
String reverseAttrDBName = TopiaGeneratorUtil.getReverseDbName(attr);
- String orderBy = generateFromTagValue(HIBERNATE_ATTRIBUTE_ORDER_BY, TopiaGeneratorUtil.getOrderByTagValue(attr));
+ String orderBy = generateFromTagValue(HIBERNATE_ATTRIBUTE_ORDER_BY, TopiaTagValues.getOrderByTagValue(attr));
String cascade = "";
if (attr.isComposite() || attr.hasAssociationClass()) {
cascade += "cascade=\"all,delete-orphan\" ";
}
- String lazy = generateFromTagValue(HIBERNATE_ATTRIBUTE_LAZY, TopiaGeneratorUtil.getLazyTagValue(attr), "true");
+ String lazy = generateFromTagValue(HIBERNATE_ATTRIBUTE_LAZY, TopiaTagValues.getLazyTagValue(attr), "true");
- String fetch = generateFromTagValue(HIBERNATE_ATTRIBUTE_FETCH, TopiaGeneratorUtil.getFetchTagValue(attr));
+ String fetch = generateFromTagValue(HIBERNATE_ATTRIBUTE_FETCH, TopiaTagValues.getFetchTagValue(attr));
String collType = TopiaGeneratorUtil.getNMultiplicityHibernateType(attr);
String inverse = "";
@@ -648,6 +649,10 @@
return generateFromTagValue(attributeName, tagValue, null);
}
+ private String generateFromTagValue(String attributeName, Boolean tagValue) {
+ return generateFromTagValue(attributeName, tagValue == null ? null : String.valueOf(tagValue), null);
+ }
+
/**
* Generate hibernate xml attribute with a final space.
*/
@@ -658,15 +663,6 @@
} else if (defaultValue != null) {
result+= attributeName + "=\"" + defaultValue +"\" ";
}
-// if (attr.hasTagValue(tagName) || defaultValue != null) {
-// result+= attributeName + "=\"";
-// if (attr.hasTagValue(tagName)) {
-// result += attr.getTagValue(tagName);
-// } else {
-// result += defaultValue;
-// }
-// result += "\" ";
-// }
return result;
}
@@ -678,7 +674,7 @@
String attrName = getName(attr);
String attrType = getType(clazz, attr);
String collType = TopiaGeneratorUtil.getNMultiplicityHibernateType(attr);
- String lazy = generateFromTagValue(HIBERNATE_ATTRIBUTE_LAZY, TopiaGeneratorUtil.getLazyTagValue(attr));
+ String lazy = generateFromTagValue(HIBERNATE_ATTRIBUTE_LAZY, TopiaTagValues.getLazyTagValue(attr));
String attrColumn = TopiaGeneratorUtil.getDbName(attr);
boolean attrIsEnumeration = attr.getClassifier() != null
&& attr.getClassifier().isEnum();
@@ -692,7 +688,7 @@
}
if (attrIsEnumeration) {
- boolean useEnumerationName = TopiaGeneratorUtil.hasUseEnumerationNameTagValue(clazz, attr, model);
+ boolean useEnumerationName = TopiaTagValues.hasUseEnumerationNameTagValue(attr, clazz, model);
/*{<%=prefix%> <element column="<%=attrColumn%>" node="id">
<%=prefix%> <type name="org.hibernate.type.EnumType">
<%=prefix%> <param name="<%=org.hibernate.type.EnumType.ENUM%>"><%=attrType%></param>
@@ -742,9 +738,9 @@
/*{access="field" }*/
}
// vérifier si le tag lazy est defini par defaut dans le fichier de proprietes
- String lazy = generateFromTagValue(HIBERNATE_ATTRIBUTE_LAZY, TopiaGeneratorUtil.getLazyTagValue(attr));
+ String lazy = generateFromTagValue(HIBERNATE_ATTRIBUTE_LAZY, TopiaTagValues.getLazyTagValue(attr));
/*{<%=lazy%>}*/
- String notNull = generateFromTagValue(HIBERNATE_ATTRIBUTE_NOT_NULL, TopiaGeneratorUtil.getNotNullTagValue(attr));
+ String notNull = generateFromTagValue(HIBERNATE_ATTRIBUTE_NOT_NULL, TopiaTagValues.getNotNullTagValue(attr));
/*{<%=notNull%>}*/
if (isUnique) {
/*{unique="true" }*/
@@ -770,7 +766,7 @@
// Le tagvalue "inverse" permet de spécifier qui possède le
// inverse="true". Il est impératif de l'utiliser sur les deux
// extrémités pour ne pas avoir de surprise.
- String inverseValue = TopiaGeneratorUtil.getInverseTagValue(attr);
+ String inverseValue = TopiaTagValues.getInverseTagValue(attr);
if (StringUtils.isNotEmpty(inverseValue)) {
isInverse &= Boolean.parseBoolean(inverseValue);
// Si aucun tagvalue n'est défini, le choix est arbitraire : le
@@ -789,8 +785,8 @@
String attrType = getType(clazz, attr);
String attrName = getName(attr);
String attrColumn = TopiaGeneratorUtil.getDbName(attr);
- String lazy = generateFromTagValue(HIBERNATE_ATTRIBUTE_LAZY, TopiaGeneratorUtil.getLazyTagValue(attr), "true");
- String orderBy = generateFromTagValue(HIBERNATE_ATTRIBUTE_ORDER_BY, TopiaGeneratorUtil.getOrderByTagValue(attr));
+ String lazy = generateFromTagValue(HIBERNATE_ATTRIBUTE_LAZY, TopiaTagValues.getLazyTagValue(attr), "true");
+ String orderBy = generateFromTagValue(HIBERNATE_ATTRIBUTE_ORDER_BY, TopiaTagValues.getOrderByTagValue(attr));
String collType = TopiaGeneratorUtil.getNMultiplicityHibernateType(attr);
String tableName = TopiaGeneratorUtil.getManyToManyTableName(attr);
String inverse = "";
Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityTransformer.java
===================================================================
--- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityTransformer.java 2014-04-27 06:22:24 UTC (rev 3085)
+++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/EntityTransformer.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -31,7 +31,7 @@
import org.nuiton.eugene.EugeneTagValues;
import org.nuiton.eugene.java.JavaGeneratorUtil;
import org.nuiton.eugene.java.ObjectModelTransformerToJava;
-import org.nuiton.eugene.metas.TagValues;
+import org.nuiton.eugene.models.tagvalue.TagValues;
import org.nuiton.eugene.models.object.ObjectModelAssociationClass;
import org.nuiton.eugene.models.object.ObjectModelAttribute;
import org.nuiton.eugene.models.object.ObjectModelClass;
@@ -140,7 +140,7 @@
generateAbstract = isGenerateAbstract(input);
generateImpl = isGenerateImpl(input);
- generateBooleanGetMethods = TopiaGeneratorUtil.isDoNotGenerateBooleanGetMethods(model, input);
+ generateBooleanGetMethods = EugeneTagValues.isDoNotGenerateBooleanGetMethods(input, model);
if (generateInterface) {
@@ -160,7 +160,7 @@
}
// Generate i18n block
- String i18nPrefix = TopiaGeneratorUtil.getI18nPrefixTagValue(input, model);
+ String i18nPrefix = EugeneTagValues.getI18nPrefixTagValue(input, model);
if (!StringUtils.isEmpty(i18nPrefix)) {
generateI18nBlock(input, outputAbstract, i18nPrefix);
}
@@ -190,7 +190,7 @@
generateExtraOperations(input);
// Implement toString operation
- if (TopiaGeneratorUtil.generateToString(input, model)) {
+ if (!TopiaTagValues.getNotGenerateToStringTagValue(input, model)) {
generateToStringOperation(input);
}
@@ -258,7 +258,7 @@
Class<?> interfaze = TopiaEntity.class;
- if (TopiaGeneratorUtil.isContextable(input)) {
+ if (TopiaTagValues.getContextableTagValue(input, model)) {
interfaze = TopiaEntityContextable.class;
}
@@ -266,7 +266,7 @@
outputInterface,
interfaze);
- } else if (TopiaGeneratorUtil.isContextable(input)) {
+ } else if (TopiaTagValues.getContextableTagValue(input, model)) {
// Even if there is no need to implement TopiaEntity, it might be
// necessary to implement TopiaEntityContextable
addInterface(interfaceAlreadyDone,
@@ -319,14 +319,14 @@
// Extends AbstractTopiaEntity (only if hasn't parent entity)
if (outputAbstract.getSuperclasses().isEmpty()) {
- String superClassName = TopiaGeneratorUtil.getEntitySuperClassTagValue(input, model);
+ String superClassName = TopiaTagValues.getEntitySuperClassTagValue(input, model);
if (superClassName == null) {
superClassName = AbstractTopiaEntity.class.getName();
}
setSuperClass(outputAbstract, superClassName);
}
- if (TopiaGeneratorUtil.isContextable(input)) {
+ if (TopiaTagValues.getContextableTagValue(input, model)) {
addContextableMethods(input, outputAbstract);
}
}
@@ -529,7 +529,7 @@
// Deprecated from 2.3.4
// Pas de génération des signatures de méthodes pour celles à intégrer au DAO de l'entité
- if (TopiaGeneratorUtil.hasDaoStereotype(operation)) {
+ if (TopiaStereoTypes.hasDaoStereotype(operation)) {
return;
// Generate entity methods which have not a public visibility.
@@ -641,7 +641,7 @@
setDocumentation(property, buffer.toString());
// Annotation
- String annotation = TopiaGeneratorUtil.getAnnotationTagValue(attribute);
+ String annotation = TopiaTagValues.getAnnotationTagValue(attribute);
if (!StringUtils.isEmpty(annotation)) {
//FIXME Make annotation works...
//TODO tchemit 20100513 Test it still works
Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/PersistenceContextTransformer.java
===================================================================
--- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/PersistenceContextTransformer.java 2014-04-27 06:22:24 UTC (rev 3085)
+++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/PersistenceContextTransformer.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -134,7 +134,7 @@
ObjectModelClass output = createAbstractClass(className, packageName);
// try to find a super class by tag-value
- String superClass = TopiaGeneratorUtil.getPersistenceContextSuperClassTagValue(model);
+ String superClass = TopiaTagValues.getPersistenceContextSuperClassTagValue(model);
if (superClass == null) {
Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaGeneratorUtil.java
===================================================================
--- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaGeneratorUtil.java 2014-04-27 06:22:24 UTC (rev 3085)
+++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaGeneratorUtil.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -30,10 +30,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.eugene.AbstractGenerator;
+import org.nuiton.eugene.EugeneStereoTypes;
import org.nuiton.eugene.GeneratorUtil;
import org.nuiton.eugene.java.JavaGeneratorUtil;
import org.nuiton.eugene.java.ObjectModelTransformerToJava;
-import org.nuiton.eugene.metas.TagValues;
import org.nuiton.eugene.models.object.ObjectModel;
import org.nuiton.eugene.models.object.ObjectModelAssociationClass;
import org.nuiton.eugene.models.object.ObjectModelAttribute;
@@ -85,7 +85,12 @@
/** Type de persistence Hibernate */
public static final String PERSISTENCE_TYPE_HIBERNATE = "hibernate";
- /** Type de persistence LDAP */
+ /**
+ * Type de persistence LDAP
+ *
+ * @deprecated since 3.0, use nowhere in ToPIA.
+ */
+ @Deprecated
public static final String PERSISTENCE_TYPE_LDAP = "ldap";
/** Type de persistence par défaut (si aucun précisé) */
@@ -199,11 +204,6 @@
return input.getName() + "Dao";
}
- @Deprecated
- public static String getLegacyDaoName(ObjectModelClass input) {
- return input.getName() + "DAO";
- }
-
public static String getAbstractDaoFqn(ObjectModelClass input) {
return input.getPackageName() + "." + getAbstractDaoName(input);
}
@@ -219,7 +219,6 @@
public static String getEntityPackage(ObjectModelTransformerToJava transformer,
ObjectModel model,
ObjectModelClassifier input) {
-
String result = input.getPackageName();
return result;
}
@@ -236,7 +235,7 @@
for (Object o : model.getInterfaces()) {
ObjectModelInterface daoInterface = (ObjectModelInterface) o;
if (daoInterface.getName().equals(clazz.getName() + "DAO")) {
- if (hasDaoStereotype(daoInterface)) {
+ if (TopiaStereoTypes.hasDaoStereotype(daoInterface)) {
return daoInterface;
}
}
@@ -253,8 +252,8 @@
* @since 2.5
*/
public static String getPersistenceType(ObjectModelClassifier classifier) {
- String tag = getPersistenceTypeTagValue(classifier);
- if (StringUtils.isEmpty(tag)) {
+ String tag = TopiaTagValues.getPersistenceTypeTagValue(classifier);
+ if (tag == null) {
tag = PERSISTENCE_TYPE_DEFAULT;
}
return tag;
@@ -289,30 +288,14 @@
if (element == null) {
return null;
}
- String value = getDbNameTagValue(element);
- if (!StringUtils.isEmpty(value)) {
+ String value = TopiaTagValues.getDbNameTagValue(element);
+ if (value != null) {
return value;
}
return toLowerCaseFirstLetter(element.getName());
}
/**
- * Cherche si le tagvalue {@link TopiaTagValues#TAG_GENERATE_OPERATOR_FOR_DAO_HELPER} a été
- * activé dans le model.
- *
- * @param model le modele utilisé
- * @return {@code true} si le tag value trouvé dans le modèle, {@code false}
- * sinon.
- * @since 2.5
- */
- public static boolean shouldGenerateOperatorForDAOHelper(ObjectModel model) {
- String tagValue = getGenerateOperatorForDAOHelperTagValue(model);
- boolean generate = StringUtils.isNotEmpty(tagValue) &&
- Boolean.valueOf(tagValue);
- return generate;
- }
-
- /**
* Cherche et renvoie la liste des attributs constituant la clef metier
* d'une classe.
*
@@ -326,7 +309,7 @@
Set<ObjectModelAttribute> results =
new LinkedHashSet<ObjectModelAttribute>();
for (ObjectModelAttribute attr : clazz.getAttributes()) {
- if (isNaturalId(attr)) {
+ if (TopiaTagValues.getNaturalIdTagValue(attr)) {
results.add(attr);
}
}
@@ -354,7 +337,7 @@
Set<ObjectModelAttribute> results =
new LinkedHashSet<ObjectModelAttribute>();
for (ObjectModelAttribute attr : clazz.getAttributes()) {
- if (isNotNull(attr)) {
+ if (isAttributeNotNull(attr)) {
results.add(attr);
}
}
@@ -375,128 +358,23 @@
}
/**
- * Test if we need to generate {@code toString} method for the given class.
- *
- * @param clazz class to test
- * @param model model
- * @return {@code true} if {@code toString} should be generated.
- * clef métier.
- */
- public static boolean generateToString(ObjectModelClass clazz,
- ObjectModel model) {
- String value = getNotGenerateToStringTagValue(clazz, model);
- return StringUtils.isEmpty(value);
- }
-
-
- /**
- * Cherche et renvoie la liste des attributs constituant la clef metier
- * d'une classe.
- *
- * @param clazz la classe à tester
- * @param model le modele
- * @return la liste des attributs de la clef métier ou null si pas de
- * clef métier.
- */
- public static boolean sortAttribute(ObjectModelClass clazz,
- ObjectModel model) {
- String value = getSortAttributeTagValue(clazz, model);
- return "true".equals(value);
- }
-
- /**
- * Detecte si un attribut fait partie d'une clef metier.
- *
- * @param attribute l'attribut à tester
- * @return {@code true} si l'attribut fait partie d'une clef metier,
- * <code>false</cdoe> sinon.
- */
- public static boolean isNaturalId(ObjectModelAttribute attribute) {
- String value = getNaturalIdTagValue(attribute);
- if (StringUtils.isEmpty(value)) {
- // valeur null, donc pas positionnee
- return false;
- }
- try {
- return Boolean.valueOf(value.trim());
- } catch (Exception e) {
- // on a pas reussi a convertir en boolean.
- //todo peut-être declancher une exception ?
- return false;
- }
- }
-
- /**
* Detecte si un attribut est marqué comme non null.
- * Les naturalId {@link #isNaturalId} sont not null par défaut
+ * Les naturalId sont not null par défaut
*
* @param attribute l'attribut à tester
* @return {@code true} si l'attribut doit être non null,
- * par défaut pour les naturalId, {@code false} sinon..
+ * par défaut pour les naturalId, {@code false} sinon..
* @since 2.6.9
*/
- public static boolean isNotNull(ObjectModelAttribute attribute) {
- String value = getNotNullTagValue(attribute);
- if (StringUtils.isEmpty(value)) {
+ public static boolean isAttributeNotNull(ObjectModelAttribute attribute) {
+ Boolean value = TopiaTagValues.getNotNullTagValue(attribute);
+ if (value == null) {
// valeur null, donc pas positionnee
- return isNaturalId(attribute);
+ return TopiaTagValues.getNaturalIdTagValue(attribute);
}
- try {
- return Boolean.valueOf(value.trim());
- } catch (Exception e) {
- // on a pas reussi a convertir en boolean.
- //todo peut-être declancher une exception ?
- return false;
- }
+ return value;
}
- public static <Type extends ObjectModelElement> Collection<Type> getElementsWithStereotype(
- Collection<Type> elements, String... stereotypes) {
- Collection<Type> result = new ArrayList<Type>();
- for (Type element : elements) {
- if (hasStereotypes(element, stereotypes)) {
- result.add(element);
- }
- }
- return result;
- }
-
- public static boolean hasStereotypes(ObjectModelElement element,
- String... stereotypes) {
- for (String stereotype : stereotypes) {
- if (!element.hasStereotype(stereotype)) {
- return false;
- }
- }
- return true;
- }
-
- public static String getPrimaryKeyAttributesListDeclaration(
- ObjectModelClass clazz, boolean includeName) {
- String attributes = "";
- Collection<ObjectModelAttribute> attributeCollection;
- attributeCollection = getElementsWithStereotype(clazz.getAttributes(),
- TopiaStereoTypes.STEREOTYPE_PRIMARY_KEY);
- for (ObjectModelAttribute attr : attributeCollection) {
- attributes += attr.getType();
- if (includeName) {
- attributes += ' ' + attr.getName();
- }
- attributes += ", ";
- }
- if (attributes.length() > 0) {
- attributes = attributes.substring(0, attributes.length() - 2);
- }
- return attributes;
- }
-
- public static boolean isAssociationClassDoublon(ObjectModelAttribute attr) {
- return attr.getReverseAttribute() != null &&
- attr.getDeclaringElement().equals(
- attr.getReverseAttribute().getDeclaringElement()) &&
- !GeneratorUtil.isFirstAttribute(attr);
- }
-
public static String getDOType(ObjectModelElement elem, ObjectModel model) {
String type = elem.getName();
if (elem instanceof ObjectModelAttribute) {
@@ -610,34 +488,6 @@
}
/**
- * Indique si la classe specifiee n'a aucune ou que des methodes abstraites
- *
- * @param clazz l'instance de ObjectModelClass
- * @return true si la classe n'a que des operations abstraite ou aucune
- * operation
- */
- public static boolean hasNothingOrAbstractMethods(ObjectModelClass clazz) {
- boolean result = true;
- Iterator<?> operations = clazz.getOperations().iterator();
- while (result && operations.hasNext()) {
- ObjectModelOperation op = (ObjectModelOperation) operations.next();
- result = op.isAbstract();
- }
- return result;
- }
-
- /**
- * Indique si la classe specifiee devrait etre abstraite
- *
- * @param clazz l'instance de ObjectModelClass
- * @return true dans ce cas, false sinon
- */
- public static boolean shouldBeAbstract(ObjectModelClass clazz) {
- return clazz != null && clazz.isAbstract() &&
- hasNothingOrAbstractMethods(clazz);
- }
-
- /**
* <p>
* Cette méthode permet de détecter si
* - l'attribut représente une relation 1-n
@@ -712,7 +562,7 @@
*/
public static String getNMultiplicityHibernateType(
ObjectModelAttribute attr) {
- if (hasUniqueStereotype(attr)) {
+ if (EugeneStereoTypes.hasUniqueStereotype(attr)) {
return "set";
} else if (JavaGeneratorUtil.isOrdered(attr)) {
return "list";
@@ -771,48 +621,6 @@
};
/**
- * Detecte si la clef metier d'une classe est mutable ou pas.
- * <p/>
- * On respecte la valeur par defaut d'hibernate, à savoir que par default
- * une clef metier est non mutable.
- *
- * @param clazz la classe a tester
- * @return {@code true} si le tag value a ete positionne sur la classe
- * via le tag {@link TopiaTagValues#TAG_NATURAL_ID_MUTABLE}, {@code false}
- * sinon.
- */
- public static boolean isNaturalIdMutable(ObjectModelClass clazz) {
- String value = getNaturalIdMutableTagValue(clazz);
- if (StringUtils.isEmpty(value)) {
- // valeur null, donc par default positionnee
- return false;
- }
- try {
- return Boolean.valueOf(value.trim());
- } catch (Exception e) {
- // on a pas reussi a convertir en boolean.
- //todo peut-être declancher une exception ?
- return false;
- }
- }
-
- /**
- * Retourne true si le tagValue {@link TopiaTagValues#TAG_CONTEXTABLE}
- * à la valeur {@code true}.
- *
- * @param classifier classifier to test
- * @return {@code true} si {@link TopiaTagValues#TAG_CONTEXTABLE} == {@code true}
- */
- public static boolean isContextable(ObjectModelClassifier classifier) {
- boolean result = false;
- String value = classifier.getTagValue(TopiaTagValues.TAG_CONTEXTABLE);
- if (StringUtils.equalsIgnoreCase(value, "true")) {
- result = true;
- }
- return result;
- }
-
- /**
* Obtain the list of fqn of object involed in the given class.
*
* @param aClass the clazz to inspect
@@ -829,22 +637,6 @@
}
/**
- * Obtain the list of fqn of object involed in the given interface.
- *
- * @param anInterface the interface to inspect
- * @param incomingFqns incoming fqns
- * @return the list of fqn of attributes
- */
- public static List<String> getImports(ObjectModelInterface anInterface,
- String... incomingFqns) {
- Set<String> tmp = new HashSet<String>();
- tmp.addAll(Arrays.asList(incomingFqns));
- getImports(anInterface, tmp);
- List<String> result = cleanImports(anInterface.getPackageName(), tmp);
- return result;
- }
-
- /**
* Obtain the list of fqn of object involed in the given class.
*
* @param aClass the class to inspect
@@ -967,37 +759,6 @@
return result;
}
- /**
- * Obtain the class to use as abstract dao.
- * <p/>
- * It will look after a tag value {@link TopiaTagValues#TAG_DAO_IMPLEMENTATION} in model
- * and if not found will use the default value which is {@link AbstractTopiaDao}.
- *
- * @param model the model which could contains
- * @return the type of the abstract dao to use
- * @since 2.5
- * @deprecated since 3.0-alpha-8, replaced by {@link #getDaoSuperClassTagValue(ObjectModelClassifier, ObjectModel)}
- */
- @Deprecated
- public static Class<?> getDAOImplementation(ObjectModel model) {
- String daoImpl = getDaoImplementationTagValue(model);
- Class<?> result;
- if (StringUtils.isEmpty(daoImpl)) {
-
- // use the default dao implementation of topia
- result = AbstractTopiaDao.class;
- } else {
- try {
- result = Class.forName(daoImpl);
- } catch (ClassNotFoundException e) {
- String message = "Could not find dao implementation named " + daoImpl;
- log.error(message);
- throw new IllegalStateException(message, e);
- }
- }
- return result;
- }
-
public static Map<ObjectModelClass, Set<ObjectModelClass>>
searchDirectUsages(ObjectModel model) {
List<ObjectModelClass> allEntities;
@@ -1087,25 +848,12 @@
}
/**
- * Check if the given classifier has the
- * {@link TopiaStereoTypes#STEREOTYPE_ENTITY} stereotype.
- *
- * @param classifier classifier to test
- * @return {@code true} if stereotype was found, {@code false} otherwise
- * @see TopiaStereoTypes#STEREOTYPE_ENTITY
- * @since 2.5
- */
- public static boolean hasEntityStereotype(ObjectModelClassifier classifier) {
- return classifier.hasStereotype(TopiaStereoTypes.STEREOTYPE_ENTITY);
- }
-
- /**
* Check if the given attribute type is an entity.
*
* @param attribute attribute to test
* @param model model containing the attribute
* @return {@code true} if type of attribute is an entity,
- * {@code false} otherwise
+ * {@code false} otherwise
* @see TopiaStereoTypes#STEREOTYPE_ENTITY
* @since 2.7
*/
@@ -1126,544 +874,184 @@
*
* @param classifier classifier to test
* @return {@code true} if stereotype was found and classifier is not
- * enumeration, {@code false} otherwise
+ * enumeration, {@code false} otherwise
* @see TopiaStereoTypes#STEREOTYPE_ENTITY
* @since 2.5
*/
public static boolean isEntity(ObjectModelClassifier classifier) {
- return hasEntityStereotype(classifier) && !classifier.isEnum();
+ return TopiaStereoTypes.hasEntityStereotype(classifier) && !classifier.isEnum();
}
/**
- * Check if the given attribute has the
- * {@link TopiaStereoTypes#STEREOTYPE_ENTITY} stereotype.
+ * Obtain the value of the {@link TopiaTagValues#TAG_INHERITANCE_STRATEGY} tag value on the given classifier.
*
- * @param attribute attribute to test
- * @return {@code true} if stereotype was found, {@code false otherwise}
- * @see TopiaStereoTypes#STEREOTYPE_ENTITY
- * @since 2.5
- */
- public static boolean hasEntityStereotype(ObjectModelAttribute attribute) {
- return attribute.hasStereotype(TopiaStereoTypes.STEREOTYPE_ENTITY);
- }
-
- /**
- * Check if the given classifier has the
- * {@link TopiaStereoTypes#STEREOTYPE_DTO} stereotype.
- *
- * @param classifier classifier to test
- * @return {@code true} if stereotype was found, {@code false otherwise}
- * @see TopiaStereoTypes#STEREOTYPE_DTO
- * @since 2.5
- */
- public static boolean hasDtoStereotype(ObjectModelClassifier classifier) {
- return classifier.hasStereotype(TopiaStereoTypes.STEREOTYPE_DTO);
- }
-
- /**
- * Check if the given classifier has the
- * {@link TopiaStereoTypes#STEREOTYPE_DAO} stereotype.
- *
- * @param classifier classifier to test
- * @return {@code true} if stereotype was found, {@code false otherwise}
- * @see TopiaStereoTypes#STEREOTYPE_DAO
- * @since 2.5
- */
- public static boolean hasDaoStereotype(ObjectModelClassifier classifier) {
- return classifier.hasStereotype(TopiaStereoTypes.STEREOTYPE_DAO);
- }
-
- /**
- * Check if the given operation has the
- * {@link TopiaStereoTypes#STEREOTYPE_DAO} stereotype.
- *
- * @param operation operation to test
- * @return {@code true} if stereotype was found, {@code false otherwise}
- * @see TopiaStereoTypes#STEREOTYPE_DAO
- * @since 2.5
- */
- public static boolean hasDaoStereotype(ObjectModelOperation operation) {
- return operation.hasStereotype(TopiaStereoTypes.STEREOTYPE_DAO);
- }
-
- /**
- * Check if the given attribute has the
- * {@link TopiaStereoTypes#STEREOTYPE_UNIQUE} stereotype.
- *
- * @param attribute attribute to test
- * @return {@code true} if stereotype was found, {@code false otherwise}
- * @see TopiaStereoTypes#STEREOTYPE_UNIQUE
- * @since 2.5
- */
- public static boolean hasUniqueStereotype(ObjectModelAttribute attribute) {
- return attribute.hasStereotype(TopiaStereoTypes.STEREOTYPE_UNIQUE);
- }
-
- /**
- * Check if the given attribute has the
- * {@link TopiaStereoTypes#STEREOTYPE_PRIMARY_KEY} stereotype.
- *
- * @param attribute attribute to test
- * @return {@code true} if stereotype was found, {@code false otherwise}
- * @see TopiaStereoTypes#STEREOTYPE_PRIMARY_KEY
- * @since 2.5
- */
- public static boolean hasPrimaryKeyStereotype(ObjectModelAttribute attribute) {
- return attribute.hasStereotype(TopiaStereoTypes.STEREOTYPE_PRIMARY_KEY);
- }
-
- /**
- * Obtain the value of the {@link TopiaTagValues#TAG_PERSISTENCE_TYPE}
- * tag value on the given classifier.
- *
* @param classifier classifier to seek
* @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_PERSISTENCE_TYPE
- * @since 2.5
- */
- public static String getPersistenceTypeTagValue(ObjectModelClassifier classifier) {
-// String value = findTagValue(TopiaTagValues.TAG_PERSISTENCE_TYPE, classifier, null);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_PERSISTENCE_TYPE, classifier);
- return value;
- }
-
- /**
- * Obtain the value of the {@link TopiaTagValues#TAG_INHERITANCE_STRATEGY}
- * tag value on the given classifier.
- *
- * @param classifier classifier to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
* @see TopiaTagValues#TAG_INHERITANCE_STRATEGY
* @since 3.0
*/
- public static String getInheritanceStrategyTagValue(ObjectModelClassifier classifier) {
-// String value = findTagValue(TopiaTagValues.TAG_INHERITANCE_STRATEGY, classifier, null);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_INHERITANCE_STRATEGY, classifier);
+ public static String getInheritanceStrategy(ObjectModelClassifier classifier) {
+ String value = TopiaTagValues.getInheritanceStrategyTagValue(classifier);
if (value == null) {
- value = DEFAULT_INHERITANCE_STRATEGY;
+ value = TopiaGeneratorUtil.DEFAULT_INHERITANCE_STRATEGY;
}
return value;
}
- /**
- * Obtain the value of the {@link TopiaTagValues#TAG_DB_NAME}
- * tag value on the given classifier.
- *
- * @param element classifier to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_DB_NAME
- * @since 2.5
- */
- public static String getDbNameTagValue(ObjectModelElement element) {
-// String value = findTagValue(TopiaTagValues.TAG_DB_NAME, element, null);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_DB_NAME, element);
- return value;
- }
+ //---------------------------------------------------------------------------------------------------------------
+ //-- DEPRECATED API TO REMOVE ---------------------------------------------------------------------------------
+ //---------------------------------------------------------------------------------------------------------------
- /**
- * Obtain the value of the {@link TopiaTagValues#TAG_SCHEMA_NAME}
- * tag value on the given classifier.
- *
- * @param classifier classifier to seek
- * @param model model to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_SCHEMA_NAME
- * @since 2.5
- */
- public static String getDbSchemaNameTagValue(ObjectModelClassifier classifier, ObjectModel model) {
-// String value = findTagValue(TopiaTagValues.TAG_SCHEMA_NAME, classifier, model);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_SCHEMA_NAME, classifier, model);
- return value;
+ @Deprecated
+ public static String getLegacyDaoName(ObjectModelClass input) {
+ return input.getName() + "DAO";
}
/**
- * Obtain the value of the {@link TopiaTagValues#TAG_SCHEMA_NAME}
- * tag value on the given attribute.
- *
- * @param attribute attribute to seek
- * @param model model to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_SCHEMA_NAME
- * @since 2.5
+ * @deprecated since 3.0, not used anywhere in ToPIA
*/
- public static String getDbSchemaNameTagValue(ObjectModelAttribute attribute, ObjectModel model) {
-// String value = findTagValue(TopiaTagValues.TAG_SCHEMA_NAME, attribute, model);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_SCHEMA_NAME, attribute, model);
- return value;
+ @Deprecated
+ public static <Type extends ObjectModelElement> Collection<Type> getElementsWithStereotype(
+ Collection<Type> elements, String... stereotypes) {
+ Collection<Type> result = new ArrayList<Type>();
+ for (Type element : elements) {
+ if (hasStereotypes(element, stereotypes)) {
+ result.add(element);
+ }
+ }
+ return result;
}
/**
- * Obtain the value of the {@link TopiaTagValues#TAG_LENGTH}
- * tag value on the given attribute.
- *
- * @param attribute attribute to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_LENGTH
- * @since 2.5
+ * @deprecated since 3.0, not used anywhere in ToPIA
*/
- public static String getLengthTagValue(ObjectModelAttribute attribute) {
-// String value = findTagValue(TopiaTagValues.TAG_LENGTH, attribute, null);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_LENGTH, attribute);
- return value;
+ @Deprecated
+ public static boolean hasStereotypes(ObjectModelElement element,
+ String... stereotypes) {
+ for (String stereotype : stereotypes) {
+ if (!element.hasStereotype(stereotype)) {
+ return false;
+ }
+ }
+ return true;
}
/**
- * Obtain the value of the {@link TopiaTagValues#TAG_ANNOTATION}
- * tag value on the given attribute.
- *
- * @param attribute attribute to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_ANNOTATION
- * @since 2.5
+ * @deprecated since 3.0, not used anywhere in ToPIA
*/
- public static String getAnnotationTagValue(ObjectModelAttribute attribute) {
-// String value = findTagValue(TopiaTagValues.TAG_ANNOTATION, attribute, null);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_ANNOTATION, attribute);
- return value;
+ @Deprecated
+ public static String getPrimaryKeyAttributesListDeclaration(
+ ObjectModelClass clazz, boolean includeName) {
+ String attributes = "";
+ Collection<ObjectModelAttribute> attributeCollection;
+ attributeCollection = getElementsWithStereotype(clazz.getAttributes(),
+ TopiaStereoTypes.STEREOTYPE_PRIMARY_KEY);
+ for (ObjectModelAttribute attr : attributeCollection) {
+ attributes += attr.getType();
+ if (includeName) {
+ attributes += ' ' + attr.getName();
+ }
+ attributes += ", ";
+ }
+ if (attributes.length() > 0) {
+ attributes = attributes.substring(0, attributes.length() - 2);
+ attributes = attributes.substring(0, attributes.length() - 2);
+ }
+ return attributes;
}
/**
- * Obtain the value of the {@link TopiaTagValues#TAG_ACCESS}
- * tag value on the given attribute.
- *
- * @param attribute attribute to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_ACCESS
- * @since 2.5
+ * @deprecated since 3.0, not used anywhere in ToPIA
*/
- public static String getAccessTagValue(ObjectModelAttribute attribute) {
-// String value = findTagValue(TopiaTagValues.TAG_ACCESS, attribute, null);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_ACCESS, attribute);
- return value;
+ @Deprecated
+ public static boolean isAssociationClassDoublon(ObjectModelAttribute attr) {
+ return attr.getReverseAttribute() != null &&
+ attr.getDeclaringElement().equals(
+ attr.getReverseAttribute().getDeclaringElement()) &&
+ !GeneratorUtil.isFirstAttribute(attr);
}
- /**
- * Obtain the value of the {@link TopiaTagValues#TAG_NATURAL_ID}
- * tag value on the given attribute.
- *
- * @param attribute attribute to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_NATURAL_ID
- * @since 2.5
- */
- public static String getNaturalIdTagValue(ObjectModelAttribute attribute) {
-// String value = findTagValue(TopiaTagValues.TAG_NATURAL_ID, attribute, null);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_NATURAL_ID, attribute);
- return value;
- }
/**
- * Obtain the value of the {@link TopiaTagValues#TAG_NATURAL_ID_MUTABLE}
- * tag value on the given classifier.
+ * Obtain the list of fqn of object involed in the given interface.
*
- * @param classifier classifier to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_NATURAL_ID_MUTABLE
- * @since 2.5
+ * @param anInterface the interface to inspect
+ * @param incomingFqns incoming fqns
+ * @return the list of fqn of attributes
+ * @deprecated since 3.0, not used anywhere in ToPIA
*/
- public static String getNaturalIdMutableTagValue(ObjectModelClassifier classifier) {
-// String value = findTagValue(TopiaTagValues.TAG_NATURAL_ID_MUTABLE, classifier, null);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_NATURAL_ID_MUTABLE, classifier);
- return value;
+ @Deprecated
+ public static List<String> getImports(ObjectModelInterface anInterface,
+ String... incomingFqns) {
+ Set<String> tmp = new HashSet<String>();
+ tmp.addAll(Arrays.asList(incomingFqns));
+ getImports(anInterface, tmp);
+ List<String> result = cleanImports(anInterface.getPackageName(), tmp);
+ return result;
}
/**
- * Obtain the value of the {@link TopiaTagValues#TAG_INVERSE}
- * tag value on the given attribute.
+ * Indique si la classe specifiee n'a aucune ou que des methodes abstraites
*
- * @param attribute attribute to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_INVERSE
- * @since 2.5
+ * @param clazz l'instance de ObjectModelClass
+ * @return true si la classe n'a que des operations abstraite ou aucune
+ * operation
+ * @deprecated since 3.0, used nowhere in ToPIA
*/
- public static String getInverseTagValue(ObjectModelAttribute attribute) {
-// String value = findTagValue(TopiaTagValues.TAG_INVERSE, attribute, null);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_INVERSE, attribute);
- return value;
+ @Deprecated
+ public static boolean hasNothingOrAbstractMethods(ObjectModelClass clazz) {
+ boolean result = true;
+ Iterator<?> operations = clazz.getOperations().iterator();
+ while (result && operations.hasNext()) {
+ ObjectModelOperation op = (ObjectModelOperation) operations.next();
+ result = op.isAbstract();
+ }
+ return result;
}
/**
- * Obtain the value of the {@link TopiaTagValues#TAG_LAZY}
- * tag value on the given attribute.
+ * Indique si la classe specifiee devrait etre abstraite
*
- * @param attribute attribute to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_LAZY
- * @since 2.5
+ * @param clazz l'instance de ObjectModelClass
+ * @return true dans ce cas, false sinon
+ * @deprecated since 3.0, used nowhere in ToPIA
*/
- public static String getLazyTagValue(ObjectModelAttribute attribute) {
-// String value = findTagValue(TopiaTagValues.TAG_LAZY, attribute, null);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_LAZY, attribute);
- return value;
+ @Deprecated
+ public static boolean shouldBeAbstract(ObjectModelClass clazz) {
+ return clazz != null && clazz.isAbstract() &&
+ hasNothingOrAbstractMethods(clazz);
}
/**
- * Obtain the value of the {@link TopiaTagValues#TAG_FETCH}
- * tag value on the given attribute.
+ * Obtain the class to use as abstract dao.
+ * <p/>
+ * It will look after a tag value {@link TopiaTagValues#TAG_DAO_IMPLEMENTATION} in model
+ * and if not found will use the default value which is {@link AbstractTopiaDao}.
*
- * @param attribute attribute to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_FETCH
+ * @param model the model which could contains
+ * @return the type of the abstract dao to use
* @since 2.5
+ * @deprecated since 3.0-alpha-8, replaced by {@link TopiaTagValues#getDaoSuperClassTagValue(ObjectModelClassifier, ObjectModel)}
*/
- public static String getFetchTagValue(ObjectModelAttribute attribute) {
-// String value = findTagValue(TopiaTagValues.TAG_FETCH, attribute, null);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_FETCH, attribute);
- return value;
- }
-
- /**
- * Obtain the value of the {@link TopiaTagValues#TAG_ORDER_BY}
- * tag value on the given attribute.
- *
- * @param attribute attribute to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_ORDER_BY
- * @since 2.5
- */
- public static String getOrderByTagValue(ObjectModelAttribute attribute) {
-// String value = findTagValue(TopiaTagValues.TAG_ORDER_BY, attribute, null);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_ORDER_BY, attribute);
- return value;
- }
-
- /**
- * Obtain the value of the {@link TopiaTagValues#TAG_NOT_NULL}
- * tag value on the given attribute.
- *
- * @param attribute attribute to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_NOT_NULL
- * @since 2.5
- */
- public static String getNotNullTagValue(ObjectModelAttribute attribute) {
-// String value = findTagValue(TopiaTagValues.TAG_NOT_NULL, attribute, null);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_NOT_NULL, attribute);
- return value;
- }
-
- /**
- * Obtain the value of the {@link TopiaTagValues#TAG_PROXY_INTERFACE}
- * tag value on the given classifier.
- *
- * @param classifier classifier to seek
- * @param model model to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_PROXY_INTERFACE
- * @since 2.5
- */
- public static String getProxyInterfaceTagValue(ObjectModelClassifier classifier, ObjectModel model) {
-// String value = findTagValue(TopiaTagValues.TAG_PROXY_INTERFACE, classifier, model);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_PROXY_INTERFACE, classifier, model);
- return value;
- }
-
- /**
- * Obtain the value of the {@link TopiaTagValues#TAG_NOT_GENERATE_TO_STRING}
- * tag value on the given class.
- *
- * @param clazz class to seek
- * @param model model to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_NOT_GENERATE_TO_STRING
- * @since 2.5
- */
- public static String getNotGenerateToStringTagValue(ObjectModelClassifier clazz, ObjectModel model) {
-// String value = findTagValue(TopiaTagValues.TAG_NOT_GENERATE_TO_STRING, clazz, model);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_NOT_GENERATE_TO_STRING, clazz, model);
- return value;
- }
-
- /**
- * Obtain the value of the {@link TopiaTagValues#TAG_SORT_ATTRIBUTE}
- * tag value on the given classifier.
- *
- * @param classifier classifier to seek
- * @param model model to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_SORT_ATTRIBUTE
- * @since 2.5
- */
- public static String getSortAttributeTagValue(ObjectModelClassifier classifier, ObjectModel model) {
-// String value = findTagValue(TopiaTagValues.TAG_SORT_ATTRIBUTE, classifier, model);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_SORT_ATTRIBUTE, classifier, model);
- return value;
- }
-
- /* Obtain the value of the {@link TopiaTagValues#TAG_GENERATE_OPERATOR_FOR_DAO_HELPER}
- * tag value on the given model.
- *
- * @param model model to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_GENERATE_OPERATOR_FOR_DAO_HELPER
- * @since 2.5
- */
- public static String getGenerateOperatorForDAOHelperTagValue(ObjectModel model) {
-// String value = findTagValue(TopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPER, null, model);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPER, model);
- return value;
- }
-
- /**
- * Obtain the value of the {@link TopiaTagValues#TAG_TYPE}
- * tag value on the given attribute.
- *
- * @param attribute attribute to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_TYPE
- * @since 2.5
- * @deprecated since 3.0, use now {@link #getHibernateAttributeType(ObjectModelAttribute, ObjectModelClassifier, ObjectModel)}
- */
@Deprecated
- public static String getTypeTagValue(ObjectModelAttribute attribute) {
-// String value = findTagValue(TopiaTagValues.TAG_TYPE, attribute, null);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_TYPE, attribute);
- return value;
- }
+ public static Class<?> getDAOImplementation(ObjectModel model) {
+ String daoImpl = TopiaTagValues.getDaoImplementationTagValue(model);
+ Class<?> result;
+ if (StringUtils.isEmpty(daoImpl)) {
- public static String getHibernateAttributeType(ObjectModelAttribute attribute, ObjectModelClassifier classifier, ObjectModel model) {
- String tagValueName = TopiaTagValues.TAG_HIBERNATE_ATTRIBUTE_TYPE + "." + attribute.getType();
- String value = TagValues.findTagValue(tagValueName, attribute, classifier, model);
- return value;
+ // use the default dao implementation of topia
+ result = AbstractTopiaDao.class;
+ } else {
+ try {
+ result = Class.forName(daoImpl);
+ } catch (ClassNotFoundException e) {
+ String message = "Could not find dao implementation named " + daoImpl;
+ log.error(message);
+ throw new IllegalStateException(message, e);
+ }
+ }
+ return result;
}
- /**
- * Obtain the value of the {@link TopiaTagValues#TAG_SQL_TYPE}
- * tag value on the given attribute.
- *
- * @param attribute attribute to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_TYPE
- * @since 2.5
- */
- public static String getSqlTypeTagValue(ObjectModelAttribute attribute) {
-// String value = findTagValue(TopiaTagValues.TAG_SQL_TYPE, attribute, null);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_SQL_TYPE, attribute);
- return value;
- }
-
- /**
- * Obtains the value of the {@link TopiaTagValues#TAG_DAO_IMPLEMENTATION}
- * tag value on the given model.
-
- *
- * @param model model to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_DAO_IMPLEMENTATION
- * @since 2.5
- */
- public static String getDaoImplementationTagValue(ObjectModel model) {
-// String value = findTagValue(TopiaTagValues.TAG_DAO_IMPLEMENTATION, null, model);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_DAO_IMPLEMENTATION, model);
- return value;
- }
-
- /**
- * Obtains the value of the tag value
- * {@link TopiaTagValues#TAG_INDEX_FOREIGN_KEYS} on the model or on the
- * given attribute.
- *
- * @param attribute attribute to test
- * @param model model to test
- * @return none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_INDEX_FOREIGN_KEYS
- * @since 2.6.5
- */
- public static String getIndexForeignKeys(ObjectModelAttribute attribute, ObjectModel model) {
-// String value = findTagValue(TopiaTagValues.TAG_INDEX_FOREIGN_KEYS, attribute, model);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_INDEX_FOREIGN_KEYS, attribute, model);
- return value;
- }
-
- //TODO Javadoc
- public static boolean hasUseEnumerationNameTagValue(ObjectModelClassifier classifier, ObjectModelAttribute attr, ObjectModel model) {
-// String value = findTagValue(TopiaTagValues.TAG_USE_ENUMERATION_NAME, classifier, model);
-// if (value == null) {
-// // try on attribute
-// value = findTagValue(TopiaTagValues.TAG_USE_ENUMERATION_NAME, attr);
-// }
-// return Boolean.parseBoolean(value);
- boolean value = TagValues.findBooleanTagValue(TopiaTagValues.TAG_USE_ENUMERATION_NAME, attr, classifier, model);
- return value;
- }
-
- /**
- * Search if the TagValue {@link TopiaTagValues#TAG_GENERATE_TOPIA_ID_IN_DTO} has been
- * activated in the model.
- *
- * @param classifier classifier to seek
- * @param model model to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_GENERATE_TOPIA_ID_IN_DTO
- * @since 2.6.7
- */
- public static boolean shouldGenerateDTOTopiaIdTagValue(ObjectModelClassifier classifier, ObjectModel model) {
-// String tagValue = findTagValue(TopiaTagValues.TAG_GENERATE_TOPIA_ID_IN_DTO, classifier, model);
-// boolean generate = StringUtils.isNotEmpty(tagValue) && Boolean.valueOf(tagValue);
-// return generate;
- boolean value = TagValues.findBooleanTagValue(TopiaTagValues.TAG_GENERATE_TOPIA_ID_IN_DTO, classifier, model);
- return value;
- }
-
- /**
- * Obtains the value of the {@link TopiaTagValues#TAG_PERSISTENCE_CONTEXT_SUPER_CLASS}
- * tag value on the model.
- *
- * @param model model to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_PERSISTENCE_CONTEXT_SUPER_CLASS
- * @since 3.0
- */
- public static String getPersistenceContextSuperClassTagValue(ObjectModel model) {
-// String value = findTagValue(TopiaTagValues.TAG_PERSISTENCE_CONTEXT_SUPER_CLASS, null, model);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_PERSISTENCE_CONTEXT_SUPER_CLASS, model);
- return value;
- }
-
- /**
- * Obtains the value of the {@link TopiaTagValues#TAG_APPLICATION_CONTEXT_SUPER_CLASS}
- * tag value on the model.
- *
- * @param model model to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_APPLICATION_CONTEXT_SUPER_CLASS
- * @since 3.0
- */
- public static String getApplicationContextSuperClassTagValue(ObjectModel model) {
-// String value = findTagValue(TopiaTagValues.TAG_APPLICATION_CONTEXT_SUPER_CLASS, null, model);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_APPLICATION_CONTEXT_SUPER_CLASS, model);
- return value;
- }
-
- /**
- * Obtains the value of the {@link TopiaTagValues#TAG_DAO_SUPER_CLASS}
- * tag value on the given classifier or on the model.
- *
- * @param model model to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_DAO_SUPER_CLASS
- * @since 3.0
- */
- public static String getDaoSuperClassTagValue(ObjectModelClassifier classifier, ObjectModel model) {
-// String value = findTagValue(TopiaTagValues.TAG_DAO_SUPER_CLASS, classifier, model);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_DAO_SUPER_CLASS, classifier, model);
- return value;
- }
-
- /**
- * Obtains the value of the {@link TopiaTagValues#TAG_ENTITY_SUPER_CLASS}
- * tag value on the given classifier or on the model.
- *
- * @param model model to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see TopiaTagValues#TAG_ENTITY_SUPER_CLASS
- * @since 3.0
- */
- public static String getEntitySuperClassTagValue(ObjectModelClassifier classifier, ObjectModel model) {
-// String value = findTagValue(TopiaTagValues.TAG_ENTITY_SUPER_CLASS, classifier, model);
- String value = TagValues.findTagValue(TopiaTagValues.TAG_ENTITY_SUPER_CLASS, classifier, model);
- return value;
- }
-
} // TopiaGeneratorUtil
Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaModelPropertiesProvider.java
===================================================================
--- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaModelPropertiesProvider.java 2014-04-27 06:22:24 UTC (rev 3085)
+++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaModelPropertiesProvider.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -1,18 +1,21 @@
package org.nuiton.topia.templates;
-import org.nuiton.eugene.metas.ModelPropertiesProvider;
+import org.nuiton.eugene.ModelPropertiesUtil;
+
/**
* The ToPIA provider of tag values and stereotypes.
*
* @author tchemit <chemit(a)codelutin.com>
* @plexus.component role="org.nuiton.eugene.metas.ModelPropertiesProvider" role-hint="topia"
* @since 2.3
+ * @deprecated since 3.0, no more used. Use now {@link TopiaStereoTypes} and {@link TopiaTagValues}.
*/
-public class TopiaModelPropertiesProvider extends ModelPropertiesProvider {
+@Deprecated
+public class TopiaModelPropertiesProvider extends ModelPropertiesUtil.ModelPropertiesProvider {
@Override
- public void initStores() throws IllegalAccessException {
+ public void init() throws IllegalAccessException {
scanStereotypeClass(TopiaStereoTypes.class);
scanTagValueClass(TopiaTagValues.class);
}
Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaStereoTypes.java
===================================================================
--- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaStereoTypes.java 2014-04-27 06:22:24 UTC (rev 3085)
+++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaStereoTypes.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -24,56 +24,132 @@
* #L%
*/
-import org.nuiton.eugene.EugeneStereoTypes;
import org.nuiton.eugene.models.object.ObjectModelAttribute;
import org.nuiton.eugene.models.object.ObjectModelClassifier;
import org.nuiton.eugene.models.object.ObjectModelOperation;
+import org.nuiton.eugene.models.stereotype.StereotypeDefinition;
+import org.nuiton.eugene.models.stereotype.StereotypeDefinitionProvider;
-import org.nuiton.eugene.metas.StereotypeDefinition;
-
/**
* All extra stereotypes usable in topia generators.
*
* @author tchemit <chemit(a)codelutin.com>
+ * @plexus.component role="org.nuiton.eugene.models.stereotype.StereotypeDefinitionProvider" role-hint="topia"
* @since 2.5
*/
-public interface TopiaStereoTypes extends EugeneStereoTypes {
+public class TopiaStereoTypes extends StereotypeDefinitionProvider {
/**
* Stéréotype pour les objets devant être générées sous forme d'entités
*
* @see TopiaGeneratorUtil#isEntity(ObjectModelClassifier)
- * @see TopiaGeneratorUtil#hasEntityStereotype(ObjectModelAttribute)
+ * @see #hasEntityStereotype(ObjectModelAttribute)
*/
@StereotypeDefinition(target = {ObjectModelClassifier.class, ObjectModelAttribute.class},
documentation = "To specify that a class is an Entity")
- String STEREOTYPE_ENTITY = "entity";
+ public static final String STEREOTYPE_ENTITY = "entity";
/**
* Stéréotype pour les objets devant être générées sous forme de DTO.
*
- * @see TopiaGeneratorUtil#hasDtoStereotype(ObjectModelClassifier)
+ * @see #hasDtoStereotype(ObjectModelClassifier)
*/
@StereotypeDefinition(target = ObjectModelClassifier.class,
documentation = "to specify that a class is a DTO")
- String STEREOTYPE_DTO = "dto";
+ public static final String STEREOTYPE_DTO = "dto";
/**
* Stéréotype pour les interfaces devant être générées sous forme de DAO.
*
- * @see TopiaGeneratorUtil#hasDaoStereotype(ObjectModelClassifier)
- * @see TopiaGeneratorUtil#hasDaoStereotype(ObjectModelOperation)
+ * @see #hasDaoStereotype(ObjectModelClassifier)
+ * @see #hasDaoStereotype(ObjectModelOperation)
*/
@StereotypeDefinition(target = {ObjectModelClassifier.class, ObjectModelOperation.class},
documentation = "To Specify that a classifier or an operation should be generated as (or in) a DAO")
- String STEREOTYPE_DAO = "dao";
+ public static final String STEREOTYPE_DAO = "dao";
/**
* Stéréotype pour les attributs étant des clés primaires.
*
- * @see TopiaGeneratorUtil#hasPrimaryKeyStereotype(ObjectModelAttribute)
+ * @see #hasPrimaryKeyStereotype(ObjectModelAttribute)
+ * @deprecated since 3.0, use nowhere in ToPIA
*/
+ @Deprecated
@StereotypeDefinition(target = ObjectModelAttribute.class,
documentation = "To specify that an attribute is part of a primary key (Hibernate mapping)")
- String STEREOTYPE_PRIMARY_KEY = "primaryKey";
+ public static final String STEREOTYPE_PRIMARY_KEY = "primaryKey";
+
+ /**
+ * Check if the given classifier has the {@link TopiaStereoTypes#STEREOTYPE_ENTITY} stereotype.
+ *
+ * @param classifier classifier to test
+ * @return {@code true} if stereotype was found, {@code false otherwise}
+ * @see TopiaStereoTypes#STEREOTYPE_ENTITY
+ * @since 2.5
+ */
+ public static boolean hasEntityStereotype(ObjectModelClassifier classifier) {
+ return classifier.hasStereotype(TopiaStereoTypes.STEREOTYPE_ENTITY);
+ }
+
+ /**
+ * Check if the given attribute has the {@link TopiaStereoTypes#STEREOTYPE_ENTITY} stereotype.
+ *
+ * @param attribute attribute to test
+ * @return {@code true} if stereotype was found, {@code false otherwise}
+ * @see TopiaStereoTypes#STEREOTYPE_ENTITY
+ * @since 2.5
+ */
+ public static boolean hasEntityStereotype(ObjectModelAttribute attribute) {
+ return attribute.hasStereotype(TopiaStereoTypes.STEREOTYPE_ENTITY);
+ }
+
+ /**
+ * Check if the given classifier has the {@link TopiaStereoTypes#STEREOTYPE_DTO} stereotype.
+ *
+ * @param classifier classifier to test
+ * @return {@code true} if stereotype was found, {@code false otherwise}
+ * @see TopiaStereoTypes#STEREOTYPE_DTO
+ * @since 2.5
+ */
+ public static boolean hasDtoStereotype(ObjectModelClassifier classifier) {
+ return classifier.hasStereotype(TopiaStereoTypes.STEREOTYPE_DTO);
+ }
+
+ /**
+ * Check if the given classifier has the {@link TopiaStereoTypes#STEREOTYPE_DAO} stereotype.
+ *
+ * @param classifier classifier to test
+ * @return {@code true} if stereotype was found, {@code false otherwise}
+ * @see TopiaStereoTypes#STEREOTYPE_DAO
+ * @since 2.5
+ */
+ public static boolean hasDaoStereotype(ObjectModelClassifier classifier) {
+ return classifier.hasStereotype(TopiaStereoTypes.STEREOTYPE_DAO);
+ }
+
+ /**
+ * Check if the given operation has the {@link TopiaStereoTypes#STEREOTYPE_DAO} stereotype.
+ *
+ * @param operation operation to test
+ * @return {@code true} if stereotype was found, {@code false otherwise}
+ * @see TopiaStereoTypes#STEREOTYPE_DAO
+ * @since 2.5
+ */
+ public static boolean hasDaoStereotype(ObjectModelOperation operation) {
+ return operation.hasStereotype(TopiaStereoTypes.STEREOTYPE_DAO);
+ }
+
+ /**
+ * Check if the given attribute has the {@link TopiaStereoTypes#STEREOTYPE_PRIMARY_KEY} stereotype.
+ *
+ * @param attribute attribute to test
+ * @return {@code true} if stereotype was found, {@code false otherwise}
+ * @see TopiaStereoTypes#STEREOTYPE_PRIMARY_KEY
+ * @since 2.5
+ * @deprecated since 3.0, not used in ToPIA
+ */
+ @Deprecated
+ public static boolean hasPrimaryKeyStereotype(ObjectModelAttribute attribute) {
+ return attribute.hasStereotype(TopiaStereoTypes.STEREOTYPE_PRIMARY_KEY);
+ }
}
Modified: trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java
===================================================================
--- trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java 2014-04-27 06:22:24 UTC (rev 3085)
+++ trunk/topia-templates/src/main/java/org/nuiton/topia/templates/TopiaTagValues.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -24,14 +24,14 @@
* #L%
*/
-import org.nuiton.eugene.EugeneTagValues;
-import org.nuiton.eugene.metas.TagValueDefinition;
-import org.nuiton.eugene.metas.matcher.PrefixTagNameMatchTagValueMatcher;
import org.nuiton.eugene.models.object.ObjectModel;
import org.nuiton.eugene.models.object.ObjectModelAttribute;
-import org.nuiton.eugene.models.object.ObjectModelClass;
import org.nuiton.eugene.models.object.ObjectModelClassifier;
import org.nuiton.eugene.models.object.ObjectModelElement;
+import org.nuiton.eugene.models.tagvalue.TagValueDefinition;
+import org.nuiton.eugene.models.tagvalue.TagValueDefinitionProvider;
+import org.nuiton.eugene.models.tagvalue.TagValues;
+import org.nuiton.eugene.models.tagvalue.matcher.StartsWithTagNameMatcher;
import org.nuiton.topia.persistence.TopiaDaoSupplier;
import org.nuiton.topia.persistence.TopiaEntityContextable;
@@ -39,20 +39,21 @@
* All extra tag values usable in topia generators.
*
* @author tchemit <chemit(a)codelutin.com>
+ * @plexus.component role="org.nuiton.eugene.models.tagvalue.TagValueDefinitionProvider" role-hint="topia"
* @since 2.5
*/
-public interface TopiaTagValues extends EugeneTagValues {
+public class TopiaTagValues extends TagValueDefinitionProvider {
/**
* Tag pour le type de persistence.
*
* @see TopiaGeneratorUtil#getPersistenceType(ObjectModelClassifier)
- * @see TopiaGeneratorUtil#getPersistenceTypeTagValue(ObjectModelClassifier)
+ * @see #getPersistenceTypeTagValue(ObjectModelClassifier)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModelClassifier.class},
documentation = "TODO")
- String TAG_PERSISTENCE_TYPE = "persistenceType";
+ public static final String TAG_PERSISTENCE_TYPE = "persistenceType";
/**
* Tag pour que les entités etendent {@link TopiaEntityContextable} et
@@ -62,81 +63,79 @@
* @since 2.5.3
*/
@TagValueDefinition(target = {ObjectModelClassifier.class}, documentation = "TODO")
- String TAG_CONTEXTABLE = "contextable";
+ public static final String TAG_CONTEXTABLE = "contextable";
/**
* Tag pour le nom du champ / entité en BD.
*
- * @see TopiaGeneratorUtil#getDbNameTagValue(ObjectModelElement)
+ * @see #getDbNameTagValue(ObjectModelElement)
* @see TopiaGeneratorUtil#getDbName(ObjectModelElement)
* @see TopiaGeneratorUtil#getReverseDbName(ObjectModelAttribute)
*/
@TagValueDefinition(target = {ObjectModelElement.class},
documentation = "Sets the database name of an element of the model (a table or a column)")
- String TAG_DB_NAME = "dbName";
+ public static final String TAG_DB_NAME = "dbName";
/**
* Tag pour le nom du schema en BD.
*
- * @see TopiaGeneratorUtil#getDbSchemaNameTagValue(ObjectModelClassifier, ObjectModel)
- * @see TopiaGeneratorUtil#getDbSchemaNameTagValue(ObjectModelAttribute, ObjectModel)
+ * @see #getDbSchemaNameTagValue(ObjectModelClassifier, ObjectModel)
+ * @see #getDbSchemaNameTagValue(ObjectModelAttribute, ObjectModel)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class, ObjectModelAttribute.class},
documentation = "Sets the database schema name")
- String TAG_SCHEMA_NAME = "dbSchema";
+ public static final String TAG_SCHEMA_NAME = "dbSchema";
/**
* Tag pour la taille du champ en BD.
*
- * @see TopiaGeneratorUtil#getLengthTagValue(ObjectModelAttribute)
+ * @see #getLengthTagValue(ObjectModelAttribute)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModelAttribute.class},
documentation = "Sets the length of an attribute in database")
- String TAG_LENGTH = "length";
+ public static final String TAG_LENGTH = "length";
/**
* Tag pour ajouter une annotation à un champ.
*
- * @see TopiaGeneratorUtil#getAnnotationTagValue(ObjectModelAttribute)
+ * @see #getAnnotationTagValue(ObjectModelAttribute)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModelAttribute.class},
documentation = "Sets an annotation of an attribute")
- String TAG_ANNOTATION = "annotation";
+ public static final String TAG_ANNOTATION = "annotation";
/**
* Tag pour specfier le type d'acces a un champ.
*
- * @see TopiaGeneratorUtil#getAccessTagValue(ObjectModelAttribute)
+ * @see #getAccessTagValue(ObjectModelAttribute)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModelAttribute.class},
documentation = "Sets the access type of an attribute (Hibernate mapping)")
- String TAG_ACCESS = "access";
+ public static final String TAG_ACCESS = "access";
/**
* Tag pour ajouter un attribut dans une clef métier.
*
- * @see TopiaGeneratorUtil#getNaturalIdTagValue(ObjectModelAttribute)
- * @see TopiaGeneratorUtil#isNaturalId(ObjectModelAttribute)
+ * @see #getNaturalIdTagValue(ObjectModelAttribute)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModelAttribute.class},
documentation = "Sets an attribute as part of a natural id (Hibernate Mapping)")
- String TAG_NATURAL_ID = "naturalId";
+ public static final String TAG_NATURAL_ID = "naturalId";
/**
* Tag pour specifier si une clef metier est mutable.
*
- * @see TopiaGeneratorUtil#getNaturalIdMutableTagValue(ObjectModelClassifier)
- * @see TopiaGeneratorUtil#isNaturalIdMutable(ObjectModelClass)
+ * @see #getNaturalIdMutableTagValue(ObjectModelClassifier)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModelClassifier.class},
documentation = "Sets if natural id of a entity is mutable (hibernate mapping)")
- String TAG_NATURAL_ID_MUTABLE = "naturalIdMutable";
+ public static final String TAG_NATURAL_ID_MUTABLE = "naturalIdMutable";
/**
* Tag pour permettre de choisir qui contrôle la relation N-N
@@ -145,52 +144,52 @@
* Par défaut le inverse=true est placé sur le premier rôle trouvé dans
* l'ordre alphabétique.
*
- * @see TopiaGeneratorUtil#getInverseTagValue(ObjectModelAttribute)
+ * @see #getInverseTagValue(ObjectModelAttribute)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModelAttribute.class},
documentation = "Sets which part of a N-N relation is master (inverse=true) and slave (inverse=false) (must be put on each side on a such relation) (Hibernate mapping)")
- String TAG_INVERSE = "inverse";
+ public static final String TAG_INVERSE = "inverse";
/**
* Tag pour spécifier la caractère lazy d'une association multiple.
*
- * @see TopiaGeneratorUtil#getLazyTagValue(ObjectModelAttribute)
+ * @see #getLazyTagValue(ObjectModelAttribute)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModelAttribute.class},
documentation = "Sets if an association should be lazy (Hibernate mapping)")
- String TAG_LAZY = "lazy";
+ public static final String TAG_LAZY = "lazy";
/**
* Tag pour spécifier la caractère fetch d'une association multiple.
*
- * @see TopiaGeneratorUtil#getFetchTagValue(ObjectModelAttribute)
+ * @see #getFetchTagValue(ObjectModelAttribute)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModelAttribute.class},
documentation = "Sets the fetch caracteristic of an attribute (Hibernate mapping)")
- String TAG_FETCH = "fetch";
+ public static final String TAG_FETCH = "fetch";
/**
* Tag pour spécifier la caractère order-by d'une association multiple.
*
- * @see TopiaGeneratorUtil#getOrderByTagValue(ObjectModelAttribute)
+ * @see #getOrderByTagValue(ObjectModelAttribute)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModelAttribute.class},
documentation = "Sets the order by propertie of an multiple association (Hibernate mapping)")
- String TAG_ORDER_BY = "orderBy";
+ public static final String TAG_ORDER_BY = "orderBy";
/**
* Tag pour spécifier la caractère not-null d'un attribut.
*
- * @see TopiaGeneratorUtil#getNotNullTagValue(ObjectModelAttribute)
+ * @see #getNotNullTagValue(ObjectModelAttribute)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModelAttribute.class},
documentation = "Sets if an attribute must be not null (Hibernate mapping)")
- String TAG_NOT_NULL = "notNull";
+ public static final String TAG_NOT_NULL = "notNull";
/**
* Tag à placer sur un l'attribut d'une entité. Cet attribut est de type
@@ -198,12 +197,12 @@
* {@code name} de l'énumération et non l'ordinal pour stocker la valeur en
* base
*
- * @see TopiaGeneratorUtil#hasUseEnumerationNameTagValue(ObjectModelClassifier, ObjectModelAttribute, ObjectModel)
+ * @see #hasUseEnumerationNameTagValue(ObjectModelAttribute, ObjectModelClassifier, ObjectModel)
* @since 3.0
*/
@TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class, ObjectModelAttribute.class},
documentation = "'true' if the value of this attribute of type Enumeration should be stored with its name (instead of using ordinal)")
- String TAG_USE_ENUMERATION_NAME = "useEnumerationName";
+ public static final String TAG_USE_ENUMERATION_NAME = "useEnumerationName";
/**
* Tag pour configurer l'interface du proxy sur autre chose que l'implementation par defaut.
@@ -213,12 +212,12 @@
* Autre valeur :
* "none" > laisse la configuration par defaut d'hibernate
*
- * @see TopiaGeneratorUtil#getPersistenceTypeTagValue(ObjectModelClassifier)
+ * @see #getPersistenceTypeTagValue(ObjectModelClassifier)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class},
documentation = "Configure the proxy interface on something else than the default implementation (null to use our default implementation, none to let hibernate deal it) (Hibernate mapping)")
- String TAG_PROXY_INTERFACE = "hibernateProxyInterface";
+ public static final String TAG_PROXY_INTERFACE = "hibernateProxyInterface";
/**
* Tag pour configurer la stategie d'heritage choisie.
@@ -228,51 +227,49 @@
* "subclass" > Single table per class hierarchy strategy
* "joined-subclass" > Joined subclass strategy
*
- * @see TopiaGeneratorUtil#getPersistenceTypeTagValue(ObjectModelClassifier)
+ * @see #getPersistenceTypeTagValue(ObjectModelClassifier)
* @since 3.0
*/
@TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class},
- documentation = "Configure the proxy interface on something else than the default implementation (null to use our default implementation, none to let hibernate deal it) (Hibernate mapping)")
- String TAG_INHERITANCE_STRATEGY = "inheritanceStrategy";
+ documentation = "Configure the proxy interface on something else than the default implementation (null to use our default implementation, none to let hibernate deal it) (Hibernate mapping)",
+ defaultValue = "union-subclass")
+ public static final String TAG_INHERITANCE_STRATEGY = "inheritanceStrategy";
/**
* Tag pour specifier de ne pas generer la methode toString.
*
- * @see TopiaGeneratorUtil#getNotGenerateToStringTagValue(ObjectModelClassifier, ObjectModel)
- * @see TopiaGeneratorUtil#generateToString(ObjectModelClass, ObjectModel)
+ * @see #getNotGenerateToStringTagValue(ObjectModelClassifier, ObjectModel)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class},
defaultValue = "true",
documentation = "To not generate the toString method on entities")
- String TAG_NOT_GENERATE_TO_STRING = "notGenerateToString";
+ public static final String TAG_NOT_GENERATE_TO_STRING = "notGenerateToString";
/**
* Tag pour specifier de trier les attributs par nom lors de la generation.
*
- * @see TopiaGeneratorUtil#getSortAttributeTagValue(ObjectModelClassifier, ObjectModel)
- * @see TopiaGeneratorUtil#sortAttribute(ObjectModelClass, ObjectModel)
+ * @see #getSortAttributeTagValue(ObjectModelClassifier, ObjectModel)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class},
documentation = "To sort attribute while generation")
- String TAG_SORT_ATTRIBUTE = "sortAttribute";
+ public static final String TAG_SORT_ATTRIBUTE = "sortAttribute";
/**
* Tag pour specfier si on doit générer la methode getOperator dans les daohelpers.
*
- * @see TopiaGeneratorUtil#getGenerateOperatorForDAOHelperTagValue(ObjectModel)
- * @see TopiaGeneratorUtil#shouldGenerateOperatorForDAOHelper(ObjectModel)
+ * @see #getGenerateOperatorForDAOHelperTagValue(ObjectModel)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModel.class},
documentation = "To generate EntityOperation on generated DAOHelper")
- String TAG_GENERATE_OPERATOR_FOR_DAO_HELPER = "generateOperatorForDAOHelper";
+ public static final String TAG_GENERATE_OPERATOR_FOR_DAO_HELPER = "generateOperatorForDAOHelper";
/**
* Tag pour spécifier le type d'une propriété dans le mapping hibernate.
*
- * @see TopiaGeneratorUtil#getTypeTagValue(ObjectModelAttribute)
+ * @see #getTypeTagValue(ObjectModelAttribute)
* @since 2.5
* @deprecated since 3.0, use now {@link #TAG_HIBERNATE_ATTRIBUTE_TYPE} which
* permits to deal the same thing but at also model and classifier scope.
@@ -280,17 +277,17 @@
@Deprecated
@TagValueDefinition(target = {ObjectModelAttribute.class},
documentation = "Sets the hibernate type of an attribute (Hibernate mapping)")
- String TAG_TYPE = "type";
+ public static final String TAG_TYPE = "type";
/**
* Tag pour spécifier le type sql d'une propriété dans le mapping hibernate.
*
- * @see TopiaGeneratorUtil#getSqlTypeTagValue(ObjectModelAttribute)
+ * @see #getSqlTypeTagValue(ObjectModelAttribute)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModelAttribute.class},
documentation = "Sets the sql type of an attribute (Hibernate mapping)")
- String TAG_SQL_TYPE = "sqlType";
+ public static final String TAG_SQL_TYPE = "sqlType";
/**
* To specify the abstract dao to use.
@@ -299,38 +296,37 @@
* <p/>
* Other value possible is {@code org.nuiton.topia.persistence.TopiaDAOLegacy}
*
- * @see TopiaGeneratorUtil#getDaoImplementationTagValue(ObjectModel)
+ * @see #getDaoImplementationTagValue(ObjectModel)
* @since 2.5
*/
@TagValueDefinition(target = {ObjectModel.class},
documentation = "Sets the fully qualified name of the DAO implementation to use in generated DAO (default is DAOImpl (base on TopiaQuery))")
- String TAG_DAO_IMPLEMENTATION = "daoImplementation";
+ public static final String TAG_DAO_IMPLEMENTATION = "daoImplementation";
/**
* Stéréotype pour les attributs avec multiplicité nécessitant la création d'un index.
*
- * @see TopiaGeneratorUtil#getIndexForeignKeys(ObjectModelAttribute, ObjectModel)
+ * @see #getIndexForeignKeysTagValue(ObjectModelAttribute, ObjectModel)
* @since 2.6.5
*/
@TagValueDefinition(target = {ObjectModel.class, ObjectModelAttribute.class},
defaultValue = "true",
documentation = "Specifies if an nm-multiplicity attribute (or all nm-multiplicity attributes of a given model) needs an index in db (Hibernate mapping)")
- String TAG_INDEX_FOREIGN_KEYS = "indexForeignKeys";
+ public static final String TAG_INDEX_FOREIGN_KEYS = "indexForeignKeys";
/**
* Tag to specify if we want to add an "id" property in DTO generated by
* {@link EntityDTOTransformer}.
- * <p/>
*
* @see EntityDTOTransformer
- * @see TopiaGeneratorUtil#shouldGenerateDTOTopiaIdTagValue(ObjectModelClassifier, ObjectModel)
+ * @see #shouldGenerateDTOTopiaIdTagValue(ObjectModelClassifier, ObjectModel)
* @since 2.6.7
* @deprecated since 3.0, will be removed at the same time that {@link EntityDTOTransformer}.
*/
@Deprecated
@TagValueDefinition(target = {ObjectModel.class, ObjectModelClassifier.class},
documentation = "Add a \"id\" property with its getter/setter on a DTO.")
- String TAG_GENERATE_TOPIA_ID_IN_DTO = "generateDTOTopiaId";
+ public static final String TAG_GENERATE_TOPIA_ID_IN_DTO = "generateDTOTopiaId";
/**
@@ -341,12 +337,12 @@
* {@link org.nuiton.topia.persistence.internal.AbstractTopiaPersistenceContext}.
*
* @see org.nuiton.topia.persistence.internal.AbstractTopiaPersistenceContext
- * @see TopiaGeneratorUtil#getPersistenceContextSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel)
+ * @see #getPersistenceContextSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel)
* @since 3.0
*/
@TagValueDefinition(target = {ObjectModel.class},
documentation = "Change the super class to use when generating PersistenceContext.")
- String TAG_PERSISTENCE_CONTEXT_SUPER_CLASS = "persistenceContextSuperClass";
+ public static final String TAG_PERSISTENCE_CONTEXT_SUPER_CLASS = "persistenceContextSuperClass";
/**
* Tag to specify a super class to use instead of
@@ -356,12 +352,12 @@
* {@link org.nuiton.topia.persistence.internal.AbstractTopiaApplicationContext}.
*
* @see org.nuiton.topia.persistence.internal.AbstractTopiaApplicationContext
- * @see TopiaGeneratorUtil#getApplicationContextSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel)
+ * @see #getApplicationContextSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModel)
* @since 3.0
*/
@TagValueDefinition(target = {ObjectModel.class},
documentation = "Change the super class to use when generating ApplicationContext.")
- String TAG_APPLICATION_CONTEXT_SUPER_CLASS = "applicationContextSuperClass";
+ public static final String TAG_APPLICATION_CONTEXT_SUPER_CLASS = "applicationContextSuperClass";
/**
* Tag to specify a super class to use instead of {@link org.nuiton.topia.persistence.internal.AbstractTopiaDao}.
@@ -369,12 +365,12 @@
* <strong>Note:</strong> the class must implements {@link org.nuiton.topia.persistence.TopiaDao}.
*
* @see org.nuiton.topia.persistence.internal.AbstractTopiaDao
- * @see TopiaGeneratorUtil#getDaoSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier, org.nuiton.eugene.models.object.ObjectModel)
+ * @see #getDaoSuperClassTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier, org.nuiton.eugene.models.object.ObjectModel)
* @since 3.0
*/
@TagValueDefinition(target = {ObjectModelClassifier.class, ObjectModel.class},
documentation = "Change the super class to use when generating dao.")
- String TAG_DAO_SUPER_CLASS = "daoSuperClass";
+ public static final String TAG_DAO_SUPER_CLASS = "daoSuperClass";
/**
* Tag to specify a super class to use instead of {@link org.nuiton.topia.persistence.internal.AbstractTopiaEntity}.
@@ -382,12 +378,12 @@
* <strong>Note:</strong> the class must implements {@link org.nuiton.topia.persistence.TopiaEntity}.
*
* @see org.nuiton.topia.persistence.TopiaEntity
- * @see TopiaGeneratorUtil#getEntitySuperClassTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier, org.nuiton.eugene.models.object.ObjectModel)
+ * @see #getEntitySuperClassTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier, org.nuiton.eugene.models.object.ObjectModel)
* @since 3.0
*/
@TagValueDefinition(target = {ObjectModelClassifier.class, ObjectModel.class},
documentation = "Change the super class to use when generating Entity.")
- String TAG_ENTITY_SUPER_CLASS = "entitySuperClass";
+ public static final String TAG_ENTITY_SUPER_CLASS = "entitySuperClass";
/**
* Tag to change the type of an attribute in a hibernate mapping.
@@ -406,12 +402,424 @@
* <p/>
* The new way permits us to validate the usage of the tagValue, old way can't.
*
- * @see TopiaGeneratorUtil#getHibernateAttributeType(ObjectModelAttribute, ObjectModelClassifier, ObjectModel)
+ * @see #getHibernateAttributeType(ObjectModelAttribute, ObjectModelClassifier, ObjectModel)
* @since 3.0
*/
@TagValueDefinition(target = {ObjectModelAttribute.class, ObjectModelClassifier.class, ObjectModel.class},
documentation = "Change the super class to use when generating Entity.",
- matcherClass = PrefixTagNameMatchTagValueMatcher.class)
- String TAG_HIBERNATE_ATTRIBUTE_TYPE = "hibernateAttributeType";
+ matcherClass = StartsWithTagNameMatcher.class)
+ public static final String TAG_HIBERNATE_ATTRIBUTE_TYPE = "hibernateAttributeType";
+ /**
+ * Obtain the value of the {@link #TAG_PERSISTENCE_TYPE} tag value on the given classifier.
+ *
+ * @param classifier classifier to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_PERSISTENCE_TYPE
+ * @since 2.5
+ */
+ public static String getPersistenceTypeTagValue(ObjectModelClassifier classifier) {
+ String value = TagValues.findTagValue(TAG_PERSISTENCE_TYPE, classifier);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_INHERITANCE_STRATEGY} tag value on the given classifier.
+ *
+ * @param classifier classifier to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_INHERITANCE_STRATEGY
+ * @since 3.0
+ */
+ public static String getInheritanceStrategyTagValue(ObjectModelClassifier classifier) {
+ String value = TagValues.findTagValue(TAG_INHERITANCE_STRATEGY, classifier);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_DB_NAME} tag value on the given classifier.
+ *
+ * @param element classifier to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_DB_NAME
+ * @since 2.5
+ */
+ public static String getDbNameTagValue(ObjectModelElement element) {
+ String value = TagValues.findTagValue(TAG_DB_NAME, element);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_SCHEMA_NAME} tag value on the given classifier.
+ *
+ * @param classifier classifier to seek
+ * @param model model to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_SCHEMA_NAME
+ * @since 2.5
+ */
+ public static String getDbSchemaNameTagValue(ObjectModelClassifier classifier, ObjectModel model) {
+ String value = TagValues.findTagValue(TAG_SCHEMA_NAME, classifier, model);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_SCHEMA_NAME} tag value on the given attribute.
+ *
+ * @param attribute attribute to seek
+ * @param model model to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_SCHEMA_NAME
+ * @since 2.5
+ */
+ public static String getDbSchemaNameTagValue(ObjectModelAttribute attribute, ObjectModel model) {
+ String value = TagValues.findTagValue(TAG_SCHEMA_NAME, attribute, model);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_LENGTH} tag value on the given attribute.
+ *
+ * @param attribute attribute to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_LENGTH
+ * @since 2.5
+ */
+ public static String getLengthTagValue(ObjectModelAttribute attribute) {
+ String value = TagValues.findTagValue(TAG_LENGTH, attribute);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_ANNOTATION} tag value on the given attribute.
+ *
+ * @param attribute attribute to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_ANNOTATION
+ * @since 2.5
+ */
+ public static String getAnnotationTagValue(ObjectModelAttribute attribute) {
+ String value = TagValues.findTagValue(TAG_ANNOTATION, attribute);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_ACCESS} tag value on the given attribute.
+ *
+ * @param attribute attribute to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_ACCESS
+ * @since 2.5
+ */
+ public static String getAccessTagValue(ObjectModelAttribute attribute) {
+ String value = TagValues.findTagValue(TAG_ACCESS, attribute);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_NATURAL_ID} tag value on the given attribute.
+ *
+ * @param attribute attribute to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_NATURAL_ID
+ * @since 2.5
+ */
+ public static boolean getNaturalIdTagValue(ObjectModelAttribute attribute) {
+ boolean value = TagValues.findBooleanTagValue(TAG_NATURAL_ID, attribute);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_NATURAL_ID_MUTABLE} tag value on the given classifier.
+ *
+ * @param classifier classifier to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_NATURAL_ID_MUTABLE
+ * @since 2.5
+ */
+ public static boolean getNaturalIdMutableTagValue(ObjectModelClassifier classifier) {
+ boolean value = TagValues.findBooleanTagValue(TAG_NATURAL_ID_MUTABLE, classifier);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_CONTEXTABLE} tag value on the given classifier or model.
+ *
+ * @param classifier classifier to seek
+ * @param model model to seek
+ * @return the boolean value of the found tag value or {@code false} if not found nor empty.
+ * @see #TAG_CONTEXTABLE
+ * @since 2.5
+ */
+ public static boolean getContextableTagValue(ObjectModelClassifier classifier, ObjectModel model) {
+ boolean value = TagValues.findBooleanTagValue(TAG_CONTEXTABLE, classifier, model);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_INVERSE} tag value on the given attribute.
+ *
+ * @param attribute attribute to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_INVERSE
+ * @since 2.5
+ */
+ public static String getInverseTagValue(ObjectModelAttribute attribute) {
+ String value = TagValues.findTagValue(TAG_INVERSE, attribute);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_LAZY} tag value on the given attribute.
+ *
+ * @param attribute attribute to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_LAZY
+ * @since 2.5
+ */
+ public static String getLazyTagValue(ObjectModelAttribute attribute) {
+ String value = TagValues.findTagValue(TAG_LAZY, attribute);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_FETCH} tag value on the given attribute.
+ *
+ * @param attribute attribute to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_FETCH
+ * @since 2.5
+ */
+ public static String getFetchTagValue(ObjectModelAttribute attribute) {
+ String value = TagValues.findTagValue(TAG_FETCH, attribute);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_ORDER_BY} tag value on the given attribute.
+ *
+ * @param attribute attribute to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_ORDER_BY
+ * @since 2.5
+ */
+ public static String getOrderByTagValue(ObjectModelAttribute attribute) {
+ String value = TagValues.findTagValue(TAG_ORDER_BY, attribute);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_NOT_NULL} tag value on the given attribute.
+ *
+ * @param attribute attribute to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_NOT_NULL
+ * @since 2.5
+ */
+ public static Boolean getNotNullTagValue(ObjectModelAttribute attribute) {
+ Boolean value = TagValues.findNullableBooleanTagValue(TAG_NOT_NULL, attribute);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_PROXY_INTERFACE} tag value on the given classifier.
+ *
+ * @param classifier classifier to seek
+ * @param model model to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_PROXY_INTERFACE
+ * @since 2.5
+ */
+ public static String getProxyInterfaceTagValue(ObjectModelClassifier classifier, ObjectModel model) {
+ String value = TagValues.findTagValue(TAG_PROXY_INTERFACE, classifier, model);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_NOT_GENERATE_TO_STRING} tag value on the given class.
+ *
+ * @param clazz class to seek
+ * @param model model to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_NOT_GENERATE_TO_STRING
+ * @since 2.5
+ */
+ public static boolean getNotGenerateToStringTagValue(ObjectModelClassifier clazz, ObjectModel model) {
+ boolean value = TagValues.findBooleanTagValue(TAG_NOT_GENERATE_TO_STRING, clazz, model);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_SORT_ATTRIBUTE} tag value on the given classifier.
+ *
+ * @param classifier classifier to seek
+ * @param model model to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_SORT_ATTRIBUTE
+ * @since 2.5
+ */
+ public static boolean getSortAttributeTagValue(ObjectModelClassifier classifier, ObjectModel model) {
+ boolean value = TagValues.findBooleanTagValue(TAG_SORT_ATTRIBUTE, classifier, model);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_HIBERNATE_ATTRIBUTE_TYPE} tag value on the given attribute, classifier or model.
+ *
+ * @param attribute attribute to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_HIBERNATE_ATTRIBUTE_TYPE
+ * @since 3.0
+ */
+
+ public static String getHibernateAttributeType(ObjectModelAttribute attribute, ObjectModelClassifier classifier, ObjectModel model) {
+ String tagValueName = TAG_HIBERNATE_ATTRIBUTE_TYPE + "." + attribute.getType();
+ String value = TagValues.findTagValue(tagValueName, attribute, classifier, model);
+ return value;
+ }
+
+ /**
+ * Obtain the value of the {@link #TAG_SQL_TYPE} tag value on the given attribute.
+ *
+ * @param attribute attribute to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_TYPE
+ * @since 2.5
+ */
+ public static String getSqlTypeTagValue(ObjectModelAttribute attribute) {
+ String value = TagValues.findTagValue(TAG_SQL_TYPE, attribute);
+ return value;
+ }
+
+ /**
+ * Obtains the value of the {@link #TAG_DAO_IMPLEMENTATION} tag value on the given model.
+ *
+ * @param model model to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_DAO_IMPLEMENTATION
+ * @since 2.5
+ */
+ public static String getDaoImplementationTagValue(ObjectModel model) {
+ String value = TagValues.findTagValue(TAG_DAO_IMPLEMENTATION, model);
+ return value;
+ }
+
+ /**
+ * Obtains the value of the tag value {@link #TAG_INDEX_FOREIGN_KEYS} on the model or on the
+ * given attribute.
+ *
+ * @param attribute attribute to test
+ * @param model model to test
+ * @return none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_INDEX_FOREIGN_KEYS
+ * @since 2.6.5
+ */
+ public static String getIndexForeignKeysTagValue(ObjectModelAttribute attribute, ObjectModel model) {
+ String value = TagValues.findTagValue(TAG_INDEX_FOREIGN_KEYS, attribute, model);
+ return value;
+ }
+
+ //TODO Javadoc
+ public static boolean hasUseEnumerationNameTagValue(ObjectModelAttribute attr, ObjectModelClassifier classifier, ObjectModel model) {
+ boolean value = TagValues.findBooleanTagValue(TAG_USE_ENUMERATION_NAME, attr, classifier, model);
+ return value;
+ }
+
+ /**
+ * Search if the TagValue {@link #TAG_GENERATE_TOPIA_ID_IN_DTO} has been activated in the model.
+ *
+ * @param classifier classifier to seek
+ * @param model model to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_GENERATE_TOPIA_ID_IN_DTO
+ * @since 2.6.7
+ */
+ public static boolean shouldGenerateDTOTopiaIdTagValue(ObjectModelClassifier classifier, ObjectModel model) {
+ boolean value = TagValues.findBooleanTagValue(TAG_GENERATE_TOPIA_ID_IN_DTO, classifier, model);
+ return value;
+ }
+
+ /**
+ * Obtains the value of the {@link #TAG_PERSISTENCE_CONTEXT_SUPER_CLASS} tag value on the model.
+ *
+ * @param model model to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_PERSISTENCE_CONTEXT_SUPER_CLASS
+ * @since 3.0
+ */
+ public static String getPersistenceContextSuperClassTagValue(ObjectModel model) {
+ String value = TagValues.findTagValue(TAG_PERSISTENCE_CONTEXT_SUPER_CLASS, model);
+ return value;
+ }
+
+ /**
+ * Obtains the value of the {@link #TAG_APPLICATION_CONTEXT_SUPER_CLASS} tag value on the model.
+ *
+ * @param model model to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_APPLICATION_CONTEXT_SUPER_CLASS
+ * @since 3.0
+ */
+ public static String getApplicationContextSuperClassTagValue(ObjectModel model) {
+ String value = TagValues.findTagValue(TAG_APPLICATION_CONTEXT_SUPER_CLASS, model);
+ return value;
+ }
+
+ /**
+ * Obtains the value of the {@link #TAG_DAO_SUPER_CLASS} tag value on the given classifier or on the model.
+ *
+ * @param model model to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_DAO_SUPER_CLASS
+ * @since 3.0
+ */
+ public static String getDaoSuperClassTagValue(ObjectModelClassifier classifier, ObjectModel model) {
+ String value = TagValues.findTagValue(TAG_DAO_SUPER_CLASS, classifier, model);
+ return value;
+ }
+
+ /**
+ * Obtains the value of the {@link #TAG_ENTITY_SUPER_CLASS} tag value on the given classifier or on the model.
+ *
+ * @param model model to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_ENTITY_SUPER_CLASS
+ * @since 3.0
+ */
+ public static String getEntitySuperClassTagValue(ObjectModelClassifier classifier, ObjectModel model) {
+ String value = TagValues.findTagValue(TAG_ENTITY_SUPER_CLASS, classifier, model);
+ return value;
+ }
+
+ /**
+ * Cherche si le tagvalue {@link #TAG_GENERATE_OPERATOR_FOR_DAO_HELPER} a été activé dans le model.
+ *
+ * @param model le modele utilisé
+ * @return {@code true} si le tag value trouvé dans le modèle, {@code false}
+ * sinon.
+ * @since 2.5
+ */
+ public static boolean getGenerateOperatorForDAOHelperTagValue(ObjectModel model) {
+ boolean value = TagValues.findBooleanTagValue(TAG_GENERATE_OPERATOR_FOR_DAO_HELPER, model);
+ return value;
+ }
+
+ //---------------------------------------------------------------------------------------------------------------
+ //-- DEPRECATED API TO REMOVE ---------------------------------------------------------------------------------
+ //---------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Obtain the value of the {@link #TAG_TYPE} tag value on the given attribute.
+ *
+ * @param attribute attribute to seek
+ * @return the none empty value of the found tag value or {@code null} if not found nor empty.
+ * @see #TAG_TYPE
+ * @since 2.5
+ * @deprecated since 3.0, use now {@link #getHibernateAttributeType(ObjectModelAttribute, ObjectModelClassifier, ObjectModel)}
+ */
+ @Deprecated
+ public static String getTypeTagValue(ObjectModelAttribute attribute) {
+ String value = TagValues.findTagValue(TAG_TYPE, attribute);
+ return value;
+ }
}
Deleted: trunk/topia-templates/src/main/resources/META-INF/services/org.nuiton.eugene.metas.ModelPropertiesProvider
===================================================================
--- trunk/topia-templates/src/main/resources/META-INF/services/org.nuiton.eugene.metas.ModelPropertiesProvider 2014-04-27 06:22:24 UTC (rev 3085)
+++ trunk/topia-templates/src/main/resources/META-INF/services/org.nuiton.eugene.metas.ModelPropertiesProvider 2014-04-27 13:36:11 UTC (rev 3086)
@@ -1 +0,0 @@
-org.nuiton.topia.templates.TopiaModelPropertiesProvider
\ No newline at end of file
Added: trunk/topia-templates/src/main/resources/META-INF/services/org.nuiton.eugene.models.stereotype.StereotypeDefinitionProvider
===================================================================
--- trunk/topia-templates/src/main/resources/META-INF/services/org.nuiton.eugene.models.stereotype.StereotypeDefinitionProvider (rev 0)
+++ trunk/topia-templates/src/main/resources/META-INF/services/org.nuiton.eugene.models.stereotype.StereotypeDefinitionProvider 2014-04-27 13:36:11 UTC (rev 3086)
@@ -0,0 +1 @@
+org.nuiton.topia.templates.TopiaStereoTypes
\ No newline at end of file
Added: trunk/topia-templates/src/main/resources/META-INF/services/org.nuiton.eugene.models.tagvalue.TagValueDefinitionProvider
===================================================================
--- trunk/topia-templates/src/main/resources/META-INF/services/org.nuiton.eugene.models.tagvalue.TagValueDefinitionProvider (rev 0)
+++ trunk/topia-templates/src/main/resources/META-INF/services/org.nuiton.eugene.models.tagvalue.TagValueDefinitionProvider 2014-04-27 13:36:11 UTC (rev 3086)
@@ -0,0 +1 @@
+org.nuiton.topia.templates.TopiaTagValues
\ No newline at end of file
Deleted: trunk/topia-templates/src/test/java/org/nuiton/topia/templates/TopiaModelPropertiesProviderTest.java
===================================================================
--- trunk/topia-templates/src/test/java/org/nuiton/topia/templates/TopiaModelPropertiesProviderTest.java 2014-04-27 06:22:24 UTC (rev 3085)
+++ trunk/topia-templates/src/test/java/org/nuiton/topia/templates/TopiaModelPropertiesProviderTest.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -1,80 +0,0 @@
-package org.nuiton.topia.templates;
-
-/*
- * #%L
- * ToPIA :: Templates
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2004 - 2014 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.nuiton.eugene.metas.ModelPropertiesProvider;
-import org.nuiton.eugene.models.object.ObjectModelClassifier;
-import org.nuiton.eugene.models.object.ObjectModelOperation;
-
-/**
- * To test {@link TopiaModelPropertiesProvider}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 2.3
- */
-public class TopiaModelPropertiesProviderTest {
-
- protected ModelPropertiesProvider provider;
-
- @Before
- public void setUp() throws Exception {
- provider = new TopiaModelPropertiesProvider();
- provider.init();
- }
-
- @Test
- public void testGetTagValueTarget() throws Exception {
- testTagValue(TopiaTagValues.TAG_PERSISTENCE_TYPE, ObjectModelClassifier.class);
- //TODO Finish with other tag values...
- }
-
- @Test
- public void testGetStereotypeTarget() throws Exception {
-
- testStereotype(TopiaStereoTypes.STEREOTYPE_DAO, ObjectModelClassifier.class, ObjectModelOperation.class);
- //TODO Finish with other stereotypes...
- }
-
- @Test
- public void testGetStore() throws Exception {
- }
-
- protected void testStereotype(String name, Class<?>... expected) {
- Class<?>[] classes = provider.getStereotypeTarget(name);
- Assert.assertNotNull("Could not find target for " + name, classes);
- Assert.assertEquals("Should have " + expected.length + " targets for " + name + " but had " + classes.length, classes.length, expected.length);
- Assert.assertArrayEquals(expected, classes);
- }
-
- protected void testTagValue(String name, Class<?>... expected) {
- Class<?>[] classes = provider.getTagValueTarget(name);
- Assert.assertNotNull("Could not find target for " + name, classes);
- Assert.assertEquals("Should have " + expected.length + " targets for " + name + " but had " + classes.length, classes.length, expected.length);
- Assert.assertArrayEquals(expected, classes);
- }
-}
Added: trunk/topia-templates/src/test/java/org/nuiton/topia/templates/TopiaStereoTypesTest.java
===================================================================
--- trunk/topia-templates/src/test/java/org/nuiton/topia/templates/TopiaStereoTypesTest.java (rev 0)
+++ trunk/topia-templates/src/test/java/org/nuiton/topia/templates/TopiaStereoTypesTest.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -0,0 +1,32 @@
+package org.nuiton.topia.templates;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.nuiton.eugene.models.stereotype.MismatchStereotypeTargetException;
+import org.nuiton.eugene.models.stereotype.StereotypeNotFoundException;
+
+public class TopiaStereoTypesTest {
+
+ protected TopiaStereoTypes provider;
+
+ @Before
+ public void setUp() throws Exception {
+ provider = new TopiaStereoTypes();
+ provider.init();
+ }
+
+
+ protected void validate(String name, boolean expected, Class<?>... types) {
+ for (Class<?> type : types) {
+ try {
+ provider.validate(name, type);
+ Assert.assertTrue(expected);
+ } catch (StereotypeNotFoundException e) {
+ Assert.assertFalse(expected);
+ } catch (MismatchStereotypeTargetException e) {
+ Assert.assertFalse(expected);
+ }
+ }
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/topia-templates/src/test/java/org/nuiton/topia/templates/TopiaStereoTypesTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/topia-templates/src/test/java/org/nuiton/topia/templates/TopiaTagValuesTest.java
===================================================================
--- trunk/topia-templates/src/test/java/org/nuiton/topia/templates/TopiaTagValuesTest.java (rev 0)
+++ trunk/topia-templates/src/test/java/org/nuiton/topia/templates/TopiaTagValuesTest.java 2014-04-27 13:36:11 UTC (rev 3086)
@@ -0,0 +1,32 @@
+package org.nuiton.topia.templates;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.nuiton.eugene.models.tagvalue.MismatchTagValueTargetException;
+import org.nuiton.eugene.models.tagvalue.TagValueNotFoundException;
+
+public class TopiaTagValuesTest {
+
+ protected TopiaTagValues provider;
+
+ @Before
+ public void setUp() throws Exception {
+ provider = new TopiaTagValues();
+ provider.init();
+ }
+
+
+ protected void validate(String name, boolean expected, Class<?>... types) {
+ for (Class<?> type : types) {
+ try {
+ provider.validate(name, type);
+ Assert.assertTrue(expected);
+ } catch (TagValueNotFoundException e) {
+ Assert.assertFalse(expected);
+ } catch (MismatchTagValueTargetException e) {
+ Assert.assertFalse(expected);
+ }
+ }
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/topia-templates/src/test/java/org/nuiton/topia/templates/TopiaTagValuesTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
1
0
Build failed in Jenkins: topia-nightly » ToPIA :: IT #26
by admin+ci-nuiton.org@codelutin.com 27 Apr '14
by admin+ci-nuiton.org@codelutin.com 27 Apr '14
27 Apr '14
See <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/26/>
------------------------------------------
[...truncated 943 lines...]
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.topiatest.BillImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.topiatest.ExtraDAOEntityImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.UnionSubclass(org.nuiton.topia.it.legacy.topiatest.GeneralizedNaturalizedEntityImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.topiatest.deletetest.Party2Impl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.topiatest.CompanyImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.topiatest.AddressImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.UnionSubclass(org.nuiton.topia.it.legacy.topiatest.PersonneImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.topiatest.QueriedEntityImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.test.entities.PetImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.topiatest.DepartmentImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.test.ano1882.FrenchCompanyImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.topiatest.StoreImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.topiatest.ProductImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.topiatest.TypeImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.test.ano1882.SIRENImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.topiatest.NaturalizedEntityImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.UnionSubclass(org.nuiton.topia.it.legacy.topiatest.EmployeImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.test.entities.RaceImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.topiatest.deletetest.Contact2Impl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.test.entities.PersonImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.RootClass(org.nuiton.topia.it.legacy.test.ano1882.SIRETImpl)
INFO [main] (TopiaUtil.java:262) isSchemaExist - available mapping org.hibernate.mapping.UnionSubclass(org.nuiton.topia.it.legacy.topiatest.deletetest.Telephone2Impl)
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.748 sec - in org.nuiton.topia.it.legacy.framework.TopiaUtilTest
Running org.nuiton.topia.it.legacy.framework.EntityStateTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in org.nuiton.topia.it.legacy.framework.EntityStateTest
Running org.nuiton.topia.it.legacy.framework.TopiaContextReplicateTest
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.53 sec - in org.nuiton.topia.it.legacy.framework.TopiaContextReplicateTest
Running org.nuiton.topia.it.legacy.generator.TopiaTestCase
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.259 sec - in org.nuiton.topia.it.legacy.generator.TopiaTestCase
Running org.nuiton.topia.it.legacy.TopiaJpaSupportTest
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.319 sec - in org.nuiton.topia.it.legacy.TopiaJpaSupportTest
Running org.nuiton.topia.it.legacy.test.ano1882.DAOAbstractTransformerTest
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.249 sec - in org.nuiton.topia.it.legacy.test.ano1882.DAOAbstractTransformerTest
Running org.nuiton.topia.it.legacy.persistence.EntityVisitorExportXmlTest
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
INFO [main] (EntityVisitorExportXmlTest.java:125) testExportXMLDepth - Export XML =
<org.nuiton.topia.it.legacy.topiatest.CompanyImpl topiaId="org.nuiton.topia.it.legacy.topiatest.Company_43ca2ef0-d004-410c-8454-fd76f3af5bba" topiaCreateDate="2014-04-27 00:47:34.277" topiaVersion="1">
<java.lang.String>CodeLutin</java.lang.String>
<int>0</int>
<org.nuiton.topia.it.legacy.topiatest.DepartmentImpl topiaId="org.nuiton.topia.it.legacy.topiatest.Department_eb529d94-2ee1-438f-b01e-e918217fa6e1" topiaCreateDate="2014-04-27 00:47:34.283" topiaVersion="1">
<java.lang.String>Commercial</java.lang.String>
<org.nuiton.topia.it.legacy.topiatest.EmployeImpl topiaId="org.nuiton.topia.it.legacy.topiatest.Employe_94e0dcb3-374c-4e56-84e1-360c1da14ff3" topiaCreateDate="2014-04-27 00:47:34.281" topiaVersion="1">
<int>30000</int>
</org.nuiton.topia.it.legacy.topiatest.EmployeImpl>
</org.nuiton.topia.it.legacy.topiatest.DepartmentImpl>
<org.nuiton.topia.it.legacy.topiatest.DepartmentImpl topiaId="org.nuiton.topia.it.legacy.topiatest.Department_e8344ced-4d9f-4fda-9b6d-59dfc10b4876" topiaCreateDate="2014-04-27 00:47:34.285" topiaVersion="1">
<java.lang.String>Dev</java.lang.String>
<org.nuiton.topia.it.legacy.topiatest.EmployeImpl topiaId="org.nuiton.topia.it.legacy.topiatest.Employe_20b0a3db-3456-4368-a246-bd7a1efe02dc" topiaCreateDate="2014-04-27 00:47:34.283" topiaVersion="1">
<int>29000</int>
</org.nuiton.topia.it.legacy.topiatest.EmployeImpl>
</org.nuiton.topia.it.legacy.topiatest.DepartmentImpl>
</org.nuiton.topia.it.legacy.topiatest.CompanyImpl>
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.259 sec - in org.nuiton.topia.it.legacy.persistence.EntityVisitorExportXmlTest
Running org.nuiton.topia.it.legacy.persistence.util.CollectorTest
INFO [main] (CollectorTest.java:83) onStarted - ( 1) >> [org.nuiton.topia.it.legacy.topiatest.CompanyImpl@1b8dde4f[name=<null>,siret=0,employe=<null>]]
INFO [main] (CollectorTest.java:92) onEnded - ( 1) << []
INFO [main] (CollectorTest.java:83) onStarted - ( 1) >> [org.nuiton.topia.it.legacy.topiatest.CompanyImpl@1b8dde4f[name=<null>,siret=0,employe=[org.nuiton.topia.it.legacy.topiatest.EmployeImpl@7efe22aa[salary=0]]]]
INFO [main] (CollectorTest.java:83) onStarted - ( 2) >> [org.nuiton.topia.it.legacy.topiatest.CompanyImpl@1b8dde4f[name=<null>,siret=0,employe=[org.nuiton.topia.it.legacy.topiatest.EmployeImpl@7efe22aa[salary=0]]], org.nuiton.topia.it.legacy.topiatest.EmployeImpl@7efe22aa[salary=0]]
INFO [main] (CollectorTest.java:92) onEnded - ( 2) << [org.nuiton.topia.it.legacy.topiatest.CompanyImpl@1b8dde4f[name=<null>,siret=0,employe=[org.nuiton.topia.it.legacy.topiatest.EmployeImpl@7efe22aa[salary=0]]]]
INFO [main] (CollectorTest.java:92) onEnded - ( 1) << []
INFO [main] (CollectorTest.java:83) onStarted - ( 1) >> [org.nuiton.topia.it.legacy.topiatest.CompanyImpl@1b8dde4f[name=<null>,siret=0,employe=[org.nuiton.topia.it.legacy.topiatest.EmployeImpl@7efe22aa[salary=0]]]]
INFO [main] (CollectorTest.java:83) onStarted - ( 2) >> [org.nuiton.topia.it.legacy.topiatest.CompanyImpl@1b8dde4f[name=<null>,siret=0,employe=[org.nuiton.topia.it.legacy.topiatest.EmployeImpl@7efe22aa[salary=0]]], org.nuiton.topia.it.legacy.topiatest.EmployeImpl@7efe22aa[salary=0]]
INFO [main] (CollectorTest.java:92) onEnded - ( 2) << [org.nuiton.topia.it.legacy.topiatest.CompanyImpl@1b8dde4f[name=<null>,siret=0,employe=[org.nuiton.topia.it.legacy.topiatest.EmployeImpl@7efe22aa[salary=0]]]]
INFO [main] (CollectorTest.java:83) onStarted - ( 2) >> [org.nuiton.topia.it.legacy.topiatest.CompanyImpl@1b8dde4f[name=<null>,siret=0,employe=[org.nuiton.topia.it.legacy.topiatest.EmployeImpl@7efe22aa[salary=0]]], org.nuiton.topia.it.legacy.topiatest.DepartmentImpl@5e960808[name=<null>,leader=<null>,product=<null>]]
INFO [main] (CollectorTest.java:92) onEnded - ( 2) << [org.nuiton.topia.it.legacy.topiatest.CompanyImpl@1b8dde4f[name=<null>,siret=0,employe=[org.nuiton.topia.it.legacy.topiatest.EmployeImpl@7efe22aa[salary=0]]]]
INFO [main] (CollectorTest.java:92) onEnded - ( 1) << []
INFO [main] (CollectorTest.java:83) onStarted - ( 1) >> [org.nuiton.topia.it.legacy.topiatest.CompanyImpl@1b8dde4f[name=<null>,siret=0,employe=[]]]
INFO [main] (CollectorTest.java:83) onStarted - ( 2) >> [org.nuiton.topia.it.legacy.topiatest.CompanyImpl@1b8dde4f[name=<null>,siret=0,employe=[]], org.nuiton.topia.it.legacy.topiatest.DepartmentImpl@5e960808[name=<null>,leader=<null>,product=<null>]]
INFO [main] (CollectorTest.java:92) onEnded - ( 2) << [org.nuiton.topia.it.legacy.topiatest.CompanyImpl@1b8dde4f[name=<null>,siret=0,employe=[]]]
INFO [main] (CollectorTest.java:92) onEnded - ( 1) << []
INFO [main] (CollectorTest.java:83) onStarted - ( 1) >> [org.nuiton.topia.it.legacy.topiatest.CompanyImpl@1b8dde4f[name=<null>,siret=0,employe=[]]]
INFO [main] (CollectorTest.java:92) onEnded - ( 1) << []
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec - in org.nuiton.topia.it.legacy.persistence.util.CollectorTest
Running org.nuiton.topia.it.legacy.persistence.util.TopiaEntityRefTesterTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 sec - in org.nuiton.topia.it.legacy.persistence.util.TopiaEntityRefTesterTest
Running org.nuiton.topia.it.legacy.persistence.util.TopiaEntityHelperTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec - in org.nuiton.topia.it.legacy.persistence.util.TopiaEntityHelperTest
Running org.nuiton.topia.it.legacy.persistence.util.TopiaEntityBinderTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec - in org.nuiton.topia.it.legacy.persistence.util.TopiaEntityBinderTest
Running org.nuiton.topia.it.legacy.persistence.util.EntityOperatorTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec - in org.nuiton.topia.it.legacy.persistence.util.EntityOperatorTest
Running org.nuiton.topia.it.legacy.persistence.NaturalIdTest
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.409 sec - in org.nuiton.topia.it.legacy.persistence.NaturalIdTest
Running org.nuiton.topia.it.legacy.topiatest.deletetest.DeleteEntityTest
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.766 sec - in org.nuiton.topia.it.legacy.topiatest.deletetest.DeleteEntityTest
Running org.nuiton.topia.it.legacy.topiatest.CascadeSaveTest
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.249 sec - in org.nuiton.topia.it.legacy.topiatest.CascadeSaveTest
Running org.nuiton.topia.it.legacy.topiatest.EnumTest
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.25 sec - in org.nuiton.topia.it.legacy.topiatest.EnumTest
Running org.nuiton.topia.it.legacy.TopiaApplicationContextCacheTest
INFO [main] (TopiaApplicationContextCacheTest.java:139) testGetContextByProperties - test 0 : add null properties
INFO [main] (TopiaApplicationContextCacheTest.java:146) testGetContextByProperties - test 1 : add new properties, will instantiate a new TopiaContext
INFO [main] (TopiaApplicationContextCacheTest.java:152) testGetContextByProperties - test 2 : with same properties, will retrieve existing TopiaContext
INFO [main] (TopiaApplicationContextCacheTest.java:158) testGetContextByProperties - test 3 : use other properties, will instantiate a differentTopiaContext
INFO [main] (TopiaApplicationContextCacheTest.java:167) testGetContextByProperties - test 4 : use other properties but equivalent to existing TopiaContext
INFO [main] (TopiaApplicationContextCacheTest.java:174) testGetContextByProperties - test5a : reinstantiate new TopiaContext after one is closed.
INFO [main] (TopiaApplicationContextCacheTest.java:196) testGetContextByProperties - test5b : beginTransaction to properly close the context
WARN [main] (DriverManagerConnectionProviderImpl.java:93) configure - HHH000402: Using Hibernate built-in connection pool (not for production use!)
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.65 sec - in org.nuiton.topia.it.legacy.TopiaApplicationContextCacheTest
Results :
Tests run: 107, Failures: 0, Errors: 0, Skipped: 2
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ topia-it ---
[INFO] Building jar: <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO]
[INFO] >>> maven-source-plugin:2.2.1:jar (attach-sources) @ topia-it >>>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ topia-it ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:check-auto-container (check-central-safe) @ topia-it ---
[INFO] Will use repository http://repo1.maven.org/maven2/
[INFO] Will use repository http://maven.nuiton.org/central-releases
[WARNING] Skip SNAPSHOT dependency : org.nuiton.eugene:eugene-maven-plugin:2.9-SNAPSHOT
[INFO] Skipping goal (runOnce flag is on and goal was already executed).
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ topia-it ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-redmine-login) @ topia-it ---
[INFO] Skipping goal (runOnce flag is on and goal was already executed).
[INFO]
[INFO] --- eugene-maven-plugin:2.9-SNAPSHOT:generate (generate-objectmodel) @ topia-it ---
[INFO] Process phase [zargo]
[INFO] No file generated.
[INFO] Process phase [xmi]
[INFO] No file generated.
[INFO] Skip phase [model] as required in skipInputs configuration.
[INFO] Process phase [generator]
[INFO] No file generated.
[INFO]
[INFO] --- eugene-maven-plugin:2.9-SNAPSHOT:generate (Model Generator (topia-it-legacy)) @ topia-it ---
[INFO] Process phase [model]
WARN [pool-1-thread-1 for channel] (AbstractObjectModelReader.java:319) loadModelTagValue - Deprecated tagValue usage [model.tagvalue.generateDTOTopiaId] : true
[INFO] No file generated.
[INFO] Process phase [generator]
[INFO] Apply generator JavaInterfaceTransformer
[INFO] Apply generator JavaBeanTransformer
[INFO] Apply generator JavaEnumerationTransformer
[INFO] Apply generator TopiaMetaTransformer
WARN [pool-1-thread-1 for channel] (TopiaMetaTransformer.java:110) validateModel - [VALIDATION] [org.nuiton.topia.it.legacy.topiatest.beangen.Voiture#proprietaire] Cet attribut n'a pas d'inverse.
WARN [pool-1-thread-1 for channel] (EntityDaoTransformer.java:1069) getDaoOperations - Dao contract in model will not be supported in topia 3.0
WARN [pool-1-thread-1 for channel] (EntityDaoTransformer.java:1069) getDaoOperations - Dao contract in model will not be supported in topia 3.0
[INFO] Apply generator BinderHelperTransformer
[INFO] Generate 165 files in 151.804ms.
[INFO]
[INFO] --- eugene-maven-plugin:2.9-SNAPSHOT:generate (Model Generator (topia-it-mapping)) @ topia-it ---
[INFO] Process phase [model]
[INFO] No file generated.
[INFO] Process phase [generator]
[INFO] Apply generator JavaInterfaceTransformer
[INFO] Apply generator JavaBeanTransformer
[INFO] Apply generator JavaEnumerationTransformer
[INFO] Apply generator TopiaMetaTransformer
[INFO] Apply generator BinderHelperTransformer
[INFO] Generate 515 files in 368.913ms.
[WARNING] Failed to getClass for org.apache.maven.plugin.source.SourceJarMojo
[INFO]
[INFO] <<< maven-source-plugin:2.2.1:jar (attach-sources) @ topia-it <<<
[INFO]
[INFO] --- maven-source-plugin:2.2.1:jar (attach-sources) @ topia-it ---
[INFO] Building jar: <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO]
[INFO] --- maven-javadoc-plugin:2.9.1:jar (attach-javadocs) @ topia-it ---
[INFO] Building jar: <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO]
[INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ topia-it ---
[INFO]
[INFO] --- maven-invoker-plugin:1.8:install (integration-test) @ topia-it ---
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/pom.xml to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/target/topia-3.0-SNAPSHOT-site_fr.xml to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/target/topia-3.0-SNAPSHOT.pom.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/target/topia-3.0-SNAPSHOT-site_fr.xml.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-persistence/pom.xml to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-persistence/target/topia-persistence-3.0-SNAPSHOT.jar to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-persistence/pom.xml to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-persistence/src/license/THIRD-PARTY.properties to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-persistence/target/topia-persistence-3.0-SNAPSHOT-sources.jar to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-persistence/target/topia-persistence-3.0-SNAPSHOT-javadoc.jar to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-persistence/target/topia-persistence-3.0-SNAPSHOT.jar.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-persistence/target/topia-persistence-3.0-SNAPSHOT.pom.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-persistence/target/gpg/src/license/THIRD-PARTY.properties.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-persistence/target/topia-persistence-3.0-SNAPSHOT-sources.jar.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-persistence/target/topia-persistence-3.0-SNAPSHOT-javadoc.jar.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-junit/pom.xml to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-junit/target/topia-junit-3.0-SNAPSHOT.jar to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-junit/pom.xml to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-junit/src/license/THIRD-PARTY.properties to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-junit/target/topia-junit-3.0-SNAPSHOT-sources.jar to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-junit/target/topia-junit-3.0-SNAPSHOT-javadoc.jar to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-junit/target/topia-junit-3.0-SNAPSHOT.jar.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-junit/target/topia-junit-3.0-SNAPSHOT.pom.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-junit/target/gpg/src/license/THIRD-PARTY.properties.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-junit/target/topia-junit-3.0-SNAPSHOT-sources.jar.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-junit/target/topia-junit-3.0-SNAPSHOT-javadoc.jar.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-templates/pom.xml to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-templates/target/topia-templates-3.0-SNAPSHOT.jar to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-templates/pom.xml to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-templates/src/license/THIRD-PARTY.properties to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-templates/target/topia-templates-3.0-SNAPSHOT-sources.jar to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-templates/target/topia-templates-3.0-SNAPSHOT-javadoc.jar to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-templates/target/topia-templates-3.0-SNAPSHOT.jar.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-templates/target/topia-templates-3.0-SNAPSHOT.pom.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-templates/target/gpg/src/license/THIRD-PARTY.properties.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-templates/target/topia-templates-3.0-SNAPSHOT-sources.jar.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing /var/local/forge/data/nuiton.org/jenkins/workspace/topia-nightly/trunk/topia-templates/target/topia-templates-3.0-SNAPSHOT-javadoc.jar.asc to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…> to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…> to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…> to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…> to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO] Installing <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…> to <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…>
[INFO]
[INFO] --- maven-invoker-plugin:1.8:run (integration-test) @ topia-it ---
[INFO] Building: ANOMALIE-1640/pom.xml
[INFO] ..FAILED (4.3 s)
[INFO] The build exited with code 1. See <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton.topia$topia-it/ws…> for details.
[INFO] -------------------------------------------------
[INFO] Build Summary:
[INFO] Passed: 0, Failed: 1, Errors: 0, Skipped: 0
[INFO] -------------------------------------------------
[ERROR] The following builds failed:
[ERROR] * ANOMALIE-1640/pom.xml
[INFO] -------------------------------------------------
[JENKINS] Archiving disabled
1
2
Author: tchemit
Date: 2014-04-27 08:22:24 +0200 (Sun, 27 Apr 2014)
New Revision: 3085
Url: http://forge.nuiton.org/projects/topia/repository/revisions/3085
Log:
reuse project version properties in it to avoid some linkage errors
Modified:
trunk/topia-it/src/it/ANOMALIE-1640/pom.xml
Modified: trunk/topia-it/src/it/ANOMALIE-1640/pom.xml
===================================================================
--- trunk/topia-it/src/it/ANOMALIE-1640/pom.xml 2014-04-26 19:17:33 UTC (rev 3084)
+++ trunk/topia-it/src/it/ANOMALIE-1640/pom.xml 2014-04-27 06:22:24 UTC (rev 3085)
@@ -38,10 +38,10 @@
<url>http://nuiton.org/issues/1640</url>
<properties>
- <eugeneVersion>2.7.3</eugeneVersion>
- <hibernateVersion>4.2.7.SP1</hibernateVersion>
- <slf4jVersion>1.7.5</slf4jVersion>
- <h2Version>1.3.172</h2Version>
+ <eugeneVersion>@eugeneVersion@</eugeneVersion>
+ <hibernateVersion>@hibernateVersion@</hibernateVersion>
+ <slf4jVersion>@sl4jVersion@</slf4jVersion>
+ <h2Version>@h2Version@</h2Version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
1
0
26 Apr '14
See <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton$topia/25/>
------------------------------------------
<===[JENKINS REMOTING CAPACITY]===> channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton$topia/ws/pom.xml> -s /var/local/forge/data/nuiton.org/maven/settings.xml -e -U clean install -DperformRelease
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] ToPIA
[INFO] ToPIA :: Persistence
[INFO] ToPIA :: JUnit
[INFO] ToPIA :: Templates
[INFO] ToPIA :: IT
[INFO] ToPIA :: Service Replication
[INFO] ToPIA :: Service Migration
[INFO] ToPIA :: Service Csv
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ToPIA 3.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ topia ---
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton$topia/ws/target>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ topia ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:check-auto-container (check-central-safe) @ topia ---
[INFO] Will use repository http://repo1.maven.org/maven2/
[INFO] Will use repository http://maven.nuiton.org/central-releases
[INFO] 14 dependencies to check.
[INFO] 14 artifact(s) resolved by repository http://repo1.maven.org/maven2/ in 2.364s
[INFO] All dependencies are safe.
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ topia ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-redmine-login) @ topia ---
[INFO] Exporting server [redmine-forge.nuiton.org] privateKey in ${redmine.apiKey}
[INFO]
[INFO] --- license-maven-plugin:1.6:update-project-license (attach-licenses) @ topia ---
[INFO]
[INFO] --- license-maven-plugin:1.6:add-third-party (attach-licenses) @ topia ---
[WARNING] The goal is skip due to packaging 'pom'
[INFO]
[INFO] --- license-maven-plugin:1.6:update-file-header (update-file-header) @ topia ---
[WARNING] The extension xsl is already accepted for comment style xml
[INFO] Will search files to update from root <http://ci.nuiton.org/jenkins/job/topia-nightly/org.nuiton$topia/ws/src>
[INFO] Scan 19 files header done in 96.737ms.
[INFO] All files are up-to-date.
[INFO]
[INFO] --- animal-sniffer-maven-plugin:1.10:check (default) @ topia ---
[INFO] Checking unresolved references to org.codehaus.mojo.signature:java16:1.1
[INFO]
[INFO] --- jredmine-maven-plugin:1.8.1:generate-changes (jredmine-generate-changes) @ topia ---
[INFO] release project ToPIA
[INFO] release version 3.0
[INFO] release date Sat Apr 26 00:47:22 CEST 2014
[INFO] release user CI Release Manager
[ERROR] (RedmineClient:491) - Error = <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>503 Service Temporarily Unavailable</title>
</head><body>
<h1>Service Temporarily Unavailable</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
<hr>
<address>Apache/2.2.16 (Debian) Server at forge.nuiton.org Port 80</address>
</body></html>
[JENKINS] Archiving disabled
1
1