[teiid-commits] teiid SVN: r3759 - in branches/7.6.x/client/src: main/java/org/teiid/net/socket and 2 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Thu Dec 22 21:17:51 EST 2011


Author: shawkins
Date: 2011-12-22 21:17:51 -0500 (Thu, 22 Dec 2011)
New Revision: 3759

Added:
   branches/7.6.x/client/src/test/java/org/teiid/net/socket/TestHandshake.java
   branches/7.6.x/client/src/test/resources/handshake.ser
Modified:
   branches/7.6.x/client/src/main/java/org/teiid/client/security/LogonResult.java
   branches/7.6.x/client/src/main/java/org/teiid/net/socket/Handshake.java
Log:
TEIID-1882 fix for backwards compatibility

Modified: branches/7.6.x/client/src/main/java/org/teiid/client/security/LogonResult.java
===================================================================
--- branches/7.6.x/client/src/main/java/org/teiid/client/security/LogonResult.java	2011-12-22 18:32:16 UTC (rev 3758)
+++ branches/7.6.x/client/src/main/java/org/teiid/client/security/LogonResult.java	2011-12-23 02:17:51 UTC (rev 3759)
@@ -22,6 +22,7 @@
 
 package org.teiid.client.security;
 
+import java.io.EOFException;
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
@@ -119,6 +120,8 @@
 		vdbVersion = in.readInt();
 		try {
 			addtionalProperties = ExternalizeUtil.readMap(in);
+		} catch (EOFException e) {
+			
 		} catch (OptionalDataException e) {
 			
 		}

Modified: branches/7.6.x/client/src/main/java/org/teiid/net/socket/Handshake.java
===================================================================
--- branches/7.6.x/client/src/main/java/org/teiid/net/socket/Handshake.java	2011-12-22 18:32:16 UTC (rev 3758)
+++ branches/7.6.x/client/src/main/java/org/teiid/net/socket/Handshake.java	2011-12-23 02:17:51 UTC (rev 3759)
@@ -22,11 +22,11 @@
 
 package org.teiid.net.socket;
 
+import java.io.EOFException;
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
-import java.io.OptionalDataException;
 
 import org.teiid.core.util.ApplicationInfo;
 
@@ -85,7 +85,7 @@
     	publicKey = (byte[])in.readObject();
     	try {
     		authType = AuthenticationType.values()[in.readByte()];
-    	} catch (OptionalDataException e) {
+    	} catch (EOFException e) {
     		
     	}
     }

Added: branches/7.6.x/client/src/test/java/org/teiid/net/socket/TestHandshake.java
===================================================================
--- branches/7.6.x/client/src/test/java/org/teiid/net/socket/TestHandshake.java	                        (rev 0)
+++ branches/7.6.x/client/src/test/java/org/teiid/net/socket/TestHandshake.java	2011-12-23 02:17:51 UTC (rev 3759)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library 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 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library 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
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.net.socket;
+
+import static org.junit.Assert.*;
+
+import java.io.FileInputStream;
+import java.io.ObjectInputStream;
+
+import org.junit.Test;
+import org.teiid.core.util.UnitTestUtil;
+
+ at SuppressWarnings("nls")
+public class TestHandshake {
+
+	@Test public void testCompatibility() throws Exception {
+		ObjectInputStream ois = new ObjectInputStream(new FileInputStream(UnitTestUtil.getTestDataFile("handshake.ser")));
+		Handshake hs = (Handshake)ois.readObject();
+		assertEquals(AuthenticationType.CLEARTEXT, hs.getAuthType());
+	}
+	
+}


Property changes on: branches/7.6.x/client/src/test/java/org/teiid/net/socket/TestHandshake.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: branches/7.6.x/client/src/test/resources/handshake.ser
===================================================================
(Binary files differ)


Property changes on: branches/7.6.x/client/src/test/resources/handshake.ser
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream



More information about the teiid-commits mailing list