You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2018/10/09 15:07:46 UTC

[isis] branch v2 updated (9379987 -> 876d754)

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a change to branch v2
in repository https://gitbox.apache.org/repos/asf/isis.git.


    from 9379987  ISIS-1920: let tooltips trigger on label instead of form-group
     new 17bde1a  ISIS-1976: fixes build for module 'unittestsupport-test'
     new 876d754  ISIS-1972: applib: add JAXB XmlAdapters for Java built-in temporal types

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/isis/applib/adapters/JaxbAdapters.java  | 106 +++++++++++++++++++++
 core/unittestsupport-test/pom.xml                  |   2 +-
 .../ServiceInjectorTestUsingCodegenPlugin.java     |  10 +-
 3 files changed, 112 insertions(+), 6 deletions(-)
 create mode 100644 core/applib/src/main/java/org/apache/isis/applib/adapters/JaxbAdapters.java


[isis] 01/02: ISIS-1976: fixes build for module 'unittestsupport-test'

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 17bde1a6355137ee6ca0295d75da0612c6b00f1c
Author: Andi Huber <ah...@apache.org>
AuthorDate: Tue Oct 9 17:02:15 2018 +0200

    ISIS-1976: fixes build for module 'unittestsupport-test'
    
    Task-Url: https://issues.apache.org/jira/browse/ISIS-1976
---
 core/unittestsupport-test/pom.xml                              |  2 +-
 .../services/ServiceInjectorTestUsingCodegenPlugin.java        | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/core/unittestsupport-test/pom.xml b/core/unittestsupport-test/pom.xml
index 55113ec..aae4cb9 100644
--- a/core/unittestsupport-test/pom.xml
+++ b/core/unittestsupport-test/pom.xml
@@ -49,7 +49,7 @@
         
         <dependency>
 			<groupId>org.apache.isis.core</groupId>
-			<artifactId>isis-core-wrapper</artifactId>
+			<artifactId>isis-core-runtime</artifactId>
 			<scope>test</scope>
 		</dependency>
         
diff --git a/core/unittestsupport-test/src/test/java/org/apache/isis/core/runtime/services/ServiceInjectorTestUsingCodegenPlugin.java b/core/unittestsupport-test/src/test/java/org/apache/isis/core/runtime/services/ServiceInjectorTestUsingCodegenPlugin.java
index c3cccd2..7f0553d 100644
--- a/core/unittestsupport-test/src/test/java/org/apache/isis/core/runtime/services/ServiceInjectorTestUsingCodegenPlugin.java
+++ b/core/unittestsupport-test/src/test/java/org/apache/isis/core/runtime/services/ServiceInjectorTestUsingCodegenPlugin.java
@@ -67,21 +67,21 @@ public class ServiceInjectorTestUsingCodegenPlugin {
 
     @Test
     public void singleton() {
-        SingletonCalculator calculator = serviceInjector.lookupService(SingletonCalculator.class);
+        SingletonCalculator calculator = serviceInjector.lookupServiceElseFail(SingletonCalculator.class);
         assertThat(calculator.add(3), is(3));
-        calculator = serviceInjector.lookupService(SingletonCalculator.class);
+        calculator = serviceInjector.lookupServiceElseFail(SingletonCalculator.class);
         assertThat(calculator.add(4), is(7));
     }
 
     @Test
     public void requestScoped_instantiate() {
-        final AccumulatingCalculator calculator = serviceInjector.lookupService(AccumulatingCalculator.class);
+        final AccumulatingCalculator calculator = serviceInjector.lookupServiceElseFail(AccumulatingCalculator.class);
         assertThat(calculator instanceof RequestScopedService, is(true));
     }
 
     @Test
     public void requestScoped_justOneThread() {
-        final AccumulatingCalculator calculator = serviceInjector.lookupService(AccumulatingCalculator.class);
+        final AccumulatingCalculator calculator = serviceInjector.lookupServiceElseFail(AccumulatingCalculator.class);
         
         try {
             ((RequestScopedService)calculator).__isis_startRequest(serviceInjector);
@@ -96,7 +96,7 @@ public class ServiceInjectorTestUsingCodegenPlugin {
     @Test
     public void requestScoped_multipleThreads() throws InterruptedException, ExecutionException {
         
-        final AccumulatingCalculator calculator = serviceInjector.lookupService(AccumulatingCalculator.class);
+        final AccumulatingCalculator calculator = serviceInjector.lookupServiceElseFail(AccumulatingCalculator.class);
         final ExecutorService executor = Executors.newFixedThreadPool(10);
         
         // setup 32 tasks


[isis] 02/02: ISIS-1972: applib: add JAXB XmlAdapters for Java built-in temporal types

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 876d754e26510f7d65cf6d73b7d5e78024f9bc81
Author: Andi Huber <ah...@apache.org>
AuthorDate: Tue Oct 9 17:07:39 2018 +0200

    ISIS-1972: applib: add JAXB XmlAdapters for Java built-in temporal types
    
    Task-Url: https://issues.apache.org/jira/browse/ISIS-1972
---
 .../apache/isis/applib/adapters/JaxbAdapters.java  | 106 +++++++++++++++++++++
 1 file changed, 106 insertions(+)

diff --git a/core/applib/src/main/java/org/apache/isis/applib/adapters/JaxbAdapters.java b/core/applib/src/main/java/org/apache/isis/applib/adapters/JaxbAdapters.java
new file mode 100644
index 0000000..c4219cf
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/adapters/JaxbAdapters.java
@@ -0,0 +1,106 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.applib.adapters;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.OffsetDateTime;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+/**
+ * Provides JAXB XmlAdapters for Java built-in temporal types. 
+ * 
+ * @since 2.0.0-M2
+ */
+public final class JaxbAdapters {
+
+    public static final class DateAdapter extends XmlAdapter<String, java.util.Date>{
+
+        public java.util.Date unmarshal(String v) throws Exception {
+            return new java.util.Date(Long.parseLong(v));
+        }
+
+        public String marshal(java.util.Date v) throws Exception {
+            return Long.toString(v.getTime());
+        }
+
+    }
+    
+    public static final class SqlDateAdapter extends XmlAdapter<String, java.sql.Date>{
+
+        public java.sql.Date unmarshal(String v) throws Exception {
+            return java.sql.Date.valueOf(v);
+        }
+
+        public String marshal(java.sql.Date v) throws Exception {
+            return v.toString();
+        }
+
+    }
+    
+    public static final class SqlTimestampAdapter extends XmlAdapter<String, java.sql.Timestamp>{
+
+        public java.sql.Timestamp unmarshal(String v) throws Exception {
+            return new java.sql.Timestamp(Long.parseLong(v));
+        }
+
+        public String marshal(java.sql.Timestamp v) throws Exception {
+            return Long.toString(v.getTime());
+        }
+
+    }
+    
+    public static final class LocalDateAdapter extends XmlAdapter<String, LocalDate>{
+
+        public LocalDate unmarshal(String v) throws Exception {
+            return LocalDate.parse(v);
+        }
+
+        public String marshal(LocalDate v) throws Exception {
+            return v.toString();
+        }
+
+    }
+
+    public static final class LocalDateTimeAdapter extends XmlAdapter<String, LocalDateTime>{
+
+        public LocalDateTime unmarshal(String v) throws Exception {
+            return LocalDateTime.parse(v);
+        }
+
+        public String marshal(LocalDateTime v) throws Exception {
+            return v.toString();
+        }
+
+    }
+
+    public static final class OffsetDateTimeAdapter extends XmlAdapter<String, OffsetDateTime>{
+
+        public OffsetDateTime unmarshal(String v) throws Exception {
+            return OffsetDateTime.parse(v);
+        }
+
+        public String marshal(OffsetDateTime v) throws Exception {
+            return v.toString();
+        }
+
+    }
+    
+}