changeset 10820:c4043aa4b2ed

Merge
author amurillo
date Tue, 09 Jun 2015 11:24:01 -0700
parents b2c55ff77112 51e129e42c92
children 7a2767ebceb0
files test/java/awt/Component/isLightweightCrash/StubPeerCrash.java
diffstat 143 files changed, 31274 insertions(+), 774 deletions(-) [+]
line wrap: on
line diff
--- a/make/CompileJavaClasses.gmk	Wed Jun 03 08:17:00 2015 -0700
+++ b/make/CompileJavaClasses.gmk	Tue Jun 09 11:24:01 2015 -0700
@@ -384,7 +384,7 @@
           JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
           SRC := $(JDK_OUTPUTDIR)/gensrc_ab/32bit, \
           BIN := $(JDK_OUTPUTDIR)/classes_ab/32bit, \
-          HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers))
+          HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers_ab/32))
 
       $(BUILD_ACCESSBRIDGE_32): $(BUILD_JDK)
 
@@ -393,7 +393,7 @@
           JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
           SRC := $(JDK_OUTPUTDIR)/gensrc_ab/legacy, \
           BIN := $(JDK_OUTPUTDIR)/classes_ab/legacy, \
-          HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers))
+          HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers_ab/legacy))
 
       $(BUILD_ACCESSBRIDGE_LEGACY): $(BUILD_JDK)
 
@@ -404,7 +404,7 @@
           JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
           SRC := $(JDK_OUTPUTDIR)/gensrc_ab/64bit, \
           BIN := $(JDK_OUTPUTDIR)/classes_ab/64bit, \
-          HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers))
+          HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers_ab/64))
 
       $(BUILD_ACCESSBRIDGE_64): $(BUILD_JDK)
 
--- a/make/lib/PlatformLibraries.gmk	Wed Jun 03 08:17:00 2015 -0700
+++ b/make/lib/PlatformLibraries.gmk	Tue Jun 09 11:24:01 2015 -0700
@@ -134,7 +134,8 @@
     define SetupAccessBridge
       # Parameter 1 Suffix
       # Parameter 2 Machine
-      # Parameter 3 ACCESSBRIDGE_ARCH_ suffix
+      # Parameter 3 ACCESSBRIDGE_ARCH_ suffix and name of directory where gensrc headers
+      #             are found.
 
       $(call SetupNativeCompilation,BUILD_JAWTACCESSBRIDGE$1, \
           LIBRARY = JAWTAccessBridge$1, \
@@ -144,7 +145,8 @@
           LANG := C++, \
           OPTIMIZATION := LOW, \
           CFLAGS := $(CFLAGS_JDKLIB) \
-              -DACCESSBRIDGE_ARCH_$3, \
+              -DACCESSBRIDGE_ARCH_$3 \
+              -I$(JDK_OUTPUTDIR)/gensrc_headers_ab/$3, \
           LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
               winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \
               ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
@@ -170,7 +172,8 @@
           LANG := C++, \
           OPTIMIZATION := LOW, \
           CFLAGS := $(CFLAGS_JDKLIB) \
-              -DACCESSBRIDGE_ARCH_$3, \
+              -DACCESSBRIDGE_ARCH_$3 \
+              -I$(JDK_OUTPUTDIR)/gensrc_headers_ab/$3, \
           LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
               winspool.lib comdlg32.lib advapi32.lib shell32.lib \
               ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
@@ -194,7 +197,8 @@
           LANG := C++, \
           OPTIMIZATION := LOW, \
           CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT \
-              -DACCESSBRIDGE_ARCH_$3, \
+              -DACCESSBRIDGE_ARCH_$3 \
+              -I$(JDK_OUTPUTDIR)/gensrc_headers_ab/$3, \
           LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
               winspool.lib comdlg32.lib advapi32.lib shell32.lib \
               ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
@@ -215,7 +219,7 @@
 
     ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
       $(eval $(call SetupAccessBridge,-32,I386,32))
-      $(eval $(call SetupAccessBridge,,I386,LEGACY))
+      $(eval $(call SetupAccessBridge,,I386,legacy))
     else
       $(eval $(call SetupAccessBridge,-64,X64,64))
     endif
--- a/src/macosx/classes/sun/font/CFont.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/macosx/classes/sun/font/CFont.java	Tue Jun 09 11:24:01 2015 -0700
@@ -77,14 +77,72 @@
     }
 
     private static native long createNativeFont(final String nativeFontName,
-                                                final int style,
-                                                final boolean isFakeItalic);
+                                                final int style);
     private static native void disposeNativeFont(final long nativeFontPtr);
 
     private boolean isFakeItalic;
     private String nativeFontName;
     private long nativeFontPtr;
 
+    private native float getWidthNative(final long nativeFontPtr);
+    private native float getWeightNative(final long nativeFontPtr);
+
+    private int fontWidth = -1;
+    private int fontWeight = -1;
+
+    @Override
+    public int getWidth() {
+        if (fontWidth == -1) {
+            // Apple use a range of -1 -> +1, where 0.0 is normal
+            // OpenType uses a % range from 50% -> 200% where 100% is normal
+            // and maps these onto the integer values 1->9.
+            // Since that is what Font2D.getWidth() expects, remap to that.
+            float fw = getWidthNative(getNativeFontPtr());
+            if (fw == 0.0) { // short cut the common case
+                fontWidth = Font2D.FWIDTH_NORMAL;
+                return fontWidth;
+            }
+            fw += 1.0; fw *= 100.0;
+            if (fw <= 50.0) {
+                fontWidth = 1;
+            } else if (fw <= 62.5) {
+                fontWidth = 2;
+            } else if (fw <= 75.0) {
+                fontWidth = 3;
+            } else if (fw <= 87.5) {
+                fontWidth = 4;
+            } else if (fw <= 100.0) {
+                fontWidth = 5;
+            } else if (fw <= 112.5) {
+                fontWidth = 6;
+            } else if (fw <= 125.0) {
+                fontWidth = 7;
+            } else if (fw <= 150.0) {
+                fontWidth = 8;
+            } else {
+                fontWidth = 9;
+            }
+        }
+        return fontWidth;
+   }
+
+    @Override
+    public int getWeight() {
+        if (fontWeight == -1) {
+            // Apple use a range of -1 -> +1, where 0 is medium/regular
+            // Map this on to the OpenType range of 100->900 where
+            // 500 is medium/regular.
+            // We'll actually map to 0->1000 but that's close enough.
+            float fw = getWeightNative(getNativeFontPtr());
+            if (fw == 0) {
+               return Font2D.FWEIGHT_NORMAL;
+            }
+            fw += 1.0; fw *= 500;
+            fontWeight = (int)fw;
+          }
+          return fontWeight;
+    }
+
     // this constructor is called from CFontWrapper.m
     public CFont(String name) {
         this(name, name);
@@ -94,10 +152,11 @@
         handle = new Font2DHandle(this);
         fullName = name;
         familyName = inFamilyName;
-        nativeFontName = inFamilyName;
+        nativeFontName = fullName;
         setStyle();
     }
 
+    /* Called from CFontManager too */
     public CFont(CFont other, String logicalFamilyName) {
         handle = new Font2DHandle(this);
         fullName = logicalFamilyName;
@@ -109,6 +168,7 @@
 
     public CFont createItalicVariant() {
         CFont font = new CFont(this, familyName);
+        font.nativeFontName = fullName;
         font.fullName =
             fullName + (style == Font.BOLD ? "" : "-") + "Italic-Derived";
         font.style |= Font.ITALIC;
@@ -118,7 +178,7 @@
 
     protected synchronized long getNativeFontPtr() {
         if (nativeFontPtr == 0L) {
-            nativeFontPtr = createNativeFont(nativeFontName, style, isFakeItalic);
+            nativeFontPtr = createNativeFont(nativeFontName, style);
 }
         return nativeFontPtr;
     }
--- a/src/macosx/classes/sun/font/CFontManager.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/macosx/classes/sun/font/CFontManager.java	Tue Jun 09 11:24:01 2015 -0700
@@ -252,13 +252,42 @@
         final CFont font = new CFont(fontName, fontFamilyName);
 
         registerGenericFont(font);
+    }
 
-        if ((font.getStyle() & Font.ITALIC) == 0) {
-            registerGenericFont(font.createItalicVariant(), true);
+    void registerItalicDerived() {
+        FontFamily[] famArr = FontFamily.getAllFontFamilies();
+        for (int i=0; i<famArr.length; i++) {
+            FontFamily family = famArr[i];
+
+            Font2D f2dPlain = family.getFont(Font.PLAIN);
+            if (f2dPlain != null && !(f2dPlain instanceof CFont)) continue;
+            Font2D f2dBold = family.getFont(Font.BOLD);
+            if (f2dBold != null && !(f2dBold instanceof CFont)) continue;
+            Font2D f2dItalic = family.getFont(Font.ITALIC);
+            if (f2dItalic != null && !(f2dItalic instanceof CFont)) continue;
+            Font2D f2dBoldItalic = family.getFont(Font.BOLD|Font.ITALIC);
+            if (f2dBoldItalic != null && !(f2dBoldItalic instanceof CFont)) continue;
+
+            CFont plain = (CFont)f2dPlain;
+            CFont bold = (CFont)f2dBold;
+            CFont italic = (CFont)f2dItalic;
+            CFont boldItalic = (CFont)f2dBoldItalic;
+
+            if (bold == null) bold = plain;
+            if (plain == null && bold == null) continue;
+            if (italic != null && boldItalic != null) continue;
+            if (plain != null && italic == null) {
+               registerGenericFont(plain.createItalicVariant(), true);
+            }
+            if (bold != null && boldItalic == null) {
+               registerGenericFont(bold.createItalicVariant(), true);
+            }
         }
     }
 
     Object waitForFontsToBeLoaded  = new Object();
+    private boolean loadedAllFonts = false;
+
     public void loadFonts()
     {
         synchronized(waitForFontsToBeLoaded)
@@ -267,7 +296,11 @@
             java.security.AccessController.doPrivileged(
                 new java.security.PrivilegedAction<Object>() {
                     public Object run() {
-                        loadNativeFonts();
+                        if (!loadedAllFonts) {
+                           loadNativeFonts();
+                           registerItalicDerived();
+                           loadedAllFonts = true;
+                        }
                         return null;
                     }
                 }
--- a/src/macosx/classes/sun/lwawt/LWTextAreaPeer.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/macosx/classes/sun/lwawt/LWTextAreaPeer.java	Tue Jun 09 11:24:01 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,6 @@
  * questions.
  */
 
-
 package sun.lwawt;
 
 import java.awt.Component;
@@ -40,7 +39,6 @@
 import javax.swing.JTextArea;
 import javax.swing.ScrollPaneConstants;
 import javax.swing.text.Document;
-import javax.swing.text.JTextComponent;
 
 /**
  * Lightweight implementation of {@link TextAreaPeer}. Delegates most of the
@@ -75,12 +73,13 @@
         super.initializeImpl();
         final int visibility = getTarget().getScrollbarVisibility();
         synchronized (getDelegateLock()) {
+            getTextComponent().setWrapStyleWord(true);
             setScrollBarVisibility(visibility);
         }
     }
 
     @Override
-    JTextComponent getTextComponent() {
+    JTextArea getTextComponent() {
         return getDelegate().getView();
     }
 
@@ -165,7 +164,7 @@
             // JTextArea.replaceRange() is called.
             final Document document = getTextComponent().getDocument();
             document.removeDocumentListener(this);
-            getDelegate().getView().replaceRange(text, start, end);
+            getTextComponent().replaceRange(text, start, end);
             revalidate();
             postEvent(new TextEvent(getTarget(), TextEvent.TEXT_VALUE_CHANGED));
             document.addDocumentListener(this);
--- a/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Tue Jun 09 11:24:01 2015 -0700
@@ -366,8 +366,7 @@
     protected void initializeDesktopProperties() {
         super.initializeDesktopProperties();
         Map <Object, Object> fontHints = new HashMap<>();
-        fontHints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-        fontHints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+        fontHints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
         desktopProperties.put(SunToolkit.DESKTOPFONTHINTS, fontHints);
         desktopProperties.put("awt.mouse.numButtons", BUTTONS);
 
--- a/src/macosx/native/sun/awt/CFRetainedResource.m	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/macosx/native/sun/awt/CFRetainedResource.m	Tue Jun 09 11:24:01 2015 -0700
@@ -23,6 +23,7 @@
  * questions.
  */
 
+#import <Cocoa/Cocoa.h>
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
 
 #import "sun_lwawt_macosx_CFRetainedResource.h"
@@ -37,7 +38,10 @@
 (JNIEnv *env, jclass clazz, jlong ptr, jboolean releaseOnAppKitThread)
 {
     if (releaseOnAppKitThread) {
-        [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+        // Releasing resources on the main AppKit message loop only
+        // Releasing resources on the nested loops may cause dangling 
+        // pointers after the nested loop is exited 
+        [NSApp postRunnableEvent:^(){
             CFRelease(jlong_to_ptr(ptr));
         }];
     } else {
--- a/src/macosx/native/sun/awt/LWCToolkit.m	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/macosx/native/sun/awt/LWCToolkit.m	Tue Jun 09 11:24:01 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -124,61 +124,6 @@
 JNF_COCOA_EXIT(env);
 }
 
-static JNF_CLASS_CACHE(jc_Component, "java/awt/Component");
-static JNF_MEMBER_CACHE(jf_Component_appContext, jc_Component, "appContext", "Lsun/awt/AppContext;");
-static JNF_CLASS_CACHE(jc_MenuComponent, "java/awt/MenuComponent");
-static JNF_MEMBER_CACHE(jf_MenuComponent_appContext, jc_MenuComponent, "appContext", "Lsun/awt/AppContext;");
-
-/*
- * Class:     sun_awt_SunToolkit
- * Method:    getAppContext
- * Signature: (Ljava/awt/Object;)Lsun/awt/AppContext;
- */
-JNIEXPORT jobject JNICALL
-Java_sun_awt_SunToolkit_getAppContext
-(JNIEnv *env, jclass cls, jobject obj)
-{
-    jobject appContext = NULL;
-
-JNF_COCOA_ENTER(env);
-
-    if (JNFIsInstanceOf(env, obj, &jc_Component)) {
-        appContext = JNFGetObjectField(env, obj, jf_Component_appContext);
-    } else if (JNFIsInstanceOf(env, obj, &jc_MenuComponent)) {
-        appContext = JNFGetObjectField(env, obj, jf_MenuComponent_appContext);
-    }
-
-JNF_COCOA_EXIT(env);
-
-    return appContext;
-}
-
-/*
- * Class:     sun_awt_SunToolkit
- * Method:    setAppContext
- * Signature: (Ljava/lang/Object;Lsun/awt/AppContext;)Z
- */
-JNIEXPORT jboolean JNICALL
-Java_sun_awt_SunToolkit_setAppContext
-(JNIEnv *env, jclass cls, jobject obj, jobject appContext)
-{
-    jboolean isComponent;
-
-JNF_COCOA_ENTER(env);
-
-    if (JNFIsInstanceOf(env, obj, &jc_Component)) {
-        JNFSetObjectField(env, obj, jf_Component_appContext, appContext);
-        isComponent = JNI_TRUE;
-    } else if (JNFIsInstanceOf(env, obj, &jc_MenuComponent)) {
-        JNFSetObjectField(env, obj, jf_MenuComponent_appContext, appContext);
-        isComponent = JNI_FALSE;
-    }
-
-JNF_COCOA_EXIT(env);
-
-    return isComponent;
-}
-
 /*
  * Class:     sun_lwawt_macosx_LWCToolkit
  * Method:    beep
@@ -339,8 +284,10 @@
                                              beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.010]];
         if (processEvents) {
             //We do not spin a runloop here as date is nil, so does not matter which mode to use
+            // Processing all events excluding NSApplicationDefined which need to be processed 
+            // on the main loop only (those events are intended for disposing resources)
             NSEvent *event;
-            if ((event = [NSApp nextEventMatchingMask:NSAnyEventMask
+            if ((event = [NSApp nextEventMatchingMask:(NSAnyEventMask & ~NSApplicationDefined)
                                            untilDate:nil
                                               inMode:NSDefaultRunLoopMode
                                              dequeue:YES]) != nil) {
--- a/src/macosx/native/sun/font/AWTFont.m	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/macosx/native/sun/font/AWTFont.m	Tue Jun 09 11:24:01 2015 -0700
@@ -35,15 +35,11 @@
 #import "AWTStrike.h"
 #import "CoreTextSupport.h"
 
-
-#define DEBUG
-
 @implementation AWTFont
 
-- (id) initWithFont:(NSFont *)font isFakeItalic:(BOOL)isFakeItalic {
+- (id) initWithFont:(NSFont *)font {
     self = [super init];
     if (self) {
-        fIsFakeItalic = isFakeItalic;
         fFont = [font retain];
         fNativeCGFont = CTFontCopyGraphicsFont((CTFontRef)font, NULL);
     }
@@ -72,7 +68,6 @@
 
 + (AWTFont *) awtFontForName:(NSString *)name
                        style:(int)style
-                isFakeItalic:(BOOL)isFakeItalic
 {
     // create font with family & size
     NSFont *nsFont = [NSFont fontWithName:name size:1.0];
@@ -95,7 +90,7 @@
         nsFont = [[NSFontManager sharedFontManager] convertFont:nsFont toHaveTrait:NSBoldFontMask];
     }
 
-    return [[[AWTFont alloc] initWithFont:nsFont isFakeItalic:isFakeItalic] autorelease];
+    return [[[AWTFont alloc] initWithFont:nsFont] autorelease];
 }
 
 + (NSFont *) nsFontForJavaFont:(jobject)javaFont env:(JNIEnv *)env {
@@ -354,7 +349,7 @@
 JNIEXPORT jlong JNICALL
 Java_sun_font_CFont_createNativeFont
     (JNIEnv *env, jclass clazz,
-     jstring nativeFontName, jint style, jboolean isFakeItalic)
+     jstring nativeFontName, jint style)
 {
     AWTFont *awtFont = nil;
 
@@ -362,8 +357,7 @@
 
     awtFont =
         [AWTFont awtFontForName:JNFJavaToNSString(env, nativeFontName)
-         style:style
-         isFakeItalic:isFakeItalic]; // autoreleased
+         style:style]; // autoreleased
 
     if (awtFont) {
         CFRetain(awtFont); // GC
@@ -376,6 +370,52 @@
 
 /*
  * Class:     sun_font_CFont
+ * Method:    getWidthNative
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL
+Java_sun_font_CFont_getWidthNative
+    (JNIEnv *env, jobject cfont, jlong awtFontPtr)
+{
+    float widthVal;
+JNF_COCOA_ENTER(env);
+
+    AWTFont *awtFont = (AWTFont *)jlong_to_ptr(awtFontPtr);
+    NSFont* nsFont = awtFont->fFont;
+    NSFontDescriptor *fontDescriptor = nsFont.fontDescriptor;
+    NSDictionary *fontTraits = [fontDescriptor objectForKey : NSFontTraitsAttribute];
+    NSNumber *width = [fontTraits objectForKey : NSFontWidthTrait];
+    widthVal = (float)[width floatValue];
+
+JNF_COCOA_EXIT(env);
+   return (jfloat)widthVal;
+}
+
+/*
+ * Class:     sun_font_CFont
+ * Method:    getWeightNative
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL
+Java_sun_font_CFont_getWeightNative
+    (JNIEnv *env, jobject cfont, jlong awtFontPtr)
+{
+    float weightVal;
+JNF_COCOA_ENTER(env);
+
+    AWTFont *awtFont = (AWTFont *)jlong_to_ptr(awtFontPtr);
+    NSFont* nsFont = awtFont->fFont;
+    NSFontDescriptor *fontDescriptor = nsFont.fontDescriptor;
+    NSDictionary *fontTraits = [fontDescriptor objectForKey : NSFontTraitsAttribute];
+    NSNumber *weight = [fontTraits objectForKey : NSFontWeightTrait];
+    weightVal = (float)[weight floatValue];
+
+JNF_COCOA_EXIT(env);
+   return (jfloat)weightVal;
+}
+
+/*
+ * Class:     sun_font_CFont
  * Method:    disposeNativeFont
  * Signature: (J)V
  */
--- a/src/macosx/native/sun/font/AWTStrike.m	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/macosx/native/sun/font/AWTStrike.m	Tue Jun 09 11:24:01 2015 -0700
@@ -311,21 +311,26 @@
 
     jlong *glyphInfos =
         (*env)->GetPrimitiveArrayCritical(env, glyphInfoLongArray, NULL);
-    if (glyphInfos != NULL) {
+
     jint *rawGlyphCodes =
-        (*env)->GetPrimitiveArrayCritical(env, glyphCodes, NULL);
-
+            (*env)->GetPrimitiveArrayCritical(env, glyphCodes, NULL);
+    @try {
+        if (rawGlyphCodes != NULL && glyphInfos != NULL) {
+            CGGlyphImages_GetGlyphImagePtrs(glyphInfos, awtStrike,
+                    rawGlyphCodes, len);
+        }
+    }
+    @finally {
         if (rawGlyphCodes != NULL) {
-    CGGlyphImages_GetGlyphImagePtrs(glyphInfos, awtStrike,
-                                    rawGlyphCodes, len);
-
-    (*env)->ReleasePrimitiveArrayCritical(env, glyphCodes,
-                                          rawGlyphCodes, JNI_ABORT);
+            (*env)->ReleasePrimitiveArrayCritical(env, glyphCodes,
+                                                  rawGlyphCodes, JNI_ABORT);
         }
-    // Do not use JNI_COMMIT, as that will not free the buffer copy
-    // when +ProtectJavaHeap is on.
-    (*env)->ReleasePrimitiveArrayCritical(env, glyphInfoLongArray,
-                                          glyphInfos, 0);
+        if (glyphInfos != NULL) {
+            // Do not use JNI_COMMIT, as that will not free the buffer copy
+            // when +ProtectJavaHeap is on.
+            (*env)->ReleasePrimitiveArrayCritical(env, glyphInfoLongArray,
+                                                  glyphInfos, 0);
+        }
     }
 
 JNF_COCOA_EXIT(env);
--- a/src/macosx/native/sun/font/CGGlyphImages.m	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/macosx/native/sun/font/CGGlyphImages.m	Tue Jun 09 11:24:01 2015 -0700
@@ -195,19 +195,41 @@
 
 
 #pragma mark --- Font Rendering Mode Descriptors ---
+static Int32 reverseGamma = 0;
+
+static UInt8 reverseGammaLut[256] = { 0 };
+
+static inline UInt8* getReverseGammaLut() {
+    if (reverseGamma == 0) {
+        // initialize gamma lut
+        double gamma;
+        int i;
+        const char* pGammaEnv = getenv("J2D_LCD_REVERSE_GAMMA");
+        if (pGammaEnv != NULL) {
+            reverseGamma = atol(pGammaEnv);
+        }
+
+        if (reverseGamma < 100 || reverseGamma > 250) {
+            reverseGamma = 180;
+        }
+
+        gamma = 100.0 / reverseGamma;
+        for (i = 0; i < 256; i++) {
+            double x = ((double)i) / 255.0;
+            reverseGammaLut[i] = (UInt8)(255 * pow(x, gamma));
+        }
+    }
+    return reverseGammaLut;
+}
 
 static inline void
 CGGI_CopyARGBPixelToRGBPixel(const UInt32 p, UInt8 *dst)
 {
-#if __LITTLE_ENDIAN__
-    *(dst + 2) = 0xFF - (p >> 24 & 0xFF);
-    *(dst + 1) = 0xFF - (p >> 16 & 0xFF);
-    *(dst) = 0xFF - (p >> 8 & 0xFF);
-#else
-    *(dst) = 0xFF - (p >> 16 & 0xFF);
-    *(dst + 1) = 0xFF - (p >> 8 & 0xFF);
-    *(dst + 2) = 0xFF - (p & 0xFF);
-#endif
+    UInt8* lut = getReverseGammaLut();
+
+    *(dst + 0) = lut[0xFF - (p >> 16 & 0xFF)];  // red
+    *(dst + 1) = lut[0xFF - (p >>  8 & 0xFF)];  // green
+    *(dst + 2) = lut[0xFF - (p & 0xFF)];        // blue
 }
 
 static void
@@ -222,17 +244,14 @@
     size_t height = info->height;
 
     size_t y;
+    
+    // fill empty glyph image with black-on-white glyph
     for (y = 0; y < height; y++) {
         size_t destRow = y * destRowWidth * 3;
         size_t srcRow = y * srcRowWidth;
 
         size_t x;
         for (x = 0; x < destRowWidth; x++) {
-            // size_t x3 = x * 3;
-            // UInt32 p = src[srcRow + x];
-            // dest[destRow + x3] = 0xFF - (p >> 16 & 0xFF);
-            // dest[destRow + x3 + 1] = 0xFF - (p >> 8 & 0xFF);
-            // dest[destRow + x3 + 2] = 0xFF - (p & 0xFF);
             CGGI_CopyARGBPixelToRGBPixel(src[srcRow + x],
                                          dest + destRow + x * 3);
         }
@@ -260,13 +279,9 @@
 //}
 
 static inline UInt8
-CGGI_ConvertPixelToGreyBit(UInt32 p)
+CGGI_ConvertBWPixelToByteGray(UInt32 p)
 {
-#ifdef __LITTLE_ENDIAN__
-    return 0xFF - ((p >> 24 & 0xFF) + (p >> 16 & 0xFF) + (p >> 8 & 0xFF)) / 3;
-#else
-    return 0xFF - ((p >> 16 & 0xFF) + (p >> 8 & 0xFF) + (p & 0xFF)) / 3;
-#endif
+    return 0xFF - (((p >> 24 & 0xFF) + (p >> 16 & 0xFF) + (p >> 8 & 0xFF)) / 3);
 }
 
 static void
@@ -281,14 +296,15 @@
     size_t height = info->height;
 
     size_t y;
+    
+    // fill empty glyph image with black-on-white glyph
     for (y = 0; y < height; y++) {
         size_t destRow = y * destRowWidth;
         size_t srcRow = y * srcRowWidth;
-
         size_t x;
         for (x = 0; x < destRowWidth; x++) {
             UInt32 p = src[srcRow + x];
-            dest[destRow + x] = CGGI_ConvertPixelToGreyBit(p);
+            dest[destRow + x] = CGGI_ConvertBWPixelToByteGray(p);
         }
     }
 }
@@ -316,13 +332,11 @@
 {
     CGGI_RenderingMode mode;
     mode.cgFontMode = strike->fStyle;
+    NSException *e = nil;
 
     switch (strike->fAAStyle) {
-    case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_DEFAULT:
     case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_OFF:
     case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_ON:
-    case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_GASP:
-    default:
         mode.glyphDescriptor = &grey;
         break;
     case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_LCD_HRGB:
@@ -331,6 +345,17 @@
     case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_LCD_VBGR:
         mode.glyphDescriptor = &rgb;
         break;
+    case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_GASP:
+    case sun_awt_SunHints_INTVAL_TEXT_ANTIALIAS_DEFAULT:
+    default:
+        /* we expect that text antialiasing hint has been already
+         * evaluated. Report an error if we get 'unevaluated' hint here.
+         */
+        e = [NSException
+                exceptionWithName:@"IllegalArgumentException"
+                reason:@"Invalid hint value"
+                userInfo:nil];
+        @throw e;
     }
 
     return mode;
@@ -345,7 +370,8 @@
  */
 static inline void
 CGGI_InitCanvas(CGGI_GlyphCanvas *canvas,
-                const vImagePixelCount width, const vImagePixelCount height)
+                const vImagePixelCount width, const vImagePixelCount height,
+                const CGGI_RenderingMode* mode)
 {
     // our canvas is *always* 4-byte ARGB
     size_t bytesPerRow = width * sizeof(UInt32);
@@ -356,19 +382,26 @@
     canvas->image->height = height;
     canvas->image->rowBytes = bytesPerRow;
 
-    canvas->image->data = (void *)calloc(byteCount, sizeof(UInt32));
+    canvas->image->data = (void *)calloc(byteCount, sizeof(UInt8));
     if (canvas->image->data == NULL) {
         [[NSException exceptionWithName:NSMallocException
             reason:@"Failed to allocate memory for the buffer which backs the CGContext for glyph strikes." userInfo:nil] raise];
     }
 
-    CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
+    uint32_t bmpInfo = kCGImageAlphaPremultipliedFirst;
+    if (mode->glyphDescriptor == &rgb) {
+        bmpInfo |= kCGBitmapByteOrder32Host;
+    }
+
+    CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
     canvas->context = CGBitmapContextCreate(canvas->image->data,
                                             width, height, 8, bytesPerRow,
                                             colorSpace,
-                                            kCGImageAlphaPremultipliedFirst);
+                                            bmpInfo);
 
+    // set foreground color
     CGContextSetRGBFillColor(canvas->context, 0.0f, 0.0f, 0.0f, 1.0f);
+    
     CGContextSetFontSize(canvas->context, 1);
     CGContextSaveGState(canvas->context);
 
@@ -404,7 +437,9 @@
  * Quick and easy inline to check if this canvas is big enough.
  */
 static inline void
-CGGI_SizeCanvas(CGGI_GlyphCanvas *canvas, const vImagePixelCount width, const vImagePixelCount height, const JRSFontRenderingStyle style)
+CGGI_SizeCanvas(CGGI_GlyphCanvas *canvas, const vImagePixelCount width,
+        const vImagePixelCount height,
+        const CGGI_RenderingMode* mode)
 {
     if (canvas->image != NULL &&
         width  < canvas->image->width &&
@@ -418,8 +453,9 @@
     CGGI_FreeCanvas(canvas);
     CGGI_InitCanvas(canvas,
                     width * CGGI_GLYPH_CANVAS_SLACK,
-                    height * CGGI_GLYPH_CANVAS_SLACK);
-    JRSFontSetRenderingStyleOnContext(canvas->context, style);
+                    height * CGGI_GLYPH_CANVAS_SLACK,
+                    mode);
+    JRSFontSetRenderingStyleOnContext(canvas->context, mode->cgFontMode);
 }
 
 /*
@@ -443,6 +479,7 @@
     Pixel_8888 opaqueWhite = { 0xFF, 0xFF, 0xFF, 0xFF };
 #endif
 
+    // clear canvas background and set foreground color
     vImageBufferFill_ARGB8888(&canvasRectToClear, opaqueWhite, kvImageNoFlags);
 }
 
@@ -577,7 +614,7 @@
     GlyphInfo *info = CGGI_CreateNewGlyphInfoFrom(advance, bbox, strike, mode);
 
     // fix the context size, just in case the substituted character is unexpectedly large
-    CGGI_SizeCanvas(canvas, info->width, info->height, mode->cgFontMode);
+    CGGI_SizeCanvas(canvas, info->width, info->height, mode);
 
     // align the transform for the real CoreText strike
     CGContextSetTextMatrix(canvas->context, strike->fAltTx);
@@ -653,8 +690,11 @@
 #endif
 }
 
-static NSString *threadLocalCanvasKey =
-    @"Java CoreGraphics Text Renderer Cached Canvas";
+static NSString *threadLocalAACanvasKey =
+    @"Java CoreGraphics Text Renderer Cached Canvas for AA";
+
+static NSString *threadLocalLCDCanvasKey =
+    @"Java CoreGraphics Text Renderer Cached Canvas for LCD";
 
 /*
  * This is the maximum length and height times the above slack squared
@@ -678,25 +718,28 @@
         CGGI_GLYPH_CANVAS_MAX*CGGI_GLYPH_CANVAS_MAX*CGGI_GLYPH_CANVAS_SLACK*CGGI_GLYPH_CANVAS_SLACK)
     {
         CGGI_GlyphCanvas *tmpCanvas = [[CGGI_GlyphCanvas alloc] init];
-        CGGI_InitCanvas(tmpCanvas, maxWidth, maxHeight);
+        CGGI_InitCanvas(tmpCanvas, maxWidth, maxHeight, mode);
         CGGI_FillImagesForGlyphsWithSizedCanvas(tmpCanvas, strike,
-                                                mode, glyphInfos, uniChars,
-                                                glyphs, len);
+                mode, glyphInfos, uniChars,
+                glyphs, len);
         CGGI_FreeCanvas(tmpCanvas);
 
         [tmpCanvas release];
         return;
     }
-
     NSMutableDictionary *threadDict =
         [[NSThread currentThread] threadDictionary];
-    CGGI_GlyphCanvas *canvas = [threadDict objectForKey:threadLocalCanvasKey];
+
+    NSString* theKey = (mode->glyphDescriptor == &rgb) ?
+        threadLocalLCDCanvasKey : threadLocalAACanvasKey;
+    
+    CGGI_GlyphCanvas *canvas = [threadDict objectForKey:theKey];
     if (canvas == nil) {
         canvas = [[CGGI_GlyphCanvas alloc] init];
-        [threadDict setObject:canvas forKey:threadLocalCanvasKey];
+        [threadDict setObject:canvas forKey:theKey];
     }
 
-    CGGI_SizeCanvas(canvas, maxWidth, maxHeight, mode->cgFontMode);
+    CGGI_SizeCanvas(canvas, maxWidth, maxHeight, mode);
     CGGI_FillImagesForGlyphsWithSizedCanvas(canvas, strike, mode,
                                             glyphInfos, uniChars, glyphs, len);
 }
--- a/src/macosx/native/sun/osxapp/NSApplicationAWT.h	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/macosx/native/sun/osxapp/NSApplicationAWT.h	Tue Jun 09 11:24:01 2015 -0700
@@ -37,6 +37,7 @@
 - (void) registerWithProcessManager;
 - (void) setDockIconWithEnv:(JNIEnv *)env;
 - (void) postDummyEvent;
+- (void) postRunnableEvent:(void (^)())block;
 - (void) waitForDummyEvent;
 
 + (void) runAWTLoopWithApp:(NSApplication*)app;
--- a/src/macosx/native/sun/osxapp/NSApplicationAWT.m	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/macosx/native/sun/osxapp/NSApplicationAWT.m	Tue Jun 09 11:24:01 2015 -0700
@@ -338,9 +338,13 @@
 
 - (void)sendEvent:(NSEvent *)event
 {
-    if ([event type] == NSApplicationDefined && TS_EQUAL([event timestamp], dummyEventTimestamp)) {
+    if ([event type] == NSApplicationDefined && TS_EQUAL([event timestamp], dummyEventTimestamp) && [event subtype] == 0) {
         [seenDummyEventLock lockWhenCondition:NO];
         [seenDummyEventLock unlockWithCondition:YES];
+    } else if ([event type] == NSApplicationDefined && [event subtype] == 777) {
+        void (^block)() = (void (^)()) [event data1];
+        block();
+        [block release];
     } else if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask)) {
         // Cocoa won't send us key up event when releasing a key while Cmd is down,
         // so we have to do it ourselves.
@@ -350,6 +354,33 @@
     }
 }
 
+/*
+ * Posts the block to the AppKit event queue which will be executed 
+ * on the main AppKit loop. 
+ * While running nested loops this event will be ignored. 
+ */
+- (void)postRunnableEvent:(void (^)())block 
+{
+    void (^copy)() = [block copy];
+    NSInteger encode = (NSInteger) copy;
+    [copy retain];
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];    
+    NSEvent* event = [NSEvent otherEventWithType: NSApplicationDefined
+                                        location: NSMakePoint(0,0)
+                                   modifierFlags: 0
+                                       timestamp: 0
+                                    windowNumber: 0
+                                         context: nil
+                                         subtype: 777
+                                           data1: encode
+                                           data2: 0];
+
+    [NSApp postEvent: event atStart: NO];
+    [pool drain];
+}
+
+
+
 - (void)postDummyEvent {
     seenDummyEventLock = [[NSConditionLock alloc] initWithCondition:NO];
     dummyEventTimestamp = [NSProcessInfo processInfo].systemUptime;
--- a/src/share/classes/com/sun/jndi/ldap/Connection.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/com/sun/jndi/ldap/Connection.java	Tue Jun 09 11:24:01 2015 -0700
@@ -439,9 +439,14 @@
     BerDecoder readReply(LdapRequest ldr)
             throws IOException, NamingException {
         BerDecoder rber;
-        boolean waited = false;
 
-        while (((rber = ldr.getReplyBer()) == null) && !waited) {
+        // Track down elapsed time to workaround spurious wakeups
+        long elapsedMilli = 0;
+        long elapsedNano = 0;
+
+        while (((rber = ldr.getReplyBer()) == null) &&
+                (readTimeout <= 0 || elapsedMilli < readTimeout))
+        {
             try {
                 // If socket closed, don't even try
                 synchronized (this) {
@@ -455,11 +460,15 @@
                     rber = ldr.getReplyBer();
                     if (rber == null) {
                         if (readTimeout > 0) {  // Socket read timeout is specified
+                            long beginNano = System.nanoTime();
 
-                            // will be woken up before readTimeout only if reply is
+                            // will be woken up before readTimeout if reply is
                             // available
-                            ldr.wait(readTimeout);
-                            waited = true;
+                            ldr.wait(readTimeout - elapsedMilli);
+                            elapsedNano += (System.nanoTime() - beginNano);
+                            elapsedMilli += elapsedNano / 1000_000;
+                            elapsedNano %= 1000_000;
+
                         } else {
                             // no timeout is set so we wait infinitely until
                             // a response is received
@@ -476,7 +485,7 @@
             }
         }
 
-        if ((rber == null) && waited) {
+        if ((rber == null) && (elapsedMilli >= readTimeout)) {
             abandonRequest(ldr, null);
             throw new NamingException("LDAP response read timed out, timeout used:"
                             + readTimeout + "ms." );
--- a/src/share/classes/java/awt/Component.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/java/awt/Component.java	Tue Jun 09 11:24:01 2015 -0700
@@ -1302,6 +1302,25 @@
     }
 
     /**
+     * Determines the bounds of a visible part of the component relative to its
+     * parent.
+     *
+     * @return the visible part of bounds
+     */
+    private Rectangle getRecursivelyVisibleBounds() {
+        final Component container = getContainer();
+        final Rectangle bounds = getBounds();
+        if (container == null) {
+            // we are top level window or haven't a container, return our bounds
+            return bounds;
+        }
+        // translate the container's bounds to our coordinate space
+        final Rectangle parentsBounds = container.getRecursivelyVisibleBounds();
+        parentsBounds.setLocation(0, 0);
+        return parentsBounds.intersection(bounds);
+    }
+
+    /**
      * Translates absolute coordinates into coordinates in the coordinate
      * space of this component.
      */
@@ -1473,7 +1492,7 @@
                 ComponentPeer peer = this.peer;
                 if (peer != null) {
                     peer.setEnabled(true);
-                    if (visible) {
+                    if (visible && !getRecursivelyVisibleBounds().isEmpty()) {
                         updateCursorImmediately();
                     }
                 }
@@ -1522,7 +1541,7 @@
                 ComponentPeer peer = this.peer;
                 if (peer != null) {
                     peer.setEnabled(false);
-                    if (visible) {
+                    if (visible && !getRecursivelyVisibleBounds().isEmpty()) {
                         updateCursorImmediately();
                     }
                 }
--- a/src/share/classes/java/awt/Container.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/java/awt/Container.java	Tue Jun 09 11:24:01 2015 -0700
@@ -44,6 +44,7 @@
 import java.lang.ref.WeakReference;
 import java.security.AccessController;
 
+import java.util.ArrayList;
 import java.util.EventListener;
 import java.util.HashSet;
 import java.util.Set;
@@ -100,7 +101,7 @@
      * @see #add
      * @see #getComponents
      */
-    private java.util.List<Component> component = new java.util.ArrayList<Component>();
+    private java.util.List<Component> component = new ArrayList<>();
 
     /**
      * Layout manager for this container.
@@ -2545,28 +2546,24 @@
         if (!contains(x, y)) {
             return null;
         }
+        Component lightweight = null;
         synchronized (getTreeLock()) {
-            // Two passes: see comment in sun.awt.SunGraphicsCallback
-            for (int i = 0; i < component.size(); i++) {
-                Component comp = component.get(i);
-                if (comp != null &&
-                    !(comp.peer instanceof LightweightPeer)) {
-                    if (comp.contains(x - comp.x, y - comp.y)) {
+            // Optimized version of two passes:
+            // see comment in sun.awt.SunGraphicsCallback
+            for (final Component comp : component) {
+                if (comp.contains(x - comp.x, y - comp.y)) {
+                    if (!comp.isLightweight()) {
+                        // return heavyweight component as soon as possible
                         return comp;
                     }
-                }
-            }
-            for (int i = 0; i < component.size(); i++) {
-                Component comp = component.get(i);
-                if (comp != null &&
-                    comp.peer instanceof LightweightPeer) {
-                    if (comp.contains(x - comp.x, y - comp.y)) {
-                        return comp;
+                    if (lightweight == null) {
+                        // save and return later the first lightweight component
+                        lightweight = comp;
                     }
                 }
             }
         }
-        return this;
+        return lightweight != null ? lightweight : this;
     }
 
     /**
@@ -2670,52 +2667,54 @@
         return null;
     }
 
-    final Component findComponentAtImpl(int x, int y, boolean ignoreEnabled){
-        checkTreeLock();
+    final Component findComponentAtImpl(int x, int y, boolean ignoreEnabled) {
+        // checkTreeLock(); commented for a performance reason
 
         if (!(contains(x, y) && visible && (ignoreEnabled || enabled))) {
             return null;
         }
-
-        // Two passes: see comment in sun.awt.SunGraphicsCallback
-        for (int i = 0; i < component.size(); i++) {
-            Component comp = component.get(i);
-            if (comp != null &&
-                !(comp.peer instanceof LightweightPeer)) {
-                if (comp instanceof Container) {
-                    comp = ((Container)comp).findComponentAtImpl(x - comp.x,
-                                                                 y - comp.y,
-                                                                 ignoreEnabled);
-                } else {
-                    comp = comp.getComponentAt(x - comp.x, y - comp.y);
+        Component lightweight = null;
+        // Optimized version of two passes:
+        // see comment in sun.awt.SunGraphicsCallback
+        for (final Component comp : component) {
+            final int x1 = x - comp.x;
+            final int y1 = y - comp.y;
+            if (!comp.contains(x1, y1)) {
+                continue; // fast path
+            }
+            if (!comp.isLightweight()) {
+                final Component child = getChildAt(comp, x1, y1, ignoreEnabled);
+                if (child != null) {
+                    // return heavyweight component as soon as possible
+                    return child;
                 }
-                if (comp != null && comp.visible &&
-                    (ignoreEnabled || comp.enabled))
-                {
-                    return comp;
+            } else {
+                if (lightweight == null) {
+                    // save and return later the first lightweight component
+                    lightweight = getChildAt(comp, x1, y1, ignoreEnabled);
                 }
             }
         }
-        for (int i = 0; i < component.size(); i++) {
-            Component comp = component.get(i);
-            if (comp != null &&
-                comp.peer instanceof LightweightPeer) {
-                if (comp instanceof Container) {
-                    comp = ((Container)comp).findComponentAtImpl(x - comp.x,
-                                                                 y - comp.y,
-                                                                 ignoreEnabled);
-                } else {
-                    comp = comp.getComponentAt(x - comp.x, y - comp.y);
-                }
-                if (comp != null && comp.visible &&
-                    (ignoreEnabled || comp.enabled))
-                {
-                    return comp;
-                }
-            }
+        return lightweight != null ? lightweight : this;
+    }
+
+    /**
+     * Helper method for findComponentAtImpl. Finds a child component using
+     * findComponentAtImpl for Container and getComponentAt for Component.
+     */
+    private static Component getChildAt(Component comp, int x, int y,
+                                        boolean ignoreEnabled) {
+        if (comp instanceof Container) {
+            comp = ((Container) comp).findComponentAtImpl(x, y,
+                                                          ignoreEnabled);
+        } else {
+            comp = comp.getComponentAt(x, y);
         }
-
-        return this;
+        if (comp != null && comp.visible &&
+                (ignoreEnabled || comp.enabled)) {
+            return comp;
+        }
+        return null;
     }
 
     /**
@@ -4402,6 +4401,18 @@
 
     private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.LightweightDispatcher");
 
+    private static final int BUTTONS_DOWN_MASK;
+
+    static {
+        int[] buttonsDownMask = AWTAccessor.getInputEventAccessor().
+                getButtonDownMasks();
+        int mask = 0;
+        for (int buttonDownMask : buttonsDownMask) {
+            mask |= buttonDownMask;
+        }
+        BUTTONS_DOWN_MASK = mask;
+    }
+
     LightweightDispatcher(Container nativeContainer) {
         this.nativeContainer = nativeContainer;
         mouseEventTarget = new WeakReference<>(null);
@@ -4470,25 +4481,12 @@
     private boolean isMouseGrab(MouseEvent e) {
         int modifiers = e.getModifiersEx();
 
-        if(e.getID() == MouseEvent.MOUSE_PRESSED
-            || e.getID() == MouseEvent.MOUSE_RELEASED)
-        {
-            switch (e.getButton()) {
-            case MouseEvent.BUTTON1:
-                modifiers ^= InputEvent.BUTTON1_DOWN_MASK;
-                break;
-            case MouseEvent.BUTTON2:
-                modifiers ^= InputEvent.BUTTON2_DOWN_MASK;
-                break;
-            case MouseEvent.BUTTON3:
-                modifiers ^= InputEvent.BUTTON3_DOWN_MASK;
-                break;
-            }
+        if (e.getID() == MouseEvent.MOUSE_PRESSED
+                || e.getID() == MouseEvent.MOUSE_RELEASED) {
+            modifiers ^= InputEvent.getMaskForButton(e.getButton());
         }
         /* modifiers now as just before event */
-        return ((modifiers & (InputEvent.BUTTON1_DOWN_MASK
-                              | InputEvent.BUTTON2_DOWN_MASK
-                              | InputEvent.BUTTON3_DOWN_MASK)) != 0);
+        return ((modifiers & BUTTONS_DOWN_MASK) != 0);
     }
 
     /**
--- a/src/share/classes/java/awt/ScrollPane.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/java/awt/ScrollPane.java	Tue Jun 09 11:24:01 2015 -0700
@@ -496,9 +496,8 @@
         Point p = getScrollPosition();
         Dimension cs = calculateChildSize();
         Dimension vs = getViewportSize();
-        Insets i = getInsets();
 
-        c.reshape(i.left - p.x, i.top - p.y, cs.width, cs.height);
+        c.reshape(- p.x, - p.y, cs.width, cs.height);
         ScrollPanePeer peer = (ScrollPanePeer)this.peer;
         if (peer != null) {
             peer.childResized(cs.width, cs.height);
--- a/src/share/classes/java/security/ProtectionDomain.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/java/security/ProtectionDomain.java	Tue Jun 09 11:24:01 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
 
 package java.security;
 
-import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -457,37 +456,24 @@
     /**
      * Used for storing ProtectionDomains as keys in a Map.
      */
-    final static class Key {}
-
-    // A cache of ProtectionDomains and their Permissions
-    private static class PDCache implements ProtectionDomainCache {
-        // We must wrap the PermissionCollection in a WeakReference as there
-        // are some PermissionCollections which contain strong references
-        // back to a ProtectionDomain and otherwise would never be removed
-        // from the WeakHashMap
-        private final Map<Key, WeakReference<PermissionCollection>>
-            map = new WeakHashMap<>();
-
-        @Override
-        public synchronized void put(ProtectionDomain pd,
-                                     PermissionCollection pc) {
-            map.put(pd == null ? null : pd.key, new WeakReference<>(pc));
-        }
-
-        @Override
-        public synchronized PermissionCollection get(ProtectionDomain pd) {
-            WeakReference<PermissionCollection> ref =
-                map.get(pd == null ? null : pd.key);
-            return ref == null ? null : ref.get();
-        }
-    }
+    final class Key {}
 
     static {
         SharedSecrets.setJavaSecurityProtectionDomainAccess(
             new JavaSecurityProtectionDomainAccess() {
-                @Override
                 public ProtectionDomainCache getProtectionDomainCache() {
-                    return new PDCache();
+                    return new ProtectionDomainCache() {
+                        private final Map<Key, PermissionCollection> map =
+                            Collections.synchronizedMap
+                                (new WeakHashMap<Key, PermissionCollection>());
+                        public void put(ProtectionDomain pd,
+                            PermissionCollection pc) {
+                            map.put((pd == null ? null : pd.key), pc);
+                        }
+                        public PermissionCollection get(ProtectionDomain pd) {
+                            return pd == null ? map.get(null) : map.get(pd.key);
+                        }
+                    };
                 }
             });
     }
--- a/src/share/classes/javax/sql/rowset/BaseRowSet.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/javax/sql/rowset/BaseRowSet.java	Tue Jun 09 11:24:01 2015 -0700
@@ -461,7 +461,7 @@
      * <code>false</code> that it is not. The default is <code>true</code>.
      * @serial
      */
-    private boolean escapeProcessing;
+    private boolean escapeProcessing = true;
 
     /**
      * A constant indicating the isolation level of the connection
--- a/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java	Tue Jun 09 11:24:01 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,6 +48,8 @@
  * Therefore, any <code>RowSetMetaDataImpl</code> method that retrieves information
  * is defined as having unspecified behavior when it is called
  * before the <code>RowSet</code> object contains data.
+ *
+ * @since 1.5
  */
 public class RowSetMetaDataImpl implements RowSetMetaData,  Serializable {
 
@@ -579,7 +581,7 @@
      *
      * @param columnIndex the first column is 1, the second is 2, and so on;
      *        must be between <code>1</code> and the number of columns, inclusive
-     * @return <code>true</code> if if a value in the designated column is a signed
+     * @return <code>true</code> if a value in the designated column is a signed
      *         number; <code>false</code> otherwise
      * @throws SQLException if a database access error occurs
      *         or the given column number is out of bounds
@@ -605,7 +607,7 @@
     }
 
     /**
-     * Retrieves the the suggested column title for the designated
+     * Retrieves the suggested column title for the designated
      * column for use in printouts and displays.
      *
      * @param columnIndex the first column is 1, the second is 2, and so on;
@@ -801,8 +803,10 @@
      * @throws SQLException if a database access error occurs
      * or the given column number is out of bounds
      */
-    public  boolean isDefinitelyWritable(int columnIndex)
-        throws SQLException { return true;}
+    public  boolean isDefinitelyWritable(int columnIndex) throws SQLException {
+        checkColRange(columnIndex);
+        return true;
+    }
 
     /**
      * Retrieves the fully-qualified name of the class in the Java
@@ -1071,7 +1075,7 @@
         public int colType;
 
         /**
-         * The field that holds the the type name used by this particular data source
+         * The field that holds the type name used by this particular data source
          * for the value stored in this column.
          *
          * @serial
@@ -1079,7 +1083,7 @@
         public String colTypeName;
 
         /**
-         * The field that holds the updatablity boolean per column of a RowSet
+         * The field that holds the updatability boolean per column of a RowSet
          *
          * @serial
          */
--- a/src/share/classes/javax/sql/rowset/RowSetWarning.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/javax/sql/rowset/RowSetWarning.java	Tue Jun 09 11:24:01 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,15 +50,12 @@
  * The inherited methods <code>getMessage</code>, <code>getSQLState</code>,
  * and <code>getErrorCode</code> retrieve information contained in a
  * <code>RowSetWarning</code> object.
+ *
+ * @since 1.5
  */
 public class RowSetWarning extends SQLException {
 
     /**
-     * RowSetWarning object handle.
-     */
-     private RowSetWarning rwarning;
-
-    /**
      * Constructs a <code>RowSetWarning</code> object
      * with the given value for the reason; SQLState defaults to null,
      * and vendorCode defaults to 0.
@@ -109,7 +106,7 @@
      * @param reason a <code>String</code> giving a description of the
      *        warning;
      * @param SQLState an XOPEN code identifying the warning; if a non standard
-     *        XPOEN <i>SQLState</i> is supplied, no exception is thrown.
+     *        XOPEN <i>SQLState</i> is supplied, no exception is thrown.
      * @param vendorCode a database vendor-specific warning code
      */
     public RowSetWarning(java.lang.String reason, java.lang.String SQLState, int vendorCode) {
@@ -126,7 +123,15 @@
      * @see #setNextWarning
      */
     public RowSetWarning getNextWarning() {
-        return rwarning;
+        SQLException warning = getNextException();
+        if (  warning == null || warning instanceof RowSetWarning) {
+            return (RowSetWarning)warning;
+        } else {
+            // The chained value isn't a RowSetWarning.
+            // This is a programming error by whoever added it to
+            // the RowSetWarning chain.  We throw a Java "Error".
+            throw new Error("RowSetWarning chain holds value that is not a RowSetWarning: ");
+        }
     }
 
     /**
@@ -139,7 +144,7 @@
      * @see #getNextWarning
      */
     public void setNextWarning(RowSetWarning warning) {
-        rwarning = warning;
+        setNextException(warning);
     }
 
     static final long serialVersionUID = 6678332766434564774L;
--- a/src/share/classes/javax/swing/JInternalFrame.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/javax/swing/JInternalFrame.java	Tue Jun 09 11:24:01 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,6 @@
 
 import java.io.ObjectOutputStream;
 import java.io.IOException;
-import java.lang.StringBuilder;
 import java.beans.PropertyChangeListener;
 import sun.awt.AppContext;
 import sun.swing.SwingUtilities2;
@@ -1650,7 +1649,7 @@
      * <dt><code>DO_NOTHING_ON_CLOSE</code>
      * <dd> Do nothing.
      *      This requires the program to handle the operation
-     *      in the <code>windowClosing</code> method
+     *      in the <code>internalFrameClosing</code> method
      *      of a registered <code>InternalFrameListener</code> object.
      * <dt><code>HIDE_ON_CLOSE</code>
      * <dd> Automatically make the internal frame invisible.
--- a/src/share/classes/javax/swing/JSpinner.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/javax/swing/JSpinner.java	Tue Jun 09 11:24:01 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,8 +42,6 @@
 import javax.accessibility.*;
 import sun.util.locale.provider.LocaleProviderAdapter;
 import sun.util.locale.provider.LocaleResources;
-import sun.util.locale.provider.LocaleServiceProviderPool;
-
 
 /**
  * A single line input field that lets the user select a
@@ -77,12 +75,12 @@
  *   try {
  *       spinner.commitEdit();
  *   }
- *   catch (ParseException pe) {{
+ *   catch (ParseException pe) {
  *       // Edited value is invalid, spinner.getValue() will return
  *       // the last valid value, you could revert the spinner to show that:
- *       JComponent editor = spinner.getEditor()
+ *       JComponent editor = spinner.getEditor();
  *       if (editor instanceof DefaultEditor) {
- *           ((DefaultEditor)editor).getTextField().setValue(spinner.getValue();
+ *           ((DefaultEditor)editor).getTextField().setValue(spinner.getValue());
  *       }
  *       // reset the value to some known value:
  *       spinner.setValue(fallbackValue);
--- a/src/share/classes/javax/swing/RepaintManager.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/javax/swing/RepaintManager.java	Tue Jun 09 11:24:01 2015 -0700
@@ -181,9 +181,16 @@
      */
     private final ProcessingRunnable processingRunnable;
 
-    private final static JavaSecurityAccess javaSecurityAccess =
-        SharedSecrets.getJavaSecurityAccess();
+    private static final JavaSecurityAccess javaSecurityAccess =
+            SharedSecrets.getJavaSecurityAccess();
 
+    /**
+     * Listener installed to detect display changes. When display changes,
+     * schedules a callback to notify all RepaintManagers of the display
+     * changes.
+     */
+    private static final DisplayChangedListener displayChangedHandler =
+            new DisplayChangedHandler();
 
     static {
         SwingAccessor.setRepaintManagerAccessor(new SwingAccessor.RepaintManagerAccessor() {
@@ -225,8 +232,8 @@
         GraphicsEnvironment ge = GraphicsEnvironment.
                 getLocalGraphicsEnvironment();
         if (ge instanceof SunGraphicsEnvironment) {
-            ((SunGraphicsEnvironment)ge).addDisplayChangedListener(
-                    new DisplayChangedHandler());
+            ((SunGraphicsEnvironment) ge).addDisplayChangedListener(
+                    displayChangedHandler);
         }
         Toolkit tk = Toolkit.getDefaultToolkit();
         if ((tk instanceof SunToolkit)
@@ -1649,6 +1656,12 @@
      */
     private static final class DisplayChangedHandler implements
                                              DisplayChangedListener {
+        // Empty non private constructor was added because access to this
+        // class shouldn't be generated by the compiler using synthetic
+        // accessor method
+        DisplayChangedHandler() {
+        }
+
         public void displayChanged() {
             scheduleDisplayChanges();
         }
@@ -1656,11 +1669,10 @@
         public void paletteChanged() {
         }
 
-        private void scheduleDisplayChanges() {
+        private static void scheduleDisplayChanges() {
             // To avoid threading problems, we notify each RepaintManager
             // on the thread it was created on.
-            for (Object c : AppContext.getAppContexts()) {
-                AppContext context = (AppContext) c;
+            for (AppContext context : AppContext.getAppContexts()) {
                 synchronized(context) {
                     if (!context.isDisposed()) {
                         EventQueue eventQueue = (EventQueue)context.get(
--- a/src/share/classes/sun/awt/datatransfer/DataTransferer.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/sun/awt/datatransfer/DataTransferer.java	Tue Jun 09 11:24:01 2015 -0700
@@ -2905,13 +2905,13 @@
                     return comp;
                 }
 
-                if (flavor1.isFlavorTextType()) {
-                    return 1;
-                }
-
-                if (flavor2.isFlavorTextType()) {
-                    return -1;
-                }
+//                if (flavor1.isFlavorTextType()) {
+//                    return 1;
+//                }
+//
+//                if (flavor2.isFlavorTextType()) {
+//                    return -1;
+//                }
 
                 // Next, look for application/x-java-* types. Prefer unknown
                 // MIME types because if the user provides his own data flavor,
--- a/src/share/classes/sun/font/Font2D.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/sun/font/Font2D.java	Tue Jun 09 11:24:01 2015 -0700
@@ -157,6 +157,21 @@
         }
     }
 
+    public static final int FWIDTH_NORMAL = 5;    // OS/2 usWidthClass
+    public static final int FWEIGHT_NORMAL = 400; // OS/2 usWeightClass
+    public static final int FWEIGHT_BOLD   = 700; // OS/2 usWeightClass
+
+    public int getWidth() {
+        return FWIDTH_NORMAL;
+    }
+
+    public int getWeight() {
+        if ((style & Font.BOLD) !=0) {
+            return FWEIGHT_BOLD;
+        } else {
+            return FWEIGHT_NORMAL;
+        }
+    }
 
     int getRank() {
         return fontRank;
--- a/src/share/classes/sun/font/FontFamily.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/sun/font/FontFamily.java	Tue Jun 09 11:24:01 2015 -0700
@@ -27,6 +27,7 @@
 
 import java.io.File;
 import java.awt.Font;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.Locale;
@@ -134,7 +135,104 @@
         return java.util.Objects.equals(newDir, existDir);
     }
 
+    /*
+     * We want a family to be of the same width and prefer medium/normal width.
+     * Once we find a particular width we accept more of the same width
+     * until we find one closer to normal when we 'evict' all existing fonts.
+     * So once we see a 'normal' width font we evict all members that are not
+     * normal width and then accept only new ones that are normal width.
+     *
+     * Once a font passes the width test we subject it to the weight test.
+     * For Plain we target the weight the closest that is <= NORMAL (400)
+     * For Bold we target the weight that is closest to BOLD (700).
+     *
+     * In the future, rather than discarding these fonts, we should
+     * extend the family to include these so lookups on these properties
+     * can locate them, as presently they will only be located by full name
+     * based lookup.
+     */
+
+    private int familyWidth = 0;
+    private boolean preferredWidth(Font2D font) {
+
+        int newWidth = font.getWidth();
+
+        if (familyWidth == 0) {
+            familyWidth = newWidth;
+            return true;
+        }
+
+        if (newWidth == familyWidth) {
+            return true;
+        }
+
+        if (Math.abs(Font2D.FWIDTH_NORMAL - newWidth) <
+            Math.abs(Font2D.FWIDTH_NORMAL - familyWidth))
+        {
+           if (FontUtilities.debugFonts()) {
+               FontUtilities.getLogger().info(
+               "Found more preferred width. New width = " + newWidth +
+               " Old width = " + familyWidth + " in font " + font +
+               " nulling out fonts plain: " + plain + " bold: " + bold +
+               " italic: " + italic + " bolditalic: " + bolditalic);
+           }
+           familyWidth = newWidth;
+           plain = bold = italic = bolditalic = null;
+           return true;
+        } else if (FontUtilities.debugFonts()) {
+               FontUtilities.getLogger().info(
+               "Family rejecting font " + font +
+               " of less preferred width " + newWidth);
+        }
+        return false;
+    }
+
+    private boolean closerWeight(Font2D currFont, Font2D font, int style) {
+        if (familyWidth != font.getWidth()) {
+            return false;
+        }
+
+        if (currFont == null) {
+            return true;
+        }
+
+        if (FontUtilities.debugFonts()) {
+            FontUtilities.getLogger().info(
+            "New weight for style " + style + ". Curr.font=" + currFont +
+            " New font="+font+" Curr.weight="+ + currFont.getWeight()+
+            " New weight="+font.getWeight());
+        }
+
+        int newWeight = font.getWeight();
+        switch (style) {
+            case Font.PLAIN:
+            case Font.ITALIC:
+                return (newWeight <= Font2D.FWEIGHT_NORMAL &&
+                        newWeight > currFont.getWeight());
+
+            case Font.BOLD:
+            case Font.BOLD|Font.ITALIC:
+                return (Math.abs(newWeight - Font2D.FWEIGHT_BOLD) <
+                        Math.abs(currFont.getWeight() - Font2D.FWEIGHT_BOLD));
+
+            default:
+               return false;
+        }
+    }
+
     public void setFont(Font2D font, int style) {
+
+        if (FontUtilities.isLogging()) {
+            String msg;
+            if (font instanceof CompositeFont) {
+                msg = "Request to add " + font.getFamilyName(null) +
+                      " with style " + style + " to family " + familyName;
+            } else {
+                msg = "Request to add " + font +
+                      " with style " + style + " to family " + this;
+            }
+            FontUtilities.getLogger().info(msg);
+        }
         /* Allow a lower-rank font only if its a file font
          * from the exact same source as any previous font.
          */
@@ -152,19 +250,27 @@
         switch (style) {
 
         case Font.PLAIN:
-            plain = font;
+            if (preferredWidth(font) && closerWeight(plain, font, style)) {
+                plain = font;
+            }
             break;
 
         case Font.BOLD:
-            bold = font;
+            if (preferredWidth(font) && closerWeight(bold, font, style)) {
+                bold = font;
+            }
             break;
 
         case Font.ITALIC:
-            italic = font;
+            if (preferredWidth(font) && closerWeight(italic, font, style)) {
+                italic = font;
+            }
             break;
 
         case Font.BOLD|Font.ITALIC:
-            bolditalic = font;
+            if (preferredWidth(font) && closerWeight(bolditalic, font, style)) {
+                bolditalic = font;
+            }
             break;
 
         default:
@@ -316,6 +422,11 @@
         return allLocaleNames.get(name.toLowerCase());
     }
 
+    public static FontFamily[] getAllFontFamilies() {
+       Collection<FontFamily> families = familyNameMap.values();
+       return families.toArray(new FontFamily[0]);
+    }
+
     public String toString() {
         return
             "Font family: " + familyName +
--- a/src/share/classes/sun/font/StandardTextSource.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/sun/font/StandardTextSource.java	Tue Jun 09 11:24:01 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,42 +33,43 @@
 import java.awt.font.FontRenderContext;
 import java.awt.font.LineMetrics;
 
-public class StandardTextSource extends TextSource {
-  char[] chars;
-  int start;
-  int len;
-  int cstart;
-  int clen;
-  int level; // assumed all uniform
-  int flags; // see GlyphVector.java
-  Font font;
-  FontRenderContext frc;
-  CoreMetrics cm;
+final class StandardTextSource extends TextSource {
 
-  /**
-   * Create a simple implementation of a TextSource.
-   *
-   * Chars is an array containing clen chars in the context, in
-   * logical order, contiguously starting at cstart.  Start and len
-   * represent that portion of the context representing the true
-   * source; start, like cstart, is relative to the start of the
-   * character array.
-   *
-   * Level is the bidi level (0-63 for the entire context. Flags is
-   * the layout flags. Font is the font, frc is the render context,
-   * and lm is the line metrics for the entire source text, but not
-   * necessarily the context.
-   */
-  public StandardTextSource(char[] chars,
-                            int start,
-                            int len,
-                            int cstart,
-                            int clen,
-                            int level,
-                            int flags,
-                            Font font,
-                            FontRenderContext frc,
-                            CoreMetrics cm) {
+    private final char[] chars;
+    private final int start;
+    private final int len;
+    private final int cstart;
+    private final int clen;
+    private final int level; // assumed all uniform
+    private final int flags; // see GlyphVector.java
+    private final Font font;
+    private final FontRenderContext frc;
+    private final CoreMetrics cm;
+
+    /**
+     * Create a simple implementation of a TextSource.
+     *
+     * Chars is an array containing clen chars in the context, in
+     * logical order, contiguously starting at cstart.  Start and len
+     * represent that portion of the context representing the true
+     * source; start, like cstart, is relative to the start of the
+     * character array.
+     *
+     * Level is the bidi level (0-63 for the entire context. Flags is
+     * the layout flags. Font is the font, frc is the render context,
+     * and lm is the line metrics for the entire source text, but not
+     * necessarily the context.
+     */
+    StandardTextSource(char[] chars,
+                       int start,
+                       int len,
+                       int cstart,
+                       int clen,
+                       int level,
+                       int flags,
+                       Font font,
+                       FontRenderContext frc,
+                       CoreMetrics cm) {
     if (chars == null) {
       throw new IllegalArgumentException("bad chars: null");
     }
@@ -97,7 +98,7 @@
       throw new IllegalArgumentException("bad frc: null");
     }
 
-    this.chars = chars.clone();
+    this.chars = chars;
     this.start = start;
     this.len = len;
     this.cstart = cstart;
@@ -115,40 +116,10 @@
     }
   }
 
-  /** Create a StandardTextSource whose context is coextensive with the source. */
-  public StandardTextSource(char[] chars,
-                            int start,
-                            int len,
-                            int level,
-                            int flags,
-                            Font font,
-                            FontRenderContext frc,
-                            CoreMetrics cm) {
-    this(chars, start, len, start, len, level, flags, font, frc, cm);
-  }
-
-  /** Create a StandardTextSource whose context and source are coextensive with the entire char array. */
-  public StandardTextSource(char[] chars,
-                            int level,
-                            int flags,
-                            Font font,
-                            FontRenderContext frc) {
-    this(chars, 0, chars.length, 0, chars.length, level, flags, font, frc, null);
-  }
-
-  /** Create a StandardTextSource whose context and source are all the text in the String. */
-  public StandardTextSource(String str,
-                            int level,
-                            int flags,
-                            Font font,
-                            FontRenderContext frc) {
-    this(str.toCharArray(), 0, str.length(), 0, str.length(), level, flags, font, frc, null);
-  }
-
   // TextSource API
 
   public char[] getChars() {
-    return chars.clone();
+    return chars;
   }
 
   public int getStart() {
--- a/src/share/classes/sun/font/TextLabelFactory.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/sun/font/TextLabelFactory.java	Tue Jun 09 11:24:01 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,12 +48,12 @@
    * @see TextLayout
    */
 
-public class TextLabelFactory {
-  private FontRenderContext frc;
-  private char[] text;
-  private Bidi bidi;
+public final class TextLabelFactory {
+  private final FontRenderContext frc;
+  private final char[] text;
+  private final Bidi bidi;
   private Bidi lineBidi;
-  private int flags;
+  private final int flags;
   private int lineStart;
   private int lineLimit;
 
--- a/src/share/classes/sun/font/TrueTypeFont.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/sun/font/TrueTypeFont.java	Tue Jun 09 11:24:01 2015 -0700
@@ -959,6 +959,18 @@
         setStyle(getTableBuffer(os_2Tag));
     }
 
+    private int fontWidth = 0;
+    @Override
+    public int getWidth() {
+       return (fontWidth > 0) ? fontWidth : super.getWidth();
+    }
+
+    private int fontWeight = 0;
+    @Override
+    public int getWeight() {
+       return (fontWeight > 0) ? fontWeight : super.getWeight();
+    }
+
     /* TrueTypeFont can use the fsSelection fields of OS/2 table
      * to determine the style. In the unlikely case that doesn't exist,
      * can use macStyle in the 'head' table but simpler to
@@ -974,8 +986,15 @@
     private static final int fsSelectionBoldBit    = 0x00020;
     private static final int fsSelectionRegularBit = 0x00040;
     private void setStyle(ByteBuffer os_2Table) {
+        if (os_2Table == null) {
+            return;
+        }
+        if (os_2Table.capacity() >= 8) {
+            fontWeight = os_2Table.getChar(4) & 0xffff;
+            fontWidth  = os_2Table.getChar(6) & 0xffff;
+        }
         /* fsSelection is unsigned short at buffer offset 62 */
-        if (os_2Table == null || os_2Table.capacity() < 64) {
+        if (os_2Table.capacity() < 64) {
             super.setStyle();
             return;
         }
--- a/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java	Tue Jun 09 11:24:01 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,6 +59,10 @@
         TransformBlit transformBlitIntArgbPreToSurface =
             new OGLSwToSurfaceTransform(SurfaceType.IntArgbPre,
                                         OGLSurfaceData.PF_INT_ARGB_PRE);
+        OGLSurfaceToSwBlit blitSurfaceToIntArgbPre =
+            new OGLSurfaceToSwBlit(SurfaceType.IntArgbPre,
+                                   OGLSurfaceData.PF_INT_ARGB_PRE);
+
         GraphicsPrimitive[] primitives = {
             // surface->surface ops
             new OGLSurfaceToSurfaceBlit(),
@@ -73,8 +77,7 @@
             // surface->sw ops
             new OGLSurfaceToSwBlit(SurfaceType.IntArgb,
                                    OGLSurfaceData.PF_INT_ARGB),
-            new OGLSurfaceToSwBlit(SurfaceType.IntArgbPre,
-                                   OGLSurfaceData.PF_INT_ARGB_PRE),
+            blitSurfaceToIntArgbPre,
 
             // sw->surface ops
             blitIntArgbPreToSurface,
@@ -102,7 +105,14 @@
                                CompositeType.AnyAlpha,
                                blitIntArgbPreToSurface),
 
-            new OGLAnyCompositeBlit(),
+            new OGLAnyCompositeBlit(OGLSurfaceData.OpenGLSurface,
+                                    blitSurfaceToIntArgbPre,
+                                    blitSurfaceToIntArgbPre,
+                                    blitIntArgbPreToSurface),
+            new OGLAnyCompositeBlit(SurfaceType.Any,
+                                    null,
+                                    blitSurfaceToIntArgbPre,
+                                    blitIntArgbPreToSurface),
 
             new OGLSwToSurfaceScale(SurfaceType.IntRgb,
                                     OGLSurfaceData.PF_INT_RGB),
@@ -869,11 +879,26 @@
     }
 }
 
+/**
+ * This general OGLAnyCompositeBlit implementation can convert any source/target
+ * surface to an intermediate surface using convertsrc/convertdst loops, applies
+ * necessary composite operation, and then uses convertresult loop to get the
+ * intermediate surface down to OpenGL.
+ */
 final class OGLAnyCompositeBlit extends Blit {
+
     private WeakReference<SurfaceData> dstTmp;
+    private WeakReference<SurfaceData> srcTmp;
+    private final Blit convertsrc;
+    private final Blit convertdst;
+    private final Blit convertresult;
 
-    OGLAnyCompositeBlit() {
-        super(SurfaceType.Any, CompositeType.Any, OGLSurfaceData.OpenGLSurface);
+    OGLAnyCompositeBlit(SurfaceType srctype, Blit convertsrc, Blit convertdst,
+                        Blit convertresult) {
+        super(srctype, CompositeType.Any, OGLSurfaceData.OpenGLSurface);
+        this.convertsrc = convertsrc;
+        this.convertdst = convertdst;
+        this.convertresult = convertresult;
     }
 
     public synchronized void Blit(SurfaceData src, SurfaceData dst,
@@ -881,9 +906,20 @@
                                   int sx, int sy, int dx, int dy,
                                   int w, int h)
     {
-        Blit convertdst = Blit.getFromCache(dst.getSurfaceType(),
-                                            CompositeType.SrcNoEa,
-                                            SurfaceType.IntArgbPre);
+        if (convertsrc != null) {
+            SurfaceData cachedSrc = null;
+            if (srcTmp != null) {
+                // use cached intermediate surface, if available
+                cachedSrc = srcTmp.get();
+            }
+            // convert source to IntArgbPre
+            src = convertFrom(convertsrc, src, sx, sy, w, h, cachedSrc,
+                              BufferedImage.TYPE_INT_ARGB_PRE);
+            if (src != cachedSrc) {
+                // cache the intermediate surface
+                srcTmp = new WeakReference<>(src);
+            }
+        }
 
         SurfaceData cachedDst = null;
 
@@ -906,12 +942,8 @@
             // cache the intermediate surface
             dstTmp = new WeakReference(dstBuffer);
         }
-
         // now blit the buffer back to the destination
-        convertdst = Blit.getFromCache(dstBuffer.getSurfaceType(),
-                                            CompositeType.SrcNoEa,
-                                            dst.getSurfaceType());
-        convertdst.Blit(dstBuffer, dst, AlphaComposite.Src,
-                 clip, 0, 0, dx, dy, w, h);
+        convertresult.Blit(dstBuffer, dst, AlphaComposite.Src, clip, 0, 0, dx,
+                           dy, w, h);
     }
 }
--- a/src/share/classes/sun/java2d/opengl/OGLSurfaceData.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/classes/sun/java2d/opengl/OGLSurfaceData.java	Tue Jun 09 11:24:01 2015 -0700
@@ -26,6 +26,7 @@
 package sun.java2d.opengl;
 
 import java.awt.AlphaComposite;
+import java.awt.Composite;
 import java.awt.GraphicsEnvironment;
 import java.awt.Rectangle;
 import java.awt.Transparency;
@@ -400,8 +401,8 @@
     /**
      * For now, we can only render LCD text if:
      *   - the fragment shader extension is available, and
-     *   - blending is disabled, and
-     *   - the source color is opaque
+     *   - the source color is opaque, and
+     *   - blending is SrcOverNoEa or disabled
      *   - and the destination is opaque
      *
      * Eventually, we could enhance the native OGL text rendering code
@@ -411,9 +412,19 @@
     public boolean canRenderLCDText(SunGraphics2D sg2d) {
         return
             graphicsConfig.isCapPresent(CAPS_EXT_LCD_SHADER) &&
-            sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY &&
+            sg2d.surfaceData.getTransparency() == Transparency.OPAQUE &&
             sg2d.paintState <= SunGraphics2D.PAINT_OPAQUECOLOR &&
-            sg2d.surfaceData.getTransparency() == Transparency.OPAQUE;
+            (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY ||
+             (sg2d.compositeState <= SunGraphics2D.COMP_ALPHA && canHandleComposite(sg2d.composite)));
+    }
+
+    private boolean canHandleComposite(Composite c) {
+        if (c instanceof AlphaComposite) {
+            AlphaComposite ac = (AlphaComposite)c;
+
+            return ac.getRule() == AlphaComposite.SRC_OVER && ac.getAlpha() >= 1f;
+        }
+        return false;
     }
 
     public void validatePipe(SunGraphics2D sg2d) {
--- a/src/share/demo/jfc/Font2DTest/FontPanel.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/demo/jfc/Font2DTest/FontPanel.java	Tue Jun 09 11:24:01 2015 -0700
@@ -515,6 +515,7 @@
 
         /// Sets the font, hints, according to the set parameters
         private void setParams( Graphics2D g2 ) {
+System.out.println("USING FONT " + testFont + " "+testFont.getPSName());
             g2.setFont( testFont );
             g2.setRenderingHint(KEY_TEXT_ANTIALIASING, antiAliasType);
             g2.setRenderingHint(KEY_FRACTIONALMETRICS, fractionalMetricsType);
--- a/src/share/native/sun/font/freetypeScaler.c	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/native/sun/font/freetypeScaler.c	Tue Jun 09 11:24:01 2015 -0700
@@ -411,7 +411,6 @@
     jobject metrics;
     jfloat ax, ay, dx, dy, bx, by, lx, ly, mx, my;
     jfloat f0 = 0.0;
-    FT_Pos bmodifier = 0;
     FTScalerContext *context =
         (FTScalerContext*) jlong_to_ptr(pScalerContext);
     FTScalerInfo *scalerInfo =
@@ -444,43 +443,38 @@
        So, we have to do adust them explicitly and stay consistent with what
        freetype does to outlines. */
 
-    /* For bolding glyphs are not just widened. Height is also changed
-       (see ftsynth.c).
-
-       TODO: In vertical direction we could do better job and adjust metrics
-       proportionally to glyoh shape. */
-    if (context->doBold) {
-        bmodifier = FT_MulFix(
-                       scalerInfo->face->units_per_EM,
-                       scalerInfo->face->size->metrics.y_scale)/24;
-    }
-
 
     /**** Note: only some metrics are affected by styling ***/
 
+    /* See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=657854 */
+#define FT_MulFixFloatShift6(a, b) (((float) (a)) * ((float) (b)) / 65536.0 / 64.0)
+
+    /*
+     * See FreeType source code: src/base/ftobjs.c ft_recompute_scaled_metrics()
+     * http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1659
+     */
     /* ascent */
     ax = 0;
-    ay = -(jfloat) FT26Dot6ToFloat(FT_MulFix(
-                       ((jlong) scalerInfo->face->ascender + bmodifier/2),
+    ay = -(jfloat) (FT_MulFixFloatShift6(
+                       ((jlong) scalerInfo->face->ascender),
                        (jlong) scalerInfo->face->size->metrics.y_scale));
     /* descent */
     dx = 0;
-    dy = -(jfloat) FT26Dot6ToFloat(FT_MulFix(
-                       ((jlong) scalerInfo->face->descender + bmodifier/2),
+    dy = -(jfloat) (FT_MulFixFloatShift6(
+                       ((jlong) scalerInfo->face->descender),
                        (jlong) scalerInfo->face->size->metrics.y_scale));
     /* baseline */
     bx = by = 0;
 
     /* leading */
     lx = 0;
-    ly = (jfloat) FT26Dot6ToFloat(FT_MulFix(
-                      (jlong) scalerInfo->face->height + bmodifier,
+    ly = (jfloat) (FT_MulFixFloatShift6(
+                      (jlong) scalerInfo->face->height,
                       (jlong) scalerInfo->face->size->metrics.y_scale))
                   + ay - dy;
     /* max advance */
     mx = (jfloat) FT26Dot6ToFloat(
                      scalerInfo->face->size->metrics.max_advance +
-                     2*bmodifier +
                      OBLIQUE_MODIFIER(scalerInfo->face->size->metrics.height));
     my = 0;
 
--- a/src/share/native/sun/java2d/opengl/OGLContext.c	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/native/sun/java2d/opengl/OGLContext.c	Tue Jun 09 11:24:01 2015 -0700
@@ -748,7 +748,7 @@
     // finally, check to see if the hardware supports the required number
     // of texture units
     j2d_glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &maxTexUnits);
-    if (maxTexUnits < 4) {
+    if (maxTexUnits < 2) {
         J2dRlsTraceLn1(J2D_TRACE_INFO,
           "OGLContext_IsLCDShaderSupportAvailable: not enough tex units (%d)",
           maxTexUnits);
--- a/src/share/native/sun/java2d/opengl/OGLTextRenderer.c	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/share/native/sun/java2d/opengl/OGLTextRenderer.c	Tue Jun 09 11:24:01 2015 -0700
@@ -95,22 +95,9 @@
 static GLhandleARB lcdTextProgram = 0;
 
 /**
- * The size of one of the gamma LUT textures in any one dimension along
- * the edge, in texels.
- */
-#define LUT_EDGE 16
-
-/**
- * These are the texture object handles for the gamma and inverse gamma
- * lookup tables.
- */
-static GLuint gammaLutTextureID = 0;
-static GLuint invGammaLutTextureID = 0;
-
-/**
  * This value tracks the previous LCD contrast setting, so if the contrast
- * value hasn't changed since the last time the lookup tables were
- * generated (not very common), then we can skip updating the tables.
+ * value hasn't changed since the last time the gamma uniforms were
+ * updated (not very common), then we can skip updating the unforms.
  */
 static jint lastLCDContrast = -1;
 
@@ -275,12 +262,9 @@
  * changes, we will modify the "src_adj" value in OGLTR_UpdateLCDTextColor()).
  *
  * The "main" function is executed for each "fragment" (or pixel) in the
- * glyph image.  We have determined that the pow() function can be quite
- * slow and it only operates on scalar values, not vectors as we require.
- * So instead we build two 3D textures containing gamma (and inverse gamma)
- * lookup tables that allow us to approximate a component-wise pow() function
- * with a single 3D texture lookup.  This approach is at least 2x faster
- * than the equivalent pow() calls.
+ * glyph image. The pow() routine operates on vectors, gives precise results,
+ * and provides acceptable level of performance, so we use it to perform
+ * the gamma adjustment.
  *
  * The variables involved in the equation can be expressed as follows:
  *
@@ -299,8 +283,8 @@
     "uniform vec3 src_adj;"
     "uniform sampler2D glyph_tex;"
     "uniform sampler2D dst_tex;"
-    "uniform sampler3D invgamma_tex;"
-    "uniform sampler3D gamma_tex;"
+    "uniform vec3 gamma;"
+    "uniform vec3 invgamma;"
     ""
     "void main(void)"
     "{"
@@ -312,12 +296,12 @@
     "    }"
          // load the RGB value from the corresponding destination pixel
     "    vec3 dst_clr = vec3(texture2D(dst_tex, gl_TexCoord[1].st));"
-         // gamma adjust the dest color using the invgamma LUT
-    "    vec3 dst_adj = vec3(texture3D(invgamma_tex, dst_clr.stp));"
+         // gamma adjust the dest color
+    "    vec3 dst_adj = pow(dst_clr.rgb, gamma);"
          // linearly interpolate the three color values
     "    vec3 result = mix(dst_adj, src_adj, glyph_clr);"
          // gamma re-adjust the resulting color (alpha is always set to 1.0)
-    "    gl_FragColor = vec4(vec3(texture3D(gamma_tex, result.stp)), 1.0);"
+    "    gl_FragColor = vec4(pow(result.rgb, invgamma), 1.0);"
     "}";
 
 /**
@@ -348,10 +332,6 @@
     j2d_glUniform1iARB(loc, 0); // texture unit 0
     loc = j2d_glGetUniformLocationARB(lcdTextProgram, "dst_tex");
     j2d_glUniform1iARB(loc, 1); // texture unit 1
-    loc = j2d_glGetUniformLocationARB(lcdTextProgram, "invgamma_tex");
-    j2d_glUniform1iARB(loc, 2); // texture unit 2
-    loc = j2d_glGetUniformLocationARB(lcdTextProgram, "gamma_tex");
-    j2d_glUniform1iARB(loc, 3); // texture unit 3
 
     // "unuse" the program object; it will be re-bound later as needed
     j2d_glUseProgramObjectARB(0);
@@ -360,108 +340,26 @@
 }
 
 /**
- * Initializes a 3D texture object for use as a three-dimensional gamma
- * lookup table.  Note that the wrap mode is initialized to GL_LINEAR so
- * that the table will interpolate adjacent values when the index falls
- * somewhere in between.
- */
-static GLuint
-OGLTR_InitGammaLutTexture()
-{
-    GLuint lutTextureID;
-
-    j2d_glGenTextures(1, &lutTextureID);
-    j2d_glBindTexture(GL_TEXTURE_3D, lutTextureID);
-    j2d_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-    j2d_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-    j2d_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-    j2d_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-    j2d_glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
-
-    return lutTextureID;
-}
-
-/**
- * Updates the lookup table in the given texture object with the float
- * values in the given system memory buffer.  Note that we could use
- * glTexSubImage3D() when updating the texture after its first
- * initialization, but since we're updating the entire table (with
- * power-of-two dimensions) and this is a relatively rare event, we'll
- * just stick with glTexImage3D().
- */
-static void
-OGLTR_UpdateGammaLutTexture(GLuint texID, GLfloat *lut, jint size)
-{
-    j2d_glBindTexture(GL_TEXTURE_3D, texID);
-    j2d_glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB8,
-                     size, size, size, 0, GL_RGB, GL_FLOAT, lut);
-}
-
-/**
- * (Re)Initializes the gamma lookup table textures.
+ * (Re)Initializes the gamma related uniforms.
  *
  * The given contrast value is an int in the range [100, 250] which we will
- * then scale to fit in the range [1.0, 2.5].  We create two LUTs, one
- * that essentially calculates pow(x, gamma) and the other calculates
- * pow(x, 1/gamma).  These values are replicated in all three dimensions, so
- * given a single 3D texture coordinate (typically this will be a triplet
- * in the form (r,g,b)), the 3D texture lookup will return an RGB triplet:
- *
- *     (pow(r,g), pow(y,g), pow(z,g)
- *
- * where g is either gamma or 1/gamma, depending on the table.
+ * then scale to fit in the range [1.0, 2.5].
  */
 static jboolean
 OGLTR_UpdateLCDTextContrast(jint contrast)
 {
-    double gamma = ((double)contrast) / 100.0;
-    double ig = gamma;
-    double g = 1.0 / ig;
-    GLfloat lut[LUT_EDGE][LUT_EDGE][LUT_EDGE][3];
-    GLfloat invlut[LUT_EDGE][LUT_EDGE][LUT_EDGE][3];
-    int min = 0;
-    int max = LUT_EDGE - 1;
-    int x, y, z;
+    double g = ((double)contrast) / 100.0;
+    double ig = 1.0 / g;
+    GLint loc;
 
     J2dTraceLn1(J2D_TRACE_INFO,
                 "OGLTR_UpdateLCDTextContrast: contrast=%d", contrast);
 
-    for (z = min; z <= max; z++) {
-        double zval = ((double)z) / max;
-        GLfloat gz = (GLfloat)pow(zval, g);
-        GLfloat igz = (GLfloat)pow(zval, ig);
+    loc = j2d_glGetUniformLocationARB(lcdTextProgram, "gamma");
+    j2d_glUniform3fARB(loc, g, g, g);
 
-        for (y = min; y <= max; y++) {
-            double yval = ((double)y) / max;
-            GLfloat gy = (GLfloat)pow(yval, g);
-            GLfloat igy = (GLfloat)pow(yval, ig);
-
-            for (x = min; x <= max; x++) {
-                double xval = ((double)x) / max;
-                GLfloat gx = (GLfloat)pow(xval, g);
-                GLfloat igx = (GLfloat)pow(xval, ig);
-
-                lut[z][y][x][0] = gx;
-                lut[z][y][x][1] = gy;
-                lut[z][y][x][2] = gz;
-
-                invlut[z][y][x][0] = igx;
-                invlut[z][y][x][1] = igy;
-                invlut[z][y][x][2] = igz;
-            }
-        }
-    }
-
-    if (gammaLutTextureID == 0) {
-        gammaLutTextureID = OGLTR_InitGammaLutTexture();
-    }
-    OGLTR_UpdateGammaLutTexture(gammaLutTextureID, (GLfloat *)lut, LUT_EDGE);
-
-    if (invGammaLutTextureID == 0) {
-        invGammaLutTextureID = OGLTR_InitGammaLutTexture();
-    }
-    OGLTR_UpdateGammaLutTexture(invGammaLutTextureID,
-                                (GLfloat *)invlut, LUT_EDGE);
+    loc = j2d_glGetUniformLocationARB(lcdTextProgram, "invgamma");
+    j2d_glUniform3fARB(loc, ig, ig, ig);
 
     return JNI_TRUE;
 }
@@ -562,14 +460,6 @@
         return JNI_FALSE;
     }
 
-    // bind the gamma LUT textures
-    j2d_glActiveTextureARB(GL_TEXTURE2_ARB);
-    j2d_glBindTexture(GL_TEXTURE_3D, invGammaLutTextureID);
-    j2d_glEnable(GL_TEXTURE_3D);
-    j2d_glActiveTextureARB(GL_TEXTURE3_ARB);
-    j2d_glBindTexture(GL_TEXTURE_3D, gammaLutTextureID);
-    j2d_glEnable(GL_TEXTURE_3D);
-
     return JNI_TRUE;
 }
 
@@ -629,10 +519,6 @@
         j2d_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
         j2d_glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
         j2d_glUseProgramObjectARB(0);
-        j2d_glActiveTextureARB(GL_TEXTURE3_ARB);
-        j2d_glDisable(GL_TEXTURE_3D);
-        j2d_glActiveTextureARB(GL_TEXTURE2_ARB);
-        j2d_glDisable(GL_TEXTURE_3D);
         j2d_glActiveTextureARB(GL_TEXTURE1_ARB);
         j2d_glDisable(GL_TEXTURE_2D);
         j2d_glActiveTextureARB(GL_TEXTURE0_ARB);
--- a/src/solaris/classes/sun/awt/X11/XClipboard.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/solaris/classes/sun/awt/X11/XClipboard.java	Tue Jun 09 11:24:01 2015 -0700
@@ -156,19 +156,29 @@
         isSelectionNotifyProcessed = true;
 
         boolean mustSchedule = false;
-        synchronized (XClipboard.classLock) {
-            if (targetsAtom2Clipboard == null) {
-                targetsAtom2Clipboard = new HashMap<Long, XClipboard>(2);
+        XToolkit.awtLock();
+        try {
+            synchronized (XClipboard.classLock) {
+                try {
+                    Thread.sleep(70);
+                } catch (InterruptedException e) {
+                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+                }
+                if (targetsAtom2Clipboard == null) {
+                    targetsAtom2Clipboard = new HashMap<Long, XClipboard>(2);
+                }
+                mustSchedule = targetsAtom2Clipboard.isEmpty();
+                targetsAtom2Clipboard.put(getTargetsPropertyAtom().getAtom(), this);
+                if (mustSchedule) {
+                    XToolkit.addEventDispatcher(XWindow.getXAWTRootWindow().getWindow(),
+                                                new SelectionNotifyHandler());
+                }
             }
-            mustSchedule = targetsAtom2Clipboard.isEmpty();
-            targetsAtom2Clipboard.put(getTargetsPropertyAtom().getAtom(), this);
             if (mustSchedule) {
-                XToolkit.addEventDispatcher(XWindow.getXAWTRootWindow().getWindow(),
-                                            new SelectionNotifyHandler());
+                XToolkit.schedule(new CheckChangeTimerTask(), XClipboard.getPollInterval());
             }
-        }
-        if (mustSchedule) {
-            XToolkit.schedule(new CheckChangeTimerTask(), XClipboard.getPollInterval());
+        } finally {
+            XToolkit.awtUnlock();
         }
     }
 
--- a/src/solaris/classes/sun/awt/X11/XRootWindow.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/solaris/classes/sun/awt/X11/XRootWindow.java	Tue Jun 09 11:24:01 2015 -0700
@@ -31,18 +31,22 @@
  * common logical ancestor
  */
 class XRootWindow extends XBaseWindow {
-    private static XRootWindow xawtRootWindow = null;
-    static XRootWindow getInstance() {
-        XToolkit.awtLock();
-        try {
-            if (xawtRootWindow == null) {
+    private static class LazyHolder {
+        private static final XRootWindow xawtRootWindow;
+
+        static {
+            XToolkit.awtLock();
+            try {
                 xawtRootWindow = new XRootWindow();
                 xawtRootWindow.init(xawtRootWindow.getDelayedParams().delete(DELAYED));
+            } finally {
+                XToolkit.awtUnlock();
             }
-            return xawtRootWindow;
-        } finally {
-            XToolkit.awtUnlock();
         }
+
+    }
+    static XRootWindow getInstance() {
+        return LazyHolder.xawtRootWindow;
     }
 
     private XRootWindow() {
--- a/src/solaris/classes/sun/awt/X11/XToolkit.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/solaris/classes/sun/awt/X11/XToolkit.java	Tue Jun 09 11:24:01 2015 -0700
@@ -598,14 +598,19 @@
                         }
                     }
                 }
-                if( keyEventLog.isLoggable(PlatformLogger.Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
-                    keyEventLog.fine("before XFilterEvent:"+ev);
+                if (keyEventLog.isLoggable(PlatformLogger.Level.FINE) && (
+                        ev.get_type() == XConstants.KeyPress
+                                || ev.get_type() == XConstants.KeyRelease)) {
+                    keyEventLog.fine("before XFilterEvent:" + ev);
                 }
                 if (XlibWrapper.XFilterEvent(ev.getPData(), w)) {
                     continue;
                 }
-                if( keyEventLog.isLoggable(PlatformLogger.Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
-                    keyEventLog.fine("after XFilterEvent:"+ev); // IS THIS CORRECT?
+                if (keyEventLog.isLoggable(PlatformLogger.Level.FINE) && (
+                        ev.get_type() == XConstants.KeyPress
+                                || ev.get_type() == XConstants.KeyRelease)) {
+                    keyEventLog.fine(
+                            "after XFilterEvent:" + ev); // IS THIS CORRECT?
                 }
 
                 dispatchEvent(ev);
@@ -621,21 +626,28 @@
         }
     }
 
+    /**
+     * Listener installed to detect display changes.
+     */
+    private static final DisplayChangedListener displayChangedHandler =
+            new DisplayChangedListener() {
+                @Override
+                public void displayChanged() {
+                    // 7045370: Reset the cached values
+                    XToolkit.screenWidth = -1;
+                    XToolkit.screenHeight = -1;
+                }
+
+                @Override
+                public void paletteChanged() {
+                }
+            };
+
     static {
         GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
         if (ge instanceof SunGraphicsEnvironment) {
-            ((SunGraphicsEnvironment)ge).addDisplayChangedListener(
-                new DisplayChangedListener() {
-                    @Override
-                    public void displayChanged() {
-                        // 7045370: Reset the cached values
-                        XToolkit.screenWidth = -1;
-                        XToolkit.screenHeight = -1;
-                    }
-
-                    @Override
-                    public void paletteChanged() {}
-            });
+            ((SunGraphicsEnvironment) ge).addDisplayChangedListener(
+                    displayChangedHandler);
         }
     }
 
@@ -645,7 +657,9 @@
             try {
                 XWindowAttributes pattr = new XWindowAttributes();
                 try {
-                    XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(), pattr.pData);
+                    XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(),
+                                                     XToolkit.getDefaultRootWindow(),
+                                                     pattr.pData);
                     screenWidth  = (int) pattr.get_width();
                     screenHeight = (int) pattr.get_height();
                 } finally {
--- a/src/windows/native/sun/windows/awt_Frame.cpp	Wed Jun 03 08:17:00 2015 -0700
+++ b/src/windows/native/sun/windows/awt_Frame.cpp	Tue Jun 09 11:24:01 2015 -0700
@@ -1864,6 +1864,7 @@
 
     AwtFrame::activateEmbeddingTopLevelMID = env->GetMethodID(cls, "activateEmbeddingTopLevel", "()V");
     DASSERT(AwtFrame::activateEmbeddingTopLevelMID != NULL);
+    CHECK_NULL(AwtFrame::activateEmbeddingTopLevelMID);
 
     AwtFrame::isEmbeddedInIEID = env->GetFieldID(cls, "isEmbeddedInIE", "Z");
     DASSERT(AwtFrame::isEmbeddedInIEID != NULL);
--- a/test/TEST.groups	Wed Jun 03 08:17:00 2015 -0700
+++ b/test/TEST.groups	Tue Jun 09 11:24:01 2015 -0700
@@ -484,6 +484,10 @@
   sun/security/jgss \
   sun/security/krb5 \
   java/lang/annotation/AnnotationType/AnnotationTypeDeadlockTest.java \
+  java/lang/invoke/lambda/LambdaStackTrace.java \
+  java/lang/invoke/LFCaching/LFGarbageCollectedTest.java \
+  java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java \
+  java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java \
   java/lang/System/MacEncoding/TestFileEncoding.java \
   java/nio/channels/AsynchronousSocketChannel/Leaky.java \
   java/security/PermissionCollection/Concurrent.java \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Component/SetEnabledPerformance/SetEnabledPerformance.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Component;
+import java.awt.FlowLayout;
+import java.awt.Frame;
+import java.awt.Robot;
+
+import javax.swing.JButton;
+import javax.swing.SwingUtilities;
+
+/**
+ * @test
+ * @bug 8071306
+ * @author Sergey Bylokhov
+ */
+public final class SetEnabledPerformance {
+
+    private static Frame frame;
+
+    private static void createAndShowGUI() {
+        frame = new Frame();
+        frame.setLayout(new FlowLayout(FlowLayout.CENTER, 25, 0));
+        frame.setSize(600, 600);
+        frame.setLocationRelativeTo(null);
+        for (int i = 1; i < 10001; ++i) {
+            frame.add(new JButton("Button " + i));
+        }
+        frame.setVisible(true);
+    }
+
+    public static void main(final String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(() -> createAndShowGUI());
+        final Robot robot = new Robot();
+        robot.waitForIdle();
+        robot.mouseMove(frame.getX() + 15, frame.getY() + 300);
+        robot.waitForIdle();
+        SwingUtilities.invokeAndWait(() -> {
+            long m = System.currentTimeMillis();
+            for (final Component comp : frame.getComponents()) {
+                comp.setEnabled(false);
+            }
+            m = System.currentTimeMillis() - m;
+            System.err.println("Disabled in " + m + " ms");
+            frame.dispose();
+            // we should be much faster, but leaves 1000 for the slow systems
+            if (m > 1000) {
+                throw new RuntimeException("Too slow");
+            }
+        });
+    }
+}
\ No newline at end of file
--- a/test/java/awt/Component/isLightweightCrash/StubPeerCrash.java	Wed Jun 03 08:17:00 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code 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 General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
-  @test
-  @bug 6255653
-  @summary REGRESSION: Override isLightweight() causes access violation in awt.dll
-  @author Andrei Dmitriev: area=awt-component
-  @run main StubPeerCrash
-*/
-
-/*
- * The test may not crash for several times so iteratively continue up to some limit.
- */
-
-import java.awt.*;
-import java.awt.peer.*;
-import java.awt.event.PaintEvent;
-import java.awt.image.ImageProducer;
-import java.awt.image.ImageObserver;
-import java.awt.image.ColorModel;
-import java.awt.image.VolatileImage;
-import java.awt.GraphicsConfiguration;
-import sun.awt.CausedFocusEvent;
-import sun.java2d.pipe.Region;
-
-public class StubPeerCrash {
-    public static int ITERATIONS = 20;
-
-    public static void main(String []s)
-    {
-        for (int i = 0; i < ITERATIONS; i++){
-            showFrame(i);
-        }
-    }
-
-    private static void showFrame(int i){
-        System.out.println("iteration = "+i);
-        Frame f = new Frame();
-        f.add(new AHeavyweightComponent());
-        f.setVisible(true);
-        f.setVisible(false);
-    }
-}
-
-class AHeavyweightComponent extends Component {
-    private ComponentPeer peer = new StubComponentPeer();
-
-    public AHeavyweightComponent(){
-    }
-
-    public boolean isLightweight() {
-        return false;
-    }
-
-    public ComponentPeer getPeer(){
-        return peer;
-    }
-}
-
-class StubComponentPeer implements ComponentPeer {
-    public boolean isObscured(){return true;};
-    public boolean canDetermineObscurity(){return true;};
-    public void                setVisible(boolean b){};
-    public void                setEnabled(boolean b){};
-    public void                paint(Graphics g){};
-    public void                repaint(long tm, int x, int y, int width, int height){};
-    public void                print(Graphics g){};
-    public void                setBounds(int x, int y, int width, int height, int op){};
-    public void                handleEvent(AWTEvent e){};
-    public void                coalescePaintEvent(PaintEvent e){};
-    public Point               getLocationOnScreen(){return null;};
-    public Dimension           getPreferredSize(){return null;};
-    public Dimension           getMinimumSize(){return null;};
-    public ColorModel          getColorModel(){return null;};
-    public Toolkit             getToolkit(){return null;};
-    public Graphics            getGraphics(){return null;};
-    public FontMetrics         getFontMetrics(Font font){return null;};
-    public void                dispose(){};
-    public void                setForeground(Color c){};
-    public void                setBackground(Color c){};
-    public void                setFont(Font f){};
-    public void                updateCursorImmediately(){};
-    public boolean             requestFocus(Component lightweightChild,
-                                     boolean temporary,
-                                     boolean focusedWindowChangeAllowed,
-                                     long time, CausedFocusEvent.Cause cause){
-        return true;
-    };
-    public boolean             isFocusable(){return true;};
-
-    public Image               createImage(ImageProducer producer){return null;};
-    public Image               createImage(int width, int height){return null;};
-    public VolatileImage       createVolatileImage(int width, int height){return null;};
-    public boolean             prepareImage(Image img, int w, int h, ImageObserver o){return true;};
-    public int                 checkImage(Image img, int w, int h, ImageObserver o){return 0;};
-    public GraphicsConfiguration getGraphicsConfiguration(){return null;};
-    public boolean     handlesWheelScrolling(){return true;};
-    public void createBuffers(int numBuffers, BufferCapabilities caps) throws AWTException{};
-    public Image getBackBuffer(){return null;};
-    public void flip(int x1, int y1, int x2, int y2, BufferCapabilities.FlipContents flipAction){};
-    public void destroyBuffers(){};
-
-    /**
-     * Reparents this peer to the new parent referenced by <code>newContainer</code> peer
-     * Implementation depends on toolkit and container.
-     * @param newContainer peer of the new parent container
-     * @since 1.5
-     */
-    public void reparent(ContainerPeer newContainer){};
-    /**
-     * Returns whether this peer supports reparenting to another parent withour destroying the peer
-     * @return true if appropriate reparent is supported, false otherwise
-     * @since 1.5
-     */
-    public boolean isReparentSupported(){return true;};
-
-    /**
-     * Used by lightweight implementations to tell a ComponentPeer to layout
-     * its sub-elements.  For instance, a lightweight Checkbox needs to layout
-     * the box, as well as the text label.
-     */
-    public void        layout(){};
-
-
-     public    Rectangle getBounds(){return null;};
-
-    /**
-     * Applies the shape to the native component window.
-     * @since 1.7
-     */
-    public void applyShape(Region shape){};
-
-    /**
-     * DEPRECATED:  Replaced by getPreferredSize().
-     */
-    public Dimension           preferredSize(){return null;};
-
-    /**
-     * DEPRECATED:  Replaced by getMinimumSize().
-     */
-    public Dimension           minimumSize(){return null;};
-
-    /**
-     * DEPRECATED:  Replaced by setVisible(boolean).
-     */
-    public void                show(){};
-
-    /**
-     * DEPRECATED:  Replaced by setVisible(boolean).
-     */
-    public void                hide(){};
-
-    /**
-     * DEPRECATED:  Replaced by setEnabled(boolean).
-     */
-    public void                enable(){};
-
-    /**
-     * DEPRECATED:  Replaced by setEnabled(boolean).
-     */
-    public void                disable(){};
-
-    /**
-     * DEPRECATED:  Replaced by setBounds(int, int, int, int).
-     */
-    public void                reshape(int x, int y, int width, int height){};
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/FontClass/DebugFonts.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4956241 80769790
+ * @summary NPE debugging fonts
+ * @run main/othervm DebugFonts
+ */
+
+import java.awt.Font;
+
+public class DebugFonts {
+
+   public static void main(String [] args) {
+      System.setProperty("sun.java2d.debugfonts", "true");
+      Font font = new Font("dialog", Font.PLAIN, 14);
+      System.out.println(font);
+      String s1 = font.getFamily();
+      String s2 = font.getFontName();
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/FontClass/HelvLtOblTest.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8064833
+ * @summary Test correct font is obtained via family+style
+ * @run main HelvLtOblTest
+ */
+
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GraphicsEnvironment;
+import java.awt.RenderingHints;
+import java.awt.font.FontRenderContext;
+import java.awt.font.GlyphVector;
+import java.awt.image.BufferedImage;
+
+public class HelvLtOblTest extends JComponent {
+
+    static Font helvFont = null;
+
+    static int[] codes = { 0x23, 0x4a, 0x48, 0x3, 0x4a, 0x55, 0x42, 0x4d,
+                    0x4a, 0x44, 0x3,
+                    0x53, 0x46, 0x45, 0x3, 0x55, 0x46, 0x59, 0x55, };
+
+    static String str = "Big italic red text";
+
+    public static void main(String[] args) throws Exception {
+        String os = System.getProperty("os.name");
+        if (!os.startsWith("Mac")) {
+             return;
+        }
+        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        Font[] fonts = ge.getAllFonts();
+        for (int i=0; i<fonts.length; i++) {
+            if (fonts[i].getPSName().equals("Helvetica-LightOblique")) {
+                 helvFont = fonts[i];
+                 break;
+            }
+        }
+        if (helvFont == null) {
+            return;
+        }
+        final HelvLtOblTest test = new HelvLtOblTest();
+        SwingUtilities.invokeLater(() -> {
+            JFrame f = new JFrame();
+            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+            f.add("Center", test);
+            f.pack();
+            f.setVisible(true);
+        });
+        test.compareImages();
+    }
+
+    public Dimension getPreferredSize() {
+      return new Dimension(400,400);
+    }
+
+    public void paintComponent(Graphics g) {
+         super.paintComponent(g);
+         Graphics2D g2 = (Graphics2D)g;
+         FontRenderContext frc = new FontRenderContext(null, true, true);
+         Font f = helvFont.deriveFont(Font.PLAIN, 40);
+         System.out.println("font = " +f.getFontName());
+         GlyphVector gv = f.createGlyphVector(frc, codes);
+         g.setFont(f);
+         g.setColor(Color.white);
+         g.fillRect(0,0,400,400);
+         g.setColor(Color.black);
+         g2.drawGlyphVector(gv, 5,200);
+         g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+                             RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+         g2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
+                             RenderingHints.VALUE_FRACTIONALMETRICS_ON);
+         g2.drawString(str, 5, 250);
+    }
+
+    void compareImages() {
+         BufferedImage bi0 = drawText(false);
+         BufferedImage bi1 = drawText(true);
+         compare(bi0, bi1);
+    }
+
+    BufferedImage drawText(boolean doGV) {
+        int w = 400;
+        int h = 50;
+        BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
+        Graphics2D g = bi.createGraphics();
+        g.setColor(Color.white);
+        g.fillRect(0,0,w,h);
+        g.setColor(Color.black);
+        Font f = helvFont.deriveFont(Font.PLAIN, 40);
+        g.setFont(f);
+        int x = 5;
+        int y = h - 10;
+        if (doGV) {
+            FontRenderContext frc = new FontRenderContext(null, true, true);
+            GlyphVector gv = f.createGlyphVector(frc, codes);
+            g.drawGlyphVector(gv, 5, y);
+       } else {
+           g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+                              RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+           g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
+                              RenderingHints.VALUE_FRACTIONALMETRICS_ON);
+           g.drawString(str, x, y);
+       }
+       return bi;
+    }
+
+    // Need to allow for minimal rounding error, so allow each component
+    // to differ by 1.
+    void compare(BufferedImage bi0, BufferedImage bi1) {
+        int wid = bi0.getWidth();
+        int hgt = bi0.getHeight();
+        for (int x=0; x<wid; x++) {
+            for (int y=0; y<hgt; y++) {
+                int rgb0 = bi0.getRGB(x, y);
+                int rgb1 = bi1.getRGB(x, y);
+                if (rgb0 == rgb1) continue;
+                int r0 = (rgb0 & 0xff0000) >> 16;
+                int r1 = (rgb1 & 0xff0000) >> 16;
+                int rdiff = r0-r1; if (rdiff<0) rdiff = -rdiff;
+                int g0 = (rgb0 & 0x00ff00) >> 8;
+                int g1 = (rgb1 & 0x00ff00) >> 8;
+                int gdiff = g0-g1; if (gdiff<0) gdiff = -gdiff;
+                int b0 = (rgb0 & 0x0000ff);
+                int b1 = (rgb1 & 0x0000ff);
+                int bdiff = b0-b1; if (bdiff<0) bdiff = -bdiff;
+                if (rdiff > 1 || gdiff > 1 || bdiff > 1) {
+                    throw new RuntimeException(
+                      "Images differ at x=" + x + " y="+ y + " " +
+                      Integer.toHexString(rgb0) + " vs " +
+                      Integer.toHexString(rgb1));
+                }
+            }
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Mouse/MouseDragEvent/MouseDraggedTest.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+/*
+ * @test
+ * @bug 8080137
+ * @summary Dragged events for extra mouse buttons (4,5,6) are not generated
+ *            on JSplitPane
+ * @author alexandr.scherbatiy area=awt.event
+ * @run main MouseDraggedTest
+ */
+public class MouseDraggedTest {
+
+    private static JFrame frame;
+    private static Rectangle frameBounds;
+    private static volatile boolean mouseDragged;
+
+    public static void main(String[] args) throws Exception {
+        try {
+            Robot robot = new Robot();
+            robot.setAutoDelay(50);
+
+            SwingUtilities.invokeAndWait(MouseDraggedTest::createAndShowGUI);
+            robot.waitForIdle();
+
+            SwingUtilities.invokeAndWait(() -> frameBounds = frame.getBounds());
+            robot.waitForIdle();
+
+            for (int i = 1; i <= MouseInfo.getNumberOfButtons(); i++) {
+                testMouseDrag(i, robot);
+            }
+        } finally {
+            SwingUtilities.invokeLater(() -> {
+                if (frame != null) {
+                    frame.dispose();
+                }
+            });
+        }
+    }
+
+    private static void testMouseDrag(int button, Robot robot) {
+
+        mouseDragged = false;
+        int x1 = frameBounds.x + frameBounds.width / 4;
+        int y1 = frameBounds.y + frameBounds.height / 4;
+        int x2 = frameBounds.x + frameBounds.width / 2;
+        int y2 = frameBounds.y + frameBounds.height / 2;
+
+        robot.mouseMove(x1, y1);
+        robot.waitForIdle();
+
+        int buttonMask = InputEvent.getMaskForButton(button);
+        robot.mousePress(buttonMask);
+        robot.mouseMove(x2, y2);
+        robot.mouseRelease(buttonMask);
+        robot.waitForIdle();
+
+        if (!mouseDragged) {
+            throw new RuntimeException("Mouse button " + button
+                    + " is not dragged");
+        }
+    }
+
+    static void createAndShowGUI() {
+
+        frame = new JFrame();
+        frame.setSize(400, 400);
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        JPanel panel = new JPanel(new BorderLayout());
+        panel.addMouseMotionListener(new MouseAdapter() {
+
+            @Override
+            public void mouseDragged(MouseEvent e) {
+                mouseDragged = true;
+            }
+        });
+        frame.add(panel, BorderLayout.CENTER);
+        frame.setVisible(true);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/ScrollPane/bug8077409Test.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+   @bug 8077409
+   @summary Drawing deviates when validate() is invoked on java.awt.ScrollPane
+   @author mikhail.cherkasov@oracle.com
+   @run main bug8077409Test
+*/
+
+
+import java.awt.*;
+import java.awt.event.*;
+
+public class bug8077409Test extends Frame {
+  ScrollPane pane;
+  MyCanvas myCanvas;
+
+  class MyCanvas extends Canvas {
+    public Dimension getPreferredSize() {
+      return new Dimension(400, 800);
+    }
+
+    public void paint(Graphics g) {
+      g.setColor(Color.BLACK);
+      g.drawLine(0, 0, 399, 0);
+      g.setColor(Color.RED);
+      g.drawLine(0, 1, 399, 1);
+      g.setColor(Color.BLUE);
+      g.drawLine(0, 2, 399, 2);
+      g.setColor(Color.GREEN);
+      g.drawLine(0, 3, 399, 3);
+    }
+
+  }
+
+  public bug8077409Test() {
+    super();
+    setLayout(new BorderLayout());
+    pane = new ScrollPane();
+
+    myCanvas = new MyCanvas();
+    pane.add(myCanvas);
+
+    add(pane, BorderLayout.CENTER);
+    setSize(320, 480);
+
+  }
+
+  @Override
+  protected void processKeyEvent(KeyEvent e) {
+    super.processKeyEvent(e);
+
+  }
+
+  public static void main(String[] args) throws AWTException, InterruptedException {
+    final bug8077409Test obj = new bug8077409Test();
+    obj.setVisible(true);
+    Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
+      @Override
+      public void eventDispatched(AWTEvent e) {
+        KeyEvent keyEvent = (KeyEvent) e;
+        if(keyEvent.getID() == KeyEvent.KEY_RELEASED) {
+            if (keyEvent.getKeyCode() == KeyEvent.VK_1) {
+              System.out.println(obj.pane.toString());
+              System.out.println("obj.myCanvas.pos: " + obj.myCanvas.getBounds());
+              System.out.println(obj.myCanvas.toString());
+            }  else if (keyEvent.getKeyCode() == KeyEvent.VK_2) {
+              obj.repaint();
+           } else if (keyEvent.getKeyCode() == KeyEvent.VK_DOWN) {
+              Point scrollPosition = obj.pane.getScrollPosition();
+              scrollPosition.translate(0, 1);
+              obj.pane.setScrollPosition(scrollPosition);
+            } else if (keyEvent.getKeyCode() == KeyEvent.VK_UP) {
+              Point scrollPosition = obj.pane.getScrollPosition();
+              scrollPosition.translate(0, -1);
+              obj.pane.setScrollPosition(scrollPosition);
+            } else if (keyEvent.getKeyCode() == KeyEvent.VK_SPACE) {
+              obj.pane.validate();
+            }
+          }
+        }
+    }, AWTEvent.KEY_EVENT_MASK);
+      Point scrollPosition = obj.pane.getScrollPosition();
+      scrollPosition.translate(0, 1);
+      obj.pane.setScrollPosition(scrollPosition);
+
+      int y = obj.pane.getComponent(0).getLocation().y;
+      obj.pane.validate();
+      if(y != obj.pane.getComponent(0).getLocation().y){
+          throw new RuntimeException("Wrong position of component in ScrollPane");
+      }
+  }
+
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+import java.io.File;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+
+import static java.awt.geom.Rectangle2D.Double;
+
+/**
+ * @test
+ * @bug 8061831
+ * @summary Tests drawing volatile image to volatile image using different
+ *          clips + xor mode. Results of the blit compatibleImage to
+ *          compatibleImage is used for comparison.
+ */
+public final class IncorrectClipXorModeSurface2Surface {
+
+    private static int[] SIZES = {2, 10, 100};
+    private static final Shape[] SHAPES = {
+            new Rectangle(0, 0, 0, 0),
+            new Rectangle(0, 0, 1, 1),
+            new Rectangle(0, 1, 1, 1),
+            new Rectangle(1, 0, 1, 1),
+            new Rectangle(1, 1, 1, 1),
+
+            new Double(0, 0, 0.5, 0.5),
+            new Double(0, 0.5, 0.5, 0.5),
+            new Double(0.5, 0, 0.5, 0.5),
+            new Double(0.5, 0.5, 0.5, 0.5),
+            new Double(0.25, 0.25, 0.5, 0.5),
+            new Double(0, 0.25, 1, 0.5),
+            new Double(0.25, 0, 0.5, 1),
+
+            new Double(.10, .10, .20, .20),
+            new Double(.75, .75, .20, .20),
+            new Double(.75, .10, .20, .20),
+            new Double(.10, .75, .20, .20),
+    };
+
+    public static void main(final String[] args) throws IOException {
+        GraphicsEnvironment ge = GraphicsEnvironment
+                .getLocalGraphicsEnvironment();
+        GraphicsConfiguration gc = ge.getDefaultScreenDevice()
+                .getDefaultConfiguration();
+        AffineTransform at;
+        for (int size : SIZES) {
+            at = AffineTransform.getScaleInstance(size, size);
+            for (Shape clip : SHAPES) {
+                clip = at.createTransformedShape(clip);
+                for (Shape to : SHAPES) {
+                    to = at.createTransformedShape(to);
+                    // Prepare test images
+                    BufferedImage snapshot;
+                    VolatileImage source = getVolatileImage(gc, size);
+                    VolatileImage target = getVolatileImage(gc, size);
+                    int attempt = 0;
+                    while (true) {
+                        if (++attempt > 10) {
+                            throw new RuntimeException("Too many attempts: " + attempt);
+                        }
+                        // Prepare source images
+                        source.validate(gc);
+                        Graphics2D g2d = source.createGraphics();
+                        g2d.setColor(Color.RED);
+                        g2d.fillRect(0, 0, size, size);
+                        g2d.dispose();
+                        if (source.validate(gc) != VolatileImage.IMAGE_OK) {
+                            continue;
+                        }
+                        // Prepare target images
+                        target.validate(gc);
+                        g2d = target.createGraphics();
+                        g2d.setColor(Color.GREEN);
+                        g2d.fillRect(0, 0, size, size);
+                        g2d.dispose();
+                        if (target.validate(gc) != VolatileImage.IMAGE_OK) {
+                            continue;
+                        }
+
+                        draw(clip, to, source, target);
+                        snapshot = target.getSnapshot();
+                        if (source.contentsLost() || target.contentsLost()) {
+                            continue;
+                        }
+                        break;
+                    }
+                    // Prepare gold images
+                    BufferedImage goldS = getSourceGold(gc, size);
+                    BufferedImage goldT = getTargetGold(gc, size);
+                    draw(clip, to, goldS, goldT);
+                    validate(snapshot, goldT);
+                    source.flush();
+                    target.flush();
+                }
+            }
+        }
+    }
+
+    private static void draw(Shape clip, Shape shape, Image from, Image to) {
+        Graphics2D g2d = (Graphics2D) to.getGraphics();
+        g2d.setXORMode(Color.BLACK);
+        g2d.setClip(clip);
+        Rectangle toBounds = shape.getBounds();
+        g2d.drawImage(from, toBounds.x, toBounds.y, toBounds.width,
+                      toBounds.height, null);
+        g2d.dispose();
+    }
+
+    private static BufferedImage getSourceGold(GraphicsConfiguration gc,
+                                               int size) {
+        final BufferedImage bi = gc.createCompatibleImage(size, size);
+        Graphics2D g2d = bi.createGraphics();
+        g2d.setColor(Color.RED);
+        g2d.fillRect(0, 0, size, size);
+        g2d.dispose();
+        return bi;
+    }
+
+    private static BufferedImage getTargetGold(GraphicsConfiguration gc,
+                                               int size) {
+        BufferedImage image = gc.createCompatibleImage(size, size);
+        Graphics2D g2d = image.createGraphics();
+        g2d.setColor(Color.GREEN);
+        g2d.fillRect(0, 0, size, size);
+        g2d.dispose();
+        return image;
+    }
+
+    private static VolatileImage getVolatileImage(GraphicsConfiguration gc,
+                                                  int size) {
+        return gc.createCompatibleVolatileImage(size, size);
+    }
+
+    private static void validate(BufferedImage bi, BufferedImage goldbi)
+            throws IOException {
+        for (int x = 0; x < bi.getWidth(); ++x) {
+            for (int y = 0; y < bi.getHeight(); ++y) {
+                if (goldbi.getRGB(x, y) != bi.getRGB(x, y)) {
+                    ImageIO.write(bi, "png", new File("actual.png"));
+                    ImageIO.write(goldbi, "png", new File("expected.png"));
+                    throw new RuntimeException("Test failed.");
+                }
+            }
+        }
+    }
+}
--- a/test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java	Wed Jun 03 08:17:00 2015 -0700
+++ b/test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java	Tue Jun 09 11:24:01 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 /*
  * @test LFGarbageCollectedTest
  * @bug 8046703
+ * @ignore 8078602
  * @summary Test verifies that lambda forms are garbage collected
  * @author kshefov
  * @library /lib/testlibrary/jsr292 /lib/testlibrary
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/TEST.properties	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,3 @@
+# JDBC unit tests uses TestNG
+TestNG.dirs = .
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/BatchUpdateExceptionTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,326 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.ObjectInputStream;
+import java.sql.BatchUpdateException;
+import java.sql.SQLException;
+import java.util.Arrays;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.SerializedBatchUpdateException;
+import util.BaseTest;
+
+public class BatchUpdateExceptionTests extends BaseTest {
+
+    private final int[] uc = {1, 2, 3};
+    private final long[] luc = {1, 2, 3};
+
+    private final String testSrcDir = System.getProperty("test.src", ".")
+            + File.separatorChar;
+
+    /**
+     * Create BatchUpdateException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        BatchUpdateException be = new BatchUpdateException(null,
+                null, errorCode, (int[]) null, null);
+        assertTrue(be.getMessage() == null && be.getSQLState() == null
+                && be.getUpdateCounts() == null && be.getCause() == null
+                && be.getLargeUpdateCounts() == null
+                && be.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create BatchUpdateException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        BatchUpdateException ex = new BatchUpdateException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && ex.getUpdateCounts() == null
+                && ex.getLargeUpdateCounts() == null);
+    }
+
+    /**
+     * Create BatchUpdateException with null Throwable
+     */
+    @Test
+    public void test2() {
+        BatchUpdateException ex = new BatchUpdateException((Throwable) null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && ex.getUpdateCounts() == null
+                && ex.getLargeUpdateCounts() == null);
+    }
+
+    /**
+     * Create BatchUpdateException with message and update counts
+     */
+    @Test
+    public void test3() {
+
+        BatchUpdateException ex = new BatchUpdateException(reason, uc);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && Arrays.equals(ex.getUpdateCounts(), uc)
+                && Arrays.equals(ex.getLargeUpdateCounts(), luc)
+        );
+    }
+
+    /**
+     * Create BatchUpdateException with update counts
+     */
+    @Test
+    public void test4() {
+        BatchUpdateException ex = new BatchUpdateException(uc);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && Arrays.equals(ex.getUpdateCounts(), uc)
+                && Arrays.equals(ex.getLargeUpdateCounts(), luc)
+        );
+    }
+
+    /**
+     * Create BatchUpdateException with Throwable and update counts
+     */
+    @Test
+    public void test5() {
+        BatchUpdateException ex = new BatchUpdateException(uc, t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0
+                && Arrays.equals(ex.getUpdateCounts(), uc)
+                && Arrays.equals(ex.getLargeUpdateCounts(), luc)
+        );
+    }
+
+    /**
+     * Create BatchUpdateException with message, Throwable, and update counts
+     */
+    @Test
+    public void test6() {
+        BatchUpdateException ex = new BatchUpdateException(reason, uc, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0
+                && Arrays.equals(ex.getUpdateCounts(), uc)
+                && Arrays.equals(ex.getLargeUpdateCounts(), luc)
+        );
+    }
+
+    /**
+     * Create BatchUpdateException with message, SQLState, Throwable, and update
+     * counts
+     */
+    @Test
+    public void test7() {
+        BatchUpdateException ex = new BatchUpdateException(reason, state, uc, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0
+                && Arrays.equals(ex.getUpdateCounts(), uc)
+                && Arrays.equals(ex.getLargeUpdateCounts(), luc)
+        );
+    }
+
+    /**
+     * Create BatchUpdateException with message, SQLState, errorCode code
+     * Throwable, and update counts
+     */
+    @Test
+    public void test8() {
+        BatchUpdateException ex = new BatchUpdateException(reason, state, errorCode,
+                uc, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode
+                && Arrays.equals(ex.getUpdateCounts(), uc)
+                && Arrays.equals(ex.getLargeUpdateCounts(), luc)
+        );
+    }
+
+    /**
+     * Create BatchUpdateException with message, SQLState, errorCode code
+     * Throwable, and long [] update counts
+     */
+    @Test
+    public void test9() {
+        BatchUpdateException ex = new BatchUpdateException(reason, state, errorCode,
+                luc, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode
+                && Arrays.equals(ex.getUpdateCounts(), uc)
+                && Arrays.equals(ex.getLargeUpdateCounts(), luc)
+        );
+    }
+
+    /**
+     * Validate that a copy of the update counts array is made
+     */
+    @Test
+    public void test10() {
+        int[] uc1 = {1, 2};
+        BatchUpdateException ex = new BatchUpdateException(uc1);
+        assertTrue(Arrays.equals(ex.getUpdateCounts(), uc1));
+        uc1[0] = 6689;
+        assertFalse(Arrays.equals(ex.getUpdateCounts(), uc1));
+    }
+
+    /**
+     * Validate that if null is specified for the update count, it is returned
+     * as null
+     */
+    @Test
+    public void test11() {
+        BatchUpdateException ex = new BatchUpdateException((int[]) null);
+        assertTrue(ex.getMessage() == null && ex.getSQLState() == null
+                && ex.getErrorCode() == 0 && ex.getUpdateCounts() == null
+                && ex.getLargeUpdateCounts() == null);
+    }
+
+    /**
+     * Serialize a BatchUpdateException and make sure you can read it back
+     * properly
+     */
+    @Test
+    public void test12() throws Exception {
+        BatchUpdateException be = new BatchUpdateException(reason, state, errorCode,
+                uc, t);
+        BatchUpdateException bue
+                = createSerializedException(be);
+        assertTrue(reason.equals(bue.getMessage())
+                && bue.getSQLState().equals(state)
+                && cause.equals(bue.getCause().toString())
+                && bue.getErrorCode() == errorCode
+                && Arrays.equals(bue.getLargeUpdateCounts(), luc)
+                && Arrays.equals(bue.getUpdateCounts(), uc));
+    }
+
+
+
+    /**
+     * De-Serialize a BatchUpdateException from JDBC 4.0 and make sure you can
+     * read it back properly
+     */
+    @Test
+    public void test13() throws Exception {
+        String reason1 = "This was the error msg";
+        String state1 = "user defined sqlState";
+        String cause1 = "java.lang.Throwable: throw 1";
+        int errorCode1 = 99999;
+        Throwable t = new Throwable("throw 1");
+        int[] uc1 = {1, 2, 21};
+        long[] luc1 = {1, 2, 21};
+
+        ObjectInputStream ois = new ObjectInputStream(
+                new ByteArrayInputStream(SerializedBatchUpdateException.DATA));
+        BatchUpdateException bue = (BatchUpdateException) ois.readObject();
+        assertTrue(reason1.equals(bue.getMessage())
+                && bue.getSQLState().equals(state1)
+                && bue.getErrorCode() == errorCode1
+                && cause1.equals(bue.getCause().toString())
+                && Arrays.equals(bue.getLargeUpdateCounts(), luc1)
+                && Arrays.equals(bue.getUpdateCounts(), uc1));
+    }
+
+    /**
+     * Serialize a BatchUpdateException with an Integer.MAX_VALUE + 1 and
+     * validate you can read it back properly
+     */
+    @Test
+    public void test14() throws Exception {
+        int[] uc1 = {Integer.MAX_VALUE, Integer.MAX_VALUE + 1};
+        long[] luc1 = {Integer.MAX_VALUE, Integer.MAX_VALUE + 1};
+        BatchUpdateException be = new BatchUpdateException(reason, state, errorCode,
+                luc1, t);
+                BatchUpdateException bue
+                = createSerializedException(be);
+        assertTrue(reason.equals(bue.getMessage())
+                && bue.getSQLState().equals(state)
+                && cause.equals(bue.getCause().toString())
+                && bue.getErrorCode() == errorCode
+                && Arrays.equals(bue.getLargeUpdateCounts(), luc1)
+                && Arrays.equals(bue.getUpdateCounts(), uc1));
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test15() {
+        BatchUpdateException ex = new BatchUpdateException("Exception 1", uc, t1);
+        BatchUpdateException ex1 = new BatchUpdateException("Exception 2", uc);
+        BatchUpdateException ex2 = new BatchUpdateException("Exception 3", uc, t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test16() {
+        BatchUpdateException ex = new BatchUpdateException("Exception 1", uc,  t1);
+        BatchUpdateException ex1 = new BatchUpdateException("Exception 2", uc);
+        BatchUpdateException ex2 = new BatchUpdateException("Exception 3", uc, t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        SQLException sqe = ex;
+        int num = 0;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/DataTruncationTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.DataTruncation;
+import java.sql.SQLException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class DataTruncationTests extends BaseTest {
+
+    private final String READ_TRUNCATION = "01004";
+    private final String WRITE_TRUNCATION = "22001";
+    private final String dtReason = "Data truncation";
+    private final int dterrorCode = 0;
+    private final String[] dtmsgs = {dtReason, "cause 1", dtReason,
+        dtReason, "cause 2"};
+    private boolean onRead = false;
+    private final boolean parameter = false;
+    private final int index = 21;
+    private final int dataSize = 25;
+    private final int transferSize = 10;
+
+    /**
+     * Create DataTruncation object indicating a truncation on read
+     */
+    @Test
+    public void test() {
+        onRead = true;
+        DataTruncation e = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize);
+        assertTrue(e.getMessage().equals(dtReason)
+                && e.getSQLState().equals(READ_TRUNCATION)
+                && e.getCause() == null
+                && e.getErrorCode() == dterrorCode
+                && e.getParameter() == parameter
+                && e.getRead() == onRead
+                && e.getDataSize() == dataSize
+                && e.getTransferSize() == transferSize
+                && e.getIndex() == index);
+    }
+
+    /**
+     * Create DataTruncation object indicating a truncation on write
+     */
+    @Test
+    public void test1() {
+        onRead = false;
+        DataTruncation e = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize);
+        assertTrue(e.getMessage().equals(dtReason)
+                && e.getSQLState().equals(WRITE_TRUNCATION)
+                && e.getCause() == null
+                && e.getErrorCode() == dterrorCode
+                && e.getParameter() == parameter
+                && e.getRead() == onRead
+                && e.getDataSize() == dataSize
+                && e.getTransferSize() == transferSize
+                && e.getIndex() == index);
+    }
+
+    /**
+     * Create DataTruncation object indicating a truncation on read with a
+     * Throwable
+     */
+    @Test
+    public void test2() {
+        onRead = true;
+        DataTruncation e = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize, t);
+        assertTrue(e.getMessage().equals(dtReason)
+                && e.getSQLState().equals(READ_TRUNCATION)
+                && cause.equals(e.getCause().toString())
+                && e.getErrorCode() == dterrorCode
+                && e.getParameter() == parameter
+                && e.getRead() == onRead
+                && e.getDataSize() == dataSize
+                && e.getTransferSize() == transferSize
+                && e.getIndex() == index);
+    }
+
+    /**
+     * Create DataTruncation object indicating a truncation on read with null
+     * specified for the Throwable
+     */
+    @Test
+    public void test3() {
+        onRead = true;;
+        DataTruncation e = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize, null);
+        assertTrue(e.getMessage().equals(dtReason)
+                && e.getSQLState().equals(READ_TRUNCATION)
+                && e.getCause() == null
+                && e.getErrorCode() == dterrorCode
+                && e.getParameter() == parameter
+                && e.getRead() == onRead
+                && e.getDataSize() == dataSize
+                && e.getTransferSize() == transferSize
+                && e.getIndex() == index);
+    }
+
+    /**
+     * Create DataTruncation object indicating a truncation on read and you can
+     * pass a -1 for the index
+     */
+    @Test
+    public void test4() {
+        onRead = true;
+        int negIndex = -1;
+        DataTruncation e = new DataTruncation(negIndex, parameter, onRead,
+                dataSize, transferSize);
+        assertTrue(e.getMessage().equals(dtReason)
+                && e.getSQLState().equals(READ_TRUNCATION)
+                && e.getCause() == null
+                && e.getErrorCode() == dterrorCode
+                && e.getParameter() == parameter
+                && e.getRead() == onRead
+                && e.getDataSize() == dataSize
+                && e.getTransferSize() == transferSize
+                && e.getIndex() == negIndex);
+    }
+
+    /**
+     * Serialize a DataTruncation and make sure you can read it back properly
+     */
+    @Test
+    public void test5() throws Exception {
+        DataTruncation e = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize);
+        DataTruncation ex1 = createSerializedException(e);
+        assertTrue(e.getMessage().equals(dtReason)
+                && e.getSQLState().equals(READ_TRUNCATION)
+                && e.getCause() == null
+                && e.getErrorCode() == dterrorCode
+                && e.getParameter() == parameter
+                && e.getRead() == onRead
+                && e.getDataSize() == dataSize
+                && e.getTransferSize() == transferSize
+                && e.getIndex() == index);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * for-each loop
+     */
+    @Test
+    public void test11() {
+        DataTruncation ex = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize, t1);
+        DataTruncation ex1 = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize);
+        DataTruncation ex2 = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize, t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(dtmsgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * traditional while loop
+     */
+    @Test
+    public void test12() {
+        DataTruncation ex = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize, t1);
+        DataTruncation ex1 = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize);
+        DataTruncation ex2 = new DataTruncation(index, parameter, onRead,
+                dataSize, transferSize, t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(dtmsgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(dtmsgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/DateTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,373 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.Date;
+import java.time.Instant;
+import java.time.LocalDate;
+import static org.testng.Assert.*;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class DateTests extends BaseTest {
+
+    /*
+     * Validate an IllegalArgumentException is thrown for an invalid Date string
+     */
+    @Test(dataProvider = "invalidDateValues",
+            expectedExceptions = IllegalArgumentException.class)
+    public void test(String d) throws Exception {
+        Date.valueOf(d);
+    }
+
+    /*
+     * Test that a date created from a date string is equal to the value
+     * returned from toString()
+     */
+    @Test(dataProvider = "validDateValues")
+    public void test00(String d, String expectedD) {
+        Date d1 = Date.valueOf(d);
+        Date d2 = Date.valueOf(expectedD);
+        assertTrue(d1.equals(d2) && d2.equals(d1)
+                && d1.toString().equals(expectedD), "Error d1 != d2");
+    }
+
+    /*
+     * Validate that a Date.after() returns false when same date is compared
+     */
+    @Test
+    public void test01() {
+        Date d = Date.valueOf("1961-08-30");
+        assertFalse(d.after(d), "Error d.after(d) = true");
+    }
+
+    /*
+     * Validate that a Date.after() returns true when later date is compared to
+     * earlier date
+     */
+    @Test
+    public void test2() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(System.currentTimeMillis());
+        assertTrue(d2.after(d), "Error d2.after(d) = false");
+    }
+
+    /*
+     * Validate that a Date.after() returns false when earlier date is compared
+     * to later date
+     */
+    @Test
+    public void test3() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(d.getTime());
+        assertFalse(d.after(d2), "Error d.after(d2) = true");
+    }
+
+    /*
+     * Validate that a Date.after() returns false when date compared to another
+     * date created from the original date
+     */
+    @Test
+    public void test4() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(d.getTime());
+        assertFalse(d.after(d2), "Error d.after(d2) = true");
+        assertFalse(d2.after(d), "Error d2.after(d) = true");
+    }
+
+    /*
+     * Validate that a Date.before() returns false when same date is compared
+     */
+    @Test
+    public void test5() {
+        Date d = Date.valueOf("1961-08-30");
+        assertFalse(d.before(d), "Error d.before(d) = true");
+    }
+
+    /*
+     * Validate that a Date.before() returns true when earlier date is compared
+     * to later date
+     */
+    @Test
+    public void test6() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(System.currentTimeMillis());
+        assertTrue(d.before(d2), "Error d.before(d2) = false");
+    }
+
+    /*
+     * Validate that a Date.before() returns false when later date is compared
+     * to earlier date
+     */
+    @Test
+    public void test7() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(d.getTime());
+        assertFalse(d2.before(d), "Error d2.before(d) = true");
+    }
+
+    /*
+     * Validate that a Date.before() returns false when date compared to another
+     * date created from the original date
+     */
+    @Test
+    public void test8() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(d.getTime());
+        assertFalse(d.before(d2), "Error d.before(d2) = true");
+        assertFalse(d2.before(d), "Error d2.before(d) = true");
+    }
+
+    /*
+     * Validate that a Date.compareTo returns 0 when both Date objects are the
+     * same
+     */
+    @Test
+    public void test9() {
+        Date d = Date.valueOf("1961-08-30");
+        assertTrue(d.compareTo(d) == 0, "Error d.compareTo(d) !=0");
+    }
+
+    /*
+     * Validate that a Date.compareTo returns 0 when both Date objects represent
+     * the same date
+     */
+    @Test
+    public void test10() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(d.getTime());
+        assertTrue(d.compareTo(d2) == 0, "Error d.compareTo(d2) !=0");
+    }
+
+    /*
+     * Validate that a Date.compareTo returns -1 when comparing a date to a
+     * later date
+     */
+    @Test
+    public void test11() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(System.currentTimeMillis());
+        assertTrue(d.compareTo(d2) == -1, "Error d.compareTo(d2) != -1");
+    }
+
+    /*
+     * Validate that a Date.compareTo returns 1 when comparing a date to an
+     * earlier date
+     */
+    @Test
+    public void test12() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(System.currentTimeMillis());
+        assertTrue(d2.compareTo(d) == 1, "Error d.compareTo(d2) != 1");
+    }
+
+    /*
+     * Validate that a Date made from a LocalDate are equal
+     */
+    @Test
+    public void test13() {
+        Date d = Date.valueOf("1961-08-30");
+        LocalDate ldt = d.toLocalDate();
+        Date d2 = Date.valueOf(ldt);
+        assertTrue(d.equals(d2), "Error d != d2");
+    }
+
+    /*
+     * Validate that a Date LocalDate value, made from a LocalDate are equal
+     */
+    @Test
+    public void test14() {
+        LocalDate ldt = LocalDate.now();
+        Date d = Date.valueOf(ldt);
+        assertTrue(ldt.equals(d.toLocalDate()),
+                "Error LocalDate values are not equal");
+    }
+
+    /*
+     * Validate an NPE occurs when a null LocalDate is passed to valueOf
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test15() throws Exception {
+        LocalDate ld = null;
+        Date.valueOf(ld);
+    }
+
+    /*
+     * Validate an UnsupportedOperationException occurs when toInstant() is
+     * called
+     */
+    @Test(expectedExceptions = UnsupportedOperationException.class)
+    public void test16() throws Exception {
+        Date d = Date.valueOf("1961-08-30");
+        Instant instant = d.toInstant();
+    }
+
+    /*
+     * Validate that two Date objects are equal when one is created from the
+     * toString() of the other
+     */
+    @Test
+    public void test17() {
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = Date.valueOf(d.toString());
+        assertTrue(d.equals(d2) && d2.equals(d), "Error d != d2");
+    }
+
+    /*
+     * Validate that two Date values one created using valueOf and another via a
+     * constructor are equal
+     */
+    @Test
+    public void test18() {
+
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(61, 7, 30);
+        assertTrue(d.equals(d2), "Error d != d2");
+    }
+
+    /*
+     * Validate that two Date values one created using getTime() of the other
+     * are equal
+     */
+    @Test
+    public void test19() {
+
+        Date d = Date.valueOf("1961-08-30");
+        Date d2 = new Date(d.getTime());
+        assertTrue(d.equals(d2), "Error d != d2");
+    }
+
+    /*
+     * Validate that a Date value is equal to itself
+     */
+    @Test
+    public void test20() {
+
+        Date d = Date.valueOf("1961-08-30");
+        assertTrue(d.equals(d), "Error d != d");
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for calling getHours
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test21() throws Exception {
+        Date d = Date.valueOf("1961-08-30");
+        d.getHours();
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for calling getMinutes
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test22() throws Exception {
+        Date d = Date.valueOf("1961-08-30");
+        d.getMinutes();
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for calling getSeconds
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test23() throws Exception {
+        Date d = Date.valueOf("1961-08-30");
+        d.getSeconds();
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for calling setHours
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test24() throws Exception {
+        Date d = Date.valueOf("1961-08-30");
+        d.setHours(8);
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for calling setMinutes
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test25() throws Exception {
+        Date d = Date.valueOf("1961-08-30");
+        d.setMinutes(0);
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for calling setSeconds
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test26() throws Exception {
+        Date d = Date.valueOf("1961-08-30");
+        d.setSeconds(0);
+    }
+
+    /*
+     * DataProvider used to provide Date which are not valid and are used
+     * to validate that an IllegalArgumentException will be thrown from the
+     * valueOf method
+     */
+    @DataProvider(name = "invalidDateValues")
+    private Object[][] invalidDateValues() {
+        return new Object[][]{
+            {"20009-11-01"},
+            {"09-11-01"},
+            {"-11-01"},
+            {"2009-111-01"},
+            {"2009--01"},
+            {"2009-13-01"},
+            {"2009-11-011"},
+            {"2009-11-"},
+            {"2009-11-00"},
+            {"2009-11-33"},
+            {"--"},
+            {""},
+            {null},
+            {"-"},
+            {"2009"},
+            {"2009-01"},
+            {"---"},
+            {"2009-13--1"},
+            {"1900-1-0"},
+            {"2009-01-01 10:50:01"},
+            {"1996-12-10 12:26:19.1"},
+            {"10:50:01"}
+        };
+    }
+
+    /*
+     * DataProvider used to provide Dates which are  valid and are used
+     * to validate that an IllegalArgumentException will not be thrown from the
+     * valueOf method and the corect value from toString() is returned
+     */
+    @DataProvider(name = "validDateValues")
+    private Object[][] validDateValues() {
+        return new Object[][]{
+            {"2009-08-30", "2009-08-30"},
+            {"2009-01-8", "2009-01-08"},
+            {"2009-1-01", "2009-01-01"},
+            {"2009-1-1", "2009-01-01"}
+
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/DriverManagerPermissionsTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.security.AccessControlException;
+import java.security.Policy;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import util.BaseTest;
+import util.StubDriver;
+import util.TestPolicy;
+
+public class DriverManagerPermissionsTests extends BaseTest {
+
+    private  static Policy policy;
+    private static SecurityManager sm;
+
+    /*
+     * Install a SecurityManager along with a base Policy to allow testNG to run
+     */
+    @BeforeClass
+    public static void setUpClass() throws Exception {
+        setPolicy(new TestPolicy());
+        System.setSecurityManager(new SecurityManager());
+    }
+
+    /*
+     * Install the original Policy and SecurityManager
+     */
+    @AfterClass
+    public static void tearDownClass() throws Exception {
+        System.setSecurityManager(sm);
+        setPolicy(policy);
+    }
+
+    /*
+     * Save off the original Policy and SecurityManager
+     */
+    public DriverManagerPermissionsTests() {
+        policy = Policy.getPolicy();
+        sm = System.getSecurityManager();
+    }
+
+    /*
+     * Validate that AccessControlException is thrown if SQLPermission("setLog")
+     * has not been granted
+     */
+    @Test(expectedExceptions = AccessControlException.class)
+    public void test() {
+        setPolicy(new TestPolicy());
+        DriverManager.setLogStream(null);
+    }
+
+    /*
+     * Validate that setLogStream succeeds if SQLPermission("setLog") has been
+     * granted
+     */
+    @Test
+    public void test1() {
+        Policy.setPolicy(new TestPolicy("setLog"));
+        DriverManager.setLogStream(null);
+    }
+
+    /*
+     * Validate that setLogStream succeeds if AllPermissions has been granted
+     */
+    @Test
+    public void test2() {
+        setPolicy(new TestPolicy("all"));
+        DriverManager.setLogStream(null);
+    }
+
+    /*
+     * Validate that AccessControlException is thrown if SQLPermission("setLog")
+     * has not been granted
+     */
+    @Test(expectedExceptions = AccessControlException.class)
+    public void test4() {
+        setPolicy(new TestPolicy());
+        DriverManager.setLogWriter(null);
+    }
+
+    /*
+     * Validate that setLogWriter succeeds if SQLPermission("setLog") has been
+     * granted
+     */
+    @Test
+    public void test5() {
+        setPolicy(new TestPolicy("setLog"));
+        DriverManager.setLogWriter(null);
+    }
+
+    /*
+     * Validate that setLogWriter succeeds if AllPermissions has been granted
+     */
+    @Test
+    public void test6() {
+        setPolicy(new TestPolicy("all"));
+        DriverManager.setLogWriter(null);
+    }
+
+    /*
+     * Validate that AccessControlException is thrown if
+     * SQLPermission("deregisterDriver") has not been granted
+     */
+    @Test(expectedExceptions = AccessControlException.class)
+    public void test7() throws SQLException {
+        setPolicy(new TestPolicy());
+        DriverManager.deregisterDriver(new StubDriver());
+    }
+
+    /*
+     * Validate that deregisterDriver succeeds if
+     * SQLPermission("deregisterDriver") has been granted
+     */
+    @Test
+    public void test8() throws SQLException {
+        setPolicy(new TestPolicy("deregisterDriver"));
+        DriverManager.deregisterDriver(new StubDriver());
+    }
+
+    /*
+     * Validate that deregisterDriver succeeds if AllPermissions has been
+     * granted
+     */
+    @Test
+    public void test9() throws SQLException {
+        setPolicy(new TestPolicy("all"));
+        DriverManager.deregisterDriver(new StubDriver());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/DriverManagerTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,354 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.CharArrayReader;
+import java.io.CharArrayWriter;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.sql.Driver;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.Properties;
+import static org.testng.Assert.*;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import util.StubDriver;
+
+public class DriverManagerTests {
+
+    private final String StubDriverURL = "jdbc:tennis:boy";
+    private final String StubDriverDAURL = "jdbc:luckydog:tennis";
+    private final String InvalidURL = "jdbc:cardio:tennis";
+    private String[] results = {"output", "more output", "and more", "the end"};
+    private String noOutput = "should not find this";
+
+    public DriverManagerTests() {
+    }
+
+    @BeforeClass
+    public static void setUpClass() throws Exception {
+    }
+
+    @AfterClass
+    public static void tearDownClass() throws Exception {
+    }
+
+    @BeforeMethod
+    public void setUpMethod() throws Exception {
+        removeAllDrivers();
+    }
+
+    @AfterMethod
+    public void tearDownMethod() throws Exception {
+    }
+
+    /**
+     * Utility method to remove all registered drivers
+     */
+    private static void removeAllDrivers() {
+        java.util.Enumeration e = DriverManager.getDrivers();
+        while (e.hasMoreElements()) {
+            try {
+                DriverManager.deregisterDriver((Driver) (e.nextElement()));
+            } catch (SQLException ex) {
+                System.out.print(ex.getMessage());
+            }
+        }
+    }
+
+    /**
+     * Utility method to see if a driver is registered
+     */
+    private boolean isDriverRegistered(Driver d) {
+        boolean foundDriver = false;
+        java.util.Enumeration e = DriverManager.getDrivers();
+        while (e.hasMoreElements()) {
+            if (d == (Driver) e.nextElement()) {
+                foundDriver = true;
+                break;
+            }
+        }
+        return foundDriver;
+    }
+
+    /**
+     * Validate that values set using setLoginTimeout will be returned by
+     * getLoginTimeout
+     */
+    @Test
+    public void test() {
+        int[] vals = {-1, 0, 5};
+        for (int val : vals) {
+            DriverManager.setLoginTimeout(val);
+            assertEquals(val, DriverManager.getLoginTimeout());
+        }
+    }
+
+    /**
+     * Validate that NullPointerException is thrown when null is passed to
+     * registerDriver
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test1() throws Exception {
+        Driver d = null;
+        DriverManager.registerDriver(d);
+    }
+
+    /**
+     * Validate that NullPointerException is thrown when null is passed to
+     * registerDriver
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test2() throws Exception {
+        Driver d = null;
+        DriverManager.registerDriver(d, null);
+    }
+
+    /**
+     * Validate that a null value allows for deRegisterDriver to return
+     */
+    @Test
+    public void test3() throws Exception {
+        DriverManager.deregisterDriver(null);
+
+    }
+
+    /**
+     * Validate that SQLException is thrown when there is no Driver to service
+     * the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test4() throws Exception {
+        DriverManager.getConnection(InvalidURL);
+    }
+
+    /**
+     * Validate that SQLException is thrown when there is no Driver to service
+     * the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test5() throws Exception {
+        DriverManager.getConnection(InvalidURL, new Properties());
+    }
+
+    /**
+     * Validate that SQLException is thrown when there is no Driver to service
+     * the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test6() throws Exception {
+        DriverManager.getConnection(InvalidURL, "LuckyDog", "tennisanyone");
+    }
+
+    /**
+     * Validate that SQLException is thrown when null is passed for the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test7() throws Exception {
+        DriverManager.getConnection(null);
+    }
+
+    /**
+     * Validate that SQLException is thrown when null is passed for the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test8() throws Exception {
+        DriverManager.getConnection(null, new Properties());
+    }
+
+    /**
+     * Validate that SQLException is thrown when null is passed for the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test9() throws Exception {
+        DriverManager.getConnection(null, "LuckyDog", "tennisanyone");
+    }
+
+    /**
+     * Validate that SQLException is thrown when there is no Driver to service
+     * the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test10() throws Exception {
+        DriverManager.getDriver(InvalidURL);
+    }
+
+    /**
+     * Validate that SQLException is thrown when null is passed for the URL
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test11() throws Exception {
+        DriverManager.getDriver(null);
+    }
+
+    /**
+     * Validate that a non-null Driver is returned by getDriver when a valid URL
+     * is specified
+     */
+    @Test
+    public void test12() throws Exception {
+
+        DriverManager.registerDriver(new StubDriver());
+        assertTrue(DriverManager.getDriver(StubDriverURL) != null);
+    }
+
+    /**
+     * Validate that SQLException is thrown when the URL is not valid for any of
+     * the registered drivers
+     */
+    @Test(expectedExceptions = SQLException.class)
+    public void test13() throws Exception {
+        DriverManager.registerDriver(new StubDriver());
+        DriverManager.getDriver(InvalidURL);
+    }
+
+    /**
+     * Validate that a Connection object is returned when a valid URL is
+     * specified to getConnection
+     *
+     */
+    @Test
+    public void test14() throws Exception {
+
+        DriverManager.registerDriver(new StubDriver());
+        assertTrue(
+                DriverManager.getConnection(StubDriverURL) != null);
+        assertTrue(DriverManager.getConnection(StubDriverURL,
+                "LuckyDog", "tennisanyone") != null);
+        Properties props = new Properties();
+        props.put("user", "LuckyDog");
+        props.put("password", "tennisanyone");
+        assertTrue(
+                DriverManager.getConnection(StubDriverURL,
+                        props) != null);
+    }
+
+    /**
+     * Register a driver and make sure you find it via its URL. Deregister the
+     * driver and validate it is not longer registered
+     *
+     * @throws Exception
+     */
+    @Test()
+    public void test15() throws Exception {
+        DriverManager.registerDriver(new StubDriver());
+        Driver d = DriverManager.getDriver(StubDriverURL);
+        assertTrue(d != null);
+        assertTrue(isDriverRegistered(d));
+        DriverManager.deregisterDriver(d);
+        assertFalse(isDriverRegistered(d));
+    }
+
+    /**
+     * Validate that DriverAction.release is called when a driver is registered
+     * via registerDriver(Driver, DriverAction)
+     *
+     * @throws Exception
+     */
+    @Test
+    public void test16() throws Exception {
+        File file = new File(util.StubDriverDA.DriverActionCalled);
+        file.delete();
+        assertFalse(file.exists());
+        Driver d = null;
+        Class.forName("util.StubDriverDA");
+        d = DriverManager.getDriver(StubDriverDAURL);
+        DriverManager.deregisterDriver(d);
+        assertFalse(isDriverRegistered(d), "Driver is registered");
+        assertTrue(file.exists());
+    }
+
+    /**
+     * Create a PrintStream and use to send output via DriverManager.println
+     * Validate that if you disable the stream, the output sent is not present
+     */
+    @Test
+    public void tests17() throws Exception {
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        PrintStream ps = new PrintStream(os);
+        DriverManager.setLogStream(ps);
+        assertTrue(DriverManager.getLogStream() == ps);
+
+        DriverManager.println(results[0]);
+        DriverManager.setLogStream((PrintStream) null);
+        assertTrue(DriverManager.getLogStream() == null);
+        DriverManager.println(noOutput);
+        DriverManager.setLogStream(ps);
+        DriverManager.println(results[1]);
+        DriverManager.println(results[2]);
+        DriverManager.println(results[3]);
+        DriverManager.setLogStream((PrintStream) null);
+        DriverManager.println(noOutput);
+
+        /*
+         * Check we do not get the output when the stream is disabled
+         */
+        InputStreamReader is
+                = new InputStreamReader(new ByteArrayInputStream(os.toByteArray()));
+        BufferedReader reader = new BufferedReader(is);
+        for (String result : results) {
+            assertTrue(result.equals(reader.readLine()));
+        }
+    }
+
+    /**
+     * Create a PrintWriter and use to to send output via DriverManager.println
+     * Validate that if you disable the writer, the output sent is not present
+     */
+    @Test
+    public void tests18() throws Exception {
+        CharArrayWriter cw = new CharArrayWriter();
+        PrintWriter pw = new PrintWriter(cw);
+        DriverManager.setLogWriter(pw);
+        assertTrue(DriverManager.getLogWriter() == pw);
+
+        DriverManager.println(results[0]);
+        DriverManager.setLogWriter(null);
+        assertTrue(DriverManager.getLogWriter() == null);
+        DriverManager.println(noOutput);
+        DriverManager.setLogWriter(pw);
+        DriverManager.println(results[1]);
+        DriverManager.println(results[2]);
+        DriverManager.println(results[3]);
+        DriverManager.setLogWriter(null);
+        DriverManager.println(noOutput);
+
+        /*
+         * Check we do not get the output when the stream is disabled
+         */
+        BufferedReader reader
+                = new BufferedReader(new CharArrayReader(cw.toCharArray()));
+        for (String result : results) {
+            assertTrue(result.equals(reader.readLine()));
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/SQLClientInfoExceptionTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,227 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.ClientInfoStatus;
+import java.sql.SQLClientInfoException;
+import java.sql.SQLException;
+import java.util.HashMap;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLClientInfoExceptionTests extends BaseTest {
+
+    private final HashMap<String, ClientInfoStatus> map = new HashMap<>();
+
+    public SQLClientInfoExceptionTests() {
+        map.put("1", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
+        map.put("21", ClientInfoStatus.REASON_UNKNOWN_PROPERTY);
+    }
+
+    /**
+     * Create SQLClientInfoException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLClientInfoException e = new SQLClientInfoException(null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == 0
+                && e.getFailedProperties() == null);
+    }
+
+    /**
+     * Create SQLClientInfoException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLClientInfoException ex = new SQLClientInfoException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && ex.getFailedProperties() == null);
+    }
+
+    /**
+     * Create SQLClientInfoException with null Throwable
+     */
+    @Test
+    public void test2() {
+
+        SQLClientInfoException ex = new SQLClientInfoException(map, null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && ex.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Create SQLClientInfoException with message
+     */
+    @Test
+    public void test3() {
+        SQLClientInfoException ex = new SQLClientInfoException(reason, map);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && ex.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Create SQLClientInfoException with null Throwable
+     */
+    @Test
+    public void test4() {
+        SQLClientInfoException ex = new SQLClientInfoException(reason, map, null);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && ex.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Create SQLClientInfoException with message, and SQLState
+     */
+    @Test
+    public void test5() {
+        SQLClientInfoException ex = new SQLClientInfoException(reason, state,
+                map);
+
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0
+                && ex.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Create SQLClientInfoException with message, and SQLState
+     */
+    @Test
+    public void test6() {
+        SQLClientInfoException ex = new SQLClientInfoException(reason, state,
+                map, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0
+                && ex.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Create SQLClientInfoException with message, SQLState, errorCode, and
+     * Throwable
+     */
+    @Test
+    public void test7() {
+        SQLClientInfoException ex = new SQLClientInfoException(reason, state,
+                errorCode, map);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode
+                && ex.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Create SQLClientInfoException with message, SQLState, and error code
+     */
+    @Test
+    public void test8() {
+        SQLClientInfoException ex = new SQLClientInfoException(reason, state,
+                errorCode, map, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode
+                && ex.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Serialize a SQLClientInfoException and make sure you can read it back
+     * properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLClientInfoException e = new SQLClientInfoException(reason, state,
+                errorCode, map, t);
+        SQLClientInfoException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode
+                && ex1.getFailedProperties().equals(map));
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLClientInfoException ex = new SQLClientInfoException("Exception 1",
+                map, t1);
+        SQLClientInfoException ex1 = new SQLClientInfoException("Exception 2",
+                map);
+        SQLClientInfoException ex2 = new SQLClientInfoException("Exception 3",
+                map, t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLClientInfoException ex = new SQLClientInfoException("Exception 1",
+                map, t1);
+        SQLClientInfoException ex1 = new SQLClientInfoException("Exception 2",
+                map);
+        SQLClientInfoException ex2 = new SQLClientInfoException("Exception 3",
+                map, t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/SQLDataExceptionTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.SQLDataException;
+import java.sql.SQLException;
+import java.sql.SQLNonTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLDataExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLDataException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLDataException e = new SQLDataException(null, null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLDataException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLDataException ex = new SQLDataException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLDataException with message
+     */
+    @Test
+    public void test2() {
+        SQLDataException ex = new SQLDataException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLDataException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLDataException ex = new SQLDataException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLDataException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLDataException ex = new SQLDataException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLDataException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLDataException ex = new SQLDataException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLDataException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLDataException ex = new SQLDataException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLDataException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLDataException ex = new SQLDataException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLDataException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLDataException ex = new SQLDataException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLDataException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLDataException ex = new SQLDataException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLDataException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLDataException e = new SQLDataException(reason, state, errorCode, t);
+        SQLDataException ex1 = createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLDataException ex = new SQLDataException("Exception 1", t1);
+        SQLDataException ex1 = new SQLDataException("Exception 2");
+        SQLDataException ex2 = new SQLDataException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLDataException ex = new SQLDataException("Exception 1", t1);
+        SQLDataException ex1 = new SQLDataException("Exception 2");
+        SQLDataException ex2 = new SQLDataException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLDataException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLDataException();
+        assertTrue(ex instanceof SQLNonTransientException);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/SQLExceptionTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,202 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.SQLException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLException e = new SQLException(null, null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLException ex = new SQLException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLException with message
+     */
+    @Test
+    public void test2() {
+        SQLException ex = new SQLException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLException ex = new SQLException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLException ex = new SQLException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLException ex = new SQLException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLException ex = new SQLException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLException ex = new SQLException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLException ex = new SQLException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLException ex = new SQLException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLException e = new SQLException(reason, state, errorCode, t);
+        SQLException ex1 = createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLException ex = new SQLException("Exception 1", t1);
+        SQLException ex1 = new SQLException("Exception 2");
+        SQLException ex2 = new SQLException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLException ex = new SQLException("Exception 1", t1);
+        SQLException ex1 = new SQLException("Exception 2");
+        SQLException ex2 = new SQLException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        while (ex != null) {
+            assertTrue(msgs[num++].equals(ex.getMessage()));
+            Throwable c = ex.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            ex = ex.getNextException();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/SQLFeatureNotSupportedExceptionTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,232 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.sql.SQLNonTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLFeatureNotSupportedExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLFeatureNotSupportedException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLFeatureNotSupportedException e =
+                new SQLFeatureNotSupportedException(null, null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLFeatureNotSupportedException ex = new SQLFeatureNotSupportedException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with message
+     */
+    @Test
+    public void test2() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException((Throwable) null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLFeatureNotSupportedException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLFeatureNotSupportedException e =
+                new SQLFeatureNotSupportedException(reason, state, errorCode, t);
+        SQLFeatureNotSupportedException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException("Exception 1", t1);
+        SQLFeatureNotSupportedException ex1 =
+                new SQLFeatureNotSupportedException("Exception 2");
+        SQLFeatureNotSupportedException ex2 =
+                new SQLFeatureNotSupportedException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLFeatureNotSupportedException ex =
+                new SQLFeatureNotSupportedException("Exception 1", t1);
+        SQLFeatureNotSupportedException ex1 =
+                new SQLFeatureNotSupportedException("Exception 2");
+        SQLFeatureNotSupportedException ex2 =
+                new SQLFeatureNotSupportedException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLFeatureNotSupportedException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLFeatureNotSupportedException();
+        assertTrue(ex instanceof SQLNonTransientException);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/SQLIntegrityConstraintViolationExceptionTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,235 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLIntegrityConstraintViolationException;
+import java.sql.SQLNonTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLIntegrityConstraintViolationExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLIntegrityConstraintViolationException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLIntegrityConstraintViolationException e =
+                new SQLIntegrityConstraintViolationException(null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with message
+     */
+    @Test
+    public void test2() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLIntegrityConstraintViolationException and make sure
+     * you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLIntegrityConstraintViolationException e =
+                new SQLIntegrityConstraintViolationException(reason, state, errorCode, t);
+        SQLIntegrityConstraintViolationException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException("Exception 1", t1);
+        SQLIntegrityConstraintViolationException ex1 =
+                new SQLIntegrityConstraintViolationException("Exception 2");
+        SQLIntegrityConstraintViolationException ex2 =
+                new SQLIntegrityConstraintViolationException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLIntegrityConstraintViolationException ex =
+                new SQLIntegrityConstraintViolationException("Exception 1", t1);
+        SQLIntegrityConstraintViolationException ex1 =
+                new SQLIntegrityConstraintViolationException("Exception 2");
+        SQLIntegrityConstraintViolationException ex2 =
+                new SQLIntegrityConstraintViolationException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLIntegrityConstraintViolationException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLIntegrityConstraintViolationException();
+        assertTrue(ex instanceof SQLNonTransientException);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/SQLInvalidAuthorizationSpecExceptionTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLInvalidAuthorizationSpecException;
+import java.sql.SQLNonTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLInvalidAuthorizationSpecExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException and setting all objects to
+     * null
+     */
+    @Test
+    public void test() {
+        SQLInvalidAuthorizationSpecException e
+                = new SQLInvalidAuthorizationSpecException(null,
+                        null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with message
+     */
+    @Test
+    public void test2() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with message, SQLState, and
+     * error code
+     */
+    @Test
+    public void test4() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with message, SQLState,
+     * errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with message, SQLState, and
+     * Throwable
+     */
+    @Test
+    public void test6() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException((Throwable) null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLInvalidAuthorizationSpecException and make sure you can
+     * read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLInvalidAuthorizationSpecException e
+                = new SQLInvalidAuthorizationSpecException(reason, state, errorCode, t);
+        SQLInvalidAuthorizationSpecException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException("Exception 1", t1);
+        SQLInvalidAuthorizationSpecException ex1
+                = new SQLInvalidAuthorizationSpecException("Exception 2");
+        SQLInvalidAuthorizationSpecException ex2
+                = new SQLInvalidAuthorizationSpecException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLInvalidAuthorizationSpecException ex
+                = new SQLInvalidAuthorizationSpecException("Exception 1", t1);
+        SQLInvalidAuthorizationSpecException ex1
+                = new SQLInvalidAuthorizationSpecException("Exception 2");
+        SQLInvalidAuthorizationSpecException ex2
+                = new SQLInvalidAuthorizationSpecException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLInvalidAuthorizationSpecException and validate it is an
+     * instance of SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLInvalidAuthorizationSpecException();
+        assertTrue(ex instanceof SQLNonTransientException);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/SQLNonTransientConnectionExceptionTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,235 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLNonTransientConnectionException;
+import java.sql.SQLNonTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLNonTransientConnectionExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLNonTransientConnectionException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLNonTransientConnectionException e =
+                new SQLNonTransientConnectionException(null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with message
+     */
+    @Test
+    public void test2() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLNonTransientConnectionException and make sure you can
+     * read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLNonTransientConnectionException e =
+                new SQLNonTransientConnectionException(reason, state, errorCode, t);
+        SQLNonTransientConnectionException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException("Exception 1", t1);
+        SQLNonTransientConnectionException ex1 =
+                new SQLNonTransientConnectionException("Exception 2");
+        SQLNonTransientConnectionException ex2 =
+                new SQLNonTransientConnectionException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLNonTransientConnectionException ex =
+                new SQLNonTransientConnectionException("Exception 1", t1);
+        SQLNonTransientConnectionException ex1 =
+                new SQLNonTransientConnectionException("Exception 2");
+        SQLNonTransientConnectionException ex2 =
+                new SQLNonTransientConnectionException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLNonTransientConnectionException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLNonTransientConnectionException();
+        assertTrue(ex instanceof SQLNonTransientException);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/SQLNonTransientExceptionTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLNonTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLNonTransientExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLNonTransientException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLNonTransientException e = new SQLNonTransientException(null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLNonTransientException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLNonTransientException ex = new SQLNonTransientException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientException with message
+     */
+    @Test
+    public void test2() {
+        SQLNonTransientException ex = new SQLNonTransientException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLNonTransientException ex = new SQLNonTransientException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {;
+        SQLNonTransientException ex =
+                new SQLNonTransientException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLNonTransientException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLNonTransientException ex =
+                new SQLNonTransientException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLNonTransientException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLNonTransientException ex = new SQLNonTransientException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLNonTransientException ex = new SQLNonTransientException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLNonTransientException ex = new SQLNonTransientException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLNonTransientException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLNonTransientException ex = new SQLNonTransientException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLNonTransientException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLNonTransientException e =
+                new SQLNonTransientException(reason, state, errorCode, t);
+        SQLNonTransientException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLNonTransientException ex = new SQLNonTransientException("Exception 1", t1);
+        SQLNonTransientException ex1 = new SQLNonTransientException("Exception 2");
+        SQLNonTransientException ex2 = new SQLNonTransientException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLNonTransientException ex = new SQLNonTransientException("Exception 1", t1);
+        SQLNonTransientException ex1 = new SQLNonTransientException("Exception 2");
+        SQLNonTransientException ex2 = new SQLNonTransientException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/SQLRecoverableExceptionTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLRecoverableException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLRecoverableExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLRecoverableException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLRecoverableException e = new SQLRecoverableException(null,
+               null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLRecoverableException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLRecoverableException ex = new SQLRecoverableException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLRecoverableException with message
+     */
+    @Test
+    public void test2() {
+        SQLRecoverableException ex = new SQLRecoverableException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLRecoverableException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLRecoverableException ex = new SQLRecoverableException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLRecoverableException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLRecoverableException ex =
+                new SQLRecoverableException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLRecoverableException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLRecoverableException ex =
+                new SQLRecoverableException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLRecoverableException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLRecoverableException ex = new SQLRecoverableException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLRecoverableException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLRecoverableException ex = new SQLRecoverableException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLRecoverableException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLRecoverableException ex = new SQLRecoverableException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLRecoverableException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLRecoverableException ex = new SQLRecoverableException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLRecoverableException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLRecoverableException e =
+                new SQLRecoverableException(reason, state, errorCode, t);
+        SQLRecoverableException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLRecoverableException ex = new SQLRecoverableException("Exception 1", t1);
+        SQLRecoverableException ex1 = new SQLRecoverableException("Exception 2");
+        SQLRecoverableException ex2 = new SQLRecoverableException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLRecoverableException ex = new SQLRecoverableException("Exception 1", t1);
+        SQLRecoverableException ex1 = new SQLRecoverableException("Exception 2");
+        SQLRecoverableException ex2 = new SQLRecoverableException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/SQLSyntaxErrorExceptionTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,221 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLNonTransientException;
+import java.sql.SQLSyntaxErrorException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLSyntaxErrorExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLSyntaxErrorException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLSyntaxErrorException e = new SQLSyntaxErrorException(null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with message
+     */
+    @Test
+    public void test2() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLSyntaxErrorException ex =
+                new SQLSyntaxErrorException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLSyntaxErrorException ex =
+                new SQLSyntaxErrorException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLSyntaxErrorException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLSyntaxErrorException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+
+        SQLSyntaxErrorException e =
+                new SQLSyntaxErrorException(reason, state, errorCode, t);
+        SQLSyntaxErrorException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException("Exception 1", t1);
+        SQLSyntaxErrorException ex1 = new SQLSyntaxErrorException("Exception 2");
+        SQLSyntaxErrorException ex2 = new SQLSyntaxErrorException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLSyntaxErrorException ex = new SQLSyntaxErrorException("Exception 1", t1);
+        SQLSyntaxErrorException ex1 = new SQLSyntaxErrorException("Exception 2");
+        SQLSyntaxErrorException ex2 = new SQLSyntaxErrorException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLSyntaxErrorException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLSyntaxErrorException();
+        assertTrue(ex instanceof SQLNonTransientException);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/SQLTimeoutExceptionTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLTimeoutException;
+import java.sql.SQLTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLTimeoutExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLTimeoutException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLTimeoutException e = new SQLTimeoutException(null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTimeoutException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLTimeoutException ex = new SQLTimeoutException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTimeoutException with message
+     */
+    @Test
+    public void test2() {
+        SQLTimeoutException ex = new SQLTimeoutException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTimeoutException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLTimeoutException ex = new SQLTimeoutException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTimeoutException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLTimeoutException ex = new SQLTimeoutException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTimeoutException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLTimeoutException ex = new SQLTimeoutException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTimeoutException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLTimeoutException ex = new SQLTimeoutException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTimeoutException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLTimeoutException ex = new SQLTimeoutException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTimeoutException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLTimeoutException ex = new SQLTimeoutException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTimeoutException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLTimeoutException ex = new SQLTimeoutException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLTimeoutException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLTimeoutException e =
+                new SQLTimeoutException(reason, state, errorCode, t);
+        SQLTimeoutException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLTimeoutException ex = new SQLTimeoutException("Exception 1", t1);
+        SQLTimeoutException ex1 = new SQLTimeoutException("Exception 2");
+        SQLTimeoutException ex2 = new SQLTimeoutException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLTimeoutException ex = new SQLTimeoutException("Exception 1", t1);
+        SQLTimeoutException ex1 = new SQLTimeoutException("Exception 2");
+        SQLTimeoutException ex2 = new SQLTimeoutException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLTimeoutException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLTimeoutException();
+        assertTrue(ex instanceof SQLTransientException);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/SQLTransactionRollbackExceptionTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,233 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLTransactionRollbackException;
+import java.sql.SQLTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLTransactionRollbackExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLTransactionRollbackException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLTransactionRollbackException e =
+                new SQLTransactionRollbackException(null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLTransactionRollbackException ex = new SQLTransactionRollbackException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with message
+     */
+    @Test
+    public void test2() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransactionRollbackException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLTransactionRollbackException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLTransactionRollbackException e =
+                new SQLTransactionRollbackException(reason, state, errorCode, t);
+        SQLTransactionRollbackException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException("Exception 1", t1);
+        SQLTransactionRollbackException ex1 =
+                new SQLTransactionRollbackException("Exception 2");
+        SQLTransactionRollbackException ex2 =
+                new SQLTransactionRollbackException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLTransactionRollbackException ex =
+                new SQLTransactionRollbackException("Exception 1", t1);
+        SQLTransactionRollbackException ex1 =
+                new SQLTransactionRollbackException("Exception 2");
+        SQLTransactionRollbackException ex2 =
+                new SQLTransactionRollbackException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLTransactionRollbackException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLTransactionRollbackException();
+        assertTrue(ex instanceof SQLTransientException);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/SQLTransientConnectionExceptionTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,233 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLTransientConnectionException;
+import java.sql.SQLTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLTransientConnectionExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLTransientConnectionException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLTransientConnectionException e =
+                new SQLTransientConnectionException( null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLTransientConnectionException ex = new SQLTransientConnectionException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with message
+     */
+    @Test
+    public void test2() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {;
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientConnectionException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLTransientConnectionException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLTransientConnectionException e =
+                new SQLTransientConnectionException(reason, state, errorCode, t);
+        SQLTransientConnectionException ex1 =
+                createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException("Exception 1", t1);
+        SQLTransientConnectionException ex1 =
+                new SQLTransientConnectionException("Exception 2");
+        SQLTransientConnectionException ex2 =
+                new SQLTransientConnectionException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLTransientConnectionException ex =
+                new SQLTransientConnectionException("Exception 1", t1);
+        SQLTransientConnectionException ex1 =
+                new SQLTransientConnectionException("Exception 2");
+        SQLTransientConnectionException ex2 =
+                new SQLTransientConnectionException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Create SQLTransientConnectionException and validate it is an instance of
+     * SQLNonTransientException
+     */
+    @Test
+    public void test13() {
+        Exception ex = new SQLTransientConnectionException();
+        assertTrue(ex instanceof SQLTransientException);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/SQLTransientExceptionTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,207 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLTransientException;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLTransientExceptionTests extends BaseTest {
+
+    /**
+     * Create SQLTransientException and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLTransientException e = new SQLTransientException(null,
+                null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransientException with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLTransientException ex = new SQLTransientException();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientException with message
+     */
+    @Test
+    public void test2() {
+        SQLTransientException ex = new SQLTransientException(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientException with message, and SQLState
+     */
+    @Test
+    public void test3() {
+        SQLTransientException ex = new SQLTransientException(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientException with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLTransientException ex = new SQLTransientException(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransientException with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLTransientException ex =
+                new SQLTransientException(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLTransientException with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLTransientException ex = new SQLTransientException(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientException with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLTransientException ex = new SQLTransientException(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientException with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLTransientException ex = new SQLTransientException((Throwable)null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLTransientException with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLTransientException ex = new SQLTransientException(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLTransientException and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLTransientException e =
+                new SQLTransientException(reason, state, errorCode, t);
+        SQLTransientException ex1 = createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLTransientException ex = new SQLTransientException("Exception 1", t1);
+        SQLTransientException ex1 = new SQLTransientException("Exception 2");
+        SQLTransientException ex2 = new SQLTransientException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct
+     * using traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLTransientException ex = new SQLTransientException("Exception 1", t1);
+        SQLTransientException ex1 = new SQLTransientException("Exception 2");
+        SQLTransientException ex2 = new SQLTransientException("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/SQLWarningTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import static org.testng.Assert.*;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class SQLWarningTests extends BaseTest {
+
+    private final String[] warnings = {"Warning 1", "cause 1", "Warning 2",
+            "Warning 3", "cause 2"};
+
+    /**
+     * Create SQLWarning and setting all objects to null
+     */
+    @Test
+    public void test() {
+        SQLWarning e = new SQLWarning(null, null, errorCode, null);
+        assertTrue(e.getMessage() == null && e.getSQLState() == null
+                && e.getCause() == null && e.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLWarning with no-arg constructor
+     */
+    @Test
+    public void test1() {
+        SQLWarning ex = new SQLWarning();
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLWarning with message
+     */
+    @Test
+    public void test2() {
+        SQLWarning ex = new SQLWarning(reason);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLWarning with message, and SQLState
+     */
+    @Test
+    public void test3() {
+
+        SQLWarning ex = new SQLWarning(reason, state);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLWarning with message, SQLState, and error code
+     */
+    @Test
+    public void test4() {
+        SQLWarning ex = new SQLWarning(reason, state, errorCode);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && ex.getCause() == null
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLWarning with message, SQLState, errorCode, and Throwable
+     */
+    @Test
+    public void test5() {
+        SQLWarning ex = new SQLWarning(reason, state, errorCode, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Create SQLWarning with message, SQLState, and Throwable
+     */
+    @Test
+    public void test6() {
+        SQLWarning ex = new SQLWarning(reason, state, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState().equals(state)
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLWarning with message, and Throwable
+     */
+    @Test
+    public void test7() {
+        SQLWarning ex = new SQLWarning(reason, t);
+        assertTrue(ex.getMessage().equals(reason)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLWarning with null Throwable
+     */
+    @Test
+    public void test8() {
+        SQLWarning ex = new SQLWarning((Throwable) null);
+        assertTrue(ex.getMessage() == null
+                && ex.getSQLState() == null
+                && ex.getCause() == null
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Create SQLWarning with Throwable
+     */
+    @Test
+    public void test9() {
+        SQLWarning ex = new SQLWarning(t);
+        assertTrue(ex.getMessage().equals(cause)
+                && ex.getSQLState() == null
+                && cause.equals(ex.getCause().toString())
+                && ex.getErrorCode() == 0);
+    }
+
+    /**
+     * Serialize a SQLWarning and make sure you can read it back properly
+     */
+    @Test
+    public void test10() throws Exception {
+        SQLWarning e = new SQLWarning(reason, state, errorCode, t);
+        SQLWarning ex1 = createSerializedException(e);
+        assertTrue(reason.equals(ex1.getMessage())
+                && ex1.getSQLState().equals(state)
+                && cause.equals(ex1.getCause().toString())
+                && ex1.getErrorCode() == errorCode);
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * for-each loop
+     */
+    @Test
+    public void test11() {
+        SQLWarning ex = new SQLWarning("Exception 1", t1);
+        SQLWarning ex1 = new SQLWarning("Exception 2");
+        SQLWarning ex2 = new SQLWarning("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(msgs[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned Exceptions is correct using
+     * traditional while loop
+     */
+    @Test
+    public void test12() {
+        SQLWarning ex = new SQLWarning("Exception 1", t1);
+        SQLWarning ex1 = new SQLWarning("Exception 2");
+        SQLWarning ex2 = new SQLWarning("Exception 3", t2);
+        ex.setNextException(ex1);
+        ex.setNextException(ex2);
+        int num = 0;
+        SQLException sqe = ex;
+        while (sqe != null) {
+            assertTrue(msgs[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextException();
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned SQLWarning is correct using
+     * for-each loop
+     */
+    @Test
+    public void test13() {
+        SQLWarning ex = new SQLWarning("Warning 1", t1);
+        SQLWarning ex1 = new SQLWarning("Warning 2");
+        SQLWarning ex2 = new SQLWarning("Warning 3", t2);
+        ex.setNextWarning(ex1);
+        ex.setNextWarning(ex2);
+        int num = 0;
+        for (Throwable e : ex) {
+            assertTrue(warnings[num++].equals(e.getMessage()));
+        }
+    }
+
+    /**
+     * Validate that the ordering of the returned SQLWarning is correct using
+     * traditional while loop
+     */
+    @Test
+    public void test14() {
+        SQLWarning ex = new SQLWarning("Warning 1", t1);
+        SQLWarning ex1 = new SQLWarning("Warning 2");
+        SQLWarning ex2 = new SQLWarning("Warning 3", t2);
+        ex.setNextWarning(ex1);
+        ex.setNextWarning(ex2);
+        int num = 0;
+        SQLWarning sqe = ex;
+        while (sqe != null) {
+            assertTrue(warnings[num++].equals(sqe.getMessage()));
+            Throwable c = sqe.getCause();
+            while (c != null) {
+                assertTrue(msgs[num++].equals(c.getMessage()));
+                c = c.getCause();
+            }
+            sqe = sqe.getNextWarning();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/TimeTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,348 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.Time;
+import java.time.LocalTime;
+import static org.testng.Assert.*;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class TimeTests extends BaseTest {
+
+    /*
+     * Validate an IllegalArgumentException is thrown for calling getYear
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test01() {
+        Time t = Time.valueOf("08:30:59");
+        t.getYear();
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for calling getMonth
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test02() {
+        Time t = Time.valueOf("08:30:59");
+        t.getMonth();
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for calling getDay
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test03() {
+        Time t = Time.valueOf("08:30:59");
+        t.getDay();
+    }
+
+    /**
+     * Validate an IllegalArgumentException is thrown for calling getDate
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test04() {
+        Time t = Time.valueOf("08:30:59");
+        t.getDate();
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for calling setYear
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test05() {
+        Time t = Time.valueOf("08:30:59");
+        t.setYear(8);
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for calling setMonth
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test06() {
+        Time t = Time.valueOf("08:30:59");
+        t.setMonth(8);
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for calling setDate
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test07() {
+        Time t = Time.valueOf("08:30:59");
+        t.setDate(30);
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for calling getDate
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test08() {
+        Time t = Time.valueOf("08:30:59");
+        t.getDate();
+    }
+
+    /*
+     * Validate that a Time made from a toLocalTime() LocalTime are equal
+     */
+    @Test
+    public void test09() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = Time.valueOf(t.toLocalTime());
+        assertTrue(t.equals(t2), "Error t != t2");
+    }
+
+    /*
+     * Validate that a Time LocalTime value, made from a LocalTime are equal
+     */
+    @Test
+    public void test10() {
+        LocalTime lt = LocalTime.of(8, 30, 59);
+        Time t = Time.valueOf(lt);
+        System.out.println("lt=" + lt + ",t=" + t.toLocalTime());
+        assertTrue(lt.equals(t.toLocalTime()),
+                "Error LocalTime values are not equal");
+    }
+
+    /*
+     * Validate an NPE occurs when a null LocalDate is passed to valueOf
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test11() throws Exception {
+        LocalTime ld = null;
+        Time.valueOf(ld);
+    }
+
+    /*
+     * Validate an UnsupportedOperationException occurs when toInstant() is
+     * called
+     */
+    @Test(expectedExceptions = UnsupportedOperationException.class)
+    public void test12() throws Exception {
+        Time t = new Time(System.currentTimeMillis());
+        t.toInstant();
+    }
+
+    /*
+     * Validate that two Time objects are equal when one is created from the
+     * toString() of the other and that the correct value is returned from
+     * toString()
+     */
+    @Test(dataProvider = "validTimeValues")
+    public void test13(String time, String expected) {
+        Time t1 = Time.valueOf(time);
+        Time t2 = Time.valueOf(t1.toString());
+        assertTrue(t1.equals(t2) && t2.equals(t1)
+                && t1.toString().equals(expected), "Error t1 != t2");
+    }
+
+    /*
+     * Validate that two Time values one created using valueOf and another via a
+     * constructor are equal
+     */
+    @Test
+    public void test14() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(8, 30, 59);
+        assertTrue(t.equals(t2) && t2.equals(t), "Error t != t2");
+    }
+
+    /*
+     * Validate that two Time values one created using valueOf and another via a
+     * constructor are equal
+     */
+    @Test
+    public void test15() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(t.getTime());
+        assertTrue(t.equals(t2) && t2.equals(t), "Error t != t2");
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for an invalid Time string
+     */
+    @Test(dataProvider = "invalidTimeValues",
+            expectedExceptions = IllegalArgumentException.class)
+    public void test16(String time) throws Exception {
+        Time.valueOf(time);
+    }
+
+    /*
+     * Validate that Time.after() returns false when same date is compared
+     */
+    @Test
+    public void test17() {
+        Time t = Time.valueOf("08:30:59");
+        assertFalse(t.after(t), "Error t.after(t) = true");
+    }
+
+    /*
+     * Validate that Time.after() returns true when later date is compared to
+     * earlier date
+     */
+    @Test
+    public void test18() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(System.currentTimeMillis());
+        assertTrue(t2.after(t), "Error t2.after(t) = false");
+    }
+
+    /*
+     * Validate that Time.after() returns false when earlier date is compared to
+     * itself
+     */
+    @Test
+    public void test19() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(t.getTime());
+        assertFalse(t.after(t2), "Error t.after(t2) = true");
+        assertFalse(t2.after(t), "Error t2.after(t) = true");
+    }
+
+    /*
+     * Validate that Time.before() returns false when same date is compared
+     */
+    @Test
+    public void test20() {
+        Time t = Time.valueOf("08:30:59");
+        assertFalse(t.before(t), "Error t.before(t) = true");
+    }
+
+    /*
+     * Validate that Time.before() returns true when earlier date is compared to
+     * later date
+     */
+    @Test
+    public void test21() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(System.currentTimeMillis());
+        assertTrue(t.before(t2), "Error t.before(t2) = false");
+    }
+
+    /*
+     * Validate that Time.before() returns false when earlier date is compared
+     * to itself
+     */
+    @Test
+    public void test22() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(t.getTime());
+        assertFalse(t.before(t2), "Error t.after(t2) = true");
+        assertFalse(t2.before(t), "Error t2.after(t) = true");
+    }
+
+    /*
+     * Validate that Time.compareTo returns 0 when both Date objects are the
+     * same
+     */
+    @Test
+    public void test23() {
+        Time t = Time.valueOf("08:30:59");
+        assertTrue(t.compareTo(t) == 0, "Error t.compareTo(t) !=0");
+    }
+
+    /*
+     * Validate thatTime.compareTo returns 0 when both Time objects are the same
+     */
+    @Test
+    public void test24() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(t.getTime());
+        assertTrue(t.compareTo(t2) == 0, "Error t.compareTo(t2) !=0");
+    }
+
+    /*
+     * Validate that Time.compareTo returns 1 when comparing a later Time to an
+     * earlier Time
+     */
+    @Test
+    public void test25() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(t.getTime() + 1);
+        assertTrue(t2.compareTo(t) == 1, "Error t2.compareTo(t) !=1");
+    }
+
+    /*
+     * Validate thatTime.compareTo returns 1 when comparing a later Time to an
+     * earlier Time
+     */
+    @Test
+    public void test26() {
+        Time t = Time.valueOf("08:30:59");
+        Time t2 = new Time(t.getTime() + 1);
+        assertTrue(t.compareTo(t2) == -1, "Error t.compareTo(t2) != -1");
+    }
+
+    /*
+     * DataProvider used to provide Time values which are not valid and are used
+     * to validate that an IllegalArgumentException will be thrown from the
+     * valueOf method
+     */
+    @DataProvider(name = "invalidTimeValues")
+    private Object[][] invalidTimeValues() {
+        return new Object[][]{
+            {"2009-11-01 10:50:01"},
+            {"1961-08-30 10:50:01.1"},
+            {"1961-08-30"},
+            {"00:00:00."},
+            {"10:50:0.1"},
+            {":00:00"},
+            {"00::00"},
+            {"00:00:"},
+            {"::"},
+            {" : : "},
+            {"0a:00:00"},
+            {"00:bb:00"},
+            {"00:01:cc"},
+            {"08:10:Batman"},
+            {"08:10:10:10"},
+            {"08:10"},
+            {"a:b:c"},
+            {null},
+            {"8:"}
+        };
+    }
+
+    /*
+     * DataProvider used to provide Time values which are  valid and are used
+     * to validate that an IllegalArgumentException will  not be thrown from the
+     * valueOf method.  It also contains the expected return value from
+     * toString()
+     */
+    @DataProvider(name = "validTimeValues")
+    private Object[][] validTimeValues() {
+        return new Object[][]{
+            {"10:50:01", "10:50:01"},
+            {"01:1:1", "01:01:01"},
+            {"01:01:1", "01:01:01"},
+            {"1:01:1", "01:01:01"},
+            {"2:02:02", "02:02:02"},
+            {"2:02:2", "02:02:02"},
+            {"10:50:1", "10:50:01"},
+            {"00:00:00", "00:00:00"},
+            {"08:30:59", "08:30:59"},
+            {"9:0:1", "09:00:01"}
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/test/sql/TimestampTests.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,777 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package test.sql;
+
+import java.sql.Date;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.Calendar;
+import java.util.TimeZone;
+import static org.testng.Assert.*;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import util.BaseTest;
+
+public class TimestampTests extends BaseTest {
+
+    private static TimeZone defaultTimeZone = null;
+
+    /*
+     * Need to set and use a custom TimeZone which does not
+     * observe daylight savings time for this test.
+     */
+    @BeforeClass
+    public static void setUpClass() throws Exception {
+        defaultTimeZone = TimeZone.getDefault();
+        TimeZone tzone = TimeZone.getTimeZone("GMT+01");
+        assertFalse(tzone.observesDaylightTime());
+        TimeZone.setDefault(tzone);
+    }
+
+    /*
+     * Conservatively reset the default time zone after test.
+     */
+    @AfterClass
+    public static void tearDownClass() throws Exception {
+        TimeZone.setDefault(defaultTimeZone);
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for an invalid Timestamp
+     */
+    @Test(dataProvider = "invalidTimestampValues",
+            expectedExceptions = IllegalArgumentException.class)
+    public void test(String ts) throws Exception {
+        Timestamp.valueOf(ts);
+    }
+
+    /*
+     * Validate that two Timestamp are equal when the leading 0 in seconds is
+     * omitted
+     */
+    @Test
+    public void test01() throws Exception {
+        String testTS = "2009-01-01 10:50:00";
+        String ExpectedTS = "2009-01-01 10:50:0";
+        Timestamp ts = Timestamp.valueOf(testTS);
+        Timestamp ts2 = Timestamp.valueOf(ExpectedTS);
+        assertEquals(ts, ts2, "Error ts1 != ts2");
+    }
+
+    /*
+     * Validate two Timestamps created from the same string are equal
+     */
+    @Test
+    public void test02() throws Exception {
+        String testTS = "2009-01-01 10:50:0";
+        Timestamp ts = Timestamp.valueOf(testTS);
+        Timestamp ts2 = Timestamp.valueOf(testTS);
+        assertEquals(ts, ts2, "Error ts1 != ts2");
+    }
+
+    /*
+     * Validate that two Timestamp values one with leading 0s for month and day
+     * equals same string without the leading 0s.
+     */
+    @Test
+    public void test03() throws Exception {
+        String testTS = "2009-1-1 10:50:0";
+        String ExpectedTS = "2009-01-01 10:50:0";
+        Timestamp ts = Timestamp.valueOf(testTS);
+        Timestamp ts2 = Timestamp.valueOf(ExpectedTS);
+        assertEquals(ts, ts2, "Error ts1 != ts2");
+    }
+
+    /*
+     * Validate that two Timestamp values one with leading 0s for day omitted
+     * are equal
+     */
+    @Test
+    public void test04() throws Exception {
+        String testTS = "2009-01-1 10:50:0";
+        String ExpectedTS = "2009-01-01 10:50:0";
+        Timestamp ts = Timestamp.valueOf(testTS);
+        Timestamp ts2 = Timestamp.valueOf(ExpectedTS);
+        assertEquals(ts, ts2, "Error ts1 != ts2");
+    }
+
+    /*
+     * Validate that two Timestamp values one with leading 0s for month omitted
+     * and both with leading 0s for seconds omitted are equal
+     */
+    @Test
+    public void test05() throws Exception {
+        String testTS = "2009-1-01 10:50:0";
+        String ExpectedTS = "2009-01-01 10:50:0";
+        Timestamp ts = Timestamp.valueOf(testTS);
+        Timestamp ts2 = Timestamp.valueOf(ExpectedTS);
+        assertEquals(ts, ts2, "Error ts1 != ts2");
+    }
+
+    /*
+     * Validate that two Timestamp values one with leading 0s for month omitted
+     */
+    @Test
+    public void test06() throws Exception {
+        String testTS = "2005-1-01 10:20:50.00";
+        String ExpectedTS = "2005-01-01 10:20:50.00";
+        Timestamp ts = Timestamp.valueOf(testTS);
+        Timestamp ts2 = Timestamp.valueOf(ExpectedTS);
+        assertEquals(ts, ts2, "Error ts1 != ts2");
+    }
+
+    /*
+     * Validate that two Timestamp values one created using valueOf and another
+     * via a constructor are equal
+     */
+    @Test
+    public void test07() {
+
+        Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.001");
+        Timestamp ts2 = new Timestamp(96, 11, 13, 14, 15, 25, 1000000);
+        assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
+    }
+
+    /*
+     * Validate that two Timestamp values one created using valueOf and another
+     * via a constructor are equal
+     */
+    @Test
+    public void test08() {
+        Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.001");
+        Timestamp ts2 = new Timestamp(ts1.getTime());
+        assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
+    }
+
+    /*
+     * Validate that two Timestamp values one created using valueOf and another
+     * via a constructor are equal
+     */
+    @Test
+    public void test09() {
+
+        Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.0");
+        Timestamp ts2 = new Timestamp(96, 11, 13, 14, 15, 25, 0);
+        assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
+    }
+
+    /*
+     * Validate that a Timestamp cannot be equal to null
+     */
+    @Test
+    public void test10() {
+
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 14:15:25.745634");
+        Timestamp ts2 = null;
+        assertFalse(ts1.equals(ts2), "Error ts1 == null");
+    }
+
+    /*
+     * Validate that a Timestamp is equal to another timestamp created with the
+     * using the same value but not equal to a Timestamp which is one day later
+     */
+    @Test
+    public void test11() {
+
+        Timestamp ts1 = Timestamp.valueOf("1996-12-10 12:26:19.12");
+        Timestamp ts2 = Timestamp.valueOf("1996-12-10 12:26:19.12");
+        Timestamp ts3 = Timestamp.valueOf("1996-12-11 12:24:19.12");
+        assertTrue(ts1.equals(ts2) && ts2.equals(ts1), "Error ts1 != ts2");
+        assertFalse(ts1.equals(ts3) && ts3.equals(ts1), "Error ts1 == ts3");
+
+    }
+
+    /*
+     * Validate that a Timestamp is equal to itself
+     */
+    @Test
+    public void test12() {
+        Timestamp ts1 = Timestamp.valueOf("1996-10-15 12:26:19.12");
+        assertTrue(ts1.equals(ts1), "Error ts1 != ts1");
+    }
+
+    /*
+     * Validate that two Timestamps are equal when one is created from the
+     * toString() of the other
+     */
+    @Test(dataProvider = "validTimestampValues")
+    public void test13(String ts, String expectedTS) {
+        Timestamp ts1 = Timestamp.valueOf(ts);
+        Timestamp ts2 = Timestamp.valueOf(ts1.toString());
+        assertTrue(ts1.equals(ts2) && ts2.equals(ts1)
+                && ts1.toString().equals(expectedTS), "Error ts1 != ts2");
+    }
+
+    // Before Tests
+    /*
+     * Validate that Timestamp ts1 is before Timestamp ts2
+     */
+    @Test
+    public void test14() {
+        Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.745634");
+        Timestamp ts2 = Timestamp.valueOf("1996-12-13 15:15:25.645634");
+        assertTrue(ts1.before(ts2), "Error ts1 not before ts2");
+    }
+
+    /*
+     * Validate that Timestamp ts1 is before Timestamp ts2
+     */
+    @Test
+    public void test15() {
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 14:15:25");
+        Timestamp ts2 = Timestamp.valueOf("1999-12-13 15:15:25");
+        assertTrue(ts1.before(ts2), "Error ts1 not before ts2");
+    }
+
+    /*
+     * Validate that Timestamp ts1 is before Timestamp ts2
+     */
+    @Test
+    public void test16() {
+
+        Timestamp ts1 = Timestamp.valueOf("1999-12-13 14:15:25.745634");
+        Timestamp ts2 = Timestamp.valueOf("1999-11-13 15:15:25.645634");
+        assertFalse(ts1.before(ts2), "Error ts1 before ts2");
+    }
+
+    /*
+     * Validate that a NullPointerException is thrown if a null is passed to
+     * the before method
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test17() throws Exception {
+        Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.745634");
+        ts1.before(null);
+    }
+
+    /*
+     * Validate a Timestamp cannot be before itself
+     */
+    @Test
+    public void test18() {
+        Timestamp ts1 = Timestamp.valueOf("1999-11-10 12:26:19.3456543");
+        assertFalse(ts1.before(ts1), "Error ts1 before ts1!");
+    }
+
+    /*
+     * Create 3 Timestamps and make sure the 1st is before the other two
+     * Timestamps which are each greater than the one before it
+     */
+    @Test
+    public void test19() {
+
+        Timestamp ts1 = new Timestamp(1234560000);
+        Timestamp ts2 = new Timestamp(1234567000);
+        Timestamp ts3 = new Timestamp(1234569000);
+        assertTrue(ts1.before(ts2) && ts2.before(ts3) && ts1.before(ts3));
+    }
+
+    /*
+     * Validate that Timestamp ts1 is not after Timestamp ts2
+     */
+    @Test
+    public void test20() {
+        Timestamp ts1 = Timestamp.valueOf("1999-12-13 14:15:25.745634");
+        Timestamp ts2 = Timestamp.valueOf("1999-12-13 15:15:25.645634");
+        assertFalse(ts1.after(ts2), "Error ts1 is after ts2");
+
+    }
+
+    /*
+     * Validate that Timestamp ts1 is after Timestamp ts2
+     */
+    @Test
+    public void test21() {
+        Timestamp ts1 = Timestamp.valueOf("1996-12-13 14:15:25.745634");
+        Timestamp ts2 = Timestamp.valueOf("1996-11-13 15:15:25.645634");
+        assertTrue(ts1.after(ts2), "Error ts1 not after ts2");
+    }
+
+    /*
+     * Validate that a NullPointerException is thrown if a null is passed to the
+     * after method
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test22() throws Exception {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        ts1.after(null);
+    }
+
+    /*
+     * Validate that a Timestamp cannot be after itself
+     */
+    @Test
+    public void test23() {
+        Timestamp ts1 = Timestamp.valueOf("1999-11-10 12:26:19.3456543");
+        assertFalse(ts1.after(ts1), "Error ts1 is after itself");
+    }
+
+    /*
+     * Validate that a Timestamp after() works correctly with Timestamp created
+     * using milliseconds
+     */
+    @Test
+    public void test24() {
+
+        Timestamp ts1 = new Timestamp(1234568000);
+        Timestamp ts2 = new Timestamp(1234565000);
+        Timestamp ts3 = new Timestamp(1234562000);
+        assertTrue(ts1.after(ts2) && ts2.after(ts3) && ts1.after(ts3));
+    }
+
+    /*
+     * Validate compareTo returns 0 for Timestamps that are the same
+     */
+    @Test
+    public void test25() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        Timestamp ts2 = new Timestamp(ts1.getTime());
+        assertTrue(ts1.compareTo(ts2) == 0, "Error ts1 != ts2");
+    }
+
+    /*
+     * Validate compareTo returns -1 for when the 1st Timestamp is earlier than
+     * the 2nd Timestamp
+     */
+    @Test
+    public void test26() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        Timestamp ts2 = new Timestamp(ts1.getTime() + 1000);
+        assertTrue(ts1.compareTo(ts2) == -1, "Error ts1 not before ts2");
+        assertTrue(ts2.compareTo(ts1) == 1, "Error ts1 is not before ts2");
+    }
+
+    /*
+     * Validate compareTo returns 1 for when the 1st Timestamp is later than the
+     * 2nd Timestamp
+     */
+    @Test
+    public void test27() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        Timestamp ts2 = new Timestamp(ts1.getTime() - 1000);
+        assertTrue(ts1.compareTo(ts2) == 1, "Error ts1 not after ts2");
+        assertTrue(ts2.compareTo(ts1) == -1, "Error ts1 not after ts2");
+    }
+
+    /*
+     * Validate compareTo returns 0 for Timestamps that are the same
+     */
+    @Test
+    public void test28() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        java.util.Date ts2 = new java.util.Date(ts1.getTime());
+        assertTrue(ts1.compareTo(ts2) == 0, "Error ts1 != ts2");
+    }
+
+    /*
+     * Validate compareTo returns 0 for Timestamps that are the same
+     */
+    @Test
+    public void test29() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        java.util.Date d = new java.util.Date(ts1.getTime());
+        assertFalse(ts1.equals(d), "Error ts1 == d");
+    }
+
+    /*
+     * Validate compareTo returns 0 for Timestamps that are the same
+     */
+    @Test
+    public void test30() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        java.util.Date d = new Timestamp(ts1.getTime());
+        assertTrue(ts1.equals(d), "Error ts1 != d");
+    }
+
+    /*
+     * Validate equals returns false when a Date object is passed to equals
+     */
+    @Test
+    public void test31() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        Date d = new Date(ts1.getTime());
+        assertFalse(ts1.equals(d), "Error ts1 != d");
+    }
+
+    /*
+     * Validate equals returns false when a Date object is passed to equals
+     */
+    @Test
+    public void test32() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        java.util.Date d = new Date(ts1.getTime());
+        assertFalse(ts1.equals(d), "Error ts1 != d");
+    }
+
+    /*
+     * Validate equals returns false when a Time object is passed to equals
+     */
+    @Test
+    public void test33() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        Time t1 = new Time(ts1.getTime());
+        assertFalse(ts1.equals(t1), "Error ts1 == t1");
+    }
+
+    /*
+     * Validate equals returns false when a String object is passed to equals
+     */
+    @Test
+    public void test34() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        assertFalse(ts1.equals("1966-08-30 08:08:08"), "Error ts1 == a String");
+    }
+
+    /*
+     * Validate getTime() returns the same value from 2 timeStamps created by
+     */
+    @Test
+    public void test35() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        Timestamp ts2 = Timestamp.valueOf("1966-08-30 08:08:08");
+        assertTrue(ts2.getTime() == ts1.getTime(),
+                "ts1.getTime() != ts2.getTime()");
+        assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
+    }
+
+    /*
+     * Validate getTime() returns the same value from 2 timeStamps when
+     * setTime() is used to specify the same value for both Timestamps
+     */
+    @Test
+    public void test36() {
+        Timestamp ts1 = Timestamp.valueOf("1966-08-30 08:08:08");
+        Timestamp ts2 = Timestamp.valueOf("1961-08-30 00:00:00");
+        ts2.setTime(ts1.getTime());
+        assertTrue(ts2.getTime() == ts1.getTime(),
+                "ts1.getTime() != ts2.getTime()");
+        assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for an invalid nanos value
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test38() throws Exception {
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
+        ts1.setNanos(-1);
+
+    }
+
+    /*
+     * Validate an IllegalArgumentException is thrown for an invalid nanos value
+     */
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void test39() throws Exception {
+        int nanos = 999999999;
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
+        ts1.setNanos(nanos + 1);
+    }
+
+    /*
+     * Validate you can set nanos to 999999999
+     */
+    @Test
+    public void test40() throws Exception {
+        int nanos = 999999999;
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
+        ts1.setNanos(nanos);
+        assertTrue(ts1.getNanos() == nanos, "Error Invalid Nanos value");
+    }
+
+    /*
+     * Validate you can set nanos to 0
+     */
+    @Test
+    public void test41() throws Exception {
+        int nanos = 0;
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
+        ts1.setNanos(nanos);
+        assertTrue(ts1.getNanos() == nanos, "Error Invalid Nanos value");
+    }
+
+    /*
+     * Validate that a Timestamp made from a LocalDateTime are equal
+     */
+    @Test
+    public void test42() throws Exception {
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
+        LocalDateTime ldt = ts1.toLocalDateTime();
+        Timestamp ts2 = Timestamp.valueOf(ldt);
+        assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
+    }
+
+    /*
+     * Validate that a Timestamp LocalDateTime value, made from a LocalDateTime
+     * are equal
+     */
+    @Test
+    public void test43() throws Exception {
+        LocalDateTime ldt = LocalDateTime.now();
+        Timestamp ts2 = Timestamp.valueOf(ldt);
+        assertTrue(ldt.equals(ts2.toLocalDateTime()),
+                "Error LocalDateTime values are not equal");
+    }
+
+    /*
+     * Validate an NPE occurs when a null LocalDateTime is passed to valueOF
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test44() throws Exception {
+        LocalDateTime ldt = null;
+        Timestamp.valueOf(ldt);
+    }
+
+    /*
+     * Validate that a Timestamp made from a Instant are equal
+     */
+    @Test
+    public void test45() throws Exception {
+        Timestamp ts1 = Timestamp.valueOf("1961-08-30 00:00:00");
+        Instant instant = ts1.toInstant();
+        Timestamp ts2 = Timestamp.from(instant);
+        assertTrue(ts1.equals(ts2), "Error ts1 != ts2");
+    }
+
+    /*
+     * Validate that a Timestamp made from a Instant are equal
+     */
+    @Test
+    public void test46() throws Exception {
+        Instant instant = Instant.now();
+        Timestamp ts2 = Timestamp.from(instant);
+        assertTrue(instant.equals(ts2.toInstant()),
+                "Error Instant values do not match");
+    }
+
+    /*
+     * Validate an NPE occurs when a null instant is passed to from
+     */
+    @Test(expectedExceptions = NullPointerException.class)
+    public void test47() throws Exception {
+        Instant instant = null;
+        Timestamp.from(instant);
+    }
+
+    // Added SQE tests
+    /*
+     * Create a Timestamp and a 2nd Timestamp that is 1 month earlier and
+     * validate that it is not before or after the original Timestamp
+     */
+    @Test
+    public void test48() {
+        Calendar cal = Calendar.getInstance();
+        Timestamp ts1 = new Timestamp(System.currentTimeMillis());
+        cal.setTimeInMillis(ts1.getTime());
+        cal.add(Calendar.MONTH, -1);
+        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+        Timestamp ts2 = new Timestamp(cal.getTimeInMillis());
+        assertFalse(ts1.before(ts2) || ts2.after(ts1));
+    }
+
+    /*
+     * Create two Timestamps and validate that compareTo returns 1 to indicate
+     * the 1st Timestamp is greater than the 2nd Timestamp
+     */
+    @Test
+    public void test49() {
+        Calendar cal = Calendar.getInstance();
+        Timestamp ts1 = new Timestamp(System.currentTimeMillis());
+        cal.setTimeInMillis(ts1.getTime());
+        cal.add(Calendar.MONTH, -1);
+        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+        Timestamp ts2 = new Timestamp(cal.getTimeInMillis());
+        assertTrue(ts1.compareTo(ts2) == 1);
+    }
+
+    /*
+     * Create two Timestamps and validate that the 1st Timestamp is not equal to
+     * the 2nd Timestamp but equal to itself
+     */
+    @Test
+    public void test50() {
+        Calendar cal = Calendar.getInstance();
+        Timestamp ts1 = new Timestamp(System.currentTimeMillis());
+        cal.setTimeInMillis(ts1.getTime());
+        cal.add(Calendar.MONTH, -1);
+        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+        Timestamp ts2 = new Timestamp(cal.getTimeInMillis());
+        assertTrue(!ts1.equals(ts2) && ts1.equals(ts1));
+    }
+
+    /*
+     * Validate that two Timestamps are equal when one is created from the
+     * toString() of the other
+     */
+    @Test(dataProvider = "validateNanos")
+    public void test51(String ts, int nanos) {
+        Timestamp ts1 = Timestamp.valueOf(ts);
+        Timestamp ts2 = Timestamp.valueOf(ts1.toString());
+        assertTrue(ts1.getNanos() == nanos && ts1.equals(ts2),
+                "Error with Nanos");
+    }
+
+    @Test(dataProvider = "validTimestampLongValues")
+    public void test52(long value, String ts) {
+        Timestamp ts1 = new Timestamp(value);
+        assertEquals(ts1.toString(), ts, "ts1.toString() != ts");
+    }
+
+    /*
+     * DataProvider used to provide Timestamps which are not valid and are used
+     * to validate that an IllegalArgumentException will be thrown from the
+     * valueOf method
+     */
+    @DataProvider(name = "invalidTimestampValues")
+    private Object[][] invalidTimestampValues() {
+        return new Object[][]{
+            {"2009-11-01-01 10:50:01"},
+            {"aaaa-11-01-01 10:50"},
+            {"aaaa-11-01 10:50"},
+            {"1961--30 00:00:00"},
+            {"--30 00:00:00"},
+            {"-- 00:00:00"},
+            {"1961-1- 00:00:00"},
+            {"2009-11-01"},
+            {"10:50:01"},
+            {"1961-a-30 00:00:00"},
+            {"1961-01-bb 00:00:00"},
+            {"1961-08-30 00:00:00."},
+            {"1961-08-30 :00:00"},
+            {"1961-08-30 00::00"},
+            {"1961-08-30 00:00:"},
+            {"1961-08-30 ::"},
+            {"1961-08-30 0a:00:00"},
+            {"1961-08-30 00:bb:00"},
+            {"1961-08-30 00:01:cc"},
+            {"1961-08-30 00:00:00.01a"},
+            {"1961-08-30 00:00:00.a"},
+            {"1996-12-10 12:26:19.1234567890"},
+            {null}
+        };
+    }
+
+    /*
+     * DataProvider used to provide Timestamps which are  valid and are used
+     * to validate that an IllegalArgumentException will not be thrown from the
+     * valueOf method and the corect value from toString() is returned
+     */
+    @DataProvider(name = "validTimestampValues")
+    private Object[][] validTimestampValues() {
+        return new Object[][]{
+            {"1961-08-30 00:00:00", "1961-08-30 00:00:00.0"},
+            {"1961-08-30 11:22:33", "1961-08-30 11:22:33.0"},
+            {"1961-8-30 00:00:00", "1961-08-30 00:00:00.0"},
+            {"1966-08-1 00:00:00", "1966-08-01 00:00:00.0"},
+            {"1996-12-10 12:26:19.1", "1996-12-10 12:26:19.1"},
+            {"1996-12-10 12:26:19.12", "1996-12-10 12:26:19.12"},
+            {"1996-12-10 12:26:19.123", "1996-12-10 12:26:19.123"},
+            {"1996-12-10 12:26:19.1234", "1996-12-10 12:26:19.1234"},
+            {"1996-12-10 12:26:19.12345", "1996-12-10 12:26:19.12345"},
+            {"1996-12-10 12:26:19.123456", "1996-12-10 12:26:19.123456"},
+            {"1996-12-10 12:26:19.1234567", "1996-12-10 12:26:19.1234567"},
+            {"1996-12-10 12:26:19.12345678", "1996-12-10 12:26:19.12345678"},
+            {"1996-12-10 12:26:19.123456789", "1996-12-10 12:26:19.123456789"},
+            {"1996-12-10 12:26:19.000000001", "1996-12-10 12:26:19.000000001"},
+            {"1996-12-10 12:26:19.000000012", "1996-12-10 12:26:19.000000012"},
+            {"1996-12-10 12:26:19.000000123", "1996-12-10 12:26:19.000000123"},
+            {"1996-12-10 12:26:19.000001234", "1996-12-10 12:26:19.000001234"},
+            {"1996-12-10 12:26:19.000012345", "1996-12-10 12:26:19.000012345"},
+            {"1996-12-10 12:26:19.000123456", "1996-12-10 12:26:19.000123456"},
+            {"1996-12-10 12:26:19.001234567", "1996-12-10 12:26:19.001234567"},
+            {"1996-12-10 12:26:19.12345678", "1996-12-10 12:26:19.12345678"},
+            {"1996-12-10 12:26:19.0", "1996-12-10 12:26:19.0"},
+            {"1996-12-10 12:26:19.01230", "1996-12-10 12:26:19.0123"}
+        };
+    }
+
+    @DataProvider(name = "validTimestampLongValues")
+    private Object[][] validTimestampLongValues() {
+        return new Object[][]{
+            {1L, "1970-01-01 01:00:00.001"},
+            {-3600*1000L - 1, "1969-12-31 23:59:59.999"},
+            {-(20000L*365*24*60*60*1000), "18018-08-28 01:00:00.0"},
+            {Timestamp.valueOf("1961-08-30 11:22:33").getTime(), "1961-08-30 11:22:33.0"},
+            {Timestamp.valueOf("1961-08-30 11:22:33.54321000").getTime(), "1961-08-30 11:22:33.543"}, // nanoprecision lost
+            {new Timestamp(114, 10, 10, 10, 10, 10, 100000000).getTime(), "2014-11-10 10:10:10.1"},
+            {new Timestamp(0, 10, 10, 10, 10, 10, 100000).getTime(), "1900-11-10 10:10:10.0"}, // nanoprecision lost
+            {new Date(114, 10, 10).getTime(), "2014-11-10 00:00:00.0"},
+            {new Date(0, 10, 10).getTime(), "1900-11-10 00:00:00.0"},
+            {LocalDateTime.of(1960, 10, 10, 10, 10, 10, 50000).atZone(ZoneId.of("America/Los_Angeles"))
+                .toInstant().toEpochMilli(), "1960-10-10 19:10:10.0"},
+
+            // millisecond timestamps wraps around at year 1, so Long.MIN_VALUE looks similar
+            // Long.MAX_VALUE, while actually representing 292278994 BCE
+            {Long.MIN_VALUE, "292278994-08-17 08:12:55.192"},
+            {Long.MAX_VALUE + 1, "292278994-08-17 08:12:55.192"},
+            {Long.MAX_VALUE, "292278994-08-17 08:12:55.807"},
+            {Long.MIN_VALUE - 1, "292278994-08-17 08:12:55.807"},
+
+            // wrap around point near 0001-01-01, test that we never get a negative year:
+            {-(1970L*365*24*60*60*1000), "0001-04-25 01:00:00.0"},
+            {-(1970L*365*24*60*60*1000 + 115*24*60*60*1000L), "0001-12-31 01:00:00.0"},
+            {-(1970L*365*24*60*60*1000 + 115*24*60*60*1000L - 23*60*60*1000L), "0001-01-01 00:00:00.0"},
+
+            {LocalDateTime.of(0, 1, 1, 10, 10, 10, 50000).atZone(ZoneId.of("America/Los_Angeles"))
+                .toInstant().toEpochMilli() - 2*24*60*60*1000L, "0001-01-01 19:03:08.0"}, // 1 BCE
+            {LocalDateTime.of(0, 1, 1, 10, 10, 10, 50000).atZone(ZoneId.of("America/Los_Angeles"))
+                .toInstant().toEpochMilli() - 3*24*60*60*1000L, "0002-12-31 19:03:08.0"} // 2 BCE
+        };
+    }
+
+    /*
+     * DataProvider used to provide Timestamp and Nanos values in order to
+     * validate that the correct Nanos value is generated from the specified
+     * Timestamp
+     */
+    @DataProvider(name = "validateNanos")
+    private Object[][] validateNanos() {
+        return new Object[][]{
+            {"1961-08-30 00:00:00", 0},
+            {"1996-12-10 12:26:19.1", 100000000},
+            {"1996-12-10 12:26:19.12", 120000000},
+            {"1996-12-10 12:26:19.123", 123000000},
+            {"1996-12-10 12:26:19.1234", 123400000},
+            {"1996-12-10 12:26:19.12345", 123450000},
+            {"1996-12-10 12:26:19.123456", 123456000},
+            {"1996-12-10 12:26:19.1234567", 123456700},
+            {"1996-12-10 12:26:19.12345678", 123456780},
+            {"1996-12-10 12:26:19.123456789", 123456789},
+            {"1996-12-10 12:26:19.000000001", 1},
+            {"1996-12-10 12:26:19.000000012", 12},
+            {"1996-12-10 12:26:19.000000123", 123},
+            {"1996-12-10 12:26:19.000001234", 1234},
+            {"1996-12-10 12:26:19.000012345", 12345},
+            {"1996-12-10 12:26:19.000123456", 123456},
+            {"1996-12-10 12:26:19.001234567", 1234567},
+            {"1996-12-10 12:26:19.012345678", 12345678},
+            {"1996-12-10 12:26:19.0", 0},
+            {"1996-12-10 12:26:19.01230", 12300000}
+        };
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/util/BaseTest.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package util;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.security.Policy;
+import java.sql.JDBCType;
+import java.sql.SQLException;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.DataProvider;
+
+public class BaseTest {
+
+    protected final String reason = "reason";
+    protected final String state = "SQLState";
+    protected final String cause = "java.lang.Throwable: cause";
+    protected final Throwable t = new Throwable("cause");
+    protected final Throwable t1 = new Throwable("cause 1");
+    protected final Throwable t2 = new Throwable("cause 2");
+    protected final int errorCode = 21;
+    protected final String[] msgs = {"Exception 1", "cause 1", "Exception 2",
+        "Exception 3", "cause 2"};
+
+    @BeforeClass
+    public static void setUpClass() throws Exception {
+    }
+
+    @AfterClass
+    public static void tearDownClass() throws Exception {
+    }
+
+    @BeforeMethod
+    public void setUpMethod() throws Exception {
+    }
+
+    @AfterMethod
+    public void tearDownMethod() throws Exception {
+    }
+
+    /*
+     * Take some form of SQLException, serialize and deserialize it
+     */
+    @SuppressWarnings("unchecked")
+    protected <T extends SQLException> T
+            createSerializedException(T ex)
+            throws IOException, ClassNotFoundException {
+        return (T) serializeDeserializeObject(ex);
+    }
+
+    /*
+     * Utility method to serialize and deserialize an object
+     */
+    @SuppressWarnings("unchecked")
+    protected <T> T serializeDeserializeObject(T o)
+            throws IOException, ClassNotFoundException {
+        T o1;
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
+            oos.writeObject(o);
+        }
+        try (ObjectInputStream ois
+                = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))) {
+            o1 = (T) ois.readObject();
+        }
+        return o1;
+    }
+
+    /*
+     * Utility Method used to set the current Policy
+     */
+    protected static void setPolicy(Policy p) {
+        Policy.setPolicy(p);
+    }
+
+    /*
+     * DataProvider used to specify the value to set and check for
+     * methods using boolean values
+     */
+    @DataProvider(name = "trueFalse")
+    protected Object[][] trueFalse() {
+        return new Object[][]{
+            {true},
+            {false}
+        };
+    }
+
+    /*
+     * DataProvider used to specify the standard JDBC Types
+     */
+    @DataProvider(name = "jdbcTypes")
+    protected Object[][] jdbcTypes() {
+        Object[][] o = new Object[JDBCType.values().length][1];
+        int pos = 0;
+        for (JDBCType c : JDBCType.values()) {
+            o[pos++][0] = c.getVendorTypeNumber();
+        }
+        return o;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/util/DriverActionImpl.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package util;
+
+import java.sql.DriverAction;
+
+/**
+ * Simple implementation of DriverAction which calls back into the Driver when
+ * release is called.
+ */
+class DriverActionImpl implements DriverAction {
+
+    public DriverActionImpl(StubDriverDA d) {
+        driver = d;
+    }
+
+    private final StubDriverDA driver;
+
+    @Override
+    public void deregister() {
+        driver.release();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/sql/testng/util/SerializedBatchUpdateException.java	Tue Jun 09 11:24:01 2015 -0700
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package util;
+
+public class SerializedBatchUpdateException {
+    /**
+     * Serialized BatchUpdateException from JDBC 4.0 with the following values
+     *  reason = "This was the error msg"
+     *  SQLState   = "user defined sqlState"
+     *  vendor Code = 99999
+     *  Update Counts = {1, 2, 21}
+     *  cause = = "java.lang.Throwable: throw 1"
+     */
+    public static byte[] DATA = {
+        (byte) 0xac, (byte) 0xed, (byte) 0x0, (byte) 0x5, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x1d, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x73, (byte) 0x71, (byte) 0x6c, (byte) 0x2e, (byte) 0x42, (byte) 0x61, (byte) 0x74, (byte) 0x63, (byte) 0x68, (byte) 0x55, (byte) 0x70, (byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65,
+        (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x52, (byte) 0xf4, (byte) 0x73, (byte) 0xc0, (byte) 0xc1, (byte) 0x8b, (byte) 0xe, (byte) 0x5d, (byte) 0x3, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x0, (byte) 0x10, (byte) 0x6c, (byte) 0x6f, (byte) 0x6e, (byte) 0x67, (byte) 0x55, (byte) 0x70, (byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x43, (byte) 0x6f, (byte) 0x75,
+        (byte) 0x6e, (byte) 0x74, (byte) 0x73, (byte) 0x74, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x4a, (byte) 0x5b, (byte) 0x0, (byte) 0xc, (byte) 0x75, (byte) 0x70, (byte) 0x64, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x43, (byte) 0x6f, (byte) 0x75, (byte) 0x6e, (byte) 0x74, (byte) 0x73, (byte) 0x74, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x49, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x15,
+        (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x73, (byte) 0x71, (byte) 0x6c, (byte) 0x2e, (byte) 0x53, (byte) 0x51, (byte) 0x4c, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x1d, (byte) 0xa1, (byte) 0xe9, (byte) 0x30, (byte) 0xdb, (byte) 0x3e, (byte) 0x75, (byte) 0xdc, (byte) 0x2, (byte) 0x0, (byte) 0x3,
+        (byte) 0x49, (byte) 0x0, (byte) 0xa, (byte) 0x76, (byte) 0x65, (byte) 0x6e, (byte) 0x64, (byte) 0x6f, (byte) 0x72, (byte) 0x43, (byte) 0x6f, (byte) 0x64, (byte) 0x65, (byte) 0x4c, (byte) 0x0, (byte) 0x8, (byte) 0x53, (byte) 0x51, (byte) 0x4c, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x12, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61,
+        (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0x4, (byte) 0x6e, (byte) 0x65, (byte) 0x78, (byte) 0x74, (byte) 0x74, (byte) 0x0, (byte) 0x17, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x73, (byte) 0x71, (byte) 0x6c,
+        (byte) 0x2f, (byte) 0x53, (byte) 0x51, (byte) 0x4c, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x3b, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65,
+        (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0xd0, (byte) 0xfd, (byte) 0x1f, (byte) 0x3e, (byte) 0x1a, (byte) 0x3b, (byte) 0x1c, (byte) 0xc4, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x72, (byte) 0x0, (byte) 0x13, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x54, (byte) 0x68,
+        (byte) 0x72, (byte) 0x6f, (byte) 0x77, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0xd5, (byte) 0xc6, (byte) 0x35, (byte) 0x27, (byte) 0x39, (byte) 0x77, (byte) 0xb8, (byte) 0xcb, (byte) 0x3, (byte) 0x0, (byte) 0x4, (byte) 0x4c, (byte) 0x0, (byte) 0x5, (byte) 0x63, (byte) 0x61, (byte) 0x75, (byte) 0x73, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x15, (byte) 0x4c, (byte) 0x6a, (byte) 0x61,
+        (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x54, (byte) 0x68, (byte) 0x72, (byte) 0x6f, (byte) 0x77, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0xd, (byte) 0x64, (byte) 0x65, (byte) 0x74, (byte) 0x61, (byte) 0x69, (byte) 0x6c, (byte) 0x4d, (byte) 0x65, (byte) 0x73, (byte) 0x73, (byte) 0x61,
+        (byte) 0x67, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x4, (byte) 0x5b, (byte) 0x0, (byte) 0xa, (byte) 0x73, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x74, (byte) 0x0, (byte) 0x1e, (byte) 0x5b, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61,
+        (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x3b, (byte) 0x4c, (byte) 0x0, (byte) 0x14, (byte) 0x73, (byte) 0x75, (byte) 0x70, (byte) 0x70, (byte) 0x72, (byte) 0x65, (byte) 0x73, (byte) 0x73,
+        (byte) 0x65, (byte) 0x64, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x73, (byte) 0x74, (byte) 0x0, (byte) 0x10, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x75, (byte) 0x74, (byte) 0x69, (byte) 0x6c, (byte) 0x2f, (byte) 0x4c, (byte) 0x69, (byte) 0x73, (byte) 0x74, (byte) 0x3b, (byte) 0x78,
+        (byte) 0x70, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x7, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0xc, (byte) 0x74, (byte) 0x0, (byte) 0x7, (byte) 0x74, (byte) 0x68, (byte) 0x72, (byte) 0x6f, (byte) 0x77, (byte) 0x20, (byte) 0x31, (byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x1e, (byte) 0x5b, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61,
+        (byte) 0x2e, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2e, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x63, (byte) 0x6b, (byte) 0x54, (byte) 0x72, (byte) 0x61, (byte) 0x63, (byte) 0x65, (byte) 0x45, (byte) 0x6c, (byte) 0x65, (byte) 0x6d, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x3b, (byte) 0x2, (byte) 0x46, (byte) 0x2a, (byte) 0x3c, (byte) 0x3c, (byte) 0xfd, (byte) 0x22, (byte) 0x39,
+        (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x2, (byte) 0x73, (byte) 0x72, (byte) 0x0, (byte) 0x1b, (byte) 0x6a, (byte