You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by GitBox <gi...@apache.org> on 2021/04/28 21:25:58 UTC

[GitHub] [db-jdo] tzaeschke commented on a change in pull request #20: Jdo 709

tzaeschke commented on a change in pull request #20:
URL: https://github.com/apache/db-jdo/pull/20#discussion_r622568482



##########
File path: tck/src/main/resources/conf/jdori-log4j2.xml
##########
@@ -38,7 +38,7 @@
     
     <!-- TCK Loggers -->
 
-    <Logger name="org.apache.jdo.tck" level="info" additivity="false">
+    <Logger name="org.apache.jdo.tck" level="debug" additivity="false">

Review comment:
       That looks like an unrelated change. Is it intended?

##########
File path: tck/src/main/java/org/apache/jdo/tck/pc/mylib/PCRect2.java
##########
@@ -0,0 +1,185 @@
+/*
+ * 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.jdo.tck.pc.mylib;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.jdo.AttributeConverter;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * PersistenceCapable class to test JDO AttributeConverter interface.
+ * It#s fields of type Point are converted to strins in the datastore.
+ *
+ * @author Michael Bouschen
+ */
+public class PCRect2 {
+    private static long counter = new Date().getTime();
+
+    private static long newId() {
+        synchronized (PCRect2.class) {
+            return counter++;
+        }
+    }
+
+    public long id = newId();
+
+    private Point upperLeft;
+    private Point lowerRight;
+
+    public PCRect2() {
+    }
+
+    public PCRect2(long id, Point ul, Point lr) {
+        upperLeft = ul;
+        lowerRight = lr;
+    }
+
+    public PCRect2(Point ul, Point lr) {
+        upperLeft = ul;
+        lowerRight = lr;
+    }
+
+    public Point getUpperLeft() {
+        return upperLeft;
+    }
+
+    public Point getLowerRight() {
+        return lowerRight;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String toString() {
+        String rc = null;
+        Object obj = this;
+        try {
+            //rc = Util.getClassName(this)
+            rc = obj.getClass().getName()
+                    + " ul: " + getUpperLeft().name()
+                    + " lr: " + getLowerRight().name();
+        } catch (NullPointerException ex) {
+            rc = "NPE getting PCRect2's values";
+        }
+        return rc;
+    }
+
+    /**
+     * PCRect2'S ObjectId class.
+     */
+    public static class Oid implements Serializable {

Review comment:
       Do we need this `Oid` class?

##########
File path: tck/src/main/java/org/apache/jdo/tck/pc/mylib/PCRect2.java
##########
@@ -0,0 +1,185 @@
+/*
+ * 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.jdo.tck.pc.mylib;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.jdo.AttributeConverter;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * PersistenceCapable class to test JDO AttributeConverter interface.
+ * It#s fields of type Point are converted to strins in the datastore.
+ *
+ * @author Michael Bouschen
+ */
+public class PCRect2 {

Review comment:
       Should we call it `PCRectString` or something instead of `PCRect2`? That may be more descriptive.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org