You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@metamodel.apache.org by ka...@apache.org on 2014/07/20 08:16:08 UTC

git commit: METAMODEL-69: Fix for accidental wrong commit

Repository: incubator-metamodel
Updated Branches:
  refs/heads/master a395c5f80 -> 48db73075


METAMODEL-69: Fix for accidental wrong commit

Project: http://git-wip-us.apache.org/repos/asf/incubator-metamodel/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-metamodel/commit/48db7307
Tree: http://git-wip-us.apache.org/repos/asf/incubator-metamodel/tree/48db7307
Diff: http://git-wip-us.apache.org/repos/asf/incubator-metamodel/diff/48db7307

Branch: refs/heads/master
Commit: 48db730750cc907ec53858be2d567c89fff9a2f0
Parents: a395c5f
Author: Kasper Sørensen <i....@gmail.com>
Authored: Sun Jul 20 08:15:03 2014 +0200
Committer: Kasper Sørensen <i....@gmail.com>
Committed: Sun Jul 20 08:15:03 2014 +0200

----------------------------------------------------------------------
 core/pom.xml                                    |  37 ++++-------
 .../LegacyDeserializationObjectInputStream.java |   2 +-
 ...acyDeserializationObjectInputStreamTest.java |  64 +++++++++----------
 .../metamodel-3.4-query-and-schema.ser          | Bin 0 -> 3804 bytes
 4 files changed, 44 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/48db7307/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index 2fa2e37..7f31096 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -1,23 +1,16 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<!--
-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.
--->
-<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/maven-v4_0_0.xsd">
+<!-- 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. -->
+<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/maven-v4_0_0.xsd">
 	<parent>
 		<artifactId>MetaModel</artifactId>
 		<groupId>org.apache.metamodel</groupId>
@@ -46,11 +39,5 @@ under the License.
 			<artifactId>easymock</artifactId>
 			<scope>test</scope>
 		</dependency>
-		<dependency>
-			<groupId>
-			org.eobjects.metamodel</groupId>
-		<artifactId>MetaModel-core</artifactId>
-		<version>3.4.11</version>
-		</dependency>
 	</dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/48db7307/core/src/main/java/org/apache/metamodel/util/LegacyDeserializationObjectInputStream.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/metamodel/util/LegacyDeserializationObjectInputStream.java b/core/src/main/java/org/apache/metamodel/util/LegacyDeserializationObjectInputStream.java
index 993bd89..5e91494 100644
--- a/core/src/main/java/org/apache/metamodel/util/LegacyDeserializationObjectInputStream.java
+++ b/core/src/main/java/org/apache/metamodel/util/LegacyDeserializationObjectInputStream.java
@@ -235,7 +235,7 @@ public class LegacyDeserializationObjectInputStream extends ObjectInputStream {
     @Override
     protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
         final String className = desc.getName();
-        if (className.startsWith("org.apache.metamodel") || className.startsWith("[Lorg.apache.metamodel")) {
+        if (className.startsWith("org.eobjects.metamodel") || className.startsWith("[Lorg.eobjects.metamodel")) {
             final String newClassName;
             if (OLD_CLASS_NAME_COLUMN_TYPE.equals(className)) {
                 // since ColumnType was changed from enum to interface, there's

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/48db7307/core/src/test/java/org/apache/metamodel/util/LegacyDeserializationObjectInputStreamTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/metamodel/util/LegacyDeserializationObjectInputStreamTest.java b/core/src/test/java/org/apache/metamodel/util/LegacyDeserializationObjectInputStreamTest.java
index 0557cf9..fffb679 100644
--- a/core/src/test/java/org/apache/metamodel/util/LegacyDeserializationObjectInputStreamTest.java
+++ b/core/src/test/java/org/apache/metamodel/util/LegacyDeserializationObjectInputStreamTest.java
@@ -19,47 +19,45 @@
 package org.apache.metamodel.util;
 
 import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.ObjectOutputStream;
+
+import junit.framework.TestCase;
 
 import org.apache.metamodel.query.Query;
 import org.apache.metamodel.schema.Column;
 import org.apache.metamodel.schema.Table;
 
-import junit.framework.TestCase;
-
 public class LegacyDeserializationObjectInputStreamTest extends TestCase {
 
+    /**
+     * Method used to generate the input file (requires org.eobjects.metamodel
+     * available)
+     * 
+     * <pre>
+     * final org.apache.metamodel.schema.MutableSchema schema = new org.apache.metamodel.schema.MutableSchema(&quot;myschema&quot;);
+     * final org.apache.metamodel.schema.MutableTable table = new org.apache.metamodel.schema.MutableTable(&quot;mytable&quot;,
+     *         org.apache.metamodel.schema.TableType.TABLE, schema);
+     * schema.addTable(table);
+     * 
+     * table.addColumn(new org.apache.metamodel.schema.MutableColumn(&quot;mycol1&quot;, org.apache.metamodel.schema.ColumnType.INTEGER,
+     *         table, 0, 16, &quot;int&quot;, false, &quot;my remark 1&quot;, false, &quot;\&quot;&quot;));
+     * table.addColumn(new org.apache.metamodel.schema.MutableColumn(&quot;mycol1&quot;, org.apache.metamodel.schema.ColumnType.VARCHAR,
+     *         table, 1, 255, &quot;text&quot;, true, &quot;my remark 2&quot;, true, null));
+     * 
+     * final org.apache.metamodel.query.Query q = new org.apache.metamodel.query.Query();
+     * q.from(table);
+     * q.select(table.getColumn(0));
+     * q.where(table.getColumn(1), org.apache.metamodel.query.OperatorType.EQUALS_TO, &quot;foo&quot;);
+     * 
+     * final FileOutputStream out = new FileOutputStream(filename);
+     * try {
+     *     new ObjectOutputStream(out).writeObject(q);
+     * } finally {
+     *     out.close();
+     * }
+     * </pre>
+     */
     public void testCreateSerializeAndDeserializeOldSchemaAndQuery() throws Exception {
-        final String filename = "target/metamodel-3.4-query-and-schema.ser";
-
-        // create the example serialized object
-        {
-            final org.apache.metamodel.schema.MutableSchema schema = new org.apache.metamodel.schema.MutableSchema(
-                    "myschema");
-            final org.apache.metamodel.schema.MutableTable table = new org.apache.metamodel.schema.MutableTable(
-                    "mytable", org.apache.metamodel.schema.TableType.TABLE, schema);
-            schema.addTable(table);
-
-            table.addColumn(new org.apache.metamodel.schema.MutableColumn("mycol1",
-                    org.apache.metamodel.schema.ColumnType.INTEGER, table, 0, 16, "int", false, "my remark 1", false,
-                    "\""));
-            table.addColumn(new org.apache.metamodel.schema.MutableColumn("mycol1",
-                    org.apache.metamodel.schema.ColumnType.VARCHAR, table, 1, 255, "text", true, "my remark 2", true,
-                    null));
-
-            final org.apache.metamodel.query.Query q = new org.apache.metamodel.query.Query();
-            q.from(table);
-            q.select(table.getColumn(0));
-            q.where(table.getColumn(1), org.apache.metamodel.query.OperatorType.EQUALS_TO, "foo");
-
-            final FileOutputStream out = new FileOutputStream(filename);
-            try {
-                new ObjectOutputStream(out).writeObject(q);
-            } finally {
-                out.close();
-            }
-        }
+        final String filename = "src/test/resources/metamodel-3.4-query-and-schema.ser";
 
         final Object obj;
         {

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/48db7307/core/src/test/resources/metamodel-3.4-query-and-schema.ser
----------------------------------------------------------------------
diff --git a/core/src/test/resources/metamodel-3.4-query-and-schema.ser b/core/src/test/resources/metamodel-3.4-query-and-schema.ser
new file mode 100644
index 0000000..d083e84
Binary files /dev/null and b/core/src/test/resources/metamodel-3.4-query-and-schema.ser differ