Build failed in Jenkins: cayenne-master » h2,JDK 1.8 (latest),ubuntu #713

2017-08-24 Thread Apache Jenkins Server
See 


Changes:

[stariy95] CAY-2355 Project compatibility module can't handle standalone data 
maps 

--
[...truncated 9.38 MB...]
[INFO] --- maven-checkstyle-plugin:2.17:check (default) @ cayenne-dbcp2 ---
[INFO] 
[INFO] >>> maven-pmd-plugin:3.8:check (default) > :pmd @ cayenne-dbcp2 >>>
[INFO] 
[INFO] --- maven-pmd-plugin:3.8:pmd (pmd) @ cayenne-dbcp2 ---
[INFO] 
[INFO] <<< maven-pmd-plugin:3.8:check (default) < :pmd @ cayenne-dbcp2 <<<
[INFO] 
[INFO] 
[INFO] --- maven-pmd-plugin:3.8:check (default) @ cayenne-dbcp2 ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ cayenne-dbcp2 
---
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ 
cayenne-dbcp2 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 

[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ 
cayenne-dbcp2 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to 

[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ 
cayenne-dbcp2 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ 
cayenne-dbcp2 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to 

[INFO] 
[INFO] --- maven-surefire-plugin:2.20:test (default-test) @ cayenne-dbcp2 ---
[INFO] Surefire report directory: 

[WARNING] The system property cayenneTestConnection is configured twice! The 
property appears in  and any of , 
 or user property.
[INFO] 
[INFO] ---
[INFO]  T E S T S
[INFO] ---
[INFO] Running 
org.apache.cayenne.configuration.server.DBCP2DataSourceFactoryTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.106 s 
- in org.apache.cayenne.configuration.server.DBCP2DataSourceFactoryTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ cayenne-dbcp2 ---
[INFO] Building jar: 

[INFO] 
[INFO] >>> maven-source-plugin:3.0.1:jar (bundle-source-jar) > generate-sources 
@ cayenne-dbcp2 >>>
[INFO] 
[INFO] <<< maven-source-plugin:3.0.1:jar (bundle-source-jar) < generate-sources 
@ cayenne-dbcp2 <<<
[INFO] 
[INFO] 
[INFO] --- maven-source-plugin:3.0.1:jar (bundle-source-jar) @ cayenne-dbcp2 ---
[INFO] Building jar: 

[INFO] 
[INFO] --- maven-failsafe-plugin:2.20:integration-test (integration-test) @ 
cayenne-dbcp2 ---
[INFO] 
[INFO] --- maven-failsafe-plugin:2.20:verify (integration-test) @ cayenne-dbcp2 
---
[INFO] Failsafe report directory: 

[INFO] 
[INFO] 
[INFO] Building cayenne-gradle-plugin: Cayenne Gradle Plugin 4.1.M1-SNAPSHOT
[INFO] 
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ cayenne-gradle-plugin 
---
[INFO] 
[INFO] --- maven-dependency-plugin:3.0.1:build-classpath (build-classpath) @ 
cayenne-gradle-plugin ---
[INFO] Wrote classpath file 
'
[INFO] 
[INFO] --- exec-maven-plugin:1.6.0:exec (gradle) @ cayenne-gradle-plugin ---
:clean
:compileJava
:licenseFiles
:pluginDescriptors
:versionFile
:processResources
:classes
:jar
:assemble
:pluginUnderTestMetadata
:compileTestJava
:processTestResources

Build failed in Jenkins: cayenne-master » hsql,JDK 1.8 (latest),ubuntu #713

2017-08-24 Thread Apache Jenkins Server
See 


Changes:

[stariy95] CAY-2355 Project compatibility module can't handle standalone data 
maps 

--
[...truncated 9.27 MB...]
[INFO] --- maven-checkstyle-plugin:2.17:check (default) @ cayenne-dbcp2 ---
[INFO] 
[INFO] >>> maven-pmd-plugin:3.8:check (default) > :pmd @ cayenne-dbcp2 >>>
[INFO] 
[INFO] --- maven-pmd-plugin:3.8:pmd (pmd) @ cayenne-dbcp2 ---
[INFO] 
[INFO] <<< maven-pmd-plugin:3.8:check (default) < :pmd @ cayenne-dbcp2 <<<
[INFO] 
[INFO] 
[INFO] --- maven-pmd-plugin:3.8:check (default) @ cayenne-dbcp2 ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ cayenne-dbcp2 
---
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ 
cayenne-dbcp2 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 

[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ 
cayenne-dbcp2 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to 

[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ 
cayenne-dbcp2 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ 
cayenne-dbcp2 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to 

[INFO] 
[INFO] --- maven-surefire-plugin:2.20:test (default-test) @ cayenne-dbcp2 ---
[INFO] Surefire report directory: 

[WARNING] The system property cayenneTestConnection is configured twice! The 
property appears in  and any of , 
 or user property.
[INFO] 
[INFO] ---
[INFO]  T E S T S
[INFO] ---
[INFO] Running 
org.apache.cayenne.configuration.server.DBCP2DataSourceFactoryTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.11 s - 
in org.apache.cayenne.configuration.server.DBCP2DataSourceFactoryTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ cayenne-dbcp2 ---
[INFO] Building jar: 

[INFO] 
[INFO] >>> maven-source-plugin:3.0.1:jar (bundle-source-jar) > generate-sources 
@ cayenne-dbcp2 >>>
[INFO] 
[INFO] <<< maven-source-plugin:3.0.1:jar (bundle-source-jar) < generate-sources 
@ cayenne-dbcp2 <<<
[INFO] 
[INFO] 
[INFO] --- maven-source-plugin:3.0.1:jar (bundle-source-jar) @ cayenne-dbcp2 ---
[INFO] Building jar: 

[INFO] 
[INFO] --- maven-failsafe-plugin:2.20:integration-test (integration-test) @ 
cayenne-dbcp2 ---
[INFO] 
[INFO] --- maven-failsafe-plugin:2.20:verify (integration-test) @ cayenne-dbcp2 
---
[INFO] Failsafe report directory: 

[INFO] 
[INFO] 
[INFO] Building cayenne-gradle-plugin: Cayenne Gradle Plugin 4.1.M1-SNAPSHOT
[INFO] 
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ cayenne-gradle-plugin 
---
[INFO] 
[INFO] --- maven-dependency-plugin:3.0.1:build-classpath (build-classpath) @ 
cayenne-gradle-plugin ---
[INFO] Wrote classpath file 
'
[INFO] 
[INFO] --- exec-maven-plugin:1.6.0:exec (gradle) @ cayenne-gradle-plugin ---
:clean
:compileJava
:licenseFiles
:pluginDescriptors
:versionFile
:processResources
:classes
:jar
:assemble
:pluginUnderTestMetadata
:compileTestJava

cayenne git commit: CAY-2355 Project compatibility module can't handle standalone data maps + make XMLDataMapLoader stateless

2017-08-24 Thread ntimofeev
Repository: cayenne
Updated Branches:
  refs/heads/master 0101fc1ca -> a1c9e2dd2


CAY-2355 Project compatibility module can't handle standalone data maps
  + make XMLDataMapLoader stateless


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/a1c9e2dd
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/a1c9e2dd
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/a1c9e2dd

Branch: refs/heads/master
Commit: a1c9e2dd2489164dc4e3411753d43866efc1b8da
Parents: 0101fc1
Author: Nikita Timofeev 
Authored: Thu Aug 24 12:48:08 2017 +0300
Committer: Nikita Timofeev 
Committed: Thu Aug 24 12:48:08 2017 +0300

--
 .../xml/CompatibilityDataMapLoader.java | 33 ++---
 .../CompatibilityUpgradeService.java| 13 
 ...patibilityDataChannelDescriptorLoaderIT.java | 55 ---
 .../xml/CompatibilityDataMapLoaderIT.java   | 71 
 .../compatibility/CompatibilityTestModule.java  | 67 ++
 .../CompatibilityUpgradeServiceIT.java  | 52 +++---
 .../configuration/xml/XMLDataMapLoader.java | 16 ++---
 7 files changed, 219 insertions(+), 88 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cayenne/blob/a1c9e2dd/cayenne-project-compatibility/src/main/java/org/apache/cayenne/configuration/xml/CompatibilityDataMapLoader.java
--
diff --git 
a/cayenne-project-compatibility/src/main/java/org/apache/cayenne/configuration/xml/CompatibilityDataMapLoader.java
 
b/cayenne-project-compatibility/src/main/java/org/apache/cayenne/configuration/xml/CompatibilityDataMapLoader.java
index 77ce2cd..3f4c8a5 100644
--- 
a/cayenne-project-compatibility/src/main/java/org/apache/cayenne/configuration/xml/CompatibilityDataMapLoader.java
+++ 
b/cayenne-project-compatibility/src/main/java/org/apache/cayenne/configuration/xml/CompatibilityDataMapLoader.java
@@ -27,9 +27,13 @@ import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
 
 import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.ConfigurationException;
 import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.di.Provider;
 import org.apache.cayenne.map.DataMap;
+import org.apache.cayenne.project.compatibility.CompatibilityUpgradeService;
 import org.apache.cayenne.project.compatibility.DocumentProvider;
+import org.apache.cayenne.project.upgrade.UpgradeService;
 import org.apache.cayenne.resource.Resource;
 import org.apache.cayenne.util.Util;
 import org.w3c.dom.Document;
@@ -42,15 +46,31 @@ import org.xml.sax.XMLReader;
 public class CompatibilityDataMapLoader extends XMLDataMapLoader {
 
 @Inject
+Provider upgradeServiceProvider;
+
+@Inject
 DocumentProvider documentProvider;
 
 @Override
 public DataMap load(Resource configurationResource) throws 
CayenneRuntimeException {
 Document document = 
documentProvider.getDocument(configurationResource.getURL());
+// no document yet in provider, maybe DataMap is directly loaded
 if(document == null) {
-return super.load(configurationResource);
+if(!(upgradeServiceProvider.get() instanceof 
CompatibilityUpgradeService)) {
+throw new ConfigurationException("CompatibilityUpgradeService 
expected");
+}
+// try to upgrade datamap directly
+CompatibilityUpgradeService upgradeService = 
(CompatibilityUpgradeService)upgradeServiceProvider.get();
+upgradeService.upgradeDataMap(configurationResource);
+document = 
documentProvider.getDocument(configurationResource.getURL());
+
+// still no document, try to load it without upgrade, though it 
likely will fail
+if(document == null) {
+return super.load(configurationResource);
+}
 }
 
+final DataMap[] maps = new DataMap[1];
 try {
 DOMSource source = new DOMSource(document);
 ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -61,12 +81,7 @@ public class CompatibilityDataMapLoader extends 
XMLDataMapLoader {
 
 XMLReader parser = Util.createXmlReader();
 LoaderContext loaderContext = new LoaderContext(parser, 
handlerFactory);
-loaderContext.addDataMapListener(new DataMapLoaderListener() {
-@Override
-public void onDataMapLoaded(DataMap dataMap) {
-map = dataMap;
-}
-});
+loaderContext.addDataMapListener(dataMap -> maps[0] = dataMap);
 RootDataMapHandler rootHandler = new 
RootDataMapHandler(loaderContext);
 
 

[jira] [Updated] (CAY-2355) Project compatibility module can't handle stand alone data maps

2017-08-24 Thread Nikita Timofeev (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAY-2355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2355:
-
Fix Version/s: 4.1.M1

> Project compatibility module can't handle stand alone data maps
> ---
>
> Key: CAY-2355
> URL: https://issues.apache.org/jira/browse/CAY-2355
> Project: Cayenne
>  Issue Type: Task
>Affects Versions: 4.1.M1
>Reporter: Nikita Timofeev
>Assignee: Nikita Timofeev
>Priority: Minor
> Fix For: 4.1.M1
>
>
> New {{cayenne-project-compatibility}} module have limitation as it can't 
> currently handle stand alone data maps not linked to cayenne project xml 
> file. Maybe it can be fixed easily, should do research.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Closed] (CAY-2355) Project compatibility module can't handle stand alone data maps

2017-08-24 Thread Nikita Timofeev (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAY-2355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev closed CAY-2355.

Resolution: Fixed

https://github.com/apache/cayenne/commit/a1c9e2dd2489164dc4e3411753d43866efc1b8da

> Project compatibility module can't handle stand alone data maps
> ---
>
> Key: CAY-2355
> URL: https://issues.apache.org/jira/browse/CAY-2355
> Project: Cayenne
>  Issue Type: Task
>Affects Versions: 4.1.M1
>Reporter: Nikita Timofeev
>Assignee: Nikita Timofeev
>Priority: Minor
>
> New {{cayenne-project-compatibility}} module have limitation as it can't 
> currently handle stand alone data maps not linked to cayenne project xml 
> file. Maybe it can be fixed easily, should do research.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)