# HG changeset patch # User asaha # Date 1434603337 25200 # Node ID 309156990bcf2f6652ad9f93c0bea0361fbea393 # Parent 37d98293b182b8b82b849eb85a678c2284924ffc# Parent 63c9cedeeb9d0de656969f3deed7ddafae11754a Merge diff -r 37d98293b182 -r 309156990bcf .hgtags --- a/.hgtags Wed Jun 10 23:15:56 2015 -0700 +++ b/.hgtags Wed Jun 17 21:55:37 2015 -0700 @@ -443,3 +443,4 @@ c30db4c968f63dce1bf2f9df240fb75a8f27f922 jdk8u60-b17 57336c319de8a141d0bcd04265ce36734fb51380 jdk8u60-b18 b2c55ff77112321472ec97c3a6931a999837d183 jdk8u60-b19 +cc6c74b164dfd0636d9dba8f9865baa18a6f2338 jdk8u60-b20 diff -r 37d98293b182 -r 309156990bcf make/CompileJavaClasses.gmk --- a/make/CompileJavaClasses.gmk Wed Jun 10 23:15:56 2015 -0700 +++ b/make/CompileJavaClasses.gmk Wed Jun 17 21:55:37 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) diff -r 37d98293b182 -r 309156990bcf make/lib/PlatformLibraries.gmk --- a/make/lib/PlatformLibraries.gmk Wed Jun 10 23:15:56 2015 -0700 +++ b/make/lib/PlatformLibraries.gmk Wed Jun 17 21:55:37 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 diff -r 37d98293b182 -r 309156990bcf make/mapfiles/libnet/mapfile-vers --- a/make/mapfiles/libnet/mapfile-vers Wed Jun 10 23:15:56 2015 -0700 +++ b/make/mapfiles/libnet/mapfile-vers Wed Jun 17 21:55:37 2015 -0700 @@ -42,7 +42,7 @@ Java_java_net_Inet4Address_init; Java_java_net_Inet6Address_init; Java_java_net_PlainDatagramSocketImpl_setTTL; - Java_java_net_PlainDatagramSocketImpl_socketSetOption; + Java_java_net_PlainDatagramSocketImpl_socketSetOption0; Java_java_net_PlainDatagramSocketImpl_bind0; Java_java_net_PlainSocketImpl_socketAccept; Java_java_net_DatagramPacket_init; @@ -73,7 +73,7 @@ Java_java_net_SocketOutputStream_init; Java_java_net_PlainDatagramSocketImpl_peek; Java_java_net_PlainDatagramSocketImpl_peekData; - Java_java_net_PlainSocketImpl_socketSetOption; + Java_java_net_PlainSocketImpl_socketSetOption0; Java_java_net_PlainSocketImpl_socketSendUrgentData; Java_java_net_PlainDatagramSocketImpl_datagramSocketCreate; Java_java_net_PlainSocketImpl_socketGetOption; diff -r 37d98293b182 -r 309156990bcf src/macosx/classes/com/apple/laf/resources/aqua_sv.properties --- a/src/macosx/classes/com/apple/laf/resources/aqua_sv.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/macosx/classes/com/apple/laf/resources/aqua_sv.properties Wed Jun 17 21:55:37 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 @@ -124,7 +124,7 @@ # The following string will be formatted by a MessageFormat # and {0} will be replaced by page number being printed -PrintingDialog.contentProgress.textAndMnemonic=Utskriven sida {0}... +PrintingDialog.contentProgress.textAndMnemonic=Skriver ut sida {0}... PrintingDialog.contentAborting.textAndMnemonic=Utskriften avbryts... @@ -172,7 +172,7 @@ ProgressMonitor.progress.textAndMnemonic=P\u00E5g\u00E5r... ############ Split Pane Strings ############ -SplitPane.leftButton.textAndMnemonic=v\u00E4nster knapp +SplitPane.leftButton.textAndMnemonic=v\u00E4nsterknapp SplitPane.rightButton.textAndMnemonic=h\u00F6ger knapp # Used for Isindex IsindexView.prompt=Detta \u00E4r ett s\u00F6kbart index. Ange s\u00F6kord: diff -r 37d98293b182 -r 309156990bcf src/macosx/classes/sun/font/CFont.java --- a/src/macosx/classes/sun/font/CFont.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/macosx/classes/sun/font/CFont.java Wed Jun 17 21:55:37 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; } diff -r 37d98293b182 -r 309156990bcf src/macosx/classes/sun/font/CFontManager.java --- a/src/macosx/classes/sun/font/CFontManager.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/macosx/classes/sun/font/CFontManager.java Wed Jun 17 21:55:37 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() { public Object run() { - loadNativeFonts(); + if (!loadedAllFonts) { + loadNativeFonts(); + registerItalicDerived(); + loadedAllFonts = true; + } return null; } } diff -r 37d98293b182 -r 309156990bcf src/macosx/classes/sun/lwawt/LWTextAreaPeer.java --- a/src/macosx/classes/sun/lwawt/LWTextAreaPeer.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/macosx/classes/sun/lwawt/LWTextAreaPeer.java Wed Jun 17 21:55:37 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); diff -r 37d98293b182 -r 309156990bcf src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java --- a/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java Wed Jun 17 21:55:37 2015 -0700 @@ -366,8 +366,7 @@ protected void initializeDesktopProperties() { super.initializeDesktopProperties(); Map 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); diff -r 37d98293b182 -r 309156990bcf src/macosx/native/sun/awt/CFRetainedResource.m --- a/src/macosx/native/sun/awt/CFRetainedResource.m Wed Jun 10 23:15:56 2015 -0700 +++ b/src/macosx/native/sun/awt/CFRetainedResource.m Wed Jun 17 21:55:37 2015 -0700 @@ -23,6 +23,7 @@ * questions. */ +#import #import #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 { diff -r 37d98293b182 -r 309156990bcf src/macosx/native/sun/awt/LWCToolkit.m --- a/src/macosx/native/sun/awt/LWCToolkit.m Wed Jun 10 23:15:56 2015 -0700 +++ b/src/macosx/native/sun/awt/LWCToolkit.m Wed Jun 17 21:55:37 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) { diff -r 37d98293b182 -r 309156990bcf src/macosx/native/sun/font/AWTFont.m --- a/src/macosx/native/sun/font/AWTFont.m Wed Jun 10 23:15:56 2015 -0700 +++ b/src/macosx/native/sun/font/AWTFont.m Wed Jun 17 21:55:37 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 */ diff -r 37d98293b182 -r 309156990bcf src/macosx/native/sun/font/AWTStrike.m --- a/src/macosx/native/sun/font/AWTStrike.m Wed Jun 10 23:15:56 2015 -0700 +++ b/src/macosx/native/sun/font/AWTStrike.m Wed Jun 17 21:55:37 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); diff -r 37d98293b182 -r 309156990bcf src/macosx/native/sun/font/CGGlyphImages.m --- a/src/macosx/native/sun/font/CGGlyphImages.m Wed Jun 10 23:15:56 2015 -0700 +++ b/src/macosx/native/sun/font/CGGlyphImages.m Wed Jun 17 21:55:37 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); } diff -r 37d98293b182 -r 309156990bcf src/macosx/native/sun/osxapp/NSApplicationAWT.h --- a/src/macosx/native/sun/osxapp/NSApplicationAWT.h Wed Jun 10 23:15:56 2015 -0700 +++ b/src/macosx/native/sun/osxapp/NSApplicationAWT.h Wed Jun 17 21:55:37 2015 -0700 @@ -37,6 +37,7 @@ - (void) registerWithProcessManager; - (void) setDockIconWithEnv:(JNIEnv *)env; - (void) postDummyEvent; +- (void) postRunnableEvent:(void (^)())block; - (void) waitForDummyEvent; + (void) runAWTLoopWithApp:(NSApplication*)app; diff -r 37d98293b182 -r 309156990bcf src/macosx/native/sun/osxapp/NSApplicationAWT.m --- a/src/macosx/native/sun/osxapp/NSApplicationAWT.m Wed Jun 10 23:15:56 2015 -0700 +++ b/src/macosx/native/sun/osxapp/NSApplicationAWT.m Wed Jun 17 21:55:37 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; diff -r 37d98293b182 -r 309156990bcf src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties --- a/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties Wed Jun 17 21:55:37 2015 -0700 @@ -88,7 +88,7 @@ modal=modal multiline=flera rader multiselectable=flerval -opaque=t\u00E4ckande +opaque=ogenomskinlig pressed=nedtryckt resizable=storleks\u00E4ndringsbar selectable=valbar diff -r 37d98293b182 -r 309156990bcf src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_sv.properties --- a/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_sv.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_sv.properties Wed Jun 17 21:55:37 2015 -0700 @@ -44,11 +44,11 @@ FileChooser.foldersLabel.textAndMnemonic=Map&par FileChooser.filesLabel.textAndMnemonic=&Filer -FileChooser.cancelButtonToolTip.textAndMnemonic=Avbryt dialogrutan Filv\u00E4ljare. +FileChooser.cancelButtonToolTip.textAndMnemonic=Avbryt dialogrutan f\u00F6r filval. FileChooser.saveButtonToolTip.textAndMnemonic=Spara vald fil. FileChooser.openButtonToolTip.textAndMnemonic=\u00D6ppna vald fil. -FileChooser.renameFileDialog.textAndMnemonic=Namn\u00E4ndra fil "{0}" till +FileChooser.renameFileDialog.textAndMnemonic=\u00C4ndra namn p\u00E5 fil "{0}" till FileChooser.renameFileError.titleAndMnemonic=Fel FileChooser.renameFileError.textAndMnemonic=Fel vid namn\u00E4ndring av fil "{0}" till "{1}" diff -r 37d98293b182 -r 309156990bcf src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties --- a/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties Wed Jun 17 21:55:37 2015 -0700 @@ -33,8 +33,8 @@ FileChooser.enterFileNameLabel.textAndMnemonic=A&nge filnamn: FileChooser.enterFolderNameLabel.textAndMnemonic=Ange ett mappnamn: -FileChooser.cancelButtonToolTip.textAndMnemonic=Avbryt dialogrutan Filv\u00E4ljare. +FileChooser.cancelButtonToolTip.textAndMnemonic=Avbryt dialogrutan f\u00F6r filval. FileChooser.saveButtonToolTip.textAndMnemonic=Spara vald fil. FileChooser.openButtonToolTip.textAndMnemonic=\u00D6ppna vald fil. FileChooser.updateButtonToolTip.textAndMnemonic=Uppdatera kataloglistan. -FileChooser.helpButtonToolTip.textAndMnemonic=Hj\u00E4lp - Filv\u00E4ljare. +FileChooser.helpButtonToolTip.textAndMnemonic=Hj\u00E4lp f\u00F6r val av fil. diff -r 37d98293b182 -r 309156990bcf src/share/classes/com/sun/jndi/ldap/Connection.java --- a/src/share/classes/com/sun/jndi/ldap/Connection.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/com/sun/jndi/ldap/Connection.java Wed Jun 17 21:55:37 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." ); diff -r 37d98293b182 -r 309156990bcf src/share/classes/com/sun/rowset/RowSetResourceBundle_sv.properties --- a/src/share/classes/com/sun/rowset/RowSetResourceBundle_sv.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/com/sun/rowset/RowSetResourceBundle_sv.properties Wed Jun 17 21:55:37 2015 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 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 @@ -77,7 +77,7 @@ cachedrowsetimpl.fwdonly = ResultSet kan endast g\u00E5 fram\u00E5t cachedrowsetimpl.type = Typ: {0} cachedrowsetimpl.opnotysupp = Det finns \u00E4nnu inget st\u00F6d f\u00F6r denna \u00E5tg\u00E4rd -cachedrowsetimpl.featnotsupp = Det finns inget st\u00F6d f\u00F6r denna funktion +cachedrowsetimpl.featnotsupp = Funktionen st\u00F6ds inte # WebRowSetImpl exceptions webrowsetimpl.nullhash = Kan inte instansiera WebRowSetImpl. Null-hashtabell skickades till konstruktor. @@ -100,7 +100,7 @@ joinrowsetimpl.emptyrowset = Tomma radupps\u00E4ttningar kan inte l\u00E4ggas till i denna JoinRowSet #JdbcRowSetImpl exceptions -jdbcrowsetimpl.invalstate = Ogiltig status +jdbcrowsetimpl.invalstate = Ogiltigt tillst\u00E5nd jdbcrowsetimpl.connect = JdbcRowSet (anslut) JNDI kan inte anslutas jdbcrowsetimpl.paramtype = Kan inte h\u00E4rleda parametertypen jdbcrowsetimpl.matchcols = Matchningskolumnerna \u00E4r inte samma som de som st\u00E4llts in @@ -112,7 +112,7 @@ jdbcrowsetimpl.usecolid = Anv\u00E4nd kolumn-id som argument f\u00F6r unsetMatchColumn jdbcrowsetimpl.resnotupd = ResultSet \u00E4r inte uppdateringsbart jdbcrowsetimpl.opnotysupp = Det finns \u00E4nnu inget st\u00F6d f\u00F6r denna \u00E5tg\u00E4rd -jdbcrowsetimpl.featnotsupp = Det finns inget st\u00F6d f\u00F6r denna funktion +jdbcrowsetimpl.featnotsupp = Funktionen st\u00F6ds inte #CachedRowSetReader exceptions crsreader.connect = (JNDI) kan inte anslutas @@ -149,15 +149,15 @@ wsrxmlwriter.notproper = Ingen riktig typ #XmlReaderContentHandler exceptions -xmlrch.errmap = Fel uppstod vid inst\u00E4llning av mappning: {0} -xmlrch.errmetadata = Fel uppstod vid inst\u00E4llning av metadata: {0} -xmlrch.errinsertval = Fel uppstod vid infogning av v\u00E4rden: {0} -xmlrch.errconstr = Fel uppstod vid konstruktion av rad: {0} -xmlrch.errdel = Fel uppstod vid borttagning av rad: {0} -xmlrch.errinsert = Fel uppstod vid konstruktion av infogad rad: {0} -xmlrch.errinsdel = Fel uppstod vid konstruktion av insdel-rad: {0} -xmlrch.errupdate = Fel uppstod vid konstruktion av uppdateringsrad: {0} -xmlrch.errupdrow = Fel uppstod vid uppdatering av rad: {0} +xmlrch.errmap = Ett fel intr\u00E4ffade vid inst\u00E4llning av mappning: {0} +xmlrch.errmetadata = Ett fel intr\u00E4ffade vid inst\u00E4llning av metadata: {0} +xmlrch.errinsertval = Ett fel intr\u00E4ffade vid infogning av v\u00E4rden: {0} +xmlrch.errconstr = Ett fel intr\u00E4ffade vid konstruktion av rad: {0} +xmlrch.errdel = Ett fel intr\u00E4ffade vid borttagning av rad: {0} +xmlrch.errinsert = Ett fel intr\u00E4ffade vid konstruktion av infogad rad: {0} +xmlrch.errinsdel = Ett fel intr\u00E4ffade vid konstruktion av insdel-rad: {0} +xmlrch.errupdate = Ett fel intr\u00E4ffade vid konstruktion av uppdateringsrad: {0} +xmlrch.errupdrow = Ett fel intr\u00E4ffade vid uppdatering av rad: {0} xmlrch.chars = tecken: xmlrch.badvalue = Felaktigt v\u00E4rde; egenskapen kan inte ha ett tomt v\u00E4rde xmlrch.badvalue1 = Felaktigt v\u00E4rde; metadatan kan inte ha ett tomt v\u00E4rde diff -r 37d98293b182 -r 309156990bcf src/share/classes/java/awt/Component.java --- a/src/share/classes/java/awt/Component.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/java/awt/Component.java Wed Jun 17 21:55:37 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(); } } diff -r 37d98293b182 -r 309156990bcf src/share/classes/java/awt/Container.java --- a/src/share/classes/java/awt/Container.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/java/awt/Container.java Wed Jun 17 21:55:37 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 = new java.util.ArrayList(); + private java.util.List 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); } /** diff -r 37d98293b182 -r 309156990bcf src/share/classes/java/awt/ScrollPane.java --- a/src/share/classes/java/awt/ScrollPane.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/java/awt/ScrollPane.java Wed Jun 17 21:55:37 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); diff -r 37d98293b182 -r 309156990bcf src/share/classes/java/net/AbstractPlainSocketImpl.java --- a/src/share/classes/java/net/AbstractPlainSocketImpl.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/java/net/AbstractPlainSocketImpl.java Wed Jun 17 21:55:37 2015 -0700 @@ -312,11 +312,16 @@ ret = socketGetOption(opt, null); return new Integer(ret); case IP_TOS: - ret = socketGetOption(opt, null); - if (ret == -1) { // ipv6 tos - return new Integer(trafficClass); - } else { - return new Integer(ret); + try { + ret = socketGetOption(opt, null); + if (ret == -1) { // ipv6 tos + return trafficClass; + } else { + return ret; + } + } catch (SocketException se) { + // TODO - should make better effort to read TOS or TCLASS + return trafficClass; // ipv6 tos } case SO_KEEPALIVE: ret = socketGetOption(opt, null); diff -r 37d98293b182 -r 309156990bcf src/share/classes/java/net/DatagramSocket.java --- a/src/share/classes/java/net/DatagramSocket.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/java/net/DatagramSocket.java Wed Jun 17 21:55:37 2015 -0700 @@ -1182,7 +1182,14 @@ if (isClosed()) throw new SocketException("Socket is closed"); - getImpl().setOption(SocketOptions.IP_TOS, new Integer(tc)); + try { + getImpl().setOption(SocketOptions.IP_TOS, tc); + } catch (SocketException se) { + // not supported if socket already connected + // Solaris returns error in such cases + if(!isConnected()) + throw se; + } } /** diff -r 37d98293b182 -r 309156990bcf src/share/classes/java/net/Socket.java --- a/src/share/classes/java/net/Socket.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/java/net/Socket.java Wed Jun 17 21:55:37 2015 -0700 @@ -1378,7 +1378,14 @@ if (isClosed()) throw new SocketException("Socket is closed"); - getImpl().setOption(SocketOptions.IP_TOS, new Integer(tc)); + try { + getImpl().setOption(SocketOptions.IP_TOS, tc); + } catch (SocketException se) { + // not supported if socket already connected + // Solaris returns error in such cases + if(!isConnected()) + throw se; + } } /** diff -r 37d98293b182 -r 309156990bcf src/share/classes/java/security/ProtectionDomain.java --- a/src/share/classes/java/security/ProtectionDomain.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/java/security/ProtectionDomain.java Wed Jun 17 21:55:37 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> - 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 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 map = + Collections.synchronizedMap + (new WeakHashMap()); + 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); + } + }; } }); } diff -r 37d98293b182 -r 309156990bcf src/share/classes/javax/sql/rowset/BaseRowSet.java --- a/src/share/classes/javax/sql/rowset/BaseRowSet.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/javax/sql/rowset/BaseRowSet.java Wed Jun 17 21:55:37 2015 -0700 @@ -461,7 +461,7 @@ * false that it is not. The default is true. * @serial */ - private boolean escapeProcessing; + private boolean escapeProcessing = true; /** * A constant indicating the isolation level of the connection diff -r 37d98293b182 -r 309156990bcf src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java --- a/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java Wed Jun 17 21:55:37 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 RowSetMetaDataImpl method that retrieves information * is defined as having unspecified behavior when it is called * before the RowSet 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 1 and the number of columns, inclusive - * @return true if if a value in the designated column is a signed + * @return true if a value in the designated column is a signed * number; false 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 */ diff -r 37d98293b182 -r 309156990bcf src/share/classes/javax/sql/rowset/RowSetWarning.java --- a/src/share/classes/javax/sql/rowset/RowSetWarning.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/javax/sql/rowset/RowSetWarning.java Wed Jun 17 21:55:37 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 getMessage, getSQLState, * and getErrorCode retrieve information contained in a * RowSetWarning object. + * + * @since 1.5 */ public class RowSetWarning extends SQLException { /** - * RowSetWarning object handle. - */ - private RowSetWarning rwarning; - - /** * Constructs a RowSetWarning object * with the given value for the reason; SQLState defaults to null, * and vendorCode defaults to 0. @@ -109,7 +106,7 @@ * @param reason a String giving a description of the * warning; * @param SQLState an XOPEN code identifying the warning; if a non standard - * XPOEN SQLState is supplied, no exception is thrown. + * XOPEN SQLState 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; diff -r 37d98293b182 -r 309156990bcf src/share/classes/javax/swing/JInternalFrame.java --- a/src/share/classes/javax/swing/JInternalFrame.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/javax/swing/JInternalFrame.java Wed Jun 17 21:55:37 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 @@ *
DO_NOTHING_ON_CLOSE *
Do nothing. * This requires the program to handle the operation - * in the windowClosing method + * in the internalFrameClosing method * of a registered InternalFrameListener object. *
HIDE_ON_CLOSE *
Automatically make the internal frame invisible. diff -r 37d98293b182 -r 309156990bcf src/share/classes/javax/swing/JSpinner.java --- a/src/share/classes/javax/swing/JSpinner.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/javax/swing/JSpinner.java Wed Jun 17 21:55:37 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); diff -r 37d98293b182 -r 309156990bcf src/share/classes/javax/swing/RepaintManager.java --- a/src/share/classes/javax/swing/RepaintManager.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/javax/swing/RepaintManager.java Wed Jun 17 21:55:37 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( diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/applet/resources/MsgAppletViewer_sv.java --- a/src/share/classes/sun/applet/resources/MsgAppletViewer_sv.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/applet/resources/MsgAppletViewer_sv.java Wed Jun 17 21:55:37 2015 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -92,10 +92,10 @@ {"appletviewer.main.debug.cantaccess", "Det finns ingen \u00E5tkomst till fels\u00F6kningsprogrammet!"}, {"appletviewer.main.nosecmgr", "Varning: SecurityManager har inte installerats!"}, {"appletviewer.main.warning", "Varning: Inga appletar har startats. Kontrollera att indata inneh\u00E5ller -tagg."}, - {"appletviewer.main.warn.prop.overwrite", "Varning: Skriver tillf\u00E4lligt \u00F6ver systemegenskap enligt beg\u00E4ran fr\u00E5n anv\u00E4ndare: nyckel: {0} gammalt v\u00E4rde: {1} nytt v\u00E4rde: {2}"}, + {"appletviewer.main.warn.prop.overwrite", "Varning: Skriver tillf\u00E4lligt \u00F6ver systemegenskap enligt beg\u00E4ran fr\u00E5n anv\u00E4ndare: nyckel: {0} tidigare v\u00E4rde: {1} nytt v\u00E4rde: {2}"}, {"appletviewer.main.warn.cantreadprops", "Varning: Kan inte l\u00E4sa egenskapsfil f\u00F6r AppletViewer: {0} Standardv\u00E4rden anv\u00E4nds."}, - {"appletioexception.loadclass.throw.interrupted", "klassinl\u00E4sning avbr\u00F6ts: {0}"}, - {"appletioexception.loadclass.throw.notloaded", "klass inte inl\u00E4st: {0}"}, + {"appletioexception.loadclass.throw.interrupted", "klassladdning avbr\u00F6ts: {0}"}, + {"appletioexception.loadclass.throw.notloaded", "klass inte laddad: {0}"}, {"appletclassloader.loadcode.verbose", "\u00D6ppnar str\u00F6m till: {0} f\u00F6r h\u00E4mtning av {1}"}, {"appletclassloader.filenotfound", "Hittade inte fil vid s\u00F6kning efter: {0}"}, {"appletclassloader.fileformat", "Undantag av filformat vid laddning av: {0}"}, @@ -124,7 +124,7 @@ {"appletpanel.exception2", "undantag: {0}: {1}."}, {"appletpanel.error", "fel: {0}."}, {"appletpanel.error2", "fel {0}: {1}."}, - {"appletpanel.notloaded", "Initiera: applet \u00E4r inte inl\u00E4st."}, + {"appletpanel.notloaded", "Initiera: applet \u00E4r inte laddad."}, {"appletpanel.notinited", "Starta: applet \u00E4r inte initierad."}, {"appletpanel.notstarted", "Stoppa: applet har inte startats."}, {"appletpanel.notstopped", "Radera: applet har inte stoppats."}, diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/awt/datatransfer/DataTransferer.java --- a/src/share/classes/sun/awt/datatransfer/DataTransferer.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/awt/datatransfer/DataTransferer.java Wed Jun 17 21:55:37 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, diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/awt/resources/awt_sv.properties --- a/src/share/classes/sun/awt/resources/awt_sv.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/awt/resources/awt_sv.properties Wed Jun 17 21:55:37 2015 -0700 @@ -20,11 +20,11 @@ AWT.capsLock=Caps Lock AWT.escape=Esc AWT.space=Mellanslag -AWT.pgup=Page Up -AWT.pgdn=Page Down +AWT.pgup=Sida upp +AWT.pgdn=Sida ned AWT.end=End AWT.home=Hem -AWT.left=V\u00E4nsterpil +AWT.left=V\u00E4nster AWT.up=Upp AWT.right=H\u00F6gerpil AWT.down=Nedpil @@ -114,7 +114,7 @@ AWT.minus=Minus AWT.rightParenthesis=H\u00F6gerparentes AWT.underscore=Understreck -AWT.final=Slutgiltig +AWT.final=Slutlig AWT.convert=Konvertera AWT.noconvert=Ingen konvertering AWT.accept=Acceptera diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/font/Font2D.java --- a/src/share/classes/sun/font/Font2D.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/font/Font2D.java Wed Jun 17 21:55:37 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; diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/font/FontFamily.java --- a/src/share/classes/sun/font/FontFamily.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/font/FontFamily.java Wed Jun 17 21:55:37 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 families = familyNameMap.values(); + return families.toArray(new FontFamily[0]); + } + public String toString() { return "Font family: " + familyName + diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/font/StandardTextSource.java --- a/src/share/classes/sun/font/StandardTextSource.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/font/StandardTextSource.java Wed Jun 17 21:55:37 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 { + + 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. - */ - public StandardTextSource(char[] chars, - int start, - int len, - int cstart, - int clen, - int level, - int flags, - Font font, - FontRenderContext frc, - 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() { diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/font/TextLabelFactory.java --- a/src/share/classes/sun/font/TextLabelFactory.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/font/TextLabelFactory.java Wed Jun 17 21:55:37 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; diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/font/TrueTypeFont.java --- a/src/share/classes/sun/font/TrueTypeFont.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/font/TrueTypeFont.java Wed Jun 17 21:55:37 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; } diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/java2d/opengl/OGLBlitLoops.java --- a/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java Wed Jun 17 21:55:37 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 dstTmp; - OGLAnyCompositeBlit() { - super(SurfaceType.Any, CompositeType.Any, OGLSurfaceData.OpenGLSurface); + private WeakReference dstTmp; + private WeakReference srcTmp; + private final Blit convertsrc; + private final Blit convertdst; + private final Blit convertresult; + + 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); } } diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/java2d/opengl/OGLSurfaceData.java --- a/src/share/classes/sun/java2d/opengl/OGLSurfaceData.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/java2d/opengl/OGLSurfaceData.java Wed Jun 17 21:55:37 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) { diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/launcher/resources/launcher_de.properties --- a/src/share/classes/sun/launcher/resources/launcher_de.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/launcher/resources/launcher_de.properties Wed Jun 17 21:55:37 2015 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 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 @@ -34,7 +34,7 @@ java.launcher.ergo.message2 =\ weil die Ausf\u00FChrung auf einem Server-Class-Rechner erfolgt.\n # Translators please note do not translate the options themselves -java.launcher.opt.footer =\ -cp \n -classpath \n Eine durch {0} getrennte Liste mit Verzeichnissen, JAR-Archiven\n und ZIP-Archiven zur Suche nach Klassendateien.\n -D=\n Legt eine Systemeigenschaft fest\n -verbose:[class|gc|jni]\n Aktiviert die Verbose-Ausgabe\n -version Druckt Produktversion und beendet das Programm\n -version:\n Erfordert die angegebene Version zur Ausf\u00FChrung\n -showversion Druckt Produktversion und f\u00E4hrt fort\n -jre-restrict-search | -no-jre-restrict-search\n Bezieht private JREs des Benutzers in Versionssuche ein bzw. schlie\u00DFt sie aus\n -? -help Druckt diese Hilfemeldung\n -X Druckt Hilfe zu Nicht-Standardoptionen\n -ea[:...|:]\n -enableassertions[:...|:]\n Aktiviert Assertions mit angegebener Granularit\u00E4t\n -da[:...|:]\n -disableassertions[:...|:]\n Deaktiviert Assertions mit angegebener Granularit\u00E4t\n -esa | -enablesystemassertions\n Aktiviert Systemassertionen\n -dsa | -disablesystemassertions\n Deaktiviert Systemassertionen\n -agentlib:[=]\n L\u00E4dt native Agent Library , z.B. -agentlib:hprof\n siehe auch -agentlib:jdwp=help und -agentlib:hprof=help\n -agentpath:[=]\n L\u00E4dt native Agent Library nach vollem Pfadnamen\n -javaagent:[=]\n L\u00E4dt Java-Programmiersprachen-Agent, siehe java.lang.instrument\n -splash:\n Zeigt Startbildschirm mit angegebenem Bild\nWeitere Einzelheiten finden Sie unter http://www.oracle.com/technetwork/java/javase/documentation/index.html +java.launcher.opt.footer =\ -cp \n -classpath \n Eine durch {0} getrennte Liste mit Verzeichnissen, JAR-Archiven\n und ZIP-Archiven zur Suche nach Klassendateien.\n -D=\n Legt eine Systemeigenschaft fest\n -verbose:[class|gc|jni]\n Aktiviert die Verbose-Ausgabe\n -version Druckt Produktversion und beendet das Programm\n -version:\n Warnung: Diese Funktion ist veraltet und wird in einer\n neueren Version entfernt.\n Erfordert die angegebene Version zur Ausf\u00FChrung\n -showversion Druckt Produktversion und f\u00E4hrt fort\n -jre-restrict-search | -no-jre-restrict-search\n Warnung: Diese Funktion ist veraltet und wird in einer\n neueren Version entfernt.\n Bezieht private JREs des Benutzers in Versionssuche ein bzw. schlie\u00DFt sie aus\n -? -help Druckt diese Hilfemeldung\n -X Druckt Hilfe zu Nicht-Standardoptionen\n -ea[:...|:]\n -enableassertions[:...|:]\n Aktiviert Assertions mit angegebener Granularit\u00E4t\n -da[:...|:]\n -disableassertions[:...|:]\n Deaktiviert Assertions mit angegebener Granularit\u00E4t\n -esa | -enablesystemassertions\n Aktiviert Systemassertionen\n -dsa | -disablesystemassertions\n Deaktiviert Systemassertionen\n -agentlib:[=]\n L\u00E4dt native Agent Library , z.B. -agentlib:hprof\n siehe auch -agentlib:jdwp=help und -agentlib:hprof=help\n -agentpath:[=]\n L\u00E4dt native Agent Library nach vollem Pfadnamen\n -javaagent:[=]\n L\u00E4dt Java-Programmiersprachen-Agent, siehe java.lang.instrument\n -splash:\n Zeigt Startbildschirm mit angegebenem Bild\nWeitere Einzelheiten finden Sie unter http://www.oracle.com/technetwork/java/javase/documentation/index.html # Translators please note do not translate the options themselves java.launcher.X.usage=\ -Xmixed Ausf\u00FChrung im gemischten Modus (Standard)\n -Xint Nur Ausf\u00FChrung im interpretierten Modus\n -Xbootclasspath:\n Legt Suchpfad f\u00FCr Bootstrap-Klassen und Ressourcen fest\n -Xbootclasspath/a:\n H\u00E4ngt an das Ende des Bootstrap Classpath an\n -Xbootclasspath/p:\n Stellt Bootstrap Classpath voran\n -Xdiag Zeigt zus\u00E4tzliche Diagnosemeldungen an\n -Xnoclassgc Deaktiviert Klassen-Garbage Collection\n -Xincgc Aktiviert inkrementelle Garbage Collection\n -Xloggc: Loggt GC-Status in einer Datei mit Zeitstempeln\n -Xbatch Deaktiviert Hintergrundkompilierung\n -Xms Legt anf\u00E4ngliche Java Heap-Gr\u00F6\u00DFe fest\n -Xmx Legt maximale Java Heap-Gr\u00F6\u00DFe fest\n -Xss Legt Java-Threadstackgr\u00F6\u00DFe fest\n -Xprof Gibt CPU-Profiling-Daten aus\n -Xfuture Aktiviert strengste Pr\u00FCfungen, antizipiert zuk\u00FCnftigen Standardwert\n -Xrs Reduziert Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n -Xcheck:jni F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen durch\n -Xshare:off Kein Versuch, gemeinsame Klassendaten zu verwenden\n -Xshare:auto Verwendet gemeinsame Klassendaten, wenn m\u00F6glich (Standard)\n -Xshare:on Erfordert die Verwendung gemeinsamer Klassendaten, sonst verl\u00E4uft der Vorgang nicht erfolgreich.\n -XshowSettings Zeigt alle Einstellungen und f\u00E4hrt fort\n -XshowSettings:all\n Zeigt alle Einstellungen und f\u00E4hrt fort\n -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen und f\u00E4hrt fort\n -XshowSettings:properties\n Zeigt alle Eigenschaftseinstellungen und f\u00E4hrt fort\n -XshowSettings:locale\n Zeigt alle gebietsschemabezogenen Einstellungen und f\u00E4hrt fort\n\nDie -X-Optionen sind keine Standardoptionen und k\u00F6nnen ohne Vorank\u00FCndigung ge\u00E4ndert werden.\n diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/launcher/resources/launcher_es.properties --- a/src/share/classes/sun/launcher/resources/launcher_es.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/launcher/resources/launcher_es.properties Wed Jun 17 21:55:37 2015 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 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 @@ -34,7 +34,7 @@ java.launcher.ergo.message2 =\ porque la ejecuci\u00F3n se est\u00E1 llevando a cabo en una m\u00E1quina de clase de servidor.\n # Translators please note do not translate the options themselves -java.launcher.opt.footer =\ -cp \n -classpath \n Lista separada por {0} de directorios, archivos JAR\n y archivos ZIP para buscar archivos de clase.\n -D=\n definir una propiedad del sistema\n -verbose:[class|gc|jni]\n activar la salida verbose\n -version imprimir la versi\u00F3n del producto y salir\n -version:\n es necesario que se ejecute la versi\u00F3n especificada\n -showversion imprimir la versi\u00F3n del producto y continuar\n -jre-restrict-search | -no-jre-restrict-search\n incluir/excluir JRE privados de usuario en la b\u00FAsqueda de versi\u00F3n\n -? -help imprimir este mensaje de ayuda\n -X imprimir la ayuda sobre las opciones que no sean est\u00E1ndar\n -ea[:...|:]\n -enableassertions[:...|:]\n activar afirmaciones con la granularidad especificada\n -da[:...|:]\n -disableassertions[:...|:]\n desactivar afirmaciones con la granularidad especificada\n -esa | -enablesystemassertions\n activar afirmaciones del sistema\n -dsa | -disablesystemassertions\n desactivar afirmaciones del sistema\n -agentlib:[=]\n cargar la biblioteca de agente nativa , como -agentlib:hprof\n v\u00E9ase tambi\u00E9n -agentlib:jdwp=help y -agentlib:hprof=help\n -agentpath:[=]\n cargar biblioteca de agente nativa con el nombre de la ruta de acceso completa\n -javaagent:[=]\n cargar agente de lenguaje de programaci\u00F3n Java, v\u00E9ase java.lang.instrument\n -splash:\n mostrar una pantalla de presentaci\u00F3n con la imagen especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obtener m\u00E1s informaci\u00F3n. +java.launcher.opt.footer =\ -cp \n -classpath \n Lista separada por {0} de directorios, archivos JAR\n y archivos ZIP para buscar archivos de clase.\n -D=\n definir una propiedad del sistema\n -verbose:[class|gc|jni]\n activar la salida verbose\n -version imprimir la versi\u00F3n del producto y salir\n -version:\n Advertencia: Esta funci\u00F3n est\u00E1 anticuada y se eliminar\u00E1\n en una versi\u00F3n futura.\n es necesario que se ejecute la versi\u00F3n especificada\n -showversion imprimir la versi\u00F3n del producto y continuar\n -jre-restrict-search | -no-jre-restrict-search\n Advertencia: Esta funci\u00F3n est\u00E1 anticuada y se eliminar\u00E1\n en una versi\u00F3n futura.\n incluir/excluir JRE privados de usuario en la b\u00FAsqueda de versi\u00F3n\n -? -help imprimir este mensaje de ayuda\n -X imprimir la ayuda sobre las opciones que no sean est\u00E1ndar\n -ea[:...|:]\n -enableassertions[:...|:]\n activar afirmaciones con la granularidad especificada\n -da[:...|:]\n -disableassertions[:...|:]\n desactivar afirmaciones con la granularidad especificada\n -esa | -enablesystemassertions\n activar afirmaciones del sistema\n -dsa | -disablesystemassertions\n desactivar afirmaciones del sistema\n -agentlib:[=]\n cargar la biblioteca de agente nativa , como -agentlib:hprof\n v\u00E9ase tambi\u00E9n -agentlib:jdwp=help y -agentlib:hprof=help\n -agentpath:[=]\n cargar biblioteca de agente nativa con el nombre de la ruta de acceso completa\n -javaagent:[=]\n cargar agente de lenguaje de programaci\u00F3n Java, v\u00E9ase java.lang.instrument\n -splash:\n mostrar una pantalla de presentaci\u00F3n con la imagen especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obtener m\u00E1s informaci\u00F3n. # Translators please note do not translate the options themselves java.launcher.X.usage=\ -Xmixed ejecuci\u00F3n de modo mixto (por defecto)\n -Xint s\u00F3lo ejecuci\u00F3n de modo interpretado\n -Xbootclasspath:\n definir la ruta de acceso de b\u00FAsqueda para los recursos y clases de inicializaci\u00F3n de datos\n -Xbootclasspath/a:\n agregar al final de la ruta de acceso de la clase de inicializaci\u00F3n de datos\n -Xbootclasspath/p:\n anteponer a la ruta de acceso de la clase de inicializaci\u00F3n de datos\n -Xdiag mostrar mensajes de diagn\u00F3stico adicionales\n -Xnoclassgc desactivar la recolecci\u00F3n de basura de clases\n -Xincgc activar la recolecci\u00F3n de basura de clases\n -Xloggc: registrar el estado de GC en un archivo con registros de hora\n -Xbatch desactivar compilaci\u00F3n en segundo plano\n -Xms definir tama\u00F1o de pila Java inicial\n -Xmx definir tama\u00F1o de pila Java m\u00E1ximo\n -Xss definir tama\u00F1o de la pila del thread de Java\n -Xprof datos de salida de creaci\u00F3n de perfil de CPU\n -Xfuture activar las comprobaciones m\u00E1s estrictas, anticip\u00E1ndose al futuro valor por defecto\n -Xrs reducir el uso de se\u00F1ales de sistema operativo por parte de Java/VM (consulte la documentaci\u00F3n)\n -Xcheck:jni realizar comprobaciones adicionales para las funciones de JNI\n -Xshare:off no intentar usar datos de clase compartidos\n -Xshare:auto usar datos de clase compartidos si es posible (valor por defecto)\n -Xshare:on es obligatorio el uso de datos de clase compartidos, de lo contrario se emitir\u00E1 un fallo.\n -XshowSettings mostrar todos los valores y continuar\n -XshowSettings:all\n mostrar todos los valores y continuar\n -XshowSettings:vm mostrar todos los valores de la VM y continuar\n -XshowSettings:properties\n mostrar todos los valores de las propiedades y continuar\n -XshowSettings:locale\n mostrar todos los valores relacionados con la configuraci\u00F3n regional y continuar\n\nLas opciones -X no son est\u00E1ndar, por lo que podr\u00EDan cambiarse sin previo aviso.\n diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/launcher/resources/launcher_fr.properties --- a/src/share/classes/sun/launcher/resources/launcher_fr.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/launcher/resources/launcher_fr.properties Wed Jun 17 21:55:37 2015 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 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 @@ -34,7 +34,7 @@ java.launcher.ergo.message2 =\ car vous ex\u00E9cutez une machine de classe de serveur.\n # Translators please note do not translate the options themselves -java.launcher.opt.footer =\ -cp \n -classpath \n Liste de r\u00E9pertoires, d''archives JAR et\n d''archives ZIP s\u00E9par\u00E9s par des {0}, dans laquelle rechercher les fichiers de classe.\n -D=\n d\u00E9finition d''une propri\u00E9t\u00E9 syst\u00E8me\n -verbose:[class|gc|jni]\n activation de la sortie en mode verbose\n -version impression de la version du produit et fin de l''op\u00E9ration\n -version:\n ex\u00E9cution de la version sp\u00E9cifi\u00E9e obligatoire\n -showversion impression de la version du produit et poursuite de l''op\u00E9ration\n -jre-restrict-search | -no-jre-restrict-search\n inclusion/exclusion des environnements JRE priv\u00E9s de l''utilisateur dans la recherche de version\n -? -help impression du message d''aide\n -X impression de l''aide sur les options non standard\n -ea[:...|:]\n -enableassertions[:...|:]\n activation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -da[:...|:]\n -disableassertions[:...|:]\n d\u00E9sactivation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -esa | -enablesystemassertions\n activation des assertions syst\u00E8me\n -dsa | -disablesystemassertions\n d\u00E9sactivation des assertions syst\u00E8me\n -agentlib:[=]\n chargement de la biblioth\u00E8que d''agent natif , par exemple -agentlib:hprof\n voir \u00E9galement, -agentlib:jdwp=help et -agentlib:hprof=help\n -agentpath:[=]\n chargement de la biblioth\u00E8que d''agent natif via le chemin d''acc\u00E8s complet\n -javaagent:[=]\n chargement de l''agent du langage de programmation Java, voir java.lang.instrument\n -splash:\n affichage de l''\u00E9cran d''accueil avec l''image sp\u00E9cifi\u00E9e\nVoir http://www.oracle.com/technetwork/java/javase/documentation/index.html pour plus de d\u00E9tails. +java.launcher.opt.footer =\ -cp \n -classpath \n Liste de r\u00E9pertoires, d''archives JAR et\n d''archives ZIP s\u00E9par\u00E9s par des {0}, dans laquelle rechercher les fichiers de classe.\n -D=\n d\u00E9finition d''une propri\u00E9t\u00E9 syst\u00E8me\n -verbose:[class|gc|jni]\n activation de la sortie en mode verbose\n -version impression de la version du produit et fin de l''op\u00E9ration\n -version:\n Avertissement : cette fonctionnalit\u00E9 est en phase d''abandon et sera enlev\u00E9e\n dans une version future.\n ex\u00E9cution de la version sp\u00E9cifi\u00E9e obligatoire\n -showversion impression de la version du produit et poursuite de l''op\u00E9ration\n -jre-restrict-search | -no-jre-restrict-search\n Avertissement : cette fonctionnalit\u00E9 est en phase d''abandon et sera enlev\u00E9e\n dans une version future.\n inclusion/exclusion des environnements JRE priv\u00E9s de l''utilisateur dans la recherche de version\n -? -help impression du message d''aide\n -X impression de l''aide sur les options non standard\n -ea[:...|:]\n -enableassertions[:...|:]\n activation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -da[:...|:]\n -disableassertions[:...|:]\n d\u00E9sactivation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -esa | -enablesystemassertions\n activation des assertions syst\u00E8me\n -dsa | -disablesystemassertions\n d\u00E9sactivation des assertions syst\u00E8me\n -agentlib:[=]\n chargement de la biblioth\u00E8que d''agent natif , par exemple -agentlib:hprof\n voir \u00E9galement, -agentlib:jdwp=help et -agentlib:hprof=help\n -agentpath:[=]\n chargement de la biblioth\u00E8que d''agent natif via le chemin d''acc\u00E8s complet\n -javaagent:[=]\n chargement de l''agent du langage de programmation Java, voir java.lang.instrument\n -splash:\n affichage de l''\u00E9cran d''accueil avec l''image sp\u00E9cifi\u00E9e\nVoir http://www.oracle.com/technetwork/java/javase/documentation/index.html pour plus de d\u00E9tails. # Translators please note do not translate the options themselves java.launcher.X.usage=\ -Xmixed ex\u00E9cution en mode mixte (valeur par d\u00E9faut)\n -Xint ex\u00E9cution en mode interpr\u00E9t\u00E9 uniquement\n -Xbootclasspath:\n d\u00E9finition du chemin de recherche pour les ressources et classes bootstrap\n -Xbootclasspath/a:\n ajout \u00E0 la fin du chemin de classe bootstrap\n -Xbootclasspath/p:\n ajout au d\u00E9but du chemin de classe bootstrap\n -Xdiag affichage de messages de diagnostic suppl\u00E9mentaires\n -Xnoclassgc d\u00E9sactivation de l''op\u00E9ration de ramasse-miette (garbage collection) de la classe\n -Xincgc activation de l''op\u00E9ration de ramasse-miette (garbage collection) incr\u00E9mentielle\n -Xloggc: journalisation du statut de l''op\u00E9ration de ramasse-miette (garbage collection) dans un fichier avec horodatages\n -Xbatch d\u00E9sactivation de la compilation en arri\u00E8re-plan\n -Xms d\u00E9finition de la taille initiale des portions de m\u00E9moire Java\n -Xmx d\u00E9finition de la taille maximale des portions de m\u00E9moire Java\n -Xss d\u00E9finition de la taille de pile de thread Java\n -Xprof sortie des donn\u00E9es de profilage de l''unit\u00E9 centrale\n -Xfuture activation des contr\u00F4les les plus stricts en vue d''anticiper la future valeur par d\u00E9faut\n -Xrs r\u00E9duction de l''utilisation des signaux OS par Java/la machine virtuelle (voir documentation)\n -Xcheck:jni ex\u00E9cution de contr\u00F4les suppl\u00E9mentaires pour les fonctions JNI\n -Xshare:off aucune tentative d''utilisation des donn\u00E9es de classe partag\u00E9es\n -Xshare:auto utilisation des donn\u00E9es de classe partag\u00E9es si possible (valeur par d\u00E9faut)\n -Xshare:on utilisation des donn\u00E9es de classe partag\u00E9es obligatoire ou \u00E9chec de l''op\u00E9ration\n -XshowSettings affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:all\n affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:vm affichage de tous les param\u00E8tres de machine virtuelle et poursuite de l''op\u00E9ration\n -XshowSettings:properties\n affichage de tous les param\u00E8tres de propri\u00E9t\u00E9 et poursuite de l''op\u00E9ration\n -XshowSettings:locale\n affichage de tous les param\u00E8tres d''environnement local et poursuite de l''op\u00E9ration\n\nLes options -X ne sont pas des options standard et peuvent faire l''objet de modifications sans pr\u00E9avis.\n diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/launcher/resources/launcher_it.properties --- a/src/share/classes/sun/launcher/resources/launcher_it.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/launcher/resources/launcher_it.properties Wed Jun 17 21:55:37 2015 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 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 @@ -34,7 +34,7 @@ java.launcher.ergo.message2 =\ perch\u00E9 si utilizza un computer di classe server.\n # Translators please note do not translate the options themselves -java.launcher.opt.footer =\ -cp \n -classpath \n Una lista separata da {0} di directory, archivi JAR,\n e archivi ZIP utilizzata per la ricerca di file di classe.\n -D=\n imposta una propriet\u00E0 di sistema\n -verbose:[class|gc|jni]\n abilita l''output descrittivo\n -version stampa la versione del prodotto ed esce\n -version:\n richiede l''esecuzione della versione specificata\n -showversion stampa la versione del prodotto e continua\n -jre-restrict-search | -no-jre-restrict-search\n include/esclude gli ambienti JRE privati dell''utente nella ricerca della versione\n -? -help stampa questo messaggio della Guida\n -X stampa la Guida sulle opzioni non standard\n -ea[:...|:]\n -enableassertions[:...|:]\n abilita le asserzioni con la granularit\u00E0 specificata\n -da[:...|:]\n -disableassertions[:...|:]\n disabilita le asserzioni con la granularit\u00E0 specificata\n -esa | -enablesystemassertions\n abilita le asserzioni di sistema\n -dsa | -disablesystemassertions\n disabilita le asserzioni di sistema\n -agentlib:[=]\n carica la libreria agenti nativa , ad esempio -agentlib:hprof\n vedere anche, -agentlib:jdwp=help and -agentlib:hprof=help\n -agentpath:[=]\n carica la libreria agenti nativa con il percorso completo\n -javaagent:[=]\n carica l''agente del linguaggio di programmazione Java. Vedere java.lang.instrument\n -splash:\n mostra la schermata iniziale con l''immagine specificata\nPer ulteriori dettagli, vedere http://www.oracle.com/technetwork/java/javase/documentation/index.html. +java.launcher.opt.footer =\ -cp \n -classpath \n Una lista separata da {0} di directory, archivi JAR,\n e archivi ZIP utilizzata per la ricerca di file di classe.\n -D=\n imposta una propriet\u00E0 di sistema\n -verbose:[class|gc|jni]\n abilita l''output descrittivo\n -version stampa la versione del prodotto ed esce\n -version:\n Attenzione: questa funzione \u00E8 obsoleta e sar\u00E0 rimossa\n in una release futura.\n -showversion stampa la versione del prodotto e continua\n -jre-restrict-search | -no-jre-restrict-search\n Attenzione: questa funzione \u00E8 obsoleta e sar\u00E0 rimossa\n in una release futura.\n -? -help stampa questo messaggio della Guida\n -X stampa la Guida sulle opzioni non standard\n -ea[:...|:]\n -enableassertions[:...|:]\n abilita le asserzioni con la granularit\u00E0 specificata\n -da[:...|:]\n -disableassertions[:...|:]\n disabilita le asserzioni con la granularit\u00E0 specificata\n -esa | -enablesystemassertions\n abilita le asserzioni di sistema\n -dsa | -disablesystemassertions\n disabilita le asserzioni di sistema\n -agentlib:[=]\n carica la libreria agenti nativa , ad esempio -agentlib:hprof\n vedere anche, -agentlib:jdwp=help e -agentlib:hprof=help\n -agentpath:[=]\n carica la libreria agenti nativa con il percorso completo\n -javaagent:[=]\n carica l''agente del linguaggio di programmazione Java. Vedere java.lang.instrument\n -splash:\n mostra la schermata iniziale con l''immagine specificata\nPer ulteriori dettagli, vedere http://www.oracle.com/technetwork/java/javase/documentation/index.html. # Translators please note do not translate the options themselves java.launcher.X.usage=\ -Xmixed esecuzione in modalit\u00E0 mista (impostazione predefinita)\n -Xint esecuzione solo in modalit\u00E0 convertita\n -Xbootclasspath:\n imposta il percorso di ricerca per le classi e le risorse di bootstrap\n -Xbootclasspath/a:\n aggiunge alla fine del classpath di bootstrap\n -Xbootclasspath/p:\n antepone al classpath di bootstrap\n -Xdiag mostra messaggi di diagnostica aggiuntivi\n -Xnoclassgc disabilita la garbage collection della classe\n -Xincgc abilita la garbage collection incrementale\n -Xloggc: registra lo stato GC in un file di log con indicatori orari\n -Xbatch disabilita la compilazione in background\n -Xms imposta la dimensione heap Java iniziale\n -Xmx imposta la dimensione heap Java massima\n -Xss imposta la dimensione dello stack di thread Java\n -Xprof visualizza i dati di profilo della CPU\n -Xfuture abilita i controlli pi\u00F9 limitativi anticipando le impostazioni predefinite future\n -Xrs riduce l''uso di segnali del sistema operativo da Java/VM (vedere la documentazione)\n -Xcheck:jni esegue controlli aggiuntivi per le funzioni JNI\n -Xshare:off non tenta di utilizzare i dati della classe condivisi\n -Xshare:auto utilizza i dati di classe condivisi se possibile (impostazione predefinita)\n -Xshare:on richiede l''uso dei dati di classe condivisi, altrimenti l''esecuzione non riesce.\n -XshowSettings mostra tutte le impostazioni e continua\n -XshowSettings:all\n mostra tutte le impostazioni e continua\n -XshowSettings:vm mostra tutte le impostazioni correlate alla VM e continua\n -XshowSettings:properties\n mostra tutte le impostazioni delle propriet\u00E0 e continua\n -XshowSettings:locale\n mostra tutte le impostazioni correlate alle impostazioni nazionali e continua\n\nLe opzioni -X non sono opzioni standard e sono soggette a modifiche senza preavviso.\n diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/launcher/resources/launcher_ja.properties --- a/src/share/classes/sun/launcher/resources/launcher_ja.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/launcher/resources/launcher_ja.properties Wed Jun 17 21:55:37 2015 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 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 @@ -34,7 +34,8 @@ java.launcher.ergo.message2 =\ \u3053\u308C\u306F\u30B5\u30FC\u30D0\u30FC\u30AF\u30E9\u30B9\u306E\u30DE\u30B7\u30F3\u3067\u5B9F\u884C\u3057\u3066\u3044\u308B\u305F\u3081\u3067\u3059\u3002\n # Translators please note do not translate the options themselves -java.launcher.opt.footer =\ -cp <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n -classpath <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001\n JAR\u30A2\u30FC\u30AB\u30A4\u30D6\u304A\u3088\u3073ZIP\u30A2\u30FC\u30AB\u30A4\u30D6\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3067\u3059\u3002\n -D=\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u8A2D\u5B9A\u3059\u308B\n -verbose:[class|gc|jni]\n \u8A73\u7D30\u306A\u51FA\u529B\u3092\u884C\u3046\n -version \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3059\u308B\n -version:\n \u6307\u5B9A\u3057\u305F\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u5B9F\u884C\u306B\u5FC5\u9808\u306B\u3059\u308B\n -showversion \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D9A\u884C\u3059\u308B\n -jre-restrict-search | -no-jre-restrict-search\n \u30E6\u30FC\u30B6\u30FC\u306E\u30D7\u30E9\u30A4\u30D9\u30FC\u30C8JRE\u3092\u30D0\u30FC\u30B8\u30E7\u30F3\u691C\u7D22\u306B\u542B\u3081\u308B/\u9664\u5916\u3059\u308B\n -? -help \u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n -X \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u95A2\u3059\u308B\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u3059\u308B\n -ea[:...|:]\n -enableassertions[:...|:]\n \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -da[:...|:]\n -disableassertions[:...|:]\n \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -esa | -enablesystemassertions\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -dsa | -disablesystemassertions\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -agentlib:[=]\n \u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002\u4F8B: -agentlib:hprof\n -agentlib:jdwp=help\u3068-agentlib:hprof=help\u3082\u53C2\u7167\n -agentpath:[=]\n \u30D5\u30EB\u30D1\u30B9\u540D\u3067\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u30ED\u30FC\u30C9\u3059\u308B\n -javaagent:[=]\n Java\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002java.lang.instrument\u3092\u53C2\u7167\n -splash:\n \u6307\u5B9A\u3057\u305F\u30A4\u30E1\u30FC\u30B8\u3067\u30B9\u30D7\u30E9\u30C3\u30B7\u30E5\u753B\u9762\u3092\u8868\u793A\u3059\u308B\n\u8A73\u7D30\u306Fhttp://www.oracle.com/technetwork/java/javase/documentation/index.html\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +java.launcher.opt.footer =\ -cp <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n -classpath <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001\n JAR\u30A2\u30FC\u30AB\u30A4\u30D6\u304A\u3088\u3073ZIP\u30A2\u30FC\u30AB\u30A4\u30D6\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3067\u3059\u3002\n -D=\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u8A2D\u5B9A\u3059\u308B\n -verbose:[class|gc|jni]\n \u8A73\u7D30\u306A\u51FA\u529B\u3092\u884C\u3046\n -version \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3059\u308B\n -version:\n \u8B66\u544A: \u3053\u306E\u6A5F\u80FD\u306F\u975E\u63A8\u5968\u3067\u3042\u308A\u3001\u8A73\u7D30\u306E\u30EA\u30EA\u30FC\u30B9\u3067\n \u5EC3\u6B62\u3055\u308C\u307E\u3059\u3002\n \u6307\u5B9A\u3057\u305F\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u5B9F\u884C\u306B\u5FC5\u9808\u306B\u3059\u308B\n -showversion \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D9A\u884C\u3059\u308B\n -jre-restrict-search | -no-jre-restrict-search\n \u8B66\u544A: \u3053\u306E\u6A5F\u80FD\u306F\u975E\u63A8\u5968\u3067\u3042\u308A\u3001\u8A73\u7D30\u306E\u30EA\u30EA\u30FC\u30B9\u3067\n \u5EC3\u6B62\u3055\u308C\u307E\u3059\u3002\n \u30E6\u30FC\u30B6\u30FC\u306E\u30D7\u30E9\u30A4\u30D9\u30FC\u30C8JRE\u3092\u30D0\u30FC\u30B8\u30E7\u30F3\u691C\u7D22\u306B\u542B\u3081\u308B/\u9664\u5916\u3059\u308B\n -? -help \u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n -X \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u95A2\u3059\u308B\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u3059\u308B\n -ea[:...|:]\n -enableassertions[:...|:]\n \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -da[:...|:]\n -disableassertions[:...|:]\n \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -esa | -enablesystemassertions\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -dsa | -disablesystemassertions\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -agentlib:[=]\n \u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002\u4F8B: -agentlib:hprof\n -agentlib:jdwp=help\u3068-agentlib:hprof=help\u3082\u53C2\u7167\n -agentpath:[=]\n \u30D5\u30EB\u30D1\u30B9\u540D\u3067\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u30ED\u30FC\u30C9\u3059\u308B\n -javaagent:[=]\n Java\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002java.lang.instrument\u3092\u53C2\u7167\n -splash:\n \ +\u6307\u5B9A\u3057\u305F\u30A4\u30E1\u30FC\u30B8\u3067\u30B9\u30D7\u30E9\u30C3\u30B7\u30E5\u753B\u9762\u3092\u8868\u793A\u3059\u308B\n\u8A73\u7D30\u306Fhttp://www.oracle.com/technetwork/java/javase/documentation/index.html\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002 # Translators please note do not translate the options themselves java.launcher.X.usage=\ -Xmixed \u6DF7\u5408\u30E2\u30FC\u30C9\u306E\u5B9F\u884C(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xint \u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u30FB\u30E2\u30FC\u30C9\u306E\u5B9F\u884C\u306E\u307F\n -Xbootclasspath:<{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB>\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u306E\u30AF\u30E9\u30B9\u3068\u30EA\u30BD\u30FC\u30B9\u306E\u691C\u7D22\u30D1\u30B9\u3092\u8A2D\u5B9A\u3059\u308B\n -Xbootclasspath/a:<{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB>\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u6700\u5F8C\u306B\u8FFD\u52A0\u3059\u308B\n -Xbootclasspath/p:<{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB>\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u524D\u306B\u4ED8\u52A0\u3059\u308B\n -Xdiag \u8FFD\u52A0\u306E\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n -Xnoclassgc \u30AF\u30E9\u30B9\u306E\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xincgc \u5897\u5206\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -Xloggc: \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u4ED8\u3044\u305F\u30D5\u30A1\u30A4\u30EB\u306BGC\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u30ED\u30B0\u3092\u8A18\u9332\u3059\u308B\n -Xbatch \u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xms Java\u306E\u521D\u671F\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xmx Java\u306E\u6700\u5927\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xss Java\u306E\u30B9\u30EC\u30C3\u30C9\u30FB\u30B9\u30BF\u30C3\u30AF\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xprof CPU\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u30FB\u30C7\u30FC\u30BF\u3092\u51FA\u529B\u3059\u308B\n -Xfuture \u5C06\u6765\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u898B\u8D8A\u3057\u3066\u3001\u6700\u3082\u53B3\u5BC6\u306A\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3059\u308B\n -Xrs Java/VM\u306B\u3088\u308BOS\u30B7\u30B0\u30CA\u30EB\u306E\u4F7F\u7528\u3092\u524A\u6E1B\u3059\u308B(\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167)\n -Xcheck:jni JNI\u95A2\u6570\u306B\u5BFE\u3059\u308B\u8FFD\u52A0\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5B9F\u884C\u3059\u308B\n -Xshare:off \u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u306A\u3044\n -Xshare:auto \u53EF\u80FD\u3067\u3042\u308C\u3070\u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xshare:on \u5171\u6709\u30AF\u30E9\u30B9\u30FB\u30C7\u30FC\u30BF\u306E\u4F7F\u7528\u3092\u5FC5\u9808\u306B\u3057\u3001\u3067\u304D\u306A\u3051\u308C\u3070\u5931\u6557\u3059\u308B\u3002\n -XshowSettings \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:all\n \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:vm \u3059\u3079\u3066\u306EVM\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:properties\n \ diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/launcher/resources/launcher_ko.properties --- a/src/share/classes/sun/launcher/resources/launcher_ko.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/launcher/resources/launcher_ko.properties Wed Jun 17 21:55:37 2015 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 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 @@ -34,7 +34,7 @@ java.launcher.ergo.message2 =\ \uC11C\uBC84\uAE09 \uC2DC\uC2A4\uD15C\uC5D0\uC11C \uC2E4\uD589 \uC911\uC774\uAE30 \uB54C\uBB38\uC785\uB2C8\uB2E4.\n # Translators please note do not translate the options themselves -java.launcher.opt.footer =\ -cp <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n -classpath <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uAC80\uC0C9\uD560 {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC,\n JAR \uC544\uCE74\uC774\uBE0C \uBC0F ZIP \uC544\uCE74\uC774\uBE0C \uBAA9\uB85D\uC785\uB2C8\uB2E4.\n -D=\n \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 \uC124\uC815\uD569\uB2C8\uB2E4.\n -verbose:[class|gc|jni]\n \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -version \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n -version:\n \uC2E4\uD589\uD560 \uBC84\uC804\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4.\n -showversion \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -jre-restrict-search | -no-jre-restrict-search\n \uBC84\uC804 \uAC80\uC0C9\uC5D0\uC11C \uC0AC\uC6A9\uC790 \uC804\uC6A9 JRE\uB97C \uD3EC\uD568/\uC81C\uC678\uD569\uB2C8\uB2E4.\n -? -help \uC774 \uB3C4\uC6C0\uB9D0 \uBA54\uC2DC\uC9C0\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4.\n -X \uBE44\uD45C\uC900 \uC635\uC158\uC5D0 \uB300\uD55C \uB3C4\uC6C0\uB9D0\uC744 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n -ea[:...|:]\n -enableassertions[:...|:]\n \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -da[:...|:]\n -disableassertions[:...|:]\n \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -esa | -enablesystemassertions\n \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -dsa | -disablesystemassertions\n \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -agentlib:[=]\n \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4(\uC608: -agentlib:hprof).\n -agentlib:jdwp=help \uBC0F -agentlib:hprof=help\uB3C4 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n -agentpath:[=]\n \uC804\uCCB4 \uACBD\uB85C\uBA85\uC744 \uC0AC\uC6A9\uD558\uC5EC \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4.\n -javaagent:[=]\n Java \uD504\uB85C\uADF8\uB798\uBC0D \uC5B8\uC5B4 \uC5D0\uC774\uC804\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. java.lang.instrument\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n -splash:\n \uC774\uBBF8\uC9C0\uAC00 \uC9C0\uC815\uB41C \uC2A4\uD50C\uB798\uC2DC \uD654\uBA74\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\uC790\uC138\uD55C \uB0B4\uC6A9\uC740 http://www.oracle.com/technetwork/java/javase/documentation/index.html\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624. +java.launcher.opt.footer =\ -cp <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n -classpath <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uAC80\uC0C9\uD560 {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC,\n JAR \uC544\uCE74\uC774\uBE0C \uBC0F ZIP \uC544\uCE74\uC774\uBE0C \uBAA9\uB85D\uC785\uB2C8\uB2E4.\n -D=\n \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 \uC124\uC815\uD569\uB2C8\uB2E4.\n -verbose:[class|gc|jni]\n \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -version \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n -version:\n \uACBD\uACE0: \uC774 \uAE30\uB2A5\uC740 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uC73C\uBA70\n \uC774\uD6C4 \uB9B4\uB9AC\uC2A4\uC5D0\uC11C \uC81C\uAC70\uB429\uB2C8\uB2E4.\n \uC2E4\uD589\uD560 \uBC84\uC804\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4.\n -showversion \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -jre-restrict-search | -no-jre-restrict-search\n \uACBD\uACE0: \uC774 \uAE30\uB2A5\uC740 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uC73C\uBA70\n \uC774\uD6C4 \uB9B4\uB9AC\uC2A4\uC5D0\uC11C \uC81C\uAC70\uB429\uB2C8\uB2E4.\n \uBC84\uC804 \uAC80\uC0C9\uC5D0\uC11C \uC0AC\uC6A9\uC790 \uC804\uC6A9 JRE\uB97C \uD3EC\uD568/\uC81C\uC678\uD569\uB2C8\uB2E4.\n -? -help \uC774 \uB3C4\uC6C0\uB9D0 \uBA54\uC2DC\uC9C0\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4.\n -X \uBE44\uD45C\uC900 \uC635\uC158\uC5D0 \uB300\uD55C \uB3C4\uC6C0\uB9D0\uC744 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n -ea[:...|:]\n -enableassertions[:...|:]\n \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -da[:...|:]\n -disableassertions[:...|:]\n \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -esa | -enablesystemassertions\n \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -dsa | -disablesystemassertions\n \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -agentlib:[=]\n \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4(\uC608: -agentlib:hprof).\n -agentlib:jdwp=help \uBC0F -agentlib:hprof=help\uB3C4 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n -agentpath:[=]\n \uC804\uCCB4 \uACBD\uB85C\uBA85\uC744 \uC0AC\uC6A9\uD558\uC5EC \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4.\n -javaagent:[=]\n Java \uD504\uB85C\uADF8\uB798\uBC0D \uC5B8\uC5B4 \uC5D0\uC774\uC804\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. java.lang.instrument\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n -splash:\n \uC774\uBBF8\uC9C0\uAC00 \uC9C0\uC815\uB41C \uC2A4\uD50C\uB798\uC2DC \uD654\uBA74\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\uC790\uC138\uD55C \uB0B4\uC6A9\uC740 http://www.oracle.com/technetwork/java/javase/documentation/index.html\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624. # Translators please note do not translate the options themselves java.launcher.X.usage=\ -Xmixed \uD63C\uD569 \uBAA8\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xint \uD574\uC11D\uB41C \uBAA8\uB4DC\uB9CC \uC2E4\uD589\uD569\uB2C8\uB2E4.\n -Xbootclasspath:<{0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C>\n \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uBC0F \uB9AC\uC18C\uC2A4\uC5D0 \uB300\uD55C \uAC80\uC0C9 \uACBD\uB85C\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xbootclasspath/a:<{0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C>\n \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uB05D\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n -Xbootclasspath/p:<{0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C>\n \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uC55E\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n -Xdiag \uCD94\uAC00 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xnoclassgc \uD074\uB798\uC2A4\uC758 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xincgc \uC99D\uBD84\uC801\uC778 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xloggc: \uC2DC\uAC04 \uAE30\uB85D\uACFC \uD568\uAED8 \uD30C\uC77C\uC5D0 GC \uC0C1\uD0DC\uB97C \uAE30\uB85D\uD569\uB2C8\uB2E4.\n -Xbatch \uBC31\uADF8\uB77C\uC6B4\uB4DC \uCEF4\uD30C\uC77C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xms \uCD08\uAE30 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xmx \uCD5C\uB300 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xss Java \uC2A4\uB808\uB4DC \uC2A4\uD0DD \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xprof CPU \uD504\uB85C\uD30C\uC77C \uC791\uC131 \uB370\uC774\uD130\uB97C \uCD9C\uB825\uD569\uB2C8\uB2E4.\n -Xfuture \uBBF8\uB798 \uAE30\uBCF8\uAC12\uC744 \uC608\uCE21\uD558\uC5EC \uAC00\uC7A5 \uC5C4\uACA9\uD55C \uAC80\uC0AC\uB97C \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xrs Java/VM\uC5D0 \uC758\uD55C OS \uC2E0\uD638 \uC0AC\uC6A9\uC744 \uC904\uC785\uB2C8\uB2E4(\uC124\uBA85\uC11C \uCC38\uC870).\n -Xcheck:jni JNI \uD568\uC218\uC5D0 \uB300\uD55C \uCD94\uAC00 \uAC80\uC0AC\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n -Xshare:off \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130 \uC0AC\uC6A9\uC744 \uC2DC\uB3C4\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -Xshare:auto \uAC00\uB2A5\uD55C \uACBD\uC6B0 \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xshare:on \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4. \uADF8\uB807\uC9C0 \uC54A\uC744 \uACBD\uC6B0 \uC2E4\uD328\uD569\uB2C8\uB2E4.\n -XshowSettings \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:all\n \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:vm \uBAA8\uB4E0 VM \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:properties\n \uBAA8\uB4E0 \uC18D\uC131 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:locale\n \uBAA8\uB4E0 \uB85C\uCF00\uC77C \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n\n-X \uC635\uC158\uC740 \uBE44\uD45C\uC900 \uC635\uC158\uC774\uBBC0\uB85C \uD1B5\uC9C0 \uC5C6\uC774 \uBCC0\uACBD\uB420 \uC218 \ diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/launcher/resources/launcher_pt_BR.properties --- a/src/share/classes/sun/launcher/resources/launcher_pt_BR.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/launcher/resources/launcher_pt_BR.properties Wed Jun 17 21:55:37 2015 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 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 @@ -34,7 +34,7 @@ java.launcher.ergo.message2 =\ porque a execu\u00E7\u00E3o est\u00E1 sendo feita em uma m\u00E1quina de classe de servidor.\n # Translators please note do not translate the options themselves -java.launcher.opt.footer =\ -cp \n -classpath \n Uma lista separada por {0} de diret\u00F3rios, archives JAR\n e archives ZIP nos quais ser\u00E3o procurados os arquivos de classe.\n -D=\n define uma propriedade do sistema\n -verbose:[class|gc|jni]\n ativa a sa\u00EDda detalhada\n -version imprime a vers\u00E3o do produto e sai do programa\n -version:\n requer a execu\u00E7\u00E3o da vers\u00E3o especificada\n -showversion imprime a vers\u00E3o do produto e continua\n -jre-restrict-search | -no-jre-restrict-search\n inclui/exclui JREs privados do usu\u00E1rio na pesquisa de vers\u00E3o\n -? -help imprime esta mensagem de ajuda\n -X imprime a ajuda sobre op\u00E7\u00F5es n\u00E3o padronizadas\n -ea[:...|:]\n -enableassertions[:...|:]\n ativa asser\u00E7\u00F5es com granularidade especificada\n -da[:...|:]\n -disableassertions[:...|:]\n desativa asser\u00E7\u00F5es com granularidade especificada\n -esa | -enablesystemassertions\n ativa asser\u00E7\u00F5es do sistema\n -dsa | -disablesystemassertions\n desativa asser\u00E7\u00F5es do sistema\n -agentlib:[=]\n carrega a biblioteca de agentes nativa , por exemplo: -agentlib:hprof\n consulte tamb\u00E9m: -agentlib:jdwp=help e -agentlib:hprof=help\n -agentpath:[=]\n carrega a biblioteca de agentes nativa com base no nome do caminho completo\n -javaagent:[=]\n carrega o agente da linguagem de programa\u00E7\u00E3o Java; consulte java.lang.instrument\n -splash:\n mostra a tela de abertura com a imagem especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obter mais detalhes. +java.launcher.opt.footer =\ -cp \n -classpath \n Uma lista separada por {0} de diret\u00F3rios, arquivos compactados JAR\n e arquivos compactados ZIP nos quais ser\u00E3o procurados os arquivos de classe.\n -D=\n define uma propriedade do sistema\n -verbose:[class|gc|jni]\n ativa a sa\u00EDda detalhada\n -version imprime a vers\u00E3o do produto e sai do programa\n -version:\n Advert\u00EAncia: esta funcionalidade est\u00E1 obsoleta e ser\u00E1 removida\n em uma release futura.\n requer a execu\u00E7\u00E3o da vers\u00E3o especificada\n -showversion imprime a vers\u00E3o do produto e continua\n -jre-restrict-search | -no-jre-restrict-search\n Advert\u00EAncia: esta funcionalidade est\u00E1 obsoleta e ser\u00E1 removida\n em uma release futura.\n inclui/exclui JREs privados do usu\u00E1rio na pesquisa de vers\u00E3o\n -? -help imprime esta mensagem de ajuda\n -X imprime a ajuda sobre op\u00E7\u00F5es n\u00E3o padronizadas\n -ea[:...|:]\n -enableassertions[:...|:]\n ativa asser\u00E7\u00F5es com granularidade especificada\n -da[:...|:]\n -disableassertions[:...|:]\n desativa asser\u00E7\u00F5es com granularidade especificada\n -esa | -enablesystemassertions\n ativa asser\u00E7\u00F5es do sistema\n -dsa | -disablesystemassertions\n desativa asser\u00E7\u00F5es do sistema\n -agentlib:[=]\n carrega a biblioteca de agentes nativa , por exemplo: -agentlib:hprof\n consulte tamb\u00E9m: -agentlib:jdwp=help e -agentlib:hprof=help\n -agentpath:[=]\n carrega a biblioteca de agentes nativa com base no nome do caminho completo\n -javaagent:[=]\n carrega o agente da linguagem de programa\u00E7\u00E3o Java; consulte java.lang.instrument\n -splash:\n mostra a tela de abertura com a imagem especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obter mais detalhes. # Translators please note do not translate the options themselves java.launcher.X.usage=\ -Xmixed execu\u00E7\u00E3o no modo misto (padr\u00E3o)\n -Xint execu\u00E7\u00E3o somente no modo interpretado\n -Xbootclasspath:\n define o caminho de pesquisa para classes e recursos de inicializa\u00E7\u00E3o\n -Xbootclasspath/a:\n anexa no final do caminho da classe de inicializa\u00E7\u00E3o\n -Xbootclasspath/p:\n anexa no in\u00EDcio do caminho da classe de inicializa\u00E7\u00E3o\n -Xdiag mostra mensagens de diagn\u00F3stico adicionais\n -Xnoclassgc desativa a coleta de lixo da classe\n -Xincgc ativa a coleta de lixo incremental\n -Xloggc: registra o status do GC status em um arquivo com marca\u00E7\u00F5es de data e hor\u00E1rio\n -Xbatch desativa a compila\u00E7\u00E3o em segundo plano\n -Xms define o tamanho inicial do heap Java\n -Xmx define o tamanho m\u00E1ximo do heap Java\n -Xss define o tamanho da pilha de threads java\n -Xprof produz dados de perfil da cpu\n -Xfuture ativa verifica\u00E7\u00F5es de n\u00EDvel m\u00E1ximo de exig\u00EAncia, prevendo o valor padr\u00E3o futuro\n -Xrs reduz o uso de sinais do SO pelo(a) Java/VM (consulte a documenta\u00E7\u00E3o)\n -Xcheck:jni executa verifica\u00E7\u00F5es adicionais de fun\u00E7\u00F5es da JNI\n -Xshare:off n\u00E3o tenta usar dados da classe compartilhada\n -Xshare:auto se poss\u00EDvel, usa dados da classe compartilhada (padr\u00E3o)\n -Xshare:on requer o uso de dados da classe compartilhada, caso contr\u00E1rio haver\u00E1 falha.\n -XshowSettings mostra todas as defini\u00E7\u00F5es e continua\n -XshowSettings:all\n mostra todas as defini\u00E7\u00F5es e continua\n -XshowSettings:vm mostra todas as defini\u00E7\u00F5es relacionadas \u00E0 vm e continua\n -XshowSettings:properties\n mostra todas as defini\u00E7\u00F5es da propriedade e continua\n -XshowSettings:locale\n mostra todas as defini\u00E7\u00F5es relativas \u00E0s configura\u00E7\u00F5es regionais e continua\n\nAs -X options n\u00E3o s\u00E3o padronizadas e est\u00E3o sujeitas a altera\u00E7\u00F5es sem aviso.\n diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/launcher/resources/launcher_sv.properties --- a/src/share/classes/sun/launcher/resources/launcher_sv.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/launcher/resources/launcher_sv.properties Wed Jun 17 21:55:37 2015 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 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 @@ -34,7 +34,7 @@ java.launcher.ergo.message2 =\ eftersom du k\u00F6r en serverklassmaskin.\n # Translators please note do not translate the options themselves -java.launcher.opt.footer =\ -cp \n -classpath \n En {0}-separerad lista med kataloger, JAR-arkiv,\n och ZIP-arkiv f\u00F6r s\u00F6kning efter klassfiler.\n -D=\n ange en systemegenskap\n -verbose:[class|gc|jni]\n aktivera utf\u00F6rliga utdata\n -version skriv ut produktversionen och avsluta\n -version:\n beg\u00E4r den specifika versionen som ska k\u00F6ras\n -showversion skriv ut produktversionen och forts\u00E4tt\n -jre-restrict-search | -no-jre-restrict-search\n inkludera/exkludera anv\u00E4ndarprivata JRE:er i versions\u00F6kningen\n -? -help skriv ut det h\u00E4r hj\u00E4lpmeddelandet\n -X skriv ut hj\u00E4lp f\u00F6r icke-standardalternativ\n -ea[:...|:]\n -enableassertions[:...|:]\n aktivera verifiering med angiven detaljgrad\n -da[:...|:]\n -disableassertions[:...|:]\n avaktivera verifiering med angiven detaljgrad\n -esa | -enablesystemassertions\n aktivera systemverifieringar\n -dsa | -disablesystemassertions\n avaktivera systemverifieringar\n -agentlib:[=]\n ladda ursprungligt agentbibliotek , e.g. -agentlib:hprof\n se \u00E4ven -agentlib:jdwp=help och -agentlib:hprof=help\n -agentpath:[=]\n ladda ursprungligt agentbibliotek med helt s\u00F6kv\u00E4gsnamn\n -javaagent:[=]\n ladda Java-programspr\u00E5ksagent, se java.lang.instrument\n -splash:\n visa v\u00E4lkomstsk\u00E4rm med angiven bild\nMer information finns p\u00E5 http://www.oracle.com/technetwork/java/javase/documentation/index.html. +java.launcher.opt.footer =\ -cp \n -classpath \n En lista \u00F6ver kataloger, JAR-arkiv och och ZIP-arkiv\n f\u00F6r s\u00F6kning efter klassfiler avgr\u00E4nsad med {0}.\n -D=\n ange en systemegenskap\n -verbose:[class|gc|jni]\n aktivera utf\u00F6rliga utdata\n -version skriv ut produktversion och avsluta\n -version:\n Varning: den h\u00E4r funktionen \u00E4r inaktuell och kommer\n att tas bort i en framtida utg\u00E5va.\n kr\u00E4v den angivna versionen f\u00F6r att k\u00F6ra\n -showversion skriv ut produktversion och forts\u00E4tt\n -jre-restrict-search | -no-jre-restrict-search\n Varning: den h\u00E4r funktionen \u00E4r inaktuell och kommer\n att tas bort i en framtida utg\u00E5va.\n inkludera/exkludera anv\u00E4ndarprivata JRE:er i versionss\u00F6kningen\n -? -help skriv ut det h\u00E4r hj\u00E4lpmeddelandet\n -X skriv ut hj\u00E4lp f\u00F6r icke-standardalternativ\n -ea[:...|:]\n -enableassertions[:...|:]\n aktivera verifieringar med den angivna detaljgraden\n -da[:...|:]\n -disableassertions[:...|:]\n avaktivera verifieringar med den angivna detaljgraden\n -esa | -enablesystemassertions\n aktivera systemverifieringar\n -dsa | -disablesystemassertions\n avaktivera systemverifieringar\n -agentlib:[=]\n ladda det ursprungliga agentbiblioteket , t.ex. -agentlib:hprof\n se \u00E4ven -agentlib:jdwp=help och -agentlib:hprof=help\n -agentpath:[=]\n ladda det ursprungliga agentbiblioteket med det fullst\u00E4ndiga s\u00F6kv\u00E4gsnamnet\n -javaagent:[=]\n ladda agenten f\u00F6r programmeringsspr\u00E5ket Java, se java.lang.instrument\n -splash:\n visa v\u00E4lkomstsk\u00E4rmen med den angivna bilden\nMer information finns p\u00E5 http://www.oracle.com/technetwork/java/javase/documentation/index.html. # Translators please note do not translate the options themselves java.launcher.X.usage=\ -Xmixed k\u00F6rning i blandat l\u00E4ge (standard)\n -Xint endast k\u00F6rning i tolkat l\u00E4ge\n -Xbootclasspath:\n ange s\u00F6kv\u00E4g f\u00F6r programladdningsklasser och -resurser\n -Xbootclasspath/a:\n l\u00E4gg till i slutet av programladdningsklassens s\u00F6kv\u00E4g\n -Xbootclasspath/p:\n l\u00E4gg till i b\u00F6rjan av programladdningsklassens s\u00F6kv\u00E4g\n -Xdiag visa ytterligare diagnostiska meddelanden\n -Xnoclassgc avaktivera klassens skr\u00E4pinsamling\n -Xincgc aktivera inkrementell skr\u00E4pinsamling\n -Xloggc: logga GC-status till en fil med tidsst\u00E4mplar\n -Xbatch avaktivera bakgrundskompilering\n -Xms ange ursprunglig storlek f\u00F6r Java-heap\n -Xmx ange maximal storlek f\u00F6r Java-heap\n -Xss ange storlek f\u00F6r java-tr\u00E5dsstack\n -Xprof utdata f\u00F6r processorprofilering\n -Xfuture aktivera str\u00E4ngaste kontroller, f\u00F6rv\u00E4ntad framtida standard\n -Xrs minska OS-signalanv\u00E4ndning av Java/VM (se dokumentation)\n -Xcheck:jni utf\u00F6r ytterligare kontroller f\u00F6r JNI-funktioner\n -Xshare:off anv\u00E4nd inte delade klassdata\n -Xshare:auto anv\u00E4nd delade klassdata om det g\u00E5r (standard)\n -Xshare:on kr\u00E4v att delade klassdata anv\u00E4nds, annars slutf\u00F6r inte.\n -XshowSettings visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:all\n visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:vm visa alla vm-relaterade inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:properties\n visa alla egenskapsinst\u00E4llningar och forts\u00E4tt\n -XshowSettings:locale\n visa alla spr\u00E5krelaterade inst\u00E4llningar och forts\u00E4tt\n\n-X-alternativen \u00E4r inte standard och kan \u00E4ndras utan f\u00F6reg\u00E5ende meddelande.\n @@ -42,7 +42,7 @@ # Translators please note do not translate the options themselves java.launcher.X.macosx.usage=\nF\u00F6ljande alternativ \u00E4r specifika f\u00F6r Mac OS X:\n -XstartOnFirstThread\n k\u00F6r huvudmetoden() p\u00E5 den f\u00F6rsta (AppKit) tr\u00E5den\n -Xdock:name="\n \u00E5sidosatt standardapplikationsnamn visas i docka\n -Xdock:icon=\n \u00E5sidosatt standardikon visas i docka\n\n -java.launcher.cls.error1=Fel: Hittar inte eller kan inte ladda huvudklassen {0} +java.launcher.cls.error1=Fel: Kan inte hitta eller kan inte ladda huvudklassen {0} java.launcher.cls.error2=Fel: Huvudmetoden \u00E4r inte {0} i klassen {1}, definiera huvudmetoden som:\n public static void main(String[] args) java.launcher.cls.error3=Fel: Huvudmetoden m\u00E5ste returnera ett v\u00E4rde av typen void i klassen {0}, \ndefiniera huvudmetoden som:\n public static void main(String[] args) java.launcher.cls.error4=Fel: Huvudmetoden finns inte i klassen {0}, definiera huvudmetoden som:\n public static void main(String[] args)\neller s\u00E5 m\u00E5ste en JavaFX-applikationsklass ut\u00F6ka {1} diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/launcher/resources/launcher_zh_CN.properties --- a/src/share/classes/sun/launcher/resources/launcher_zh_CN.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/launcher/resources/launcher_zh_CN.properties Wed Jun 17 21:55:37 2015 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 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 @@ -34,7 +34,7 @@ java.launcher.ergo.message2 =\ \u56E0\u4E3A\u60A8\u662F\u5728\u670D\u52A1\u5668\u7C7B\u8BA1\u7B97\u673A\u4E0A\u8FD0\u884C\u3002\n # Translators please note do not translate the options themselves -java.launcher.opt.footer =\ -cp <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n -classpath <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55, JAR \u6863\u6848\n \u548C ZIP \u6863\u6848\u5217\u8868, \u7528\u4E8E\u641C\u7D22\u7C7B\u6587\u4EF6\u3002\n -D<\u540D\u79F0>=<\u503C>\n \u8BBE\u7F6E\u7CFB\u7EDF\u5C5E\u6027\n -verbose:[class|gc|jni]\n \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA\n -version \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u9000\u51FA\n -version:<\u503C>\n \u9700\u8981\u6307\u5B9A\u7684\u7248\u672C\u624D\u80FD\u8FD0\u884C\n -showversion \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u7EE7\u7EED\n -jre-restrict-search | -no-jre-restrict-search\n \u5728\u7248\u672C\u641C\u7D22\u4E2D\u5305\u62EC/\u6392\u9664\u7528\u6237\u4E13\u7528 JRE\n -? -help \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F\n -X \u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u5E2E\u52A9\n -ea[:...|:]\n -enableassertions[:...|:]\n \u6309\u6307\u5B9A\u7684\u7C92\u5EA6\u542F\u7528\u65AD\u8A00\n -da[:...|:]\n -disableassertions[:...|:]\n \u7981\u7528\u5177\u6709\u6307\u5B9A\u7C92\u5EA6\u7684\u65AD\u8A00\n -esa | -enablesystemassertions\n \u542F\u7528\u7CFB\u7EDF\u65AD\u8A00\n -dsa | -disablesystemassertions\n \u7981\u7528\u7CFB\u7EDF\u65AD\u8A00\n -agentlib:[=<\u9009\u9879>]\n \u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93 , \u4F8B\u5982 -agentlib:hprof\n \u53E6\u8BF7\u53C2\u9605 -agentlib:jdwp=help \u548C -agentlib:hprof=help\n -agentpath:[=<\u9009\u9879>]\n \u6309\u5B8C\u6574\u8DEF\u5F84\u540D\u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93\n -javaagent:[=<\u9009\u9879>]\n \u52A0\u8F7D Java \u7F16\u7A0B\u8BED\u8A00\u4EE3\u7406, \u8BF7\u53C2\u9605 java.lang.instrument\n -splash:\n \u4F7F\u7528\u6307\u5B9A\u7684\u56FE\u50CF\u663E\u793A\u542F\u52A8\u5C4F\u5E55\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605 http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3002 +java.launcher.opt.footer =\ -cp <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n -classpath <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55, JAR \u6863\u6848\n \u548C ZIP \u6863\u6848\u5217\u8868, \u7528\u4E8E\u641C\u7D22\u7C7B\u6587\u4EF6\u3002\n -D<\u540D\u79F0>=<\u503C>\n \u8BBE\u7F6E\u7CFB\u7EDF\u5C5E\u6027\n -verbose:[class|gc|jni]\n \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA\n -version \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u9000\u51FA\n -version:<\u503C>\n \u8B66\u544A: \u6B64\u529F\u80FD\u5DF2\u8FC7\u65F6, \u5C06\u5728\n \u672A\u6765\u53D1\u884C\u7248\u4E2D\u5220\u9664\u3002\n \u9700\u8981\u6307\u5B9A\u7684\u7248\u672C\u624D\u80FD\u8FD0\u884C\n -showversion \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u7EE7\u7EED\n -jre-restrict-search | -no-jre-restrict-search\n \u8B66\u544A: \u6B64\u529F\u80FD\u5DF2\u8FC7\u65F6, \u5C06\u5728\n \u672A\u6765\u53D1\u884C\u7248\u4E2D\u5220\u9664\u3002\n \u5728\u7248\u672C\u641C\u7D22\u4E2D\u5305\u62EC/\u6392\u9664\u7528\u6237\u4E13\u7528 JRE\n -? -help \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F\n -X \u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u5E2E\u52A9\n -ea[:...|:]\n -enableassertions[:...|:]\n \u6309\u6307\u5B9A\u7684\u7C92\u5EA6\u542F\u7528\u65AD\u8A00\n -da[:...|:]\n -disableassertions[:...|:]\n \u7981\u7528\u5177\u6709\u6307\u5B9A\u7C92\u5EA6\u7684\u65AD\u8A00\n -esa | -enablesystemassertions\n \u542F\u7528\u7CFB\u7EDF\u65AD\u8A00\n -dsa | -disablesystemassertions\n \u7981\u7528\u7CFB\u7EDF\u65AD\u8A00\n -agentlib:[=<\u9009\u9879>]\n \u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93 , \u4F8B\u5982 -agentlib:hprof\n \u53E6\u8BF7\u53C2\u9605 -agentlib:jdwp=help \u548C -agentlib:hprof=help\n -agentpath:[=<\u9009\u9879>]\n \u6309\u5B8C\u6574\u8DEF\u5F84\u540D\u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93\n -javaagent:[=<\u9009\u9879>]\n \u52A0\u8F7D Java \u7F16\u7A0B\u8BED\u8A00\u4EE3\u7406, \u8BF7\u53C2\u9605 java.lang.instrument\n -splash:\n \u4F7F\u7528\u6307\u5B9A\u7684\u56FE\u50CF\u663E\u793A\u542F\u52A8\u5C4F\u5E55\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605 http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3002 # Translators please note do not translate the options themselves java.launcher.X.usage=\ -Xmixed \u6DF7\u5408\u6A21\u5F0F\u6267\u884C (\u9ED8\u8BA4)\n -Xint \u4EC5\u89E3\u91CA\u6A21\u5F0F\u6267\u884C\n -Xbootclasspath:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n \u8BBE\u7F6E\u641C\u7D22\u8DEF\u5F84\u4EE5\u5F15\u5BFC\u7C7B\u548C\u8D44\u6E90\n -Xbootclasspath/a:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n \u9644\u52A0\u5728\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u672B\u5C3E\n -Xbootclasspath/p:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n \u7F6E\u4E8E\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u4E4B\u524D\n -Xdiag \u663E\u793A\u9644\u52A0\u8BCA\u65AD\u6D88\u606F\n -Xnoclassgc \u7981\u7528\u7C7B\u5783\u573E\u6536\u96C6\n -Xincgc \u542F\u7528\u589E\u91CF\u5783\u573E\u6536\u96C6\n -Xloggc: \u5C06 GC \u72B6\u6001\u8BB0\u5F55\u5728\u6587\u4EF6\u4E2D (\u5E26\u65F6\u95F4\u6233)\n -Xbatch \u7981\u7528\u540E\u53F0\u7F16\u8BD1\n -Xms \u8BBE\u7F6E\u521D\u59CB Java \u5806\u5927\u5C0F\n -Xmx \u8BBE\u7F6E\u6700\u5927 Java \u5806\u5927\u5C0F\n -Xss \u8BBE\u7F6E Java \u7EBF\u7A0B\u5806\u6808\u5927\u5C0F\n -Xprof \u8F93\u51FA cpu \u914D\u7F6E\u6587\u4EF6\u6570\u636E\n -Xfuture \u542F\u7528\u6700\u4E25\u683C\u7684\u68C0\u67E5, \u9884\u671F\u5C06\u6765\u7684\u9ED8\u8BA4\u503C\n -Xrs \u51CF\u5C11 Java/VM \u5BF9\u64CD\u4F5C\u7CFB\u7EDF\u4FE1\u53F7\u7684\u4F7F\u7528 (\u8BF7\u53C2\u9605\u6587\u6863)\n -Xcheck:jni \u5BF9 JNI \u51FD\u6570\u6267\u884C\u5176\u4ED6\u68C0\u67E5\n -Xshare:off \u4E0D\u5C1D\u8BD5\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E\n -Xshare:auto \u5728\u53EF\u80FD\u7684\u60C5\u51B5\u4E0B\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E (\u9ED8\u8BA4)\n -Xshare:on \u8981\u6C42\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E, \u5426\u5219\u5C06\u5931\u8D25\u3002\n -XshowSettings \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:all\n \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:vm \u663E\u793A\u6240\u6709\u4E0E vm \u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:properties\n \u663E\u793A\u6240\u6709\u5C5E\u6027\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:locale\n \u663E\u793A\u6240\u6709\u4E0E\u533A\u57DF\u8BBE\u7F6E\u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n\n-X \u9009\u9879\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/launcher/resources/launcher_zh_TW.properties --- a/src/share/classes/sun/launcher/resources/launcher_zh_TW.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/launcher/resources/launcher_zh_TW.properties Wed Jun 17 21:55:37 2015 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 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 @@ -34,7 +34,7 @@ java.launcher.ergo.message2 =\ \u56E0\u70BA\u60A8\u6B63\u5728\u4F3A\u670D\u5668\u985E\u5225\u6A5F\u5668\u4E0A\u57F7\u884C\u3002\n # Translators please note do not translate the options themselves -java.launcher.opt.footer =\ -cp \n -classpath \n \u4F7F\u7528 {0} \u5340\u9694\u7684\u76EE\u9304\u3001JAR \u5B58\u6A94\u4EE5\u53CA\n ZIP \u5B58\u6A94\u6E05\u55AE\u4F86\u641C\u5C0B\u985E\u5225\u6A94\u6848\u3002\n -D=\n \u8A2D\u5B9A\u7CFB\u7D71\u5C6C\u6027\n -verbose:[class|gc|jni]\n \u555F\u7528\u8A73\u7D30\u8CC7\u8A0A\u8F38\u51FA\n -version \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7D50\u675F\n -version:\n \u9700\u8981\u6307\u5B9A\u7684\u7248\u672C\u624D\u80FD\u57F7\u884C\n -showversion \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7E7C\u7E8C\n -jre-restrict-search | -no-jre-restrict-search\n \u5728\u7248\u672C\u641C\u5C0B\u4E2D\u5305\u62EC/\u6392\u9664\u4F7F\u7528\u8005\u5C08\u7528 JRE\n -? -help \u5217\u5370\u6B64\u8AAA\u660E\u8A0A\u606F\n -X \u5217\u5370\u975E\u6A19\u6E96\u9078\u9805\u7684\u8AAA\u660E\n -ea[:...|:]\n -enableassertions[:...|:]\n \u555F\u7528\u542B\u6307\u5B9A\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n -da[:...|:]\n -disableassertions[:...|:]\n \u505C\u7528\u542B\u6307\u5B9A\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n -esa | -enablesystemassertions\n \u555F\u7528\u7CFB\u7D71\u5BA3\u544A\n -dsa | -disablesystemassertions\n \u505C\u7528\u7CFB\u7D71\u5BA3\u544A\n -agentlib:[=]\n \u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB \uFF0C\u4F8B\u5982 -agentlib:hprof\n \u53E6\u8ACB\u53C3\u95B1 -agentlib:jdwp=help \u8207 -agentlib:hprof=help\n -agentpath:[=]\n \u4F7F\u7528\u5B8C\u6574\u8DEF\u5F91\u540D\u7A31\u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB\n -javaagent:[=]\n \u8F09\u5165 Java \u7A0B\u5F0F\u8A9E\u8A00\u4EE3\u7406\u7A0B\u5F0F\uFF0C\u8ACB\u53C3\u95B1 java.lang.instrument\n -splash:\n \u986F\u793A\u6307\u5B9A\u5F71\u50CF\u7684\u8EDF\u9AD4\u8CC7\u8A0A\u756B\u9762\n\u8ACB\u53C3\u95B1 http://www.oracle.com/technetwork/java/javase/documentation/index.html \u66B8\u89E3\u8A73\u7D30\u8CC7\u8A0A\u3002 +java.launcher.opt.footer =\ -cp \n -classpath \n \u4F7F\u7528 {0} \u5340\u9694\u7684\u76EE\u9304\u3001JAR \u5B58\u6A94\u4EE5\u53CA\n ZIP \u5B58\u6A94\u6E05\u55AE\u4F86\u641C\u5C0B\u985E\u5225\u6A94\u6848\u3002\n -D=\n \u8A2D\u5B9A\u7CFB\u7D71\u5C6C\u6027\n -verbose:[class|gc|jni]\n \u555F\u7528\u8A73\u7D30\u8CC7\u8A0A\u8F38\u51FA\n -version \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7D50\u675F\n -version:\n \u8B66\u544A: \u6B64\u529F\u80FD\u5DF2\u4E0D\u518D\u4F7F\u7528\uFF0C\u5C07\u6703\u5F9E\n \u672A\u4F86\u7248\u672C\u4E2D\u79FB\u9664\u3002\n \u9700\u8981\u6307\u5B9A\u7684\u7248\u672C\u624D\u80FD\u57F7\u884C\n -showversion \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7E7C\u7E8C\n -jre-restrict-search | -no-jre-restrict-search\n \u8B66\u544A: \u6B64\u529F\u80FD\u5DF2\u4E0D\u518D\u4F7F\u7528\uFF0C\u5C07\u6703\u5F9E\n \u672A\u4F86\u7248\u672C\u4E2D\u79FB\u9664\u3002\n \u5728\u7248\u672C\u641C\u5C0B\u4E2D\u5305\u62EC/\u6392\u9664\u4F7F\u7528\u8005\u5C08\u7528 JRE\n -? -help \u5217\u5370\u6B64\u8AAA\u660E\u8A0A\u606F\n -X \u5217\u5370\u975E\u6A19\u6E96\u9078\u9805\u7684\u8AAA\u660E\n -ea[:...|:]\n -enableassertions[:...|:]\n \u555F\u7528\u542B\u6307\u5B9A\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n -da[:...|:]\n -disableassertions[:...|:]\n \u505C\u7528\u542B\u6307\u5B9A\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n -esa | -enablesystemassertions\n \u555F\u7528\u7CFB\u7D71\u5BA3\u544A\n -dsa | -disablesystemassertions\n \u505C\u7528\u7CFB\u7D71\u5BA3\u544A\n -agentlib:[=]\n \u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB \uFF0C\u4F8B\u5982 -agentlib:hprof\n \u53E6\u8ACB\u53C3\u95B1 -agentlib:jdwp=help \u8207 -agentlib:hprof=help\n -agentpath:[=]\n \u4F7F\u7528\u5B8C\u6574\u8DEF\u5F91\u540D\u7A31\u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB\n -javaagent:[=]\n \u8F09\u5165 Java \u7A0B\u5F0F\u8A9E\u8A00\u4EE3\u7406\u7A0B\u5F0F\uFF0C\u8ACB\u53C3\u95B1 java.lang.instrument\n -splash:\n \u986F\u793A\u6307\u5B9A\u5F71\u50CF\u7684\u8EDF\u9AD4\u8CC7\u8A0A\u756B\u9762\n\u8ACB\u53C3\u95B1 http://www.oracle.com/technetwork/java/javase/documentation/index.html \u66B8\u89E3\u8A73\u7D30\u8CC7\u8A0A\u3002 # Translators please note do not translate the options themselves java.launcher.X.usage=\ -Xmixed \u6DF7\u5408\u6A21\u5F0F\u57F7\u884C (\u9810\u8A2D)\n -Xint \u50C5\u9650\u89E3\u8B6F\u6A21\u5F0F\u57F7\u884C\n -Xbootclasspath:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n \u8A2D\u5B9A\u555F\u52D5\u5B89\u88DD\u985E\u5225\u548C\u8CC7\u6E90\u7684\u641C\u5C0B\u8DEF\u5F91\n -Xbootclasspath/a:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n \u9644\u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u7D50\u5C3E\n -Xbootclasspath/p:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n \u9644\u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u524D\u9762\n -Xdiag \u986F\u793A\u5176\u4ED6\u7684\u8A3A\u65B7\u8A0A\u606F\n -Xnoclassgc \u505C\u7528\u985E\u5225\u8CC7\u6E90\u56DE\u6536\n -Xincgc \u555F\u7528\u6F38\u9032\u8CC7\u6E90\u56DE\u6536\n -Xloggc: \u5229\u7528\u6642\u6233\u5C07 GC \u72C0\u614B\u8A18\u9304\u81F3\u6A94\u6848\u4E2D\n -Xbatch \u505C\u7528\u80CC\u666F\u7DE8\u8B6F\n -Xms \u8A2D\u5B9A\u8D77\u59CB Java \u5806\u96C6\u5927\u5C0F\n -Xmx \u8A2D\u5B9A Java \u5806\u96C6\u5927\u5C0F\u4E0A\u9650\n -Xss \u8A2D\u5B9A Java \u57F7\u884C\u7DD2\u5806\u758A\u5927\u5C0F\n -Xprof \u8F38\u51FA CPU \u5206\u6790\u8CC7\u6599\n -Xfuture \u555F\u7528\u6700\u56B4\u683C\u7684\u6AA2\u67E5\uFF0C\u9810\u5148\u4F5C\u70BA\u5C07\u4F86\u7684\u9810\u8A2D\n -Xrs \u6E1B\u5C11 Java/VM \u4F7F\u7528\u4F5C\u696D\u7CFB\u7D71\u4FE1\u865F (\u8ACB\u53C3\u95B1\u6587\u4EF6)\n -Xcheck:jni \u57F7\u884C\u5176\u4ED6\u7684 JNI \u51FD\u6578\u6AA2\u67E5\n -Xshare:off \u4E0D\u5617\u8A66\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\n -Xshare:auto \u5118\u53EF\u80FD\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599 (\u9810\u8A2D)\n -Xshare:on \u9700\u8981\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\uFF0C\u5426\u5247\u5931\u6557\u3002\n -XshowSettings \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:all\n \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:vm \u986F\u793A\u6240\u6709 VM \u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:properties\n \u986F\u793A\u6240\u6709\u5C6C\u6027\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:locale\n \u986F\u793A\u6240\u6709\u5730\u5340\u8A2D\u5B9A\u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n\n -X \u9078\u9805\u4E0D\u662F\u6A19\u6E96\u9078\u9805\uFF0C\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/management/resources/agent_sv.properties --- a/src/share/classes/sun/management/resources/agent_sv.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/management/resources/agent_sv.properties Wed Jun 17 21:55:37 2015 -0700 @@ -1,6 +1,6 @@ # # -# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 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 @@ -43,7 +43,7 @@ agent.err.premain.notfound = premain(String) finns inte i agentklassen agent.err.agentclass.access.denied = \u00C5tkomst till premain(String) nekad agent.err.invalid.agentclass = Ogiltigt egenskapsv\u00E4rde f\u00F6r com.sun.management.agent.class -agent.err.invalid.state = Ogiltig agentstatus +agent.err.invalid.state = Ogiltigt agenttillst\u00E5nd agent.err.invalid.jmxremote.port = Ogiltigt com.sun.management.jmxremote.port-nummer agent.err.invalid.jmxremote.rmi.port = Ogiltigt com.sun.management.jmxremote.rmi.port-nummer diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/nio/cs/ext/HKSCS.java --- a/src/share/classes/sun/nio/cs/ext/HKSCS.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/nio/cs/ext/HKSCS.java Wed Jun 17 21:55:37 2015 -0700 @@ -377,7 +377,6 @@ dst[dp++] = repl[1]; continue; } - sp++; } if (bb > MAX_SINGLEBYTE) { // DoubleByte dst[dp++] = (byte)(bb >> 8); diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/print/resources/serviceui_sv.properties --- a/src/share/classes/sun/print/resources/serviceui_sv.properties Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/print/resources/serviceui_sv.properties Wed Jun 17 21:55:37 2015 -0700 @@ -28,7 +28,7 @@ dialog.noprintermsg=Hittade ingen utskriftstj\u00E4nst. dialog.writeerror=Kan inte skriva till filen: # -label.info=Information: +label.info=Info: label.jobname=&Utskrift: label.numcopies=Antal e&xemplar: label.priority=P&rioritet: diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/security/tools/policytool/Resources_sv.java --- a/src/share/classes/sun/security/tools/policytool/Resources_sv.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/security/tools/policytool/Resources_sv.java Wed Jun 17 21:55:37 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 @@ -101,7 +101,7 @@ {"Principals", "Identitetshavare"}, {".Edit.Principal.", " Redigera identitetshavare:"}, {".Add.New.Principal.", " L\u00E4gg till ny identitetshavare:"}, - {"Permissions", "Beh\u00F6righet"}, + {"Permissions", "Beh\u00F6righeter"}, {".Edit.Permission.", " Redigera beh\u00F6righet:"}, {".Add.New.Permission.", " L\u00E4gg till ny beh\u00F6righet:"}, {"Signed.By.", "Signerad av:"}, diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/security/util/AuthResources_sv.java --- a/src/share/classes/sun/security/util/AuthResources_sv.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/security/util/AuthResources_sv.java Wed Jun 17 21:55:37 2015 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, 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 @@ -117,7 +117,7 @@ {"only.Principal.based.grant.entries.permitted", "endast identitetshavarbaserade poster till\u00E5ts"}, {"expected.permission.entry", "f\u00F6rv\u00E4ntade beh\u00F6righetspost"}, - {"number.", "antal "}, + {"number.", "nummer"}, {"expected.expect.read.end.of.file.", "f\u00F6rv\u00E4ntade {0}, l\u00E4ste filslut"}, {"expected.read.end.of.file", "f\u00F6rv\u00E4ntade ';', l\u00E4ste filslut"}, diff -r 37d98293b182 -r 309156990bcf src/share/classes/sun/security/util/Resources_sv.java --- a/src/share/classes/sun/security/util/Resources_sv.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/classes/sun/security/util/Resources_sv.java Wed Jun 17 21:55:37 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 @@ -135,7 +135,7 @@ {"expected.codeBase.or.SignedBy.or.Principal", "f\u00F6rv\u00E4ntad codeBase eller SignedBy eller identitetshavare"}, {"expected.permission.entry", "f\u00F6rv\u00E4ntade beh\u00F6righetspost"}, - {"number.", "antal "}, + {"number.", "nummer"}, {"expected.expect.read.end.of.file.", "f\u00F6rv\u00E4ntade [{0}], l\u00E4ste [filslut]"}, {"expected.read.end.of.file.", diff -r 37d98293b182 -r 309156990bcf src/share/demo/jfc/Font2DTest/FontPanel.java --- a/src/share/demo/jfc/Font2DTest/FontPanel.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/demo/jfc/Font2DTest/FontPanel.java Wed Jun 17 21:55:37 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); diff -r 37d98293b182 -r 309156990bcf src/share/native/sun/font/freetypeScaler.c --- a/src/share/native/sun/font/freetypeScaler.c Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/native/sun/font/freetypeScaler.c Wed Jun 17 21:55:37 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; diff -r 37d98293b182 -r 309156990bcf src/share/native/sun/java2d/cmm/lcms/cmsopt.c --- a/src/share/native/sun/java2d/cmm/lcms/cmsopt.c Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/native/sun/java2d/cmm/lcms/cmsopt.c Wed Jun 17 21:55:37 2015 -0700 @@ -260,7 +260,9 @@ cmsStage* Multmat = cmsStageAllocMatrix(Lut->ContextID, 3, 3, (const cmsFloat64Number*) &res, NULL); // Recover the chain + if (Multmat != NULL) { Multmat->Next = chain; + } *pt1 = Multmat; } diff -r 37d98293b182 -r 309156990bcf src/share/native/sun/java2d/opengl/OGLContext.c --- a/src/share/native/sun/java2d/opengl/OGLContext.c Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/native/sun/java2d/opengl/OGLContext.c Wed Jun 17 21:55:37 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); diff -r 37d98293b182 -r 309156990bcf src/share/native/sun/java2d/opengl/OGLTextRenderer.c --- a/src/share/native/sun/java2d/opengl/OGLTextRenderer.c Wed Jun 10 23:15:56 2015 -0700 +++ b/src/share/native/sun/java2d/opengl/OGLTextRenderer.c Wed Jun 17 21:55:37 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); - - 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); + loc = j2d_glGetUniformLocationARB(lcdTextProgram, "gamma"); + j2d_glUniform3fARB(loc, g, g, g); - 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); diff -r 37d98293b182 -r 309156990bcf src/solaris/classes/java/net/PlainDatagramSocketImpl.java --- a/src/solaris/classes/java/net/PlainDatagramSocketImpl.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/solaris/classes/java/net/PlainDatagramSocketImpl.java Wed Jun 17 21:55:37 2015 -0700 @@ -69,6 +69,15 @@ return (T)flow; } + protected void socketSetOption(int opt, Object val) throws SocketException { + try { + socketSetOption0(opt, val); + } catch (SocketException se) { + if (!connected) + throw se; + } + } + protected synchronized native void bind0(int lport, InetAddress laddr) throws SocketException; @@ -101,7 +110,7 @@ protected native void datagramSocketClose(); - protected native void socketSetOption(int opt, Object val) + protected native void socketSetOption0(int opt, Object val) throws SocketException; protected native Object socketGetOption(int opt) throws SocketException; diff -r 37d98293b182 -r 309156990bcf src/solaris/classes/java/net/PlainSocketImpl.java --- a/src/solaris/classes/java/net/PlainSocketImpl.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/solaris/classes/java/net/PlainSocketImpl.java Wed Jun 17 21:55:37 2015 -0700 @@ -83,6 +83,15 @@ return (T)flow; } + protected void socketSetOption(int opt, boolean b, Object val) throws SocketException { + try { + socketSetOption0(opt, b, val); + } catch (SocketException se) { + if (socket == null || !socket.isConnected()) + throw se; + } + } + native void socketCreate(boolean isServer) throws IOException; native void socketConnect(InetAddress address, int port, int timeout) @@ -103,7 +112,7 @@ static native void initProto(); - native void socketSetOption(int cmd, boolean on, Object value) + native void socketSetOption0(int cmd, boolean on, Object value) throws SocketException; native int socketGetOption(int opt, Object iaContainerObj) throws SocketException; diff -r 37d98293b182 -r 309156990bcf src/solaris/classes/sun/awt/X11/XClipboard.java --- a/src/solaris/classes/sun/awt/X11/XClipboard.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/solaris/classes/sun/awt/X11/XClipboard.java Wed Jun 17 21:55:37 2015 -0700 @@ -156,19 +156,29 @@ isSelectionNotifyProcessed = true; boolean mustSchedule = false; - synchronized (XClipboard.classLock) { - if (targetsAtom2Clipboard == null) { - targetsAtom2Clipboard = new HashMap(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(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(); } } diff -r 37d98293b182 -r 309156990bcf src/solaris/classes/sun/awt/X11/XRootWindow.java --- a/src/solaris/classes/sun/awt/X11/XRootWindow.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/solaris/classes/sun/awt/X11/XRootWindow.java Wed Jun 17 21:55:37 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() { diff -r 37d98293b182 -r 309156990bcf src/solaris/classes/sun/awt/X11/XToolkit.java --- a/src/solaris/classes/sun/awt/X11/XToolkit.java Wed Jun 10 23:15:56 2015 -0700 +++ b/src/solaris/classes/sun/awt/X11/XToolkit.java Wed Jun 17 21:55:37 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 { diff -r 37d98293b182 -r 309156990bcf src/solaris/native/java/net/Inet4AddressImpl.c --- a/src/solaris/native/java/net/Inet4AddressImpl.c Wed Jun 10 23:15:56 2015 -0700 +++ b/src/solaris/native/java/net/Inet4AddressImpl.c Wed Jun 17 21:55:37 2015 -0700 @@ -144,7 +144,7 @@ jobjectArray ret = 0; int retLen = 0; - int error=0; + int getaddrinfo_error=0; struct addrinfo hints, *res, *resNew = NULL; if (!initializeInetClasses(env)) @@ -172,22 +172,23 @@ return NULL; } + getaddrinfo_error = getaddrinfo(hostname, NULL, &hints, &res); + #ifdef MACOSX - /* If we're looking up the local machine, bypass DNS lookups and get - * address from getifaddrs. - */ - ret = lookupIfLocalhost(env, hostname, JNI_FALSE); - if (ret != NULL || (*env)->ExceptionCheck(env)) { - JNU_ReleaseStringPlatformChars(env, host, hostname); - return ret; + if (getaddrinfo_error) { + // If getaddrinfo fails try getifaddrs. + ret = lookupIfLocalhost(env, hostname, JNI_FALSE); + if (ret != NULL || (*env)->ExceptionCheck(env)) { + JNU_ReleaseStringPlatformChars(env, host, hostname); + return ret; + } } #endif - error = getaddrinfo(hostname, NULL, &hints, &res); - - if (error) { + if (getaddrinfo_error) { /* report error */ - ThrowUnknownHostExceptionWithGaiError(env, hostname, error); + ThrowUnknownHostExceptionWithGaiError( + env, hostname, getaddrinfo_error); JNU_ReleaseStringPlatformChars(env, host, hostname); return NULL; } else { diff -r 37d98293b182 -r 309156990bcf src/solaris/native/java/net/Inet6AddressImpl.c --- a/src/solaris/native/java/net/Inet6AddressImpl.c Wed Jun 10 23:15:56 2015 -0700 +++ b/src/solaris/native/java/net/Inet6AddressImpl.c Wed Jun 17 21:55:37 2015 -0700 @@ -296,7 +296,7 @@ jobjectArray ret = 0; int retLen = 0; - int error=0; + int getaddrinfo_error=0; #ifdef AF_INET6 struct addrinfo hints, *res, *resNew = NULL; #endif /* AF_INET6 */ @@ -311,19 +311,6 @@ hostname = JNU_GetStringPlatformChars(env, host, JNI_FALSE); CHECK_NULL_RETURN(hostname, NULL); -#ifdef MACOSX - /* - * If we're looking up the local machine, attempt to get the address - * from getifaddrs. This ensures we get an IPv6 address for the local - * machine. - */ - ret = lookupIfLocalhost(env, hostname, JNI_TRUE); - if (ret != NULL || (*env)->ExceptionCheck(env)) { - JNU_ReleaseStringPlatformChars(env, host, hostname); - return ret; - } -#endif - #ifdef AF_INET6 /* Try once, with our static buffer. */ memset(&hints, 0, sizeof(hints)); @@ -343,11 +330,27 @@ } #endif - error = getaddrinfo(hostname, NULL, &hints, &res); + getaddrinfo_error = getaddrinfo(hostname, NULL, &hints, &res); - if (error) { +#ifdef MACOSX + if (getaddrinfo_error) { + /* + * If getaddrinfo fails looking up the local machine, attempt to get the + * address from getifaddrs. This ensures we get an IPv6 address for the + * local machine. + */ + ret = lookupIfLocalhost(env, hostname, JNI_TRUE); + if (ret != NULL || (*env)->ExceptionCheck(env)) { + JNU_ReleaseStringPlatformChars(env, host, hostname); + return ret; + } + } +#endif + + if (getaddrinfo_error) { /* report error */ - ThrowUnknownHostExceptionWithGaiError(env, hostname, error); + ThrowUnknownHostExceptionWithGaiError( + env, hostname, getaddrinfo_error); JNU_ReleaseStringPlatformChars(env, host, hostname); return NULL; } else { diff -r 37d98293b182 -r 309156990bcf src/solaris/native/java/net/PlainDatagramSocketImpl.c --- a/src/solaris/native/java/net/PlainDatagramSocketImpl.c Wed Jun 10 23:15:56 2015 -0700 +++ b/src/solaris/native/java/net/PlainDatagramSocketImpl.c Wed Jun 17 21:55:37 2015 -0700 @@ -1321,11 +1321,11 @@ /* * Class: java_net_PlainDatagramSocketImpl - * Method: socketSetOption + * Method: socketSetOption0 * Signature: (ILjava/lang/Object;)V */ JNIEXPORT void JNICALL -Java_java_net_PlainDatagramSocketImpl_socketSetOption(JNIEnv *env, +Java_java_net_PlainDatagramSocketImpl_socketSetOption0(JNIEnv *env, jobject this, jint opt, jobject value) { diff -r 37d98293b182 -r 309156990bcf src/solaris/native/java/net/PlainSocketImpl.c --- a/src/solaris/native/java/net/PlainSocketImpl.c Wed Jun 10 23:15:56 2015 -0700 +++ b/src/solaris/native/java/net/PlainSocketImpl.c Wed Jun 17 21:55:37 2015 -0700 @@ -885,11 +885,11 @@ /* * Class: java_net_PlainSocketImpl - * Method: socketSetOption + * Method: socketSetOption0 * Signature: (IZLjava/lang/Object;)V */ JNIEXPORT void JNICALL -Java_java_net_PlainSocketImpl_socketSetOption(JNIEnv *env, jobject this, +Java_java_net_PlainSocketImpl_socketSetOption0(JNIEnv *env, jobject this, jint cmd, jboolean on, jobject value) { int fd; diff -r 37d98293b182 -r 309156990bcf src/solaris/native/java/net/net_util_md.c --- a/src/solaris/native/java/net/net_util_md.c Wed Jun 10 23:15:56 2015 -0700 +++ b/src/solaris/native/java/net/net_util_md.c Wed Jun 17 21:55:37 2015 -0700 @@ -1012,12 +1012,10 @@ int i; - /* - * Different multicast options if IPv6 is enabled - */ #ifdef AF_INET6 if (ipv6_available()) { switch (cmd) { + // Different multicast options if IPv6 is enabled case java_net_SocketOptions_IP_MULTICAST_IF: case java_net_SocketOptions_IP_MULTICAST_IF2: *level = IPPROTO_IPV6; @@ -1028,6 +1026,13 @@ *level = IPPROTO_IPV6; *optname = IPV6_MULTICAST_LOOP; return 0; +#if (defined(__solaris__) || defined(MACOSX)) + // Map IP_TOS request to IPV6_TCLASS + case java_net_SocketOptions_IP_TOS: + *level = IPPROTO_IPV6; + *optname = IPV6_TCLASS; + return 0; +#endif } } #endif @@ -1203,9 +1208,6 @@ * Wrapper for getsockopt system routine - does any necessary * pre/post processing to deal with OS specific oddities :- * - * IP_TOS is a no-op with IPv6 sockets as it's setup when - * the connection is established. - * * On Linux the SO_SNDBUF/SO_RCVBUF values must be post-processed * to compensate for an incorrect value returned by the kernel. */ @@ -1215,21 +1217,6 @@ { int rv; -#ifdef AF_INET6 - if ((level == IPPROTO_IP) && (opt == IP_TOS)) { - if (ipv6_available()) { - - /* - * For IPv6 socket option implemented at Java-level - * so return -1. - */ - int *tc = (int *)result; - *tc = -1; - return 0; - } - } -#endif - #ifdef __solaris__ rv = getsockopt(fd, level, opt, result, len); #else @@ -1280,8 +1267,7 @@ * * For IP_TOS socket option need to mask off bits as this * aren't automatically masked by the kernel and results in - * an error. In addition IP_TOS is a NOOP with IPv6 as it - * should be setup as connection time. + * an error. */ int NET_SetSockOpt(int fd, int level, int opt, const void *arg, @@ -1312,9 +1298,9 @@ /* * IPPROTO/IP_TOS :- - * 1. IPv6 on Solaris/Mac OS: NOOP and will be set - * in flowinfo field when connecting TCP socket, - * or sending UDP packet. + * 1. IPv6 on Solaris/Mac OS: + * Set the TOS OR Traffic Class value to cater for + * IPv6 and IPv4 scenarios. * 2. IPv6 on Linux: By default Linux ignores flowinfo * field so enable IPV6_FLOWINFO_SEND so that flowinfo * will be examined. We also set the IPv4 TOS option in this case. @@ -1324,12 +1310,6 @@ if (level == IPPROTO_IP && opt == IP_TOS) { int *iptos; -#if defined(AF_INET6) && (defined(__solaris__) || defined(MACOSX)) - if (ipv6_available()) { - return 0; - } -#endif - #if defined(AF_INET6) && defined(__linux__) if (ipv6_available()) { int optval = 1; @@ -1337,6 +1317,16 @@ (void *)&optval, sizeof(optval)) < 0) { return -1; } + /* + * Let's also set the IPV6_TCLASS flag. + * Linux appears to allow both IP_TOS and IPV6_TCLASS to be set + * This helps in mixed environments where IPv4 and IPv6 sockets + * are connecting. + */ + if (setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, + arg, len) < 0) { + return -1; + } } #endif @@ -1429,7 +1419,7 @@ * On Linux the receive buffer is used for both socket * structures and the the packet payload. The implication * is that if SO_RCVBUF is too small then small packets - * must be discard. + * must be discarded. */ #ifdef __linux__ if (level == SOL_SOCKET && opt == SO_RCVBUF) { @@ -1609,7 +1599,7 @@ * NET_WAIT_READ, NET_WAIT_WRITE & NET_WAIT_CONNECT. * * The function will return when either the socket is ready for one - * of the specified operation or the timeout expired. + * of the specified operations or the timeout expired. * * It returns the time left from the timeout (possibly 0), or -1 if it expired. */ diff -r 37d98293b182 -r 309156990bcf src/windows/native/sun/windows/awt_Frame.cpp --- a/src/windows/native/sun/windows/awt_Frame.cpp Wed Jun 10 23:15:56 2015 -0700 +++ b/src/windows/native/sun/windows/awt_Frame.cpp Wed Jun 17 21:55:37 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); diff -r 37d98293b182 -r 309156990bcf test/TEST.groups --- a/test/TEST.groups Wed Jun 10 23:15:56 2015 -0700 +++ b/test/TEST.groups Wed Jun 17 21:55:37 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 \ diff -r 37d98293b182 -r 309156990bcf test/java/awt/Component/SetEnabledPerformance/SetEnabledPerformance.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/Component/SetEnabledPerformance/SetEnabledPerformance.java Wed Jun 17 21:55:37 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 diff -r 37d98293b182 -r 309156990bcf test/java/awt/Component/isLightweightCrash/StubPeerCrash.java --- a/test/java/awt/Component/isLightweightCrash/StubPeerCrash.java Wed Jun 10 23:15:56 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 newContainer 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){}; -} diff -r 37d98293b182 -r 309156990bcf test/java/awt/FontClass/DebugFonts.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/FontClass/DebugFonts.java Wed Jun 17 21:55:37 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(); + } +} diff -r 37d98293b182 -r 309156990bcf test/java/awt/FontClass/HelvLtOblTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/FontClass/HelvLtOblTest.java Wed Jun 17 21:55:37 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 { + 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> 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)); + } + } + } + } + +} diff -r 37d98293b182 -r 309156990bcf test/java/awt/Mouse/MouseDragEvent/MouseDraggedTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/Mouse/MouseDragEvent/MouseDraggedTest.java Wed Jun 17 21:55:37 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 diff -r 37d98293b182 -r 309156990bcf test/java/awt/ScrollPane/bug8077409Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/ScrollPane/bug8077409Test.java Wed Jun 17 21:55:37 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 diff -r 37d98293b182 -r 309156990bcf test/java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java Wed Jun 17 21:55:37 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."); + } + } + } + } +} diff -r 37d98293b182 -r 309156990bcf test/java/lang/invoke/8022701/InvokeSeveralWays.java --- a/test/java/lang/invoke/8022701/InvokeSeveralWays.java Wed Jun 10 23:15:56 2015 -0700 +++ b/test/java/lang/invoke/8022701/InvokeSeveralWays.java Wed Jun 17 21:55:37 2015 -0700 @@ -38,12 +38,19 @@ failures++; } catch (InvocationTargetException e) { Throwable c = e.getCause(); - if (expected.isInstance(c)) - System.out.println("EXPECTED: " + expected.getName() + ", "+ c); - else { - failures++; - System.out.println("FAIL: Unexpected wrapped exception " + c); - e.printStackTrace(System.out); + if (BootstrapMethodError.class.isInstance(c)) { + c = c.getCause(); + if (expected.isInstance(c)) + System.out.println("EXPECTED: " + expected.getName() + ", "+ c); + else { + failures++; + System.out.println("FAIL: Unexpected wrapped exception " + c); + e.printStackTrace(System.out); + } + } else { + failures++; + System.out.println("FAIL: Exception from MethodHandle invocation not wrapped in BootstrapMethodError " + c); + e.printStackTrace(System.out); } } catch (Throwable e) { failures++; @@ -74,14 +81,19 @@ Invoker.invoke(); System.out.println("FAIL: No exception throw, probably failed to load modified bytecodes for MethodSupplier"); failures++; - } catch (Throwable e) { - if (expected.isInstance(e)) - System.out.println("EXPECTED: " + expected.getName() + ", "+ e); + } catch (BootstrapMethodError e) { + Throwable c = e.getCause(); + if (expected.isInstance(c)) + System.out.println("EXPECTED: " + expected.getName() + ", "+ c); else { + failures++; + System.out.println("FAIL: Unexpected exception has been caught " + c); + e.printStackTrace(System.out); + } + } catch (Throwable e) { failures++; - System.out.println("FAIL: Unexpected exception has been caught " + e); + System.out.println("FAIL: Exception from MethodHandle invocation not wrapped in BootstrapMethodError " + e); e.printStackTrace(System.out); - } } System.out.println(); try { diff -r 37d98293b182 -r 309156990bcf test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java --- a/test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java Wed Jun 10 23:15:56 2015 -0700 +++ b/test/java/lang/invoke/LFCaching/LFGarbageCollectedTest.java Wed Jun 17 21:55:37 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 diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/TEST.properties Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,3 @@ +# JDBC unit tests uses TestNG +TestNG.dirs = . + diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/BatchUpdateExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/BatchUpdateExceptionTests.java Wed Jun 17 21:55:37 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(); + } + } + +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/DataTruncationTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/DataTruncationTests.java Wed Jun 17 21:55:37 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(); + } + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/DateTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/DateTests.java Wed Jun 17 21:55:37 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"} + + }; + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/DriverManagerPermissionsTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/DriverManagerPermissionsTests.java Wed Jun 17 21:55:37 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()); + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/DriverManagerTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/DriverManagerTests.java Wed Jun 17 21:55:37 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())); + } + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/SQLClientInfoExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/SQLClientInfoExceptionTests.java Wed Jun 17 21:55:37 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 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(); + } + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/SQLDataExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/SQLDataExceptionTests.java Wed Jun 17 21:55:37 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); + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/SQLExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/SQLExceptionTests.java Wed Jun 17 21:55:37 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(); + } + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/SQLFeatureNotSupportedExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/SQLFeatureNotSupportedExceptionTests.java Wed Jun 17 21:55:37 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); + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/SQLIntegrityConstraintViolationExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/SQLIntegrityConstraintViolationExceptionTests.java Wed Jun 17 21:55:37 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); + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/SQLInvalidAuthorizationSpecExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/SQLInvalidAuthorizationSpecExceptionTests.java Wed Jun 17 21:55:37 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); + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/SQLNonTransientConnectionExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/SQLNonTransientConnectionExceptionTests.java Wed Jun 17 21:55:37 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); + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/SQLNonTransientExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/SQLNonTransientExceptionTests.java Wed Jun 17 21:55:37 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(); + } + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/SQLRecoverableExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/SQLRecoverableExceptionTests.java Wed Jun 17 21:55:37 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(); + } + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/SQLSyntaxErrorExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/SQLSyntaxErrorExceptionTests.java Wed Jun 17 21:55:37 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); + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/SQLTimeoutExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/SQLTimeoutExceptionTests.java Wed Jun 17 21:55:37 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); + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/SQLTransactionRollbackExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/SQLTransactionRollbackExceptionTests.java Wed Jun 17 21:55:37 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); + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/SQLTransientConnectionExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/SQLTransientConnectionExceptionTests.java Wed Jun 17 21:55:37 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); + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/SQLTransientExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/SQLTransientExceptionTests.java Wed Jun 17 21:55:37 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(); + } + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/SQLWarningTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/SQLWarningTests.java Wed Jun 17 21:55:37 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(); + } + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/TimeTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/TimeTests.java Wed Jun 17 21:55:37 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"} + }; + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/test/sql/TimestampTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/test/sql/TimestampTests.java Wed Jun 17 21:55:37 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} + }; + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/util/BaseTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/util/BaseTest.java Wed Jun 17 21:55:37 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 + createSerializedException(T ex) + throws IOException, ClassNotFoundException { + return (T) serializeDeserializeObject(ex); + } + + /* + * Utility method to serialize and deserialize an object + */ + @SuppressWarnings("unchecked") + protected 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; + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/util/DriverActionImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/util/DriverActionImpl.java Wed Jun 17 21:55:37 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(); + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/util/SerializedBatchUpdateException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/util/SerializedBatchUpdateException.java Wed Jun 17 21:55:37 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) 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) 0x61, (byte) 0x9, (byte) 0xc5, (byte) 0x9a, (byte) 0x26, (byte) 0x36, (byte) 0xdd, (byte) 0x85, (byte) 0x2, (byte) 0x0, (byte) 0x4, (byte) 0x49, (byte) 0x0, (byte) 0xa, (byte) 0x6c, (byte) 0x69, (byte) 0x6e, (byte) 0x65, (byte) 0x4e, (byte) 0x75, (byte) 0x6d, (byte) 0x62, (byte) 0x65, (byte) 0x72, + (byte) 0x4c, (byte) 0x0, (byte) 0xe, (byte) 0x64, (byte) 0x65, (byte) 0x63, (byte) 0x6c, (byte) 0x61, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x43, (byte) 0x6c, (byte) 0x61, (byte) 0x73, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x4, (byte) 0x4c, (byte) 0x0, (byte) 0x8, (byte) 0x66, (byte) 0x69, (byte) 0x6c, (byte) 0x65, (byte) 0x4e, (byte) 0x61, (byte) 0x6d, + (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x4, (byte) 0x4c, (byte) 0x0, (byte) 0xa, (byte) 0x6d, (byte) 0x65, (byte) 0x74, (byte) 0x68, (byte) 0x6f, (byte) 0x64, (byte) 0x4e, (byte) 0x61, (byte) 0x6d, (byte) 0x65, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x4, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x23, (byte) 0x74, (byte) 0x0, + (byte) 0x17, (byte) 0x43, (byte) 0x72, (byte) 0x65, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x42, (byte) 0x61, (byte) 0x74, (byte) 0x63, (byte) 0x68, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x53, (byte) 0x65, (byte) 0x72, (byte) 0x74, (byte) 0x0, (byte) 0x1c, (byte) 0x43, (byte) 0x72, (byte) 0x65, (byte) 0x61, (byte) 0x74, + (byte) 0x65, (byte) 0x42, (byte) 0x61, (byte) 0x74, (byte) 0x63, (byte) 0x68, (byte) 0x45, (byte) 0x78, (byte) 0x63, (byte) 0x65, (byte) 0x70, (byte) 0x74, (byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x53, (byte) 0x65, (byte) 0x72, (byte) 0x2e, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x74, (byte) 0x0, (byte) 0x9, (byte) 0x77, (byte) 0x72, (byte) 0x69, (byte) 0x74, (byte) 0x65, (byte) 0x54, + (byte) 0x65, (byte) 0x73, (byte) 0x74, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1a, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x12, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x13, (byte) 0x74, (byte) 0x0, (byte) 0x4, (byte) 0x6d, (byte) 0x61, (byte) 0x69, (byte) 0x6e, (byte) 0x70, (byte) 0x78, + (byte) 0x74, (byte) 0x0, (byte) 0x16, (byte) 0x54, (byte) 0x68, (byte) 0x69, (byte) 0x73, (byte) 0x20, (byte) 0x77, (byte) 0x61, (byte) 0x73, (byte) 0x20, (byte) 0x74, (byte) 0x68, (byte) 0x65, (byte) 0x20, (byte) 0x65, (byte) 0x72, (byte) 0x72, (byte) 0x6f, (byte) 0x72, (byte) 0x20, (byte) 0x6d, (byte) 0x73, (byte) 0x67, (byte) 0x75, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0xe, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x2, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x28, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x12, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x13, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x14, (byte) 0x73, (byte) 0x71, (byte) 0x0, (byte) 0x7e, + (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1a, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x12, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x13, (byte) 0x71, (byte) 0x0, (byte) 0x7e, (byte) 0x0, (byte) 0x16, (byte) 0x70, (byte) 0x78, (byte) 0x0, (byte) 0x1, (byte) 0x86, (byte) 0x9f, (byte) 0x74, (byte) 0x0, (byte) 0x15, (byte) 0x75, (byte) 0x73, + (byte) 0x65, (byte) 0x72, (byte) 0x20, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x69, (byte) 0x6e, (byte) 0x65, (byte) 0x64, (byte) 0x20, (byte) 0x73, (byte) 0x71, (byte) 0x6c, (byte) 0x53, (byte) 0x74, (byte) 0x61, (byte) 0x74, (byte) 0x65, (byte) 0x70, (byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x4a, (byte) 0x78, (byte) 0x20, (byte) 0x4, (byte) 0xb5, (byte) 0x12, (byte) 0xb1, + (byte) 0x75, (byte) 0x93, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x3, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x15, (byte) 0x75, (byte) 0x72, (byte) 0x0, (byte) 0x2, (byte) 0x5b, (byte) 0x49, (byte) 0x4d, (byte) 0xba, (byte) 0x60, (byte) 0x26, (byte) 0x76, (byte) 0xea, (byte) 0xb2, (byte) 0xa5, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x78, (byte) 0x70, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x3, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x15, (byte) 0x78 + }; +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/util/StubConnection.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/util/StubConnection.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,315 @@ +/* + * 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.Array; +import java.sql.Blob; +import java.sql.CallableStatement; +import java.sql.Clob; +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.NClob; +import java.sql.PreparedStatement; +import java.sql.SQLClientInfoException; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.sql.SQLXML; +import java.sql.Savepoint; +import java.sql.Statement; +import java.sql.Struct; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.Executor; + +public class StubConnection implements Connection { + + @Override + public Statement createStatement() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public PreparedStatement prepareStatement(String sql) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CallableStatement prepareCall(String sql) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String nativeSQL(String sql) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAutoCommit(boolean autoCommit) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getAutoCommit() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void commit() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rollback() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void close() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isClosed() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public DatabaseMetaData getMetaData() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setReadOnly(boolean readOnly) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isReadOnly() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCatalog(String catalog) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getCatalog() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTransactionIsolation(int level) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getTransactionIsolation() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLWarning getWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void clearWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Map> getTypeMap() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTypeMap(Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setHoldability(int holdability) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getHoldability() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Savepoint setSavepoint() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Savepoint setSavepoint(String name) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rollback(Savepoint savepoint) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void releaseSavepoint(Savepoint savepoint) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Clob createClob() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Blob createBlob() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public NClob createNClob() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLXML createSQLXML() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isValid(int timeout) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClientInfo(String name, String value) throws SQLClientInfoException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClientInfo(Properties properties) throws SQLClientInfoException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getClientInfo(String name) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Properties getClientInfo() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Array createArrayOf(String typeName, Object[] elements) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Struct createStruct(String typeName, Object[] attributes) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSchema(String schema) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getSchema() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void abort(Executor executor) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getNetworkTimeout() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T unwrap(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isWrapperFor(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/util/StubDriver.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/util/StubDriver.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,75 @@ +/* + * 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.Connection; +import java.sql.Driver; +import java.sql.DriverPropertyInfo; +import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; +import java.util.Properties; +import java.util.logging.Logger; + +public class StubDriver implements Driver { + + public StubDriver() { + } + + @Override + public Connection connect(String url, Properties info) throws SQLException { + if (acceptsURL(url)) { + return new StubConnection(); + } + return null; + } + + @Override + public boolean acceptsURL(String url) throws SQLException { + return url.matches("^jdbc:tennis:.*"); + } + + @Override + public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMajorVersion() { + return 1; + } + + @Override + public int getMinorVersion() { + return 0; + } + + @Override + public boolean jdbcCompliant() { + return true; + } + + @Override + public Logger getParentLogger() throws SQLFeatureNotSupportedException { + throw new UnsupportedOperationException("Not supported yet."); + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/util/StubDriverDA.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/util/StubDriverDA.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,75 @@ +/* + * 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.File; +import java.io.IOException; +import java.sql.DriverAction; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Simple java.sql.Driver stub class that registers the driver via a static + * block with a DriverAction Implementation + * @author ljanders + */ +public class StubDriverDA extends StubDriver { + + public static final String DriverActionCalled = "DriverActionCalled.txt"; + + static DriverAction da; + + static { + try { + DriverManager.registerDriver(new StubDriverDA(), da); + } catch (SQLException ex) { + Logger.getLogger(StubDriverDA.class.getName()).log(Level.SEVERE, null, ex); + } + } + + public StubDriverDA() { + da = new DriverActionImpl(this); + } + + @Override + public boolean acceptsURL(String url) throws SQLException { + return url.matches("^jdbc:luckydog:.*"); + } + + /** + * This method will write out a text file when called by the + * DriverActionImpl.release method when DriverManager.deregisterDriver + * is called. This is used by DriverManagerTests to validate that + * DriverAction.release was called + */ + protected void release() { + File file = new File(DriverActionCalled); + try { + file.createNewFile(); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + } +} diff -r 37d98293b182 -r 309156990bcf test/java/sql/testng/util/TestPolicy.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/sql/testng/util/TestPolicy.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,142 @@ +/* + * 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.FilePermission; +import java.security.AllPermission; +import java.security.CodeSource; +import java.security.Permission; +import java.security.PermissionCollection; +import java.security.Permissions; +import java.security.Policy; +import java.security.ProtectionDomain; +import java.security.SecurityPermission; +import java.sql.SQLPermission; +import java.util.Enumeration; +import java.util.PropertyPermission; +import java.util.StringJoiner; +import java.util.logging.LoggingPermission; + +/* + * Simple Policy class that supports the required Permissions to validate the + * JDBC concrete classes + */ +public class TestPolicy extends Policy { + + final PermissionCollection permissions = new Permissions(); + + /** + * Constructor which sets the minimum permissions allowing testNG to work + * with a SecurityManager + */ + public TestPolicy() { + setMinimalPermissions(); + } + + /* + * Constructor which determines which permissions are defined for this + * Policy used by the JDBC tests Possible values are: all (ALLPermissions), + * setLog (SQLPemission("setLog"), deregisterDriver + * (SQLPermission("deregisterDriver") (SQLPermission("deregisterDriver"), + * setSyncFactory(SQLPermission(setSyncFactory), and also + * LoggerPermission("control", null) when setting a Level + * + * @param policy Permissions to set + */ + public TestPolicy(String policy) { + + switch (policy) { + case "all": + permissions.add(new AllPermission()); + break; + case "setLog": + setMinimalPermissions(); + permissions.add(new SQLPermission("setLog")); + break; + case "deregisterDriver": + setMinimalPermissions(); + permissions.add(new SQLPermission("deregisterDriver")); + break; + case "setSyncFactory": + setMinimalPermissions(); + permissions.add(new SQLPermission("setSyncFactory")); + break; + case "setSyncFactoryLogger": + setMinimalPermissions(); + permissions.add(new SQLPermission("setSyncFactory")); + permissions.add(new LoggingPermission("control", null)); + break; + default: + setMinimalPermissions(); + } + } + + /* + * Defines the minimal permissions required by testNG when running these + * tests + */ + private void setMinimalPermissions() { + permissions.add(new SecurityPermission("getPolicy")); + permissions.add(new SecurityPermission("setPolicy")); + permissions.add(new RuntimePermission("getClassLoader")); + permissions.add(new RuntimePermission("setSecurityManager")); + permissions.add(new RuntimePermission("createSecurityManager")); + permissions.add(new PropertyPermission("testng.show.stack.frames", + "read")); + permissions.add(new PropertyPermission("line.separator", "read")); + permissions.add(new PropertyPermission("fileStringBuffer", "read")); + permissions.add(new PropertyPermission("dataproviderthreadcount", "read")); + permissions.add(new PropertyPermission("java.io.tmpdir", "read")); + permissions.add(new FilePermission("<>", + "read, write, delete")); + } + + /* + * Overloaded methods from the Policy class + */ + @Override + public String toString() { + StringJoiner sj = new StringJoiner("\n", "policy: ", ""); + Enumeration perms = permissions.elements(); + while (perms.hasMoreElements()) { + sj.add(perms.nextElement().toString()); + } + return sj.toString(); + + } + + @Override + public PermissionCollection getPermissions(ProtectionDomain domain) { + return permissions; + } + + @Override + public PermissionCollection getPermissions(CodeSource codesource) { + return permissions; + } + + @Override + public boolean implies(ProtectionDomain domain, Permission perm) { + return permissions.implies(perm); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/TEST.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/TEST.properties Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,7 @@ +# JDBC unit tests uses TestNG +TestNG.dirs= . +othervm.dirs= . +lib.dirs = /java/sql/testng +modules = java.sql.rowset/com.sun.rowset \ + java.sql.rowset/com.sun.rowset.internal \ + java.sql.rowset/com.sun.rowset.providers diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/jars/badFactory/META-INF/services/javax.sql.rowset.RowSetFactory --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/jars/badFactory/META-INF/services/javax.sql.rowset.RowSetFactory Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,1 @@ +invalid.RowSetFactoryImpl diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/jars/goodFactory/META-INF/services/javax.sql.rowset.RowSetFactory --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/jars/goodFactory/META-INF/services/javax.sql.rowset.RowSetFactory Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,1 @@ +util.StubRowSetFactory diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/BaseRowSetTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/BaseRowSetTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,444 @@ +/* + * 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 + * 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.rowset; + +import java.io.InputStream; +import java.io.Reader; +import java.io.StringBufferInputStream; +import java.io.StringReader; +import java.math.BigDecimal; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Date; +import java.sql.Ref; +import java.sql.SQLException; +import java.sql.Time; +import java.sql.Timestamp; +import java.sql.Types; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.Calendar; +import javax.sql.RowSet; +import javax.sql.rowset.serial.SerialArray; +import javax.sql.rowset.serial.SerialBlob; +import javax.sql.rowset.serial.SerialClob; +import javax.sql.rowset.serial.SerialRef; +import static org.testng.Assert.*; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import util.StubArray; +import util.StubBaseRowSet; +import util.StubBlob; +import util.StubClob; +import util.StubRef; +import util.TestRowSetListener; + +public class BaseRowSetTests extends CommonRowSetTests { + + private StubBaseRowSet brs; + + @Override + protected RowSet newInstance() throws SQLException { + return new StubBaseRowSet(); + } + + /* + * Create a RowSetListener and validate that notifyCursorMoved is called + */ + @Test(dataProvider = "rowSetType") + public void baseRowSetTest0000(StubBaseRowSet rs) throws Exception { + TestRowSetListener rsl = new TestRowSetListener(); + rs.addRowSetListener(rsl); + rs.notifyCursorMoved(); + assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED)); + } + + /* + * Create a RowSetListener and validate that notifyRowChanged is called + */ + @Test(dataProvider = "rowSetType") + public void baseRowSetTest0001(StubBaseRowSet rs) throws Exception { + TestRowSetListener rsl = new TestRowSetListener(); + rs.addRowSetListener(rsl); + rs.notifyRowChanged(); + assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED)); + } + + /* + * Create a RowSetListener and validate that notifyRowSetChanged is called + */ + @Test(dataProvider = "rowSetType") + public void baseRowSetTest0002(StubBaseRowSet rs) throws Exception { + TestRowSetListener rsl = new TestRowSetListener(); + rs.addRowSetListener(rsl); + rs.notifyRowSetChanged(); + assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED)); + } + + /* + * Create multiple RowSetListeners and validate that notifyRowSetChanged + * is called on all listeners + */ + @Test(dataProvider = "rowSetType") + public void baseRowSetTest0003(StubBaseRowSet rs) throws Exception { + TestRowSetListener rsl = new TestRowSetListener(); + TestRowSetListener rsl2 = new TestRowSetListener(); + rs.addRowSetListener(rsl); + rs.addRowSetListener(rsl2); + rs.notifyRowSetChanged(); + assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED)); + assertTrue(rsl2.isNotified(TestRowSetListener.ROWSET_CHANGED)); + } + + /* + * Create multiple RowSetListeners and validate that notifyRowChanged + * is called on all listeners + */ + @Test(dataProvider = "rowSetType") + public void baseRowSetTest0004(StubBaseRowSet rs) throws Exception { + TestRowSetListener rsl = new TestRowSetListener(); + TestRowSetListener rsl2 = new TestRowSetListener(); + rs.addRowSetListener(rsl); + rs.addRowSetListener(rsl2); + rs.notifyRowChanged(); + assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED)); + assertTrue(rsl2.isNotified(TestRowSetListener.ROW_CHANGED)); + } + + /* + * Create multiple RowSetListeners and validate that notifyCursorMoved + * is called on all listeners + */ + @Test(dataProvider = "rowSetType") + public void baseRowSetTest0005(StubBaseRowSet rs) throws Exception { + TestRowSetListener rsl = new TestRowSetListener(); + TestRowSetListener rsl2 = new TestRowSetListener(); + rs.addRowSetListener(rsl); + rs.addRowSetListener(rsl2); + rs.notifyCursorMoved(); + assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED)); + assertTrue(rsl2.isNotified(TestRowSetListener.CURSOR_MOVED)); + } + + /* + * Create a RowSetListener and validate that notifyRowSetChanged, + * notifyRowChanged() and notifyCursorMoved are called + */ + @Test(dataProvider = "rowSetType") + public void baseRowSetTest0006(StubBaseRowSet rs) throws Exception { + TestRowSetListener rsl = new TestRowSetListener(); + rs.addRowSetListener(rsl); + rs.notifyRowSetChanged(); + rs.notifyRowChanged(); + rs.notifyCursorMoved(); + assertTrue(rsl.isNotified( + TestRowSetListener.CURSOR_MOVED | TestRowSetListener.ROWSET_CHANGED + | TestRowSetListener.ROW_CHANGED)); + } + + + /* + * Create multiple RowSetListeners and validate that notifyRowSetChanged, + * notifyRowChanged() and notifyCursorMoved are called on all listeners + */ + @Test(dataProvider = "rowSetType") + public void baseRowSetTest0007(StubBaseRowSet rs) throws Exception { + TestRowSetListener rsl = new TestRowSetListener(); + TestRowSetListener rsl2 = new TestRowSetListener(); + rs.addRowSetListener(rsl); + rs.addRowSetListener(rsl2); + rs.notifyRowSetChanged(); + rs.notifyRowChanged(); + rs.notifyCursorMoved(); + assertTrue(rsl.isNotified( + TestRowSetListener.CURSOR_MOVED | TestRowSetListener.ROWSET_CHANGED + | TestRowSetListener.ROW_CHANGED)); + assertTrue(rsl2.isNotified( + TestRowSetListener.CURSOR_MOVED | TestRowSetListener.ROWSET_CHANGED + | TestRowSetListener.ROW_CHANGED)); + } + + /* + * Create a RowSetListener and validate that notifyRowSetChanged is called, + * remove the listener, invoke notifyRowSetChanged again and verify the + * listner is not called + */ + @Test(dataProvider = "rowSetType") + public void baseRowSetTest0008(StubBaseRowSet rs) throws Exception { + TestRowSetListener rsl = new TestRowSetListener(); + rs.addRowSetListener(rsl); + rs.notifyRowSetChanged(); + assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED)); + // Clear the flag indicating the listener has been called + rsl.resetFlag(); + rs.removeRowSetListener(rsl); + rs.notifyRowSetChanged(); + assertFalse(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED)); + } + + /* + * Set the base parameters and validate that the value set is + * the correct type and value + */ + @Test(dataProvider = "testBaseParameters") + public void baseRowSetTest0009(int pos, Object o) throws Exception { + assertTrue(getParam(pos, o).getClass().isInstance(o)); + assertTrue(o.equals(getParam(pos, o))); + } + + /* + * Set the complex parameters and validate that the value set is + * the correct type + */ + @Test(dataProvider = "testAdvancedParameters") + public void baseRowSetTest0010(int pos, Object o) throws Exception { + assertTrue(getParam(pos, o).getClass().isInstance(o)); + } + + /* + * Validate setNull specifying the supported type values + */ + @Test(dataProvider = "jdbcTypes") + public void baseRowSetTest0011(Integer type) throws Exception { + brs = new StubBaseRowSet(); + brs.setNull(1, type); + assertTrue(checkNullParam(1, type, null)); + } + + /* + * Validate setNull specifying the supported type values and that + * typeName is set internally + */ + @Test(dataProvider = "jdbcTypes") + public void baseRowSetTest0012(Integer type) throws Exception { + brs = new StubBaseRowSet(); + brs.setNull(1, type, "SUPERHERO"); + assertTrue(checkNullParam(1, type, "SUPERHERO")); + } + + /* + * Validate that setDate sets the specified Calendar internally + */ + @Test() + public void baseRowSetTest0013() throws Exception { + Calendar cal = Calendar.getInstance(); + brs = new StubBaseRowSet(); + brs.setDate(1, Date.valueOf(LocalDate.now()), cal); + assertTrue(checkCalendarParam(1, cal)); + } + + /* + * Validate that setTime sets the specified Calendar internally + */ + @Test() + public void baseRowSetTest0014() throws Exception { + Calendar cal = Calendar.getInstance(); + brs = new StubBaseRowSet(); + brs.setTime(1, Time.valueOf(LocalTime.now()), cal); + assertTrue(checkCalendarParam(1, cal)); + } + + /* + * Validate that setTimestamp sets the specified Calendar internally + */ + @Test() + public void baseRowSetTest0015() throws Exception { + Calendar cal = Calendar.getInstance(); + brs = new StubBaseRowSet(); + brs.setTimestamp(1, Timestamp.valueOf(LocalDateTime.now()), cal); + assertTrue(checkCalendarParam(1, cal)); + } + + /* + * Validate that initParams() initializes the parameters + */ + @Test(dataProvider = "rowSetType") + public void baseRowSetTest0016(StubBaseRowSet rs) throws Exception { + rs.setInt(1, 1); + rs.initParams(); + assertTrue(rs.getParams().length == 0); + } + + + /* + * DataProvider used to set parameters for basic types that are supported + */ + @DataProvider(name = "testBaseParameters") + private Object[][] testBaseParameters() throws SQLException { + Integer aInt = 1; + Long aLong = Long.MAX_VALUE; + Short aShort = Short.MIN_VALUE; + BigDecimal bd = BigDecimal.ONE; + Double aDouble = Double.MAX_VALUE; + Date aDate = Date.valueOf(LocalDate.now()); + Time aTime = Time.valueOf(LocalTime.now()); + Timestamp aTimeStamp = Timestamp.valueOf(LocalDateTime.now()); + Calendar cal = Calendar.getInstance(); + Boolean aBoolean = true; + Float aFloat = 1.5f; + Byte aByte = 1; + brs = new StubBaseRowSet(); + + brs.setInt(1, aInt); + brs.setString(2, query); + brs.setLong(3, aLong); + brs.setBoolean(4, aBoolean); + brs.setShort(5, aShort); + brs.setDouble(6, aDouble); + brs.setBigDecimal(7, bd); + brs.setFloat(8, aFloat); + brs.setByte(9, aByte); + brs.setDate(10, aDate); + brs.setTime(11, aTime); + brs.setTimestamp(12, aTimeStamp); + brs.setDate(13, aDate, cal); + brs.setTime(14, aTime, cal); + brs.setTimestamp(15, aTimeStamp); + brs.setObject(16, query); + brs.setObject(17, query, Types.CHAR); + brs.setObject(18, query, Types.CHAR, 0); + + return new Object[][]{ + {1, aInt}, + {2, query}, + {3, aLong}, + {4, aBoolean}, + {5, aShort}, + {6, aDouble}, + {7, bd}, + {8, aFloat}, + {9, aByte}, + {10, aDate}, + {11, aTime}, + {12, aTimeStamp}, + {13, aDate}, + {14, aTime}, + {15, aTimeStamp}, + {16, query}, + {17, query}, + {18, query} + + }; + } + + /* + * DataProvider used to set advanced parameters for types that are supported + */ + @DataProvider(name = "testAdvancedParameters") + private Object[][] testAdvancedParameters() throws SQLException { + + byte[] bytes = new byte[10]; + Ref aRef = new SerialRef(new StubRef("INTEGER", query)); + Array aArray = new SerialArray(new StubArray("INTEGER", new Object[1])); + Blob aBlob = new SerialBlob(new StubBlob()); + Clob aClob = new SerialClob(new StubClob()); + Reader rdr = new StringReader(query); + InputStream is = new StringBufferInputStream(query);; + brs = new StubBaseRowSet(); + brs.setBytes(1, bytes); + brs.setAsciiStream(2, is, query.length()); + brs.setRef(3, aRef); + brs.setArray(4, aArray); + brs.setBlob(5, aBlob); + brs.setClob(6, aClob); + brs.setBinaryStream(7, is, query.length()); + brs.setUnicodeStream(8, is, query.length()); + brs.setCharacterStream(9, rdr, query.length()); + + return new Object[][]{ + {1, bytes}, + {2, is}, + {3, aRef}, + {4, aArray}, + {5, aBlob}, + {6, aClob}, + {7, is}, + {8, is}, + {9, rdr} + }; + } + + /* + * Method that returns the specified parameter instance that was set via setXXX + * Note non-basic types are stored as an Object[] where the 1st element + * is the object instnace + */ + @SuppressWarnings("unchecked") + private T getParam(int pos, T o) throws SQLException { + Object[] params = brs.getParams(); + if (params[pos - 1] instanceof Object[]) { + Object[] param = (Object[]) params[pos - 1]; + return (T) param[0]; + } else { + return (T) params[pos - 1]; + } + } + + /* + * Utility method to validate parameters when the param is an Object[] + */ + private boolean checkParam(int pos, int type, Object val) throws SQLException { + boolean result = false; + Object[] params = brs.getParams(); + if (params[pos - 1] instanceof Object[]) { + Object[] param = (Object[]) params[pos - 1]; + + if (param[0] == null) { + // setNull was used + if (param.length == 2 && (Integer) param[1] == type) { + result = true; + } else { + if (param.length == 3 && (Integer) param[1] == type + && val.equals(param[2])) { + result = true; + } + } + + } else if (param[0] instanceof java.util.Date) { + // setDate/Time/Timestamp with a Calendar object + if (param[1] instanceof Calendar && val.equals(param[1])) { + result = true; + } + } + } + return result; + } + + /* + * Wrapper method for validating that a null was set and the appropriate + * type and typeName if applicable + */ + private boolean checkNullParam(int pos, int type, String typeName) throws SQLException { + return checkParam(pos, type, typeName); + } + + /* + * Wrapper method for validating that a Calander was set + */ + private boolean checkCalendarParam(int pos, Calendar cal) throws SQLException { + // 2nd param is ignored when instanceof java.util.Date + return checkParam(pos, Types.DATE, cal); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/CommonRowSetTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/CommonRowSetTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,1372 @@ +/* + * 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. + */ +package test.rowset; + +import java.io.InputStream; +import java.io.Reader; +import java.math.BigDecimal; +import java.sql.Connection; +import java.sql.Date; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.RowId; +import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; +import java.sql.Time; +import java.sql.Timestamp; +import java.sql.Types; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.sql.RowSet; +import javax.sql.rowset.BaseRowSet; +import javax.sql.rowset.CachedRowSet; +import javax.sql.rowset.RowSetFactory; +import javax.sql.rowset.RowSetMetaDataImpl; +import javax.sql.rowset.RowSetProvider; +import org.testng.Assert; +import static org.testng.Assert.assertNull; +import static org.testng.Assert.assertTrue; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import util.BaseTest; +import util.StubBlob; +import util.StubClob; +import util.StubNClob; +import util.StubSQLXML; + +public abstract class CommonRowSetTests extends BaseTest { + + protected final String stubProvider = "util.StubSyncProvider"; + protected final String query = "SELECT * FROM SUPERHEROS"; + private final String url = "jdbc:derby://localhost:1527/myDB"; + private final String dsName = "jdbc/myDB"; + private final String user = "Bruce Wayne"; + private final String password = "The Dark Knight"; + protected final String COFFEE_HOUSES_TABLE = "COFFEE_HOUSES"; + protected final String COFFEES_TABLE = "COFFEES"; + protected final int COFFEE_HOUSES_ROWS = 14; + protected final int COFFEES_ROWS = 5; + protected final Object[] COFFEES_PRIMARY_KEYS = {1, 2, 3, 4, 5}; + protected final Object[] COFFEE_HOUSES_PRIMARY_KEYS = { + 10023, 33002, 10040, 32001, 10042, 10024, 10039, 10041, + 33005, 33010, 10035, 10037, 10034, 32004 + }; + + /* + * COFFEES_HOUSES Table column names + */ + protected final String[] COFFEE_HOUSES_COLUMN_NAMES = { + "STORE_ID", "CITY", "COFFEE", "MERCH", "TOTAL" + }; + + /* + * COFFEES Table column names + */ + protected final String[] COFFEES_COLUMN_NAMES = { + "COF_ID", "COF_NAME", "SUP_ID", "PRICE", "SALES", "TOTAL" + }; + + protected RowSetFactory rsf; + + public CommonRowSetTests() { + try { + rsf = RowSetProvider.newFactory(); + } catch (SQLException ex) { + Assert.fail(ex.getMessage()); + } + } + + // Create an instance of the RowSet we are using + protected abstract T newInstance() throws SQLException; + + //DataProvider to use for common tests + + /* + * DataProvider used to specify the value to set and check for the + * methods for fetch direction + */ + @DataProvider(name = "rowSetFetchDirection") + protected Object[][] rowSetFetchDirection() throws Exception { + RowSet rs = newInstance(); + return new Object[][]{ + {rs, ResultSet.FETCH_FORWARD}, + {rs, ResultSet.FETCH_REVERSE}, + {rs, ResultSet.FETCH_UNKNOWN} + }; + } + + /* + * DataProvider used to specify the value to set and check for the + * methods for Cursor Scroll Type + */ + @DataProvider(name = "rowSetScrollTypes") + protected Object[][] rowSetScrollTypes() throws Exception { + RowSet rs = newInstance(); + + return new Object[][]{ + {rs, ResultSet.TYPE_FORWARD_ONLY}, + {rs, ResultSet.TYPE_SCROLL_INSENSITIVE}, + {rs, ResultSet.TYPE_SCROLL_SENSITIVE} + }; + } + + /* + * DataProvider used to specify the value to set and check for + * methods using transaction isolation types + */ + @DataProvider(name = "rowSetIsolationTypes") + protected Object[][] rowSetIsolationTypes() throws Exception { + RowSet rs = newInstance(); + + return new Object[][]{ + {rs, Connection.TRANSACTION_NONE}, + {rs, Connection.TRANSACTION_READ_COMMITTED}, + {rs, Connection.TRANSACTION_READ_UNCOMMITTED}, + {rs, Connection.TRANSACTION_REPEATABLE_READ}, + {rs, Connection.TRANSACTION_SERIALIZABLE} + }; + } + + /* + * DataProvider used to specify the value to set and check for the + * methods for Concurrency + */ + @DataProvider(name = "rowSetConcurrencyTypes") + protected Object[][] rowSetConcurrencyTypes() throws Exception { + RowSet rs = newInstance(); + return new Object[][]{ + {rs, ResultSet.CONCUR_READ_ONLY}, + {rs, ResultSet.CONCUR_UPDATABLE} + }; + } + + /* + * DataProvider used to specify the value to set and check for + * methods using boolean values + */ + @DataProvider(name = "rowSetTrueFalse") + protected Object[][] rowSetTrueFalse() throws Exception { + RowSet rs = newInstance(); + return new Object[][]{ + {rs, true}, + {rs, false} + }; + } + /* + * DataProvider used to specify the type of RowSet to use. We also must + * initialize the RowSet + */ + @DataProvider(name = "rowSetType") + protected Object[][] rowSetType() throws Exception { + + RowSet rs = newInstance(); + return new Object[][]{ + {rs} + }; + } + + /* + * Initializes a RowSet containing the COFFEE_HOUSES data + */ + protected T createCoffeeHousesRowSet() throws SQLException { + T rs = (T) newInstance(); + initCoffeeHousesMetaData((CachedRowSet) rs); + createCoffeeHouseRows(rs); + // Make sure you are not on the insertRow + rs.moveToCurrentRow(); + return rs; + } + + /* + * Initializes a RowSet containing the COFFEE_HOUSES data + */ + protected T createCoffeesRowSet() throws SQLException { + T rs = (T) newInstance(); + initCoffeesMetaData((CachedRowSet) rs); + createCoffeesRows(rs); + // Make sure you are not on the insertRow + rs.moveToCurrentRow(); + return rs; + } + + /* + * Initializes the COFFEE_HOUSES metadata + */ + private void initCoffeeHousesMetaData(CachedRowSet crs) throws SQLException { + RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl(); + crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE); + + /* + * CREATE TABLE COFFEE_HOUSES( + * STORE_ID Integer NOT NULL, + * CITY VARCHAR(32), + * COFFEE INTEGER NOT NULL, + * MERCH INTEGER NOT NULL, + * TOTAL INTEGER NOT NULL, + * PRIMARY KEY (STORE_ID)) + */ + rsmd.setColumnCount(COFFEE_HOUSES_COLUMN_NAMES.length); + for(int i = 1; i <= COFFEE_HOUSES_COLUMN_NAMES.length; i++){ + rsmd.setColumnName(i, COFFEE_HOUSES_COLUMN_NAMES[i-1]); + rsmd.setColumnLabel(i, rsmd.getColumnName(i)); + } + + rsmd.setColumnType(1, Types.INTEGER); + rsmd.setColumnType(2, Types.VARCHAR); + rsmd.setColumnType(3, Types.INTEGER); + rsmd.setColumnType(4, Types.INTEGER); + rsmd.setColumnType(5, Types.INTEGER); + crs.setMetaData(rsmd); + crs.setTableName(COFFEE_HOUSES_TABLE); + + } + + /* + * Add rows to COFFEE_HOUSES table + */ + protected void createCoffeeHouseRows(RowSet rs) throws SQLException { + + // insert into COFFEE_HOUSES values(10023, 'Mendocino', 3450, 2005, 5455) + rs.moveToInsertRow(); + rs.updateInt(1, 10023); + rs.updateString(2, "Mendocino"); + rs.updateInt(3, 3450); + rs.updateInt(4, 2005); + rs.updateInt(5, 5455); + rs.insertRow(); + // insert into COFFEE_HOUSES values(33002, 'Seattle', 4699, 3109, 7808) + rs.moveToInsertRow(); + rs.updateInt(1, 33002); + rs.updateString(2, "Seattle"); + rs.updateInt(3, 4699); + rs.updateInt(4, 3109); + rs.updateInt(5, 7808); + rs.insertRow(); + // insert into COFFEE_HOUSES values(10040, 'SF', 5386, 2841, 8227) + rs.moveToInsertRow(); + rs.updateInt(1, 10040); + rs.updateString(2, "SF"); + rs.updateInt(3, 5386); + rs.updateInt(4, 2841); + rs.updateInt(5, 8227); + rs.insertRow(); + // insert into COFFEE_HOUSES values(32001, 'Portland', 3147, 3579, 6726) + rs.moveToInsertRow(); + rs.updateInt(1, 32001); + rs.updateString(2, "Portland"); + rs.updateInt(3, 3147); + rs.updateInt(4, 3579); + rs.updateInt(5, 6726); + rs.insertRow(); + // insert into COFFEE_HOUSES values(10042, 'SF', 2863, 1874, 4710) + rs.moveToInsertRow(); + rs.updateInt(1, 10042); + rs.updateString(2, "SF"); + rs.updateInt(3, 2863); + rs.updateInt(4, 1874); + rs.updateInt(5, 4710); + rs.insertRow(); + // insert into COFFEE_HOUSES values(10024, 'Sacramento', 1987, 2341, 4328) + rs.moveToInsertRow(); + rs.updateInt(1, 10024); + rs.updateString(2, "Sacramento"); + rs.updateInt(3, 1987); + rs.updateInt(4, 2341); + rs.updateInt(5, 4328); + rs.insertRow(); + // insert into COFFEE_HOUSES values(10039, 'Carmel', 2691, 1121, 3812) + rs.moveToInsertRow(); + rs.updateInt(1, 10039); + rs.updateString(2, "Carmel"); + rs.updateInt(3, 2691); + rs.updateInt(4, 1121); + rs.updateInt(5, 3812); + rs.insertRow(); + // insert into COFFEE_HOUSES values(10041, 'LA', 1533, 1007, 2540) + rs.moveToInsertRow(); + rs.updateInt(1, 10041); + rs.updateString(2, "LA"); + rs.updateInt(3, 1533); + rs.updateInt(4, 1007); + rs.updateInt(5, 2540); + rs.insertRow(); + // insert into COFFEE_HOUSES values(33005, 'Olympia', 2733, 1550, 1550) + rs.moveToInsertRow(); + rs.updateInt(1, 33005); + rs.updateString(2, "Olympia"); + rs.updateInt(3, 2733); + rs.updateInt(4, 1550); + rs.updateInt(5, 1550); + rs.insertRow(); + // insert into COFFEE_HOUSES values(33010, 'Seattle', 3210, 2177, 5387) + rs.moveToInsertRow(); + rs.updateInt(1, 33010); + rs.updateString(2, "Seattle"); + rs.updateInt(3, 3210); + rs.updateInt(4, 2177); + rs.updateInt(5, 5387); + rs.insertRow(); + // insert into COFFEE_HOUSES values(10035, 'SF', 1922, 1056, 2978) + rs.moveToInsertRow(); + rs.updateInt(1, 10035); + rs.updateString(2, "SF"); + rs.updateInt(3, 1922); + rs.updateInt(4, 1056); + rs.updateInt(5, 2978); + rs.insertRow(); + // insert into COFFEE_HOUSES values(10037, 'LA', 2143, 1876, 4019) + rs.moveToInsertRow(); + rs.updateInt(1, 10037); + rs.updateString(2, "LA"); + rs.updateInt(3, 2143); + rs.updateInt(4, 1876); + rs.updateInt(5, 4019); + rs.insertRow(); + // insert into COFFEE_HOUSES values(10034, 'San_Jose', 1234, 1032, 2266) + rs.moveToInsertRow(); + rs.updateInt(1, 10034); + rs.updateString(2, "San Jose"); + rs.updateInt(3, 1234); + rs.updateInt(4, 1032); + rs.updateInt(5, 2266); + rs.insertRow(); + // insert into COFFEE_HOUSES values(32004, 'Eugene', 1356, 1112, 2468) + rs.moveToInsertRow(); + rs.updateInt(1, 32004); + rs.updateString(2, "Eugene"); + rs.updateInt(3, 1356); + rs.updateInt(4, 1112); + rs.updateInt(5, 2468); + rs.insertRow(); + rs.moveToCurrentRow(); + } + + /* + * Initializes the COFFEES metadata + */ + protected void initCoffeesMetaData(CachedRowSet crs) throws SQLException { + RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl(); + crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE); + + /* + * CREATE TABLE COFFEES ( + * COF_ID INTEGER NOT NULL, + * COF_NAME VARCHAR(32) NOT NULL, + * SUP_ID INTEGER NOT NULL, + * PRICE NUMBERIC(10,2 NOT NULL, + * SALES INTEGER NOT NULL, + * TOTAL INTEGER NOT NULL, + * PRIMARY KEY (COF_ID), + * FOREIGN KEY (SUP_ID) REFERENCES SUPPLIERS (SUP_ID) ) + */ + rsmd.setColumnCount(COFFEES_COLUMN_NAMES.length); + for(int i = 1; i <= COFFEES_COLUMN_NAMES.length; i++){ + rsmd.setColumnName(i, COFFEES_COLUMN_NAMES[i-1]); + rsmd.setColumnLabel(i, rsmd.getColumnName(i)); + } + + rsmd.setColumnType(1, Types.INTEGER); + rsmd.setColumnType(2, Types.VARCHAR); + rsmd.setColumnType(3, Types.INTEGER); + rsmd.setColumnType(4, Types.NUMERIC); + rsmd.setPrecision(4, 10); + rsmd.setScale(4, 2); + rsmd.setColumnType(5, Types.INTEGER); + rsmd.setColumnType(6, Types.INTEGER); + crs.setMetaData(rsmd); + crs.setTableName(COFFEES_TABLE); + + } + + /* + * Add rows to COFFEES table + */ + protected void createCoffeesRows(RowSet rs) throws SQLException { + + // insert into COFFEES values(1, 'Colombian', 101, 7.99, 0, 0) + rs.moveToInsertRow(); + rs.updateInt(1, 1); + rs.updateString(2, "Colombian"); + rs.updateInt(3, 101); + rs.updateBigDecimal(4, BigDecimal.valueOf(7.99)); + rs.updateInt(5, 0); + rs.updateInt(6, 0); + rs.insertRow(); + // insert into COFFEES values(2, 'French_Roast', 49, 8.99, 0, 0) + rs.moveToInsertRow(); + rs.updateInt(1, 2); + rs.updateString(2, "French_Roast"); + rs.updateInt(3, 49); + rs.updateBigDecimal(4, BigDecimal.valueOf(8.99)); + rs.updateInt(5, 0); + rs.updateInt(6, 0); + rs.insertRow(); + // insert into COFFEES values(3, 'Espresso', 150, 9.99, 0, 0) + rs.moveToInsertRow(); + rs.updateInt(1, 3); + rs.updateString(2, "Espresso"); + rs.updateInt(3, 150); + rs.updateBigDecimal(4, BigDecimal.valueOf(9.99)); + rs.updateInt(5, 0); + rs.updateInt(6, 0); + rs.insertRow(); + // insert into COFFEES values(4, 'Colombian_Decaf', 101, 8.99, 0, 0) + rs.moveToInsertRow(); + rs.updateInt(1, 4); + rs.updateString(2, "Colombian_Decaf"); + rs.updateInt(3, 101); + rs.updateBigDecimal(4, BigDecimal.valueOf(8.99)); + rs.updateInt(5, 0); + rs.updateInt(6, 0); + rs.insertRow(); + // insert into COFFEES values(5, 'French_Roast_Decaf', 049, 9.99, 0, 0) + rs.moveToInsertRow(); + rs.updateInt(1, 5); + rs.updateString(2, "French_Roast_Decaf"); + rs.updateInt(3, 49); + rs.updateBigDecimal(4, BigDecimal.valueOf(9.99)); + rs.updateInt(5, 0); + rs.updateInt(6, 0); + rs.insertRow(); + + } + + + /* + * Utility method to return the Primary Keys for a RowSet. The Primary + * keys are assumed to be in the first column of the RowSet + */ + protected Object[] getPrimaryKeys(ResultSet rs) throws SQLException { + List result = new ArrayList<>(); + if (rs == null) { + return null; + } + rs.beforeFirst(); + while (rs.next()) { + result.add(rs.getInt(1)); + } + return result.toArray(); + } + + /* + * Utility method to display the RowSet and will return the row count + * it found + */ + protected int displayResults(ResultSet rs) throws SQLException { + int rows = 0; + ResultSetMetaData rsmd = rs.getMetaData(); + int cols = rsmd.getColumnCount(); + if (rs != null) { + rs.beforeFirst(); + while (rs.next()) { + rows++; + + for (int i = 0; i < cols; i++) { + System.out.print(rs.getString(i + 1) + " "); + } + System.out.println(); + } + } + + return rows; + } + + + // Insert common tests here + + /* + * Validate that getCommand() returns null by default + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0000(RowSet rs) { + assertNull(rs.getCommand()); + } + + /* + * Validate that getCommand() returns command specified to setCommand + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0001(RowSet rs) throws Exception { + rs.setCommand(query); + assertTrue(rs.getCommand().equals(query)); + } + + + /* + * Validate that getCurrency() returns the correct default value + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0002(RowSet rs) throws Exception { + assertTrue(rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE); + } + + /* + * Validate that getCurrency() returns the correct value + * after a call to setConcurrency()) + */ + @Test(dataProvider = "rowSetConcurrencyTypes") + public void commonRowSetTest0003(RowSet rs, int concurType) throws Exception { + rs.setConcurrency(concurType); + assertTrue(rs.getConcurrency() == concurType); + } + + /* + * Validate that getCurrency() throws a SQLException for an invalid value + */ + @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class) + public void commonRowSetTest0004(RowSet rs) throws Exception { + rs.setConcurrency(ResultSet.CLOSE_CURSORS_AT_COMMIT); + } + + /* + * Validate that getDataSourceName() returns null by default + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0005(RowSet rs) throws Exception { + assertTrue(rs.getDataSourceName() == null); + } + + /* + * Validate that getDataSourceName() returns the value specified + * by setDataSourceName() and getUrl() returns null + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0006(RowSet rs) throws Exception { + rs.setUrl(url); + rs.setDataSourceName(dsName); + assertTrue(rs.getDataSourceName().equals(dsName)); + assertNull(rs.getUrl()); + } + + /* + * Validate that setDataSourceName() throws a SQLException for an empty + * String specified for the data source name + */ + @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class) + public void commonRowSetTest0007(RowSet rs) throws Exception { + String dsname = ""; + rs.setDataSourceName(dsname); + } + + /* + * Validate that getEscapeProcessing() returns false by default + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0008(RowSet rs) throws Exception { + assertTrue(rs.getEscapeProcessing()); + } + + /* + * Validate that getEscapeProcessing() returns value set by + * setEscapeProcessing() + */ + @Test(dataProvider = "rowSetTrueFalse") + public void commonRowSetTest0009(RowSet rs, boolean val) throws Exception { + rs.setEscapeProcessing(val); + assertTrue(rs.getEscapeProcessing() == val); + } + + /* + * Validate that getFetchDirection() returns the correct default value + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0010(RowSet rs) throws Exception { + assertTrue(rs.getFetchDirection() == ResultSet.FETCH_FORWARD); + } + + /* + * Validate that getFetchDirection() returns the value set by + * setFetchDirection() + */ + @Test(dataProvider = "rowSetFetchDirection") + public void commonRowSetTest0011(RowSet rs, int direction) throws Exception { + rs.setFetchDirection(direction); + assertTrue(rs.getFetchDirection() == direction); + } + + /* + * Validate that setFetchSize() throws a SQLException for an invalid value + */ + @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class) + public void commonRowSetTest0013(RowSet rs) throws Exception { + rs.setFetchSize(-1); + } + + /* + * Validate that setFetchSize() throws a SQLException for a + * value greater than getMaxRows() + */ + @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class) + public void commonRowSetTest0014(RowSet rs) throws Exception { + rs.setMaxRows(5); + rs.setFetchSize(rs.getMaxRows() + 1); + } + + /* + * Validate that getFetchSize() returns the correct value after + * setFetchSize() has been called + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0015(RowSet rs) throws Exception { + int maxRows = 150; + rs.setFetchSize(0); + assertTrue(rs.getFetchSize() == 0); + rs.setFetchSize(100); + assertTrue(rs.getFetchSize() == 100); + rs.setMaxRows(maxRows); + rs.setFetchSize(maxRows); + assertTrue(rs.getFetchSize() == maxRows); + } + + /* + * Validate that setMaxFieldSize() throws a SQLException for an invalid value + */ + @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class) + public void commonRowSetTest0016(RowSet rs) throws Exception { + rs.setMaxFieldSize(-1); + } + + /* + * Validate that getMaxFieldSize() returns the value set by + * setMaxFieldSize() + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0017(RowSet rs) throws Exception { + rs.setMaxFieldSize(0); + assertTrue(rs.getMaxFieldSize() == 0); + rs.setMaxFieldSize(100); + assertTrue(rs.getMaxFieldSize() == 100); + rs.setMaxFieldSize(50); + assertTrue(rs.getMaxFieldSize() == 50); + } + + /* + * Validate that isReadOnly() returns value set by + * setReadOnly() + */ + @Test(dataProvider = "rowSetTrueFalse") + public void commonRowSetTest0018(RowSet rs, boolean val) throws Exception { + rs.setReadOnly(val); + assertTrue(rs.isReadOnly() == val); + } + + /* + * Validate that getTransactionIsolation() returns value set by + * setTransactionIsolation() + */ + @Test(dataProvider = "rowSetIsolationTypes") + public void commonRowSetTest0019(RowSet rs, int val) throws Exception { + rs.setTransactionIsolation(val); + assertTrue(rs.getTransactionIsolation() == val); + } + + /* + * Validate that getType() returns value set by setType() + */ + @Test(dataProvider = "rowSetScrollTypes") + public void commonRowSetTest0020(RowSet rs, int val) throws Exception { + rs.setType(val); + assertTrue(rs.getType() == val); + } + + /* + * Validate that getEscapeProcessing() returns value set by + * setEscapeProcessing() + */ + @Test(dataProvider = "rowSetTrueFalse") + public void commonRowSetTest0021(BaseRowSet rs, boolean val) throws Exception { + rs.setShowDeleted(val); + assertTrue(rs.getShowDeleted() == val); + } + + /* + * Validate that getTypeMap() returns same value set by + * setTypeMap() + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0022(RowSet rs) throws Exception { + Map> map = new HashMap<>(); + map.put("SUPERHERO", Class.forName("util.SuperHero")); + rs.setTypeMap(map); + assertTrue(rs.getTypeMap().equals(map)); + } + + /* + * Validate that getUsername() returns same value set by + * setUsername() + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0023(RowSet rs) throws Exception { + rs.setUsername(user); + assertTrue(rs.getUsername().equals(user)); + } + + /* + * Validate that getPassword() returns same password set by + * setPassword() + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0024(RowSet rs) throws Exception { + rs.setPassword(password); + assertTrue(rs.getPassword().equals(password)); + } + + /* + * Validate that getQueryTimeout() returns same value set by + * setQueryTimeout() and that 0 is a valid timeout value + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0025(RowSet rs) throws Exception { + int timeout = 0; + rs.setQueryTimeout(timeout); + assertTrue(rs.getQueryTimeout() == timeout); + } + + /* + * Validate that getQueryTimeout() returns same value set by + * setQueryTimeout() and that 0 is a valid timeout value + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0026(RowSet rs) throws Exception { + int timeout = 10000; + rs.setQueryTimeout(timeout); + assertTrue(rs.getQueryTimeout() == timeout); + } + + /* + * Validate that setQueryTimeout() throws a SQLException for a timeout + * value < 0 + */ + @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class) + public void commonRowSetTest0027(RowSet rs) throws Exception { + rs.setQueryTimeout(-1); + } + + + /* + * Validate addRowSetListener does not throw an Exception when null is + * passed as the parameter + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0028(RowSet rs) throws Exception { + rs.addRowSetListener(null); + } + + /* + * Validate removeRowSetListener does not throw an Exception when null is + * passed as the parameter + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0029(RowSet rs) throws Exception { + rs.removeRowSetListener(null); + } + + /* + * Set two parameters and then validate clearParameters() will clear them + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0030(BaseRowSet rs) throws Exception { + rs.setInt(1, 1); + rs.setString(2, query); + assertTrue(rs.getParams().length == 2); + rs.clearParameters(); + assertTrue(rs.getParams().length == 0); + } + + /* + * Validate that getURL() returns same value set by + * setURL() + */ + @Test(dataProvider = "rowSetType") + public void commonRowSetTest0031(RowSet rs) throws Exception { + rs.setUrl(url); + assertTrue(rs.getUrl().equals(url)); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0100(RowSet rs) throws Exception { + InputStream is = null; + rs.setAsciiStream(1, is); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0101(RowSet rs) throws Exception { + InputStream is = null; + rs.setAsciiStream("one", is); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0102(RowSet rs) throws Exception { + InputStream is = null; + rs.setAsciiStream("one", is, query.length()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0103(RowSet rs) throws Exception { + InputStream is = null; + rs.setBinaryStream(1, is); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0104(RowSet rs) throws Exception { + InputStream is = null; + rs.setBinaryStream("one", is); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0105(RowSet rs) throws Exception { + InputStream is = null; + rs.setBinaryStream("one", is, query.length()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0106(RowSet rs) throws Exception { + rs.setBigDecimal("one", BigDecimal.ONE); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0107(RowSet rs) throws Exception { + InputStream is = null; + rs.setBlob(1, is); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0108(RowSet rs) throws Exception { + InputStream is = null; + rs.setBlob("one", is); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0109(RowSet rs) throws Exception { + InputStream is = null; + rs.setBlob("one", is, query.length()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0110(RowSet rs) throws Exception { + rs.setBlob("one", new StubBlob()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0111(RowSet rs) throws Exception { + rs.setBoolean("one", true); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0112(RowSet rs) throws Exception { + byte b = 1; + rs.setByte("one", b); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0113(RowSet rs) throws Exception { + byte b = 1; + rs.setBytes("one", new byte[10]); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0114(RowSet rs) throws Exception { + Reader rdr = null; + rs.setCharacterStream("one", rdr, query.length()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0115(RowSet rs) throws Exception { + Reader rdr = null; + rs.setCharacterStream("one", rdr); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0116(RowSet rs) throws Exception { + Reader rdr = null; + rs.setCharacterStream(1, rdr); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0117(RowSet rs) throws Exception { + Reader rdr = null; + rs.setClob(1, rdr); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0118(RowSet rs) throws Exception { + Reader rdr = null; + rs.setClob("one", rdr); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0119(RowSet rs) throws Exception { + Reader rdr = null; + rs.setClob("one", rdr, query.length()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0120(RowSet rs) throws Exception { + rs.setClob("one", new StubClob()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0121(RowSet rs) throws Exception { + rs.setDate("one", Date.valueOf(LocalDate.now())); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0122(RowSet rs) throws Exception { + rs.setDate("one", Date.valueOf(LocalDate.now()), + Calendar.getInstance()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0123(RowSet rs) throws Exception { + rs.setTime("one", Time.valueOf(LocalTime.now())); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0124(RowSet rs) throws Exception { + rs.setTime("one", Time.valueOf(LocalTime.now()), + Calendar.getInstance()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0125(RowSet rs) throws Exception { + rs.setTimestamp("one", Timestamp.valueOf(LocalDateTime.now())); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0126(RowSet rs) throws Exception { + rs.setTimestamp("one", Timestamp.valueOf(LocalDateTime.now()), + Calendar.getInstance()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0127(RowSet rs) throws Exception { + rs.setDouble("one", 2.0d); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0128(RowSet rs) throws Exception { + rs.setFloat("one", 2.0f); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0129(RowSet rs) throws Exception { + rs.setInt("one", 21); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0130(RowSet rs) throws Exception { + rs.setLong("one", 21l); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0131(RowSet rs) throws Exception { + Reader rdr = null; + rs.setNCharacterStream("one", rdr, query.length()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0132(RowSet rs) throws Exception { + Reader rdr = null; + rs.setNCharacterStream("one", rdr); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0133(RowSet rs) throws Exception { + Reader rdr = null; + rs.setNCharacterStream(1, rdr); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0134(RowSet rs) throws Exception { + Reader rdr = null; + rs.setNCharacterStream(1, rdr, query.length()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0135(RowSet rs) throws Exception { + Reader rdr = null; + rs.setClob("one", rdr); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0136(RowSet rs) throws Exception { + Reader rdr = null; + rs.setClob("one", rdr, query.length()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0137(RowSet rs) throws Exception { + rs.setNClob("one", new StubNClob()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0138(RowSet rs) throws Exception { + Reader rdr = null; + rs.setNClob(1, rdr); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0139(RowSet rs) throws Exception { + Reader rdr = null; + rs.setNClob(1, rdr, query.length()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0140(RowSet rs) throws Exception { + rs.setNClob(1, new StubNClob()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0141(RowSet rs) throws Exception { + rs.setNString(1, query); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0142(RowSet rs) throws Exception { + rs.setNull("one", Types.INTEGER); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0143(RowSet rs) throws Exception { + rs.setNull("one", Types.INTEGER, "my.type"); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0144(RowSet rs) throws Exception { + rs.setObject("one", query, Types.VARCHAR); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0145(RowSet rs) throws Exception { + rs.setObject("one", query, Types.VARCHAR, 0); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0146(RowSet rs) throws Exception { + rs.setObject("one", query); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0147(RowSet rs) throws Exception { + RowId aRowid = null; + rs.setRowId("one", aRowid); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0148(RowSet rs) throws Exception { + rs.setSQLXML("one", new StubSQLXML()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0149(RowSet rs) throws Exception { + rs.setSQLXML(1, new StubSQLXML()); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0150(RowSet rs) throws Exception { + rs.setNString(1, query); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0151(RowSet rs) throws Exception { + rs.setNString("one", query); + } + + /* + * This method is currently not implemented in BaseRowSet and will + * throw a SQLFeatureNotSupportedException + */ + @Test(dataProvider = "rowSetType", + expectedExceptions = SQLFeatureNotSupportedException.class) + public void commonRowSetTest0152(RowSet rs) throws Exception { + short val = 21; + rs.setShort("one", val); + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/RowSetFactoryTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/RowSetFactoryTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,119 @@ +/* + * 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.rowset; + +import java.sql.SQLException; +import javax.sql.rowset.RowSetFactory; +import javax.sql.rowset.RowSetProvider; +import static org.testng.Assert.*; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import util.BaseTest; + +public class RowSetFactoryTests extends BaseTest { + + // RowSet implementations that we are testing for + private final String DEFAULT_CACHEDROWSET_CLASSNAME = "com.sun.rowset.CachedRowSetImpl"; + private final String DEFAULT_FILTEREDROWSET_CLASSNAME = "com.sun.rowset.FileteredRowSetImpl"; + private final String DEFAULT_JDBCROWSET_CLASSNAME = "com.sun.rowset.JdbcRowSetImpl"; + private final String DEFAULT_JOINROWSET_CLASSNAME = "com.sun.rowset.JoinRowSetImpl"; + private final String DEFAULT_WEBROWSET_CLASSNAME = "com.sun.rowset.WebRowSetImpl"; + private final String STUB_FACTORY_CLASSNAME = "util.StubRowSetFactory"; + private final String STUB_CACHEDROWSET_CLASSNAME = "util.StubCachedRowSetImpl"; + private final String STUB_FILTEREDROWSET_CLASSNAME = "util.StubFilteredRowSetImpl"; + private final String STUB_JDBCROWSET_CLASSNAME = "util.StubJdbcRowSetImpl"; + private final String STUB_JOINROWSET_CLASSNAME = "util.StubJoinRowSetImpl"; + private final String STUB_WEBROWSET_CLASSNAME = "util.StubWebRowSetImpl"; + + + /* + * Validate that the RowSetFactory returned by RowSetProvider.newFactory() + * returns the correct RowSet implementations + */ + @Test(dataProvider = "RowSetValues", enabled = true) + public void test(RowSetFactory rsf, String impl) throws SQLException { + validateRowSetImpl(rsf, impl); + } + + /* + * Utility Method to validate the RowsetFactory returns the correct + * RowSet implementation + */ + private void validateRowSetImpl(RowSetFactory rsf, String implName) + throws SQLException { + assertNotNull(rsf, "RowSetFactory should not be null"); + switch (implName) { + case DEFAULT_CACHEDROWSET_CLASSNAME: + assertTrue(rsf.createCachedRowSet() instanceof com.sun.rowset.CachedRowSetImpl); + break; + case DEFAULT_FILTEREDROWSET_CLASSNAME: + assertTrue(rsf.createFilteredRowSet() instanceof com.sun.rowset.FilteredRowSetImpl); + break; + case DEFAULT_JDBCROWSET_CLASSNAME: + assertTrue(rsf.createJdbcRowSet() instanceof com.sun.rowset.JdbcRowSetImpl); + break; + case DEFAULT_JOINROWSET_CLASSNAME: + assertTrue(rsf.createJoinRowSet() instanceof com.sun.rowset.JoinRowSetImpl); + break; + case DEFAULT_WEBROWSET_CLASSNAME: + assertTrue(rsf.createWebRowSet() instanceof com.sun.rowset.WebRowSetImpl); + break; + case STUB_CACHEDROWSET_CLASSNAME: + assertTrue(rsf.createCachedRowSet() instanceof util.StubCachedRowSetImpl); + break; + case STUB_FILTEREDROWSET_CLASSNAME: + assertTrue(rsf.createFilteredRowSet() instanceof util.StubFilteredRowSetImpl); + break; + case STUB_JDBCROWSET_CLASSNAME: + assertTrue(rsf.createJdbcRowSet() instanceof util.StubJdbcRowSetImpl); + break; + case STUB_WEBROWSET_CLASSNAME: + assertTrue(rsf.createWebRowSet() instanceof util.StubWebRowSetImpl); + break; + } + + } + + /* + * DataProvider used to provide the RowSetFactory and the RowSet + * implementation that should be returned + */ + @DataProvider(name = "RowSetValues") + private Object[][] RowSetValues() throws SQLException { + RowSetFactory rsf = RowSetProvider.newFactory(); + RowSetFactory rsf1 = RowSetProvider.newFactory(STUB_FACTORY_CLASSNAME, null); + return new Object[][]{ + {rsf, DEFAULT_CACHEDROWSET_CLASSNAME}, + {rsf, DEFAULT_FILTEREDROWSET_CLASSNAME}, + {rsf, DEFAULT_JDBCROWSET_CLASSNAME}, + {rsf, DEFAULT_JOINROWSET_CLASSNAME}, + {rsf, DEFAULT_WEBROWSET_CLASSNAME}, + {rsf1, STUB_CACHEDROWSET_CLASSNAME}, + {rsf1, STUB_FILTEREDROWSET_CLASSNAME}, + {rsf1, STUB_JDBCROWSET_CLASSNAME}, + {rsf1, STUB_JOINROWSET_CLASSNAME}, + {rsf1, STUB_WEBROWSET_CLASSNAME} + + }; + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/RowSetMetaDataTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/RowSetMetaDataTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,555 @@ +/* + * 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.rowset; + +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.sql.Types; +import javax.sql.RowSetMetaData; +import javax.sql.rowset.RowSetMetaDataImpl; +import static org.testng.Assert.*; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import util.BaseTest; + +public class RowSetMetaDataTests extends BaseTest { + + // Max columns used in the tests + private final int MAX_COLUMNS = 5; + // Instance to be used within the tests + private RowSetMetaDataImpl rsmd; + + @BeforeMethod + public void setUpMethod() throws Exception { + rsmd = new RowSetMetaDataImpl(); + rsmd.setColumnCount(MAX_COLUMNS); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test(Integer col) throws Exception { + rsmd.getCatalogName(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test01(Integer col) throws Exception { + rsmd.getColumnClassName(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test02(Integer col) throws Exception { + rsmd.getColumnDisplaySize(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test03(Integer col) throws Exception { + rsmd.getColumnLabel(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test04(Integer col) throws Exception { + rsmd.getColumnName(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test05(Integer col) throws Exception { + rsmd.getColumnType(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test06(Integer col) throws Exception { + rsmd.getColumnTypeName(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test07(Integer col) throws Exception { + rsmd.getPrecision(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test08(Integer col) throws Exception { + rsmd.getScale(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test09(Integer col) throws Exception { + rsmd.getSchemaName(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test10(Integer col) throws Exception { + rsmd.getTableName(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test11(Integer col) throws Exception { + rsmd.isAutoIncrement(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test12(Integer col) throws Exception { + rsmd.isCaseSensitive(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test13(Integer col) throws Exception { + rsmd.isCurrency(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test14(Integer col) throws Exception { + rsmd.isDefinitelyWritable(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test15(Integer col) throws Exception { + rsmd.isNullable(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test16(Integer col) throws Exception { + rsmd.isReadOnly(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test17(Integer col) throws Exception { + rsmd.isSearchable(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test18(Integer col) throws Exception { + rsmd.isSigned(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test19(Integer col) throws Exception { + rsmd.isWritable(col); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test20(Integer col) throws Exception { + rsmd.setAutoIncrement(col, true); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test21(Integer col) throws Exception { + rsmd.setCaseSensitive(col, true); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test22(Integer col) throws Exception { + rsmd.setCatalogName(col, null); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test23(Integer col) throws Exception { + rsmd.setColumnDisplaySize(col, 5); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test24(Integer col) throws Exception { + rsmd.setColumnLabel(col, "label"); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test25(Integer col) throws Exception { + rsmd.setColumnName(col, "F1"); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test26(Integer col) throws Exception { + rsmd.setColumnType(col, Types.CHAR); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test27(Integer col) throws Exception { + rsmd.setColumnTypeName(col, "F1"); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test28(Integer col) throws Exception { + rsmd.setCurrency(col, true); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test29(Integer col) throws Exception { + rsmd.setNullable(col, ResultSetMetaData.columnNoNulls); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test30(Integer col) throws Exception { + rsmd.setPrecision(col, 2); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test31(Integer col) throws Exception { + rsmd.setScale(col, 2); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test32(Integer col) throws Exception { + rsmd.setSchemaName(col, "Gotham"); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test33(Integer col) throws Exception { + rsmd.setSearchable(col, false); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test34(Integer col) throws Exception { + rsmd.setSigned(col, false); + } + + /* + * Validate a SQLException is thrown for an invalid column index + */ + @Test(dataProvider = "invalidColumnRanges", + expectedExceptions = SQLException.class) + public void test35(Integer col) throws Exception { + rsmd.setTableName(col, "SUPERHEROS"); + } + + /* + * Validate that the correct class name is returned for the column + * Note: Once setColumnClassName is added to RowSetMetaData, this + * method will need to change. + */ + @Test(dataProvider = "columnClassNames") + public void test36(Integer type, String name) throws Exception { + rsmd.setColumnType(1, type); + assertTrue(rsmd.getColumnClassName(1).equals(name)); + } + + /* + * Validate that all of the methods are accessible and the correct value + * is returned for each column + */ + @Test(dataProvider = "columnRanges") + public void test37(Integer col) throws Exception { + rsmd.setAutoIncrement(col, true); + assertTrue(rsmd.isAutoIncrement(col)); + rsmd.setCaseSensitive(col, true); + assertTrue(rsmd.isCaseSensitive(col)); + rsmd.setCatalogName(col, "Gotham"); + assertTrue(rsmd.getCatalogName(col).equals("Gotham")); + rsmd.setColumnDisplaySize(col, 20); + assertTrue(rsmd.getColumnDisplaySize(col) == 20); + rsmd.setColumnLabel(col, "F1"); + assertTrue(rsmd.getColumnLabel(col).equals("F1")); + rsmd.setColumnName(col, "F1"); + assertTrue(rsmd.getColumnName(col).equals("F1")); + rsmd.setColumnType(col, Types.INTEGER); + assertTrue(rsmd.getColumnType(col) == Types.INTEGER); + assertTrue(rsmd.getColumnClassName(col).equals(Integer.class.getName())); + rsmd.setColumnTypeName(col, "INTEGER"); + assertTrue(rsmd.getColumnTypeName(col).equals("INTEGER")); + rsmd.setCurrency(col, true); + assertTrue(rsmd.isCurrency(col)); + rsmd.setNullable(col, ResultSetMetaData.columnNoNulls); + assertTrue(rsmd.isNullable(col) == ResultSetMetaData.columnNoNulls); + rsmd.setPrecision(col, 2); + assertTrue(rsmd.getPrecision(col) == 2); + rsmd.setScale(col, 2); + assertTrue(rsmd.getScale(col) == 2); + rsmd.setSchemaName(col, "GOTHAM"); + assertTrue(rsmd.getSchemaName(col).equals("GOTHAM")); + rsmd.setSearchable(col, false); + assertFalse(rsmd.isSearchable(col)); + rsmd.setSigned(col, false); + assertFalse(rsmd.isSigned(col)); + rsmd.setTableName(col, "SUPERHEROS"); + assertTrue(rsmd.getTableName(col).equals("SUPERHEROS")); + rsmd.isReadOnly(col); + rsmd.isDefinitelyWritable(col); + rsmd.isWritable(col); + + } + + /* + * Validate that the proper values are accepted by setNullable + */ + @Test(dataProvider = "validSetNullableValues") + public void test38(Integer val) throws Exception { + rsmd.setNullable(1, val); + } + + /* + * Validate that the correct type is returned for the column + */ + @Test(dataProvider = "jdbcTypes") + public void test39(Integer type) throws Exception { + rsmd.setColumnType(1, type); + assertTrue(type == rsmd.getColumnType(1)); + } + + /* + * Validate that the correct value is returned from the isXXX methods + */ + @Test(dataProvider = "trueFalse") + public void test40(Boolean b) throws Exception { + rsmd.setAutoIncrement(1, b); + rsmd.setCaseSensitive(1, b); + rsmd.setCurrency(1, b); + rsmd.setSearchable(1, b); + rsmd.setSigned(1, b); + assertTrue(rsmd.isAutoIncrement(1) == b); + assertTrue(rsmd.isCaseSensitive(1) == b); + assertTrue(rsmd.isCurrency(1) == b); + assertTrue(rsmd.isSearchable(1) == b); + assertTrue(rsmd.isSigned(1) == b); + } + + /* + * Validate isWrapperFor and unwrap work correctly + */ + @SuppressWarnings("unchecked") + @Test + public void test99() throws Exception { + RowSetMetaData rsmd1 = rsmd; + ResultSetMetaData rsmd2 = rsmd; + Class clzz = rsmd.getClass(); + assertTrue(rsmd1.isWrapperFor(clzz)); + assertTrue(rsmd2.isWrapperFor(clzz)); + RowSetMetaDataImpl rsmdi = (RowSetMetaDataImpl) rsmd2.unwrap(clzz); + + // False should be returned + assertFalse(rsmd1.isWrapperFor(this.getClass())); + assertFalse(rsmd2.isWrapperFor(this.getClass())); + } + + /* + * 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 = "validSetNullableValues") + private Object[][] validSetNullableValues() { + return new Object[][]{ + {ResultSetMetaData.columnNoNulls}, + {ResultSetMetaData.columnNullable}, + {ResultSetMetaData.columnNullableUnknown} + }; + } + + /* + * DataProvider used to provide column indexes that are out of range so that + * SQLException is thrown + */ + @DataProvider(name = "invalidColumnRanges") + private Object[][] invalidColumnRanges() { + return new Object[][]{ + {-1}, + {0}, + {MAX_COLUMNS + 1} + }; + } + + /* + * DataProvider used to provide the valid column ranges for the + * RowSetMetaDataImpl object + */ + @DataProvider(name = "columnRanges") + private Object[][] columnRanges() { + Object[][] o = new Object[MAX_COLUMNS][1]; + for (int i = 1; i <= MAX_COLUMNS; i++) { + o[i - 1][0] = i; + } + return o; + } + + /* + * DataProvider used to specify the value to set via setColumnType and + * the expected value to be returned from getColumnClassName + */ + @DataProvider(name = "columnClassNames") + private Object[][] columnClassNames() { + return new Object[][]{ + {Types.CHAR, "java.lang.String"}, + {Types.NCHAR, "java.lang.String"}, + {Types.VARCHAR, "java.lang.String"}, + {Types.NVARCHAR, "java.lang.String"}, + {Types.LONGVARCHAR, "java.lang.String"}, + {Types.LONGNVARCHAR, "java.lang.String"}, + {Types.NUMERIC, "java.math.BigDecimal"}, + {Types.DECIMAL, "java.math.BigDecimal"}, + {Types.BIT, "java.lang.Boolean"}, + {Types.TINYINT, "java.lang.Byte"}, + {Types.SMALLINT, "java.lang.Short"}, + {Types.INTEGER, "java.lang.Integer"}, + {Types.FLOAT, "java.lang.Double"}, + {Types.DOUBLE, "java.lang.Double"}, + {Types.BINARY, "byte[]"}, + {Types.VARBINARY, "byte[]"}, + {Types.LONGVARBINARY, "byte[]"}, + {Types.DATE, "java.sql.Date"}, + {Types.TIME, "java.sql.Time"}, + {Types.TIMESTAMP, "java.sql.Timestamp"}, + {Types.CLOB, "java.sql.Clob"}, + {Types.BLOB, "java.sql.Blob"} + + }; + + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/RowSetProviderTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/RowSetProviderTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,189 @@ +/* + * 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.rowset; + +import com.sun.rowset.RowSetFactoryImpl; +import java.io.File; +import java.net.URL; +import java.net.URLClassLoader; +import java.sql.SQLException; +import javax.sql.rowset.RowSetFactory; +import javax.sql.rowset.RowSetProvider; +import static org.testng.Assert.*; +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import util.BaseTest; +import util.StubRowSetFactory; + +public class RowSetProviderTests extends BaseTest { + + // Default RowSetFactory Implementation + private final String DEFFAULT_FACTORY_CLASSNAME = "com.sun.rowset.RowSetFactoryImpl"; + // Stub RowSetFactory Implementation + private final String STUB_FACTORY_CLASSNAME = "util.StubRowSetFactory"; + // Indicator that the factory implementation does not need to be checked + private final String NO_VALADATE_IMPL = ""; + // Original System property value for javax.sql.rowset.RowSetFactory + private static String origFactoryProperty; + // Original ClassLoader + private static ClassLoader cl; + // Path to the location of the jar files used by the ServiceLoader API + private static String jarPath; + + /* + * Save off the original property value for javax.sql.rowset.RowSetFactory, + * original classloader and define the path to the jars directory + */ + @BeforeClass + public static void setUpClass() throws Exception { + origFactoryProperty = System.getProperty("javax.sql.rowset.RowSetFactory"); + cl = Thread.currentThread().getContextClassLoader(); + jarPath = System.getProperty("test.src", ".") + File.separatorChar + + "jars" + File.separatorChar; + } + + /* + * Install the original javax.sql.rowset.RowSetFactory property value + */ + @AfterClass + public static void tearDownClass() throws Exception { + if (origFactoryProperty != null) { + System.setProperty("javax.sql.rowset.RowSetFactory", + origFactoryProperty); + } + } + + /* + * Clear the javax.sql.rowset.RowSetFactory property value and + * reset the classloader to its original value + */ + @AfterMethod + public void tearDownMethod() throws Exception { + System.clearProperty("javax.sql.rowset.RowSetFactory"); + Thread.currentThread().setContextClassLoader(cl); + } + + /* + * Validate that the correct RowSetFactory is returned by newFactory(). + */ + @Test(dataProvider = "RowSetFactoryValues") + public void test(RowSetFactory rsf, String impl) throws SQLException { + validateProvider(rsf, impl); + } + + /* + * Validate that the default RowSetFactory is returned by newFactory() + * when specified by the javax.sql.rowset.RowSetFactory property. + */ + @Test + public void test01() throws SQLException { + System.setProperty("javax.sql.rowset.RowSetFactory", + DEFFAULT_FACTORY_CLASSNAME); + validateProvider(RowSetProvider.newFactory(), DEFFAULT_FACTORY_CLASSNAME); + } + + /* + * Validate that the correct RowSetFactory is returned by newFactory() + * when specified by the javax.sql.rowset.RowSetFactory property. + */ + @Test(enabled = true) + public void test02() throws SQLException { + System.setProperty("javax.sql.rowset.RowSetFactory", STUB_FACTORY_CLASSNAME); + validateProvider(RowSetProvider.newFactory(), STUB_FACTORY_CLASSNAME); + } + + /* + * Validate that a SQLException is thrown by newFactory() + * when specified RowSetFactory specified by the + * javax.sql.rowset.RowSetFactory property is not valid. + */ + @Test(expectedExceptions = SQLException.class) + public void test03() throws SQLException { + System.setProperty("javax.sql.rowset.RowSetFactory", + "invalid.RowSetFactoryImpl"); + RowSetFactory rsf = RowSetProvider.newFactory(); + } + + /* + * Validate that the correct RowSetFactory is returned by newFactory() + * when specified by the ServiceLoader API. + */ + @Test + public void test04() throws Exception { + File f = new File(jarPath + "goodFactory"); + URLClassLoader loader = new URLClassLoader(new URL[]{ + new URL(f.toURI().toString())}, getClass().getClassLoader()); + Thread.currentThread().setContextClassLoader(loader); + validateProvider(RowSetProvider.newFactory(), STUB_FACTORY_CLASSNAME); + } + + /* + * Validate that a SQLException is thrown by newFactory() if the default + * RowSetFactory specified by the ServiceLoader API is not valid + */ + @Test(expectedExceptions = SQLException.class) + public void test05() throws Exception { + File f = new File(jarPath + "badFactory"); + URLClassLoader loader = new URLClassLoader(new URL[]{ + new URL(f.toURI().toString())}, getClass().getClassLoader()); + Thread.currentThread().setContextClassLoader(loader); + RowSetProvider.newFactory(); + } + + /* + * Utility Method to validate that the RowsetFactory returned from + * RowSetProvider.newFactory() is correct + */ + private void validateProvider(RowSetFactory rsf, String implName) { + assertNotNull(rsf, "RowSetFactory should not be null"); + switch (implName) { + case DEFFAULT_FACTORY_CLASSNAME: + assertTrue(rsf instanceof RowSetFactoryImpl); + break; + case STUB_FACTORY_CLASSNAME: + assertTrue(rsf instanceof StubRowSetFactory); + break; + default: + } + } + + /* + * DataProvider used to provide a RowSetFactory and the expected + * RowSetFactory implementation that should be returned + */ + @DataProvider(name = "RowSetFactoryValues") + private Object[][] RowSetFactoryValues() throws SQLException { + RowSetFactory rsf = RowSetProvider.newFactory(); + RowSetFactory rsf1 = RowSetProvider.newFactory(STUB_FACTORY_CLASSNAME, null); + RowSetFactory rsf2 = RowSetProvider.newFactory(DEFFAULT_FACTORY_CLASSNAME, null); + return new Object[][]{ + {rsf, NO_VALADATE_IMPL}, + {rsf, DEFFAULT_FACTORY_CLASSNAME}, + {rsf1, STUB_FACTORY_CLASSNAME}, + {rsf2, DEFFAULT_FACTORY_CLASSNAME} + }; + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/RowSetWarningTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/RowSetWarningTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,238 @@ +/* + * 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.rowset; + +import java.sql.SQLException; +import javax.sql.rowset.RowSetWarning; +import static org.testng.Assert.*; +import org.testng.annotations.Test; +import util.BaseTest; + +public class RowSetWarningTests extends BaseTest { + + private final String[] warnings = {"Warning 1", "cause 1", "Warning 2", + "Warning 3", "cause 2"}; + + /* + * Create RowSetWarning and setting all objects to null + */ + @Test + public void test() { + RowSetWarning e = new RowSetWarning(null, null, errorCode); + assertTrue(e.getMessage() == null && e.getSQLState() == null + && e.getCause() == null && e.getErrorCode() == errorCode); + } + + /* + * Create RowSetWarning with no-arg constructor + */ + @Test + public void test01() { + RowSetWarning ex = new RowSetWarning(); + assertTrue(ex.getMessage() == null + && ex.getSQLState() == null + && ex.getCause() == null + && ex.getErrorCode() == 0); + } + + /* + * Create RowSetWarning with message + */ + @Test + public void test02() { + RowSetWarning ex = new RowSetWarning(reason); + assertTrue(ex.getMessage().equals(reason) + && ex.getSQLState() == null + && ex.getCause() == null + && ex.getErrorCode() == 0); + } + + /* + * Create RowSetWarning with message, and SQLState + */ + @Test + public void test03() { + + RowSetWarning ex = new RowSetWarning(reason, state); + assertTrue(ex.getMessage().equals(reason) + && ex.getSQLState().equals(state) + && ex.getCause() == null + && ex.getErrorCode() == 0); + } + + /* + * Create RowSetWarning with message, SQLState, and error code + */ + @Test + public void test04() { + RowSetWarning ex = new RowSetWarning(reason, state, errorCode); + assertTrue(ex.getMessage().equals(reason) + && ex.getSQLState().equals(state) + && ex.getCause() == null + && ex.getErrorCode() == errorCode); + } + + /* + * Serialize a RowSetWarning and make sure you can read it back properly + */ + @Test + public void test05() throws Exception { + RowSetWarning e = new RowSetWarning(reason, state, errorCode); + e.initCause(t); + RowSetWarning 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 test06() { + RowSetWarning ex = new RowSetWarning("Exception 1"); + ex.initCause(t1); + RowSetWarning ex1 = new RowSetWarning("Exception 2"); + RowSetWarning ex2 = new RowSetWarning("Exception 3"); + ex2.initCause(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 test07() { + RowSetWarning ex = new RowSetWarning("Exception 1"); + ex.initCause(t1); + RowSetWarning ex1 = new RowSetWarning("Exception 2"); + RowSetWarning ex2 = new RowSetWarning("Exception 3"); + ex2.initCause(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 RowSetWarning is correct using + * for-each loop + */ + @Test + public void test08() { + RowSetWarning ex = new RowSetWarning("Warning 1"); + ex.initCause(t1); + RowSetWarning ex1 = new RowSetWarning("Warning 2"); + RowSetWarning ex2 = new RowSetWarning("Warning 3"); + ex2.initCause(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 RowSetWarning is correct using + * traditional while loop + */ + @Test + public void test09() { + RowSetWarning ex = new RowSetWarning("Warning 1"); + ex.initCause(t1); + RowSetWarning ex1 = new RowSetWarning("Warning 2"); + RowSetWarning ex2 = new RowSetWarning("Warning 3"); + ex2.initCause(t2); + ex.setNextWarning(ex1); + ex.setNextWarning(ex2); + int num = 0; + RowSetWarning 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(); + } + } + + /* + * Serialize a RowSetWarning and make sure you can read it back properly + */ + @Test + public void test10() throws Exception { + RowSetWarning e = new RowSetWarning(reason, state, errorCode); + RowSetWarning ex1 = createSerializedException(e); + assertTrue(reason.equals(ex1.getMessage()) + && ex1.getSQLState().equals(state) + && ex1.getCause() == null + && ex1.getErrorCode() == errorCode); + } + + /* + * Serialize a RowSetWarning and make sure you can read it back properly. + * Validate that the ordering of the returned RowSetWarning is correct using + * traditional while loop + */ + @Test + public void test11() throws Exception { + RowSetWarning ex = new RowSetWarning("Warning 1"); + ex.initCause(t1); + RowSetWarning ex1 = new RowSetWarning("Warning 2"); + RowSetWarning ex2 = new RowSetWarning("Warning 3"); + ex2.initCause(t2); + ex.setNextWarning(ex1); + ex.setNextWarning(ex2); + int num = 0; + RowSetWarning sqe = createSerializedException(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(); + } + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/cachedrowset/CachedRowSetTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/cachedrowset/CachedRowSetTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,35 @@ +/* + * 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. + */ +package test.rowset.cachedrowset; + +import java.sql.SQLException; +import javax.sql.rowset.CachedRowSet; + +public class CachedRowSetTests extends CommonCachedRowSetTests { + + @Override + protected CachedRowSet newInstance() throws SQLException { + return rsf.createCachedRowSet(); + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/cachedrowset/CommonCachedRowSetTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/cachedrowset/CommonCachedRowSetTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,1612 @@ +/* + * 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. + */ +package test.rowset.cachedrowset; + +import java.math.BigDecimal; +import java.sql.Array; +import java.sql.Date; +import java.sql.JDBCType; +import java.sql.Ref; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.sql.Time; +import java.sql.Timestamp; +import java.sql.Types; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.Collection; +import javax.sql.RowSet; +import javax.sql.rowset.CachedRowSet; +import javax.sql.rowset.RowSetMetaDataImpl; +import javax.sql.rowset.serial.SerialRef; +import javax.sql.rowset.spi.SyncFactory; +import javax.sql.rowset.spi.SyncProvider; +import javax.sql.rowset.spi.SyncProviderException; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertNull; +import static org.testng.Assert.assertTrue; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.rowset.CommonRowSetTests; +import util.StubArray; +import util.StubRef; +import util.StubSyncProvider; +import util.TestRowSetListener; + +public abstract class CommonCachedRowSetTests extends CommonRowSetTests { + + /* + * DATATYPES Table column names + */ + private final String[] DATATYPES_COLUMN_NAMES = {"AINTEGER", "ACHAR", + "AVARCHAR", "ALONG", "ABOOLEAN", "ASHORT", "ADOUBLE", "ABIGDECIMAL", + "AREAL", "ABYTE", "ADATE", "ATIME", "ATIMESTAMP", "ABYTES", "ARRAY", + "AREF", "AFLOAT"}; + + /* + * Initializes a RowSet containing the DATAYPES data + */ + protected T createDataTypesRowSet() throws SQLException { + T rs = (T) newInstance(); + initDataTypesMetaData((CachedRowSet) rs); + createDataTypesRows(rs); + // Make sure you are not on the insertRow + rs.moveToCurrentRow(); + return rs; + } + + //DataProviders to use for common tests + + /* + * DataProvider that uses a RowSet with the COFFEE_HOUSES Table + */ + @DataProvider(name = "rowsetUsingCoffeeHouses") + protected Object[][] rowsetUsingCoffeeHouses() throws Exception { + RowSet rs = createCoffeeHousesRowSet(); + return new Object[][]{ + {rs} + }; + } + + /* + * DataProvider that uses a RowSet with the COFFEES Table + */ + @DataProvider(name = "rowsetUsingCoffees") + protected Object[][] rowsetUsingCoffees() throws Exception { + RowSet rs = createCoffeesRowSet(); + return new Object[][]{ + {rs} + }; + } + + /* + * DataProvider that uses a RowSet with the DATAYPES Table and + * used to validate the various supported data types + */ + @DataProvider(name = "rowsetUsingDataTypes") + protected Object[][] rowsetUsingDataTypes() throws Exception { + + CachedRowSet rs = createDataTypesRowSet(); + return new Object[][]{ + {rs, JDBCType.INTEGER}, + {rs, JDBCType.CHAR}, + {rs, JDBCType.VARCHAR}, + {rs, JDBCType.BIGINT}, + {rs, JDBCType.BOOLEAN}, + {rs, JDBCType.SMALLINT}, + {rs, JDBCType.DOUBLE}, + {rs, JDBCType.DECIMAL}, + {rs, JDBCType.REAL}, + {rs, JDBCType.TINYINT}, + {rs, JDBCType.DATE}, + {rs, JDBCType.TIME}, + {rs, JDBCType.TIMESTAMP}, + {rs, JDBCType.VARBINARY}, + {rs, JDBCType.ARRAY}, + {rs, JDBCType.REF}, + {rs, JDBCType.FLOAT} + }; + } + + /* + * Initializes the DATAYPES table metadata + */ + protected void initDataTypesMetaData(CachedRowSet crs) throws SQLException { + RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl(); + crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE); + + rsmd.setColumnCount(DATATYPES_COLUMN_NAMES.length); + + for (int i = 1; i <= DATATYPES_COLUMN_NAMES.length; i++) { + rsmd.setColumnName(i, DATATYPES_COLUMN_NAMES[i - 1]); + rsmd.setColumnLabel(i, rsmd.getColumnName(i)); + } + + rsmd.setColumnType(1, Types.INTEGER); + rsmd.setColumnType(2, Types.CHAR); + rsmd.setColumnType(3, Types.VARCHAR); + rsmd.setColumnType(4, Types.BIGINT); + rsmd.setColumnType(5, Types.BOOLEAN); + rsmd.setColumnType(6, Types.SMALLINT); + rsmd.setColumnType(7, Types.DOUBLE); + rsmd.setColumnType(8, Types.DECIMAL); + rsmd.setColumnType(9, Types.REAL); + rsmd.setColumnType(10, Types.TINYINT); + rsmd.setColumnType(11, Types.DATE); + rsmd.setColumnType(12, Types.TIME); + rsmd.setColumnType(13, Types.TIMESTAMP); + rsmd.setColumnType(14, Types.VARBINARY); + rsmd.setColumnType(15, Types.ARRAY); + rsmd.setColumnType(16, Types.REF); + rsmd.setColumnType(17, Types.FLOAT); + crs.setMetaData(rsmd); + + } + + /* + * Add rows to DATAYPES table + */ + protected void createDataTypesRows(RowSet crs) throws SQLException { + + Integer aInteger = 100; + String aChar = "Oswald Cobblepot"; + Long aLong = Long.MAX_VALUE; + Short aShort = Short.MAX_VALUE; + Double aDouble = Double.MAX_VALUE; + BigDecimal aBigDecimal = BigDecimal.ONE; + Boolean aBoolean = false; + Float aFloat = Float.MAX_VALUE; + Byte aByte = Byte.MAX_VALUE; + Date aDate = Date.valueOf(LocalDate.now()); + Time aTime = Time.valueOf(LocalTime.now()); + Timestamp aTimeStamp = Timestamp.valueOf(LocalDateTime.now()); + Array aArray = new StubArray("INTEGER", new Object[1]); + Ref aRef = new SerialRef(new StubRef("INTEGER", query)); + byte[] bytes = new byte[10]; + crs.moveToInsertRow(); + crs.updateInt(1, aInteger); + crs.updateString(2, aChar); + crs.updateString(3, aChar); + crs.updateLong(4, aLong); + crs.updateBoolean(5, aBoolean); + crs.updateShort(6, aShort); + crs.updateDouble(7, aDouble); + crs.updateBigDecimal(8, aBigDecimal); + crs.updateFloat(9, aFloat); + crs.updateByte(10, aByte); + crs.updateDate(11, aDate); + crs.updateTime(12, aTime); + crs.updateTimestamp(13, aTimeStamp); + crs.updateBytes(14, bytes); + crs.updateArray(15, aArray); + crs.updateRef(16, aRef); + crs.updateDouble(17, aDouble); + crs.insertRow(); + crs.moveToCurrentRow(); + + } + + /* + * Dermine if a Row exists in a ResultSet by its primary key + * If the parameter deleteRow is true, delete the row and validate + * the RowSet indicates it is deleted + */ + protected boolean findRowByPrimaryKey(RowSet rs, int id, int idPos, + boolean deleteRow) throws Exception { + boolean foundRow = false; + rs.beforeFirst(); + while (rs.next()) { + if (rs.getInt(idPos) == id) { + foundRow = true; + if (deleteRow) { + rs.deleteRow(); + // validate row is marked as deleted + assertTrue(rs.rowDeleted()); + } + break; + } + } + return foundRow; + } + + /* + * Wrapper method to find if a row exists within a RowSet by its primary key + */ + protected boolean findRowByPrimaryKey(RowSet rs, int id, int idPos) throws Exception { + return findRowByPrimaryKey(rs, id, idPos, false); + } + + /* + * Wrapper method to find if a row exists within a RowSet by its primary key + * and delete it + */ + protected boolean deleteRowByPrimaryKey(RowSet rs, int id, int idPos) throws Exception { + return findRowByPrimaryKey(rs, id, idPos, true); + } + + /* + * Utility method that compares two ResultSetMetaDataImpls for containing + * the same values + */ + private void compareMetaData(ResultSetMetaData rsmd, + ResultSetMetaData rsmd1) throws SQLException { + + assertEquals(rsmd1.getColumnCount(), rsmd.getColumnCount()); + int cols = rsmd.getColumnCount(); + for (int i = 1; i <= cols; i++) { + assertTrue(rsmd1.getCatalogName(i).equals(rsmd.getCatalogName(i))); + assertTrue(rsmd1.getColumnClassName(i).equals(rsmd.getColumnClassName(i))); + assertTrue(rsmd1.getColumnDisplaySize(i) == rsmd.getColumnDisplaySize(i)); + assertTrue(rsmd1.getColumnLabel(i).equals(rsmd.getColumnLabel(i))); + assertTrue(rsmd1.getColumnName(i).equals(rsmd.getColumnName(i))); + assertTrue(rsmd1.getColumnType(i) == rsmd.getColumnType(i)); + assertTrue(rsmd1.getPrecision(i) == rsmd.getPrecision(i)); + assertTrue(rsmd1.getScale(i) == rsmd.getScale(i)); + assertTrue(rsmd1.getSchemaName(i).equals(rsmd.getSchemaName(i))); + assertTrue(rsmd1.getTableName(i).equals(rsmd.getTableName(i))); + assertTrue(rsmd1.isAutoIncrement(i) == rsmd.isAutoIncrement(i)); + assertTrue(rsmd1.isCaseSensitive(i) == rsmd.isCaseSensitive(i)); + assertTrue(rsmd1.isCurrency(i) == rsmd.isCurrency(i)); + assertTrue(rsmd1.isDefinitelyWritable(i) == rsmd.isDefinitelyWritable(i)); + assertTrue(rsmd1.isNullable(i) == rsmd.isNullable(i)); + assertTrue(rsmd1.isReadOnly(i) == rsmd.isReadOnly(i)); + assertTrue(rsmd1.isSearchable(i) == rsmd.isSearchable(i)); + assertTrue(rsmd1.isSigned(i) == rsmd.isSigned(i)); + assertTrue(rsmd1.isWritable(i) == rsmd.isWritable(i)); + + } + } + + /* + * Utility method to compare two rowsets + */ + private void compareRowSets(CachedRowSet crs, CachedRowSet crs1) throws Exception { + + int rows = crs.size(); + assertTrue(rows == crs1.size()); + + ResultSetMetaData rsmd = crs.getMetaData(); + + compareMetaData(rsmd, crs1.getMetaData()); + int cols = rsmd.getColumnCount(); + + for (int row = 1; row <= rows; row++) { + crs.absolute((row)); + crs1.absolute(row); + for (int col = 1; col <= cols; col++) { + compareColumnValue(JDBCType.valueOf(rsmd.getColumnType(col)), + crs, crs1, col); + } + } + + } + + /* + * Utility method to compare two columns + */ + private void compareColumnValue(JDBCType type, ResultSet rs, ResultSet rs1, + int col) throws SQLException { + + switch (type) { + case INTEGER: + assertTrue(rs.getInt(col) == rs1.getInt(col)); + break; + case CHAR: + case VARCHAR: + assertTrue(rs.getString(col).equals(rs1.getString(col))); + break; + case BIGINT: + assertTrue(rs.getLong(col) == rs1.getLong(col)); + break; + case BOOLEAN: + assertTrue(rs.getBoolean(col) == rs1.getBoolean(col)); + break; + case SMALLINT: + assertTrue(rs.getShort(col) == rs1.getShort(col)); + break; + case DOUBLE: + case FLOAT: + assertTrue(rs.getDouble(col) == rs1.getDouble(col)); + break; + case DECIMAL: + assertTrue(rs.getBigDecimal(col).equals(rs1.getBigDecimal(col))); + break; + case REAL: + assertTrue(rs.getFloat(col) == rs1.getFloat(col)); + break; + case TINYINT: + assertTrue(rs.getByte(col) == rs1.getByte(col)); + break; + case DATE: + assertTrue(rs.getDate(col).equals(rs1.getDate(col))); + break; + case TIME: + assertTrue(rs.getTime(col).equals(rs1.getTime(col))); + break; + case TIMESTAMP: + assertTrue(rs.getTimestamp(col).equals(rs1.getTimestamp(col))); + break; + } + } + + /* + * Validate SyncProviderException is thrown when acceptChanges is called + * but there is not a way to make a connection to the datasource + */ + @Test(dataProvider = "rowSetType", expectedExceptions = SyncProviderException.class) + public void commonCachedRowSetTest0000(CachedRowSet rs) throws Exception { + rs.acceptChanges(); + rs.close(); + } + + /* + * Validate SyncProviderException is thrown when acceptChanges is called + * when null is passed as the datasource + */ + @Test(dataProvider = "rowSetType", expectedExceptions = SyncProviderException.class) + public void commonCachedRowSetTest0001(CachedRowSet rs) throws Exception { + rs.acceptChanges(null); + rs.close(); + } + + /* + * Validate that that RIOPtimsticProvider is the default SyncProvider + */ + @Test(dataProvider = "rowSetType") + public void commonCachedRowSetTest0002(CachedRowSet rs) throws SQLException { + SyncProvider sp = rs.getSyncProvider(); + assertTrue(sp instanceof com.sun.rowset.providers.RIOptimisticProvider); + rs.close(); + } + + /* + * Validate that you can specify a SyncProvider + */ + @Test(dataProvider = "rowSetType") + public void commonCachedRowSetTest0003(CachedRowSet rs) throws SQLException { + + // Register a provider and make sure it is avaiable + SyncFactory.registerProvider(stubProvider); + rs.setSyncProvider(stubProvider); + SyncProvider sp = rs.getSyncProvider(); + assertTrue(sp instanceof StubSyncProvider); + SyncFactory.unregisterProvider(stubProvider); + rs.close(); + } + + /* + * Create a RowSetListener and validate that notifyRowSetChanged is called + */ + @Test(dataProvider = "rowSetType") + public void commonCachedRowSetTest0004(CachedRowSet rs) throws Exception { + TestRowSetListener rsl = new TestRowSetListener(); + rs.addRowSetListener(rsl); + rs.release(); + assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED)); + rs.close(); + } + + /* + * Create a RowSetListener and validate that notifyRowSetChanged is called + */ + @Test(dataProvider = "rowSetType") + public void commonCachedRowSetTest0005(CachedRowSet rs) throws Exception { + TestRowSetListener rsl = new TestRowSetListener(); + rs.addRowSetListener(rsl); + rs.restoreOriginal(); + assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED)); + rs.close(); + } + + /* + * Create a RowSetListener and validate that notifyRowChanged is called + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0006(RowSet rs) throws Exception { + TestRowSetListener rsl = new TestRowSetListener(); + rs.addRowSetListener(rsl); + rs.moveToInsertRow(); + rs.updateInt(1, 10024); + rs.updateString(2, "Sacramento"); + rs.updateInt(3, 1987); + rs.updateInt(4, 2341); + rs.updateInt(5, 4328); + rs.insertRow(); + assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED)); + rs.close(); + } + + /* + * Create a multiple RowSetListeners and validate that notifyRowChanged, + * notifiyMoved is called on all listners + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0007(RowSet rs) throws Exception { + TestRowSetListener rsl = new TestRowSetListener(); + TestRowSetListener rsl2 = new TestRowSetListener(); + rs.addRowSetListener(rsl); + rs.addRowSetListener(rsl2); + rs.first(); + rs.updateInt(1, 1961); + rs.updateString(2, "Pittsburgh"); + rs.updateInt(3, 1987); + rs.updateInt(4, 2341); + rs.updateInt(5, 6689); + rs.updateRow(); + assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED + | TestRowSetListener.ROW_CHANGED)); + assertTrue(rsl2.isNotified(TestRowSetListener.CURSOR_MOVED + | TestRowSetListener.ROW_CHANGED)); + rs.close(); + } + + /* + * Create a RowSetListener and validate that notifyRowChanged and + * notifyCursorMoved are called + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0008(CachedRowSet rs) throws Exception { + TestRowSetListener rsl = new TestRowSetListener(); + rs.addRowSetListener(rsl); + + rs.first(); + assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED)); + rs.deleteRow(); + assertTrue( + rsl.isNotified(TestRowSetListener.ROW_CHANGED | TestRowSetListener.CURSOR_MOVED)); + rsl.resetFlag(); + rs.setShowDeleted(true); + rs.undoDelete(); + assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED)); + rs.close(); + } + + /* + * Create a RowSetListener and validate that notifyCursorMoved is called + */ + @Test(dataProvider = "rowSetType") + public void commonCachedRowSetTest0009(RowSet rs) throws Exception { + TestRowSetListener rsl = new TestRowSetListener(); + rs.addRowSetListener(rsl); + rs.beforeFirst(); + assertTrue(rsl.isNotified(TestRowSetListener.CURSOR_MOVED)); + rs.close(); + } + + /* + * Validate that getTableName() returns the proper values + */ + @Test(dataProvider = "rowSetType") + public void commonCachedRowSetTest0010(CachedRowSet rs) throws Exception { + assertNull(rs.getTableName()); + rs.setTableName(COFFEE_HOUSES_TABLE); + assertTrue(rs.getTableName().equals(COFFEE_HOUSES_TABLE)); + rs.close(); + } + + /* + * Validate that getKeyColumns() returns the proper values + */ + @Test(dataProvider = "rowSetType") + public void commonCachedRowSetTest0011(CachedRowSet rs) throws Exception { + int[] pkeys = {1, 3}; + assertNull(rs.getKeyColumns()); + rs.setKeyColumns(pkeys); + assertEquals(rs.getKeyColumns(), pkeys); + rs.close(); + } + + /* + * Validate that setMatchColumn throws a SQLException if the column + * index specified is out of range + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0012(CachedRowSet rs) throws Exception { + rs.setMatchColumn(-1); + rs.close(); + } + + /* + * Validate that setMatchColumn throws a SQLException if the column + * index specified is out of range + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0013(CachedRowSet rs) throws Exception { + int[] cols = {1, -1}; + rs.setMatchColumn(cols); + rs.close(); + } + + /* + * Validate that setMatchColumn throws a SQLException if the column + * index specified is out of range + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0014(CachedRowSet rs) throws Exception { + rs.setMatchColumn((String) null); + rs.close(); + } + + /* + * Validate that setMatchColumn throws a SQLException if the column + * index specified is out of range + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0015(CachedRowSet rs) throws Exception { + String[] cols = {"ID", null}; + rs.setMatchColumn(cols); + } + + /* + * Validate that getMatchColumn returns the same value specified by + * setMatchColumn + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", enabled = false) + public void commonCachedRowSetTest0016(CachedRowSet rs) throws Exception { + int[] expectedCols = {1}; + String[] expectedColNames = {"ID"}; + rs.setMatchColumn(1); + int[] actualCols = rs.getMatchColumnIndexes(); + String[] actualColNames = rs.getMatchColumnNames(); + for (int i = 0; i < actualCols.length; i++) { + System.out.println(actualCols[i]); + } + assertEquals(actualCols, expectedCols); + assertEquals(actualColNames, expectedColNames); + rs.close(); + } + + /* + * Validate that getMatchColumn returns the same value specified by + * setMatchColumn + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", enabled = false) + public void commonCachedRowSetTest0017(CachedRowSet rs) throws Exception { + int[] expectedCols = {1}; + String[] expectedColNames = {"ID"}; + rs.setMatchColumn(expectedColNames[0]); + int[] actualCols = rs.getMatchColumnIndexes(); + String[] actualColNames = rs.getMatchColumnNames(); + assertEquals(actualCols, expectedCols); + assertEquals(actualColNames, expectedColNames); + rs.close(); + } + + /* + * Validate that getMatchColumn returns the same valid value specified by + * setMatchColumn + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", enabled = false) + public void commonCachedRowSetTest0018(CachedRowSet rs) throws Exception { + int[] expectedCols = {1, 3}; + String[] expectedColNames = {"COF_ID", "SUP_ID"}; + rs.setMatchColumn(expectedCols); + int[] actualCols = rs.getMatchColumnIndexes(); + String[] actualColNames = rs.getMatchColumnNames(); + assertEquals(actualCols, expectedCols); + assertEquals(actualColNames, expectedColNames); + assertEquals(actualCols, expectedCols); + rs.close(); + } + + /* + * Validate that getMatchColumn returns the same valid value specified by + * setMatchColumn + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", enabled = false) + public void commonCachedRowSetTest0019(CachedRowSet rs) throws Exception { + int[] expectedCols = {1, 3}; + String[] expectedColNames = {"COF_ID", "SUP_ID"}; + rs.setMatchColumn(expectedColNames); + int[] actualCols = rs.getMatchColumnIndexes(); + String[] actualColNames = rs.getMatchColumnNames(); + assertEquals(actualCols, expectedCols); + assertEquals(actualColNames, expectedColNames); + rs.close(); + } + + /* + * Validate that getMatchColumnIndexes throws a SQLException if + * unsetMatchColumn has been called + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0020(CachedRowSet rs) throws Exception { + rs.setMatchColumn(1); + int[] actualCols = rs.getMatchColumnIndexes(); + assertTrue(actualCols != null); + rs.unsetMatchColumn(1); + actualCols = rs.getMatchColumnIndexes(); + rs.close(); + } + + /* + * Validate that getMatchColumnNames throws a SQLException if + * unsetMatchColumn has been called + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0021(CachedRowSet rs) throws Exception { + String matchColumn = "ID"; + rs.setMatchColumn(matchColumn); + String[] actualColNames = rs.getMatchColumnNames(); + assertTrue(actualColNames != null); + rs.unsetMatchColumn(matchColumn); + actualColNames = rs.getMatchColumnNames(); + rs.close(); + } + + /* + * Validate that getMatchColumnIndexes throws a SQLException if + * unsetMatchColumn has been called + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0022(CachedRowSet rs) throws Exception { + int[] expectedCols = {1, 3}; + rs.setMatchColumn(expectedCols); + int[] actualCols = rs.getMatchColumnIndexes(); + assertTrue(actualCols != null); + rs.unsetMatchColumn(expectedCols); + actualCols = rs.getMatchColumnIndexes(); + rs.close(); + } + + /* + * Validate that getMatchColumnNames throws a SQLException if + * unsetMatchColumn has been called + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0023(CachedRowSet rs) throws Exception { + String[] expectedColNames = {"COF_ID", "SUP_ID"}; + rs.setMatchColumn(expectedColNames); + String[] actualColNames = rs.getMatchColumnNames(); + assertTrue(actualColNames != null); + rs.unsetMatchColumn(expectedColNames); + actualColNames = rs.getMatchColumnNames(); + rs.close(); + } + + /* + * Validate size() returns the correct number of rows + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0024(CachedRowSet rs) throws Exception { + assertTrue(rs.size() == COFFEE_HOUSES_ROWS); + rs.close(); + } + + /* + * Validate that the correct rows are returned comparing the primary + * keys + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0025(RowSet rs) throws SQLException { + assertEquals(getPrimaryKeys(rs), COFFEE_HOUSES_PRIMARY_KEYS); + rs.close(); + } + + /* + * Delete a row within the RowSet using its primary key + * Validate the visibility of the row depending on the value of + * setShowdelete + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0026(CachedRowSet rs) throws Exception { + Object[] afterDelete = { + 10023, 33002, 10040, 32001, 10042, 10024, 10039, 10041, + 33005, 33010, 10037, 10034, 32004 + }; + int rowToDelete = 10035; + // All rows should be found + assertEquals(getPrimaryKeys(rs), COFFEE_HOUSES_PRIMARY_KEYS); + // Delete the row + assertTrue(deleteRowByPrimaryKey(rs, rowToDelete, 1)); + // With setShowDeleted(false) which is the default, + // the deleted row should not be visible + assertFalse(findRowByPrimaryKey(rs, rowToDelete, 1)); + assertEquals(getPrimaryKeys(rs), afterDelete); + assertTrue(rs.size() == COFFEE_HOUSES_ROWS); + // With setShowDeleted(true), the deleted row should be visible + rs.setShowDeleted(true); + assertTrue(findRowByPrimaryKey(rs, rowToDelete, 1)); + rs.close(); + } + + /* + * Validate that there is no page size by default + */ + @Test(dataProvider = "rowSetType") + public void commonCachedRowSetTest0027(CachedRowSet rs) throws Exception { + assertTrue(rs.getPageSize() == 0); + rs.close(); + } + + /* + * Validate the value you set via setPageSize is returned by getPageSize + * then reset to having no limit + */ + @Test(dataProvider = "rowSetType") + public void commonCachedRowSetTest0028(CachedRowSet rs) throws Exception { + int rows = 100; + rs.setPageSize(rows); + assertTrue(rows == rs.getPageSize()); + rs.setPageSize(0); + assertTrue(rs.getPageSize() == 0); + rs.close(); + } + + /* + * Validate SQLException is thrown when an invalid value is specified + * for setPageSize + */ + @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0029(CachedRowSet rs) throws Exception { + rs.setPageSize(-1); + rs.close(); + } + + /* + * Validate SQLException is thrown when nextPage is called without a + * call to populate or execute + */ + @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0030(CachedRowSet rs) throws Exception { + rs.nextPage(); + rs.close(); + } + + /* + * Validate SQLException is thrown when previousPage is called without a + * call to populate or execute + */ + @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0031(CachedRowSet rs) throws Exception { + rs.previousPage(); + rs.close(); + } + + + /* + * Validate SQLException is thrown when execute is called + * but there is not a way to make a connection to the datasource + */ + @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0032(CachedRowSet rs) throws Exception { + rs.execute(null); + rs.close(); + } + + /* + * Validate SQLException is thrown when execute is called + * but there is not a way to make a connection to the datasource + */ + @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0033(CachedRowSet rs) throws Exception { + rs.execute(); + rs.close(); + } + + /* + * Validate that toCollection() returns the proper values + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0034(CachedRowSet rs) throws Exception { + Object[] cities = {"Mendocino", "Seattle", "SF", "Portland", "SF", + "Sacramento", "Carmel", "LA", "Olympia", "Seattle", "SF", + "LA", "San Jose", "Eugene"}; + rs.beforeFirst(); + assertEquals(rs.toCollection(2).toArray(), cities); + assertEquals(rs.toCollection("CITY").toArray(), cities); + rs.close(); + } + + /* + * Validate that toCollection() returns the proper values + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0035(CachedRowSet rs) throws Exception { + Collection col = rs.toCollection(); + assertTrue(rs.size() == col.size()); + assertTrue(rs.toCollection().containsAll(col) + && col.containsAll(rs.toCollection())); + try ( // Validate that False is returned when compared to a different RowSet; + CachedRowSet crs1 = createCoffeesRowSet()) { + assertFalse(crs1.toCollection().containsAll(col) + && col.containsAll(crs1.toCollection())); + } + rs.close(); + + } + + /* + * Validate that createCopy() returns the proper values + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0036(CachedRowSet rs) throws Exception { + try (CachedRowSet crs1 = rs.createCopy()) { + compareRowSets(rs, crs1); + } + rs.close(); + } + + /* + * Validate that createCopySchema() returns the proper values + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0037(CachedRowSet rs) throws Exception { + try (CachedRowSet crs1 = rs.createCopySchema()) { + assertTrue(crs1.size() == 0); + compareMetaData(crs1.getMetaData(), rs.getMetaData()); + } + rs.close(); + } + + /* + * Validate that createCopyNoConstraints() returns the proper values + * and getMatchColumnIndexes should throw a SQLException. This test + * specifies setMatchColumn(int) + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0038(CachedRowSet rs) throws Exception { + rs.setMatchColumn(1); + try (CachedRowSet crs1 = rs.createCopyNoConstraints()) { + assertTrue(crs1.size() == COFFEE_HOUSES_ROWS); + compareRowSets(rs, crs1); + boolean recievedSQE = false; + try { + int[] indexes = crs1.getMatchColumnIndexes(); + } catch (SQLException e) { + recievedSQE = true; + } + assertTrue(recievedSQE); + recievedSQE = false; + try { + String[] colNames = crs1.getMatchColumnNames(); + } catch (SQLException e) { + recievedSQE = true; + } + assertTrue(recievedSQE); + } + rs.close(); + } + + /* + * Validate that createCopyNoConstraints() returns the proper values + * and getMatchColumnIndexes should throw a SQLException. This test + * specifies setMatchColumn(String) + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0039(CachedRowSet rs) throws Exception { + rs.setMatchColumn("ID"); + try (CachedRowSet crs1 = rs.createCopyNoConstraints()) { + assertTrue(crs1.size() == COFFEE_HOUSES_ROWS); + compareRowSets(rs, crs1); + boolean recievedSQE = false; + try { + int[] indexes = crs1.getMatchColumnIndexes(); + } catch (SQLException e) { + recievedSQE = true; + } + assertTrue(recievedSQE); + recievedSQE = false; + try { + String[] colNames = crs1.getMatchColumnNames(); + } catch (SQLException e) { + recievedSQE = true; + } + assertTrue(recievedSQE); + } + rs.close(); + } + + /* + * Validate that columnUpdated works with the various datatypes specifying + * the column index + */ + @Test(dataProvider = "rowsetUsingDataTypes") + public void commonCachedRowSetTest0040(CachedRowSet rs, JDBCType type) throws Exception { + rs.beforeFirst(); + assertTrue(rs.next()); + switch (type) { + case INTEGER: + assertFalse(rs.columnUpdated(1)); + rs.updateInt(1, Integer.MIN_VALUE); + assertTrue(rs.columnUpdated(1)); + break; + case CHAR: + assertFalse(rs.columnUpdated(2)); + rs.updateString(2, "foo"); + assertTrue(rs.columnUpdated(2)); + break; + case VARCHAR: + assertFalse(rs.columnUpdated(3)); + rs.updateString(3, "foo"); + assertTrue(rs.columnUpdated(3)); + break; + case BIGINT: + assertFalse(rs.columnUpdated(4)); + rs.updateLong(4, Long.MIN_VALUE); + assertTrue(rs.columnUpdated(4)); + break; + case BOOLEAN: + assertFalse(rs.columnUpdated(5)); + rs.updateBoolean(5, false); + assertTrue(rs.columnUpdated(5)); + break; + case SMALLINT: + assertFalse(rs.columnUpdated(6)); + rs.updateShort(6, Short.MIN_VALUE); + assertTrue(rs.columnUpdated(6)); + break; + case DOUBLE: + assertFalse(rs.columnUpdated(7)); + rs.updateDouble(7, Double.MIN_VALUE); + assertTrue(rs.columnUpdated(7)); + break; + case DECIMAL: + assertFalse(rs.columnUpdated(8)); + rs.updateBigDecimal(8, BigDecimal.TEN); + assertTrue(rs.columnUpdated(8)); + break; + case REAL: + assertFalse(rs.columnUpdated(9)); + rs.updateFloat(9, Float.MIN_VALUE); + assertTrue(rs.columnUpdated(9)); + break; + case TINYINT: + assertFalse(rs.columnUpdated(10)); + rs.updateByte(10, Byte.MIN_VALUE); + assertTrue(rs.columnUpdated(10)); + break; + case DATE: + assertFalse(rs.columnUpdated(11)); + rs.updateDate(11, Date.valueOf(LocalDate.now())); + assertTrue(rs.columnUpdated(11)); + break; + case TIME: + assertFalse(rs.columnUpdated(12)); + rs.updateTime(12, Time.valueOf(LocalTime.now())); + assertTrue(rs.columnUpdated(12)); + break; + case TIMESTAMP: + assertFalse(rs.columnUpdated(13)); + rs.updateTimestamp(13, Timestamp.valueOf(LocalDateTime.now())); + assertTrue(rs.columnUpdated(13)); + break; + case VARBINARY: + assertFalse(rs.columnUpdated(14)); + rs.updateBytes(14, new byte[1]); + assertTrue(rs.columnUpdated(14)); + break; + case ARRAY: + assertFalse(rs.columnUpdated(15)); + rs.updateArray(15, new StubArray("VARCHAR", new Object[10])); + assertTrue(rs.columnUpdated(15)); + break; + case REF: + assertFalse(rs.columnUpdated(16)); + rs.updateRef(16, new StubRef("INTEGER", query)); + assertTrue(rs.columnUpdated(16)); + break; + case FLOAT: + assertFalse(rs.columnUpdated(17)); + rs.updateDouble(17, Double.MIN_NORMAL); + assertTrue(rs.columnUpdated(17)); + } + + } + + /* + * Validate that columnUpdated works with the various datatypes specifying + * the column name + */ + @Test(dataProvider = "rowsetUsingDataTypes") + public void commonCachedRowSetTest0041(CachedRowSet rs, JDBCType type) throws Exception { + rs.beforeFirst(); + assertTrue(rs.next()); + switch (type) { + case INTEGER: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[0])); + rs.updateInt(DATATYPES_COLUMN_NAMES[0], Integer.MIN_VALUE); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[0])); + break; + case CHAR: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[1])); + rs.updateString(DATATYPES_COLUMN_NAMES[1], "foo"); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[1])); + break; + case VARCHAR: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[2])); + rs.updateString(DATATYPES_COLUMN_NAMES[2], "foo"); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[2])); + break; + case BIGINT: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[3])); + rs.updateLong(DATATYPES_COLUMN_NAMES[3], Long.MIN_VALUE); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[3])); + break; + case BOOLEAN: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[4])); + rs.updateBoolean(DATATYPES_COLUMN_NAMES[4], false); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[4])); + break; + case SMALLINT: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[5])); + rs.updateShort(DATATYPES_COLUMN_NAMES[5], Short.MIN_VALUE); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[5])); + break; + case DOUBLE: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[6])); + rs.updateDouble(DATATYPES_COLUMN_NAMES[6], Double.MIN_VALUE); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[6])); + break; + case DECIMAL: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[7])); + rs.updateBigDecimal(DATATYPES_COLUMN_NAMES[7], BigDecimal.TEN); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[7])); + break; + case REAL: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[8])); + rs.updateFloat(DATATYPES_COLUMN_NAMES[8], Float.MIN_VALUE); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[8])); + break; + case TINYINT: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[9])); + rs.updateByte(DATATYPES_COLUMN_NAMES[9], Byte.MIN_VALUE); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[9])); + break; + case DATE: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[10])); + rs.updateDate(DATATYPES_COLUMN_NAMES[10], Date.valueOf(LocalDate.now())); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[10])); + break; + case TIME: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[11])); + rs.updateTime(DATATYPES_COLUMN_NAMES[11], Time.valueOf(LocalTime.now())); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[11])); + break; + case TIMESTAMP: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[12])); + rs.updateTimestamp(DATATYPES_COLUMN_NAMES[12], Timestamp.valueOf(LocalDateTime.now())); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[12])); + break; + case VARBINARY: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[13])); + rs.updateBytes(DATATYPES_COLUMN_NAMES[13], new byte[1]); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[13])); + break; + case ARRAY: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[14])); + rs.updateArray(DATATYPES_COLUMN_NAMES[14], new StubArray("VARCHAR", new Object[10])); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[14])); + break; + case REF: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[15])); + rs.updateRef(DATATYPES_COLUMN_NAMES[15], new StubRef("INTEGER", query)); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[15])); + break; + case FLOAT: + assertFalse(rs.columnUpdated(DATATYPES_COLUMN_NAMES[16])); + rs.updateDouble(DATATYPES_COLUMN_NAMES[16], Double.MIN_NORMAL); + assertTrue(rs.columnUpdated(DATATYPES_COLUMN_NAMES[16])); + break; + } + + } + + /* + * Validate isBeforeFirst(), isFirst() and first() return the correct + * results + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0042(RowSet rs) throws Exception { + assertFalse(rs.isBeforeFirst()); + assertFalse(rs.isFirst()); + rs.beforeFirst(); + assertTrue(rs.isBeforeFirst()); + assertFalse(rs.isFirst()); + rs.next(); + assertFalse(rs.isBeforeFirst()); + assertTrue(rs.isFirst()); + rs.next(); + assertFalse(rs.isBeforeFirst()); + assertFalse(rs.isFirst()); + rs.first(); + assertFalse(rs.isBeforeFirst()); + assertTrue(rs.isFirst()); + rs.close(); + } + + /* + * Validate isAfterLast(), isLast() and last() return the correct + * results + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0043(RowSet rs) throws Exception { + assertFalse(rs.isAfterLast()); + assertFalse(rs.isLast()); + rs.afterLast(); + assertTrue(rs.isAfterLast()); + assertFalse(rs.isLast()); + rs.previous(); + assertFalse(rs.isAfterLast()); + assertTrue(rs.isLast()); + rs.previous(); + assertFalse(rs.isAfterLast()); + assertFalse(rs.isLast()); + rs.last(); + assertFalse(rs.isAfterLast()); + assertTrue(rs.isLast()); + rs.close(); + } + + /* + * Validate a SQLException is thrown when undoDelete is called on the + * insertRow + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0044(CachedRowSet rs) throws Exception { + rs.insertRow(); + rs.undoDelete(); + rs.close(); + } + + /* + * Validate a SQLException is thrown when undoDelete is called when + * cursor is before the first row + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0045(CachedRowSet rs) throws Exception { + rs.setShowDeleted(true); + rs.beforeFirst(); + rs.undoDelete(); + rs.close(); + } + + /* + * Validate a SQLException is thrown when undoDelete is called when + * cursor is after the last row + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0046(CachedRowSet rs) throws Exception { + rs.setShowDeleted(true); + rs.afterLast(); + rs.undoDelete(); + rs.close(); + } + + /* + * Validate a SQLException is thrown when undoUpdate is called on the + * insertRow + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0047(CachedRowSet rs) throws Exception { + rs.insertRow(); + rs.undoUpdate(); + rs.close(); + } + + /* + * Validate a SQLException is thrown when undoUpdate is called when + * cursor is before the first row + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0048(CachedRowSet rs) throws Exception { + rs.setShowDeleted(true); + rs.beforeFirst(); + rs.undoUpdate(); + rs.close(); + } + + /* + * Validate a SQLException is thrown when undoUpdate is called when + * cursor is after the last row + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0049(CachedRowSet rs) throws Exception { + rs.setShowDeleted(true); + rs.afterLast(); + rs.undoUpdate(); + rs.close(); + } + + /* + * Validate a SQLException is thrown when undoInsert is called on the + * insertRow + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0050(CachedRowSet rs) throws Exception { + rs.insertRow(); + rs.undoInsert(); + rs.close(); + } + + /* + * Validate a SQLException is thrown when undoInsert is called when + * cursor is before the first row + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0051(CachedRowSet rs) throws Exception { + rs.setShowDeleted(true); + rs.beforeFirst(); + rs.undoInsert(); + rs.close(); + } + + /* + * Validate a SQLException is thrown when undoInsert is called when + * cursor is after the last row + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses", + expectedExceptions = SQLException.class) + public void commonCachedRowSetTest0052(CachedRowSet rs) throws Exception { + rs.setShowDeleted(true); + rs.afterLast(); + rs.undoInsert(); + rs.close(); + } + + /* + * Insert a row, then call undoInsert to roll back the insert and validate + * the row is not there + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0053(CachedRowSet rs) throws Exception { + int rowToInsert = 1961; + assertTrue(rs.size() == COFFEE_HOUSES_ROWS); + // Add new row + rs.moveToInsertRow(); + rs.updateInt(1, rowToInsert); + rs.updateString(2, "GOTHAM"); + rs.updateInt(3, 3450); + rs.updateInt(4, 2005); + rs.updateInt(5, 5455); + rs.insertRow(); + rs.moveToCurrentRow(); + // check that the number of rows has increased + assertTrue(rs.size() == COFFEE_HOUSES_ROWS + 1); + assertTrue(findRowByPrimaryKey(rs, rowToInsert, 1)); + rs.undoInsert(); + // Check to make sure the row is no longer there + assertTrue(rs.size() == COFFEE_HOUSES_ROWS); + assertFalse(findRowByPrimaryKey(rs, rowToInsert, 1)); + rs.close(); + } + + /* + * Insert a row, delete the row and then call undoDelete to make sure it + * is comes back + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0054(CachedRowSet rs) throws Exception { + int rowToDelete = 1961; + assertTrue(rs.size() == COFFEE_HOUSES_ROWS); + // Add new row + rs.moveToInsertRow(); + rs.updateInt(1, rowToDelete); + rs.updateString(2, "GOTHAM"); + rs.updateInt(3, 3450); + rs.updateInt(4, 2005); + rs.updateInt(5, 5455); + rs.insertRow(); + rs.moveToCurrentRow(); + // check that the number of rows has increased + assertTrue(rs.size() == COFFEE_HOUSES_ROWS + 1); + assertTrue(findRowByPrimaryKey(rs, rowToDelete, 1)); + rs.absolute(COFFEE_HOUSES_ROWS + 1); + rs.deleteRow(); + // Check to make sure the row is no longer there + //assertTrue(rs.size() == COFFEE_HOUSES_ROWS); + assertFalse(findRowByPrimaryKey(rs, rowToDelete, 1)); + rs.setShowDeleted(true); + rs.absolute(COFFEE_HOUSES_ROWS + 1); + rs.undoDelete(); + // check that the row is back + assertTrue(rs.size() == COFFEE_HOUSES_ROWS + 1); + assertTrue(findRowByPrimaryKey(rs, rowToDelete, 1)); + rs.close(); + } + + /* + * Insert a row, modify a field and then call undoUpdate to revert the + * insert + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0055(CachedRowSet rs) throws Exception { + int rowToInsert = 1961; + assertTrue(rs.size() == COFFEE_HOUSES_ROWS); + // Add new row + rs.moveToInsertRow(); + rs.updateInt(1, rowToInsert); + rs.updateString(2, "GOTHAM"); + rs.updateInt(3, 3450); + rs.updateInt(4, 2005); + rs.updateInt(5, 5455); + rs.insertRow(); + rs.moveToCurrentRow(); + // check that the number of rows has increased + assertTrue(rs.size() == COFFEE_HOUSES_ROWS + 1); + assertTrue(findRowByPrimaryKey(rs, rowToInsert, 1)); + rs.absolute(COFFEE_HOUSES_ROWS + 1); + // Save off the original column values + String f2 = rs.getString(2); + int f3 = rs.getInt(3); + rs.updateString(2, "SMALLVILLE"); + rs.updateInt(3, 500); + // Validate the columns have been updated + assertTrue(rs.columnUpdated(2)); + assertTrue(rs.columnUpdated(3)); + // Undo the update and validate it has taken place + rs.absolute(COFFEE_HOUSES_ROWS + 1); + rs.undoUpdate(); + assertTrue(rs.size() == COFFEE_HOUSES_ROWS); + assertFalse(findRowByPrimaryKey(rs, rowToInsert, 1)); + rs.close(); + } + + /* + * Validate getOriginal returns a ResultSet which is a copy of the original + * RowSet + */ + @Test(dataProvider = "rowsetUsingCoffees") + public void commonCachedRowSetTest0056(CachedRowSet rs) throws Exception { + String coffee = "Hazelnut"; + int sales = 100; + int id = 200; + Object[] updatedPkeys = {1, id, 3, 4, 5}; + // Change the coffee name and sales total for row 2 and save the + // previous values + rs.absolute(2); + int origId = rs.getInt(1); + String origCoffee = rs.getString(2); + int origSales = rs.getInt(5); + rs.updateInt(1, id); + rs.updateString(2, coffee); + rs.updateInt(5, sales); + // MetaData should match + try ( // Get the original original RowSet and validate that the changes + // are only made to the current, not the original + ResultSet rs1 = rs.getOriginal()) { + // MetaData should match + compareMetaData(rs.getMetaData(), rs1.getMetaData()); + assertTrue(rs1.isBeforeFirst()); + assertTrue(rs1.getConcurrency() == ResultSet.CONCUR_UPDATABLE); + assertTrue(rs1.getType() == ResultSet.TYPE_SCROLL_INSENSITIVE); + rs1.absolute(2); + // Check original rowset is not changed + assertTrue(rs1.getInt(1) == origId); + assertTrue(rs1.getString(2).equals(origCoffee)); + assertTrue(rs1.getInt(5) == origSales); + assertEquals(getPrimaryKeys(rs1), COFFEES_PRIMARY_KEYS); + // Check current rowset + assertTrue(rs.getInt(1) == id); + assertTrue(rs.getString(2).equals(coffee)); + assertTrue(rs.getInt(5) == sales); + assertEquals(getPrimaryKeys(rs), updatedPkeys); + } + rs.close(); + } + + /* + * Validate getOriginalRow returns a ResultSet which is a copy of the + * original row that was modified + */ + @Test(dataProvider = "rowsetUsingCoffees") + public void commonCachedRowSetTest0057(CachedRowSet rs) throws Exception { + String coffee = "Hazelnut"; + int sales = 100; + int id = 200; + Object[] updatedPkeys = {1, id, 3, 4, 5}; + // Change the coffee name and sales total for row 2 and save the + // previous values + rs.absolute(2); + int origId = rs.getInt(1); + String origCoffee = rs.getString(2); + int origSales = rs.getInt(5); + rs.updateInt(1, id); + rs.updateString(2, coffee); + rs.updateInt(5, sales); + // MetaData should match + try ( // Get the original original row and validate that the changes + // are only made to the current, not the original + ResultSet rs1 = rs.getOriginalRow()) { + // MetaData should match + compareMetaData(rs.getMetaData(), rs1.getMetaData()); + assertTrue(rs1.isBeforeFirst()); + assertTrue(rs1.getConcurrency() == ResultSet.CONCUR_UPDATABLE); + assertTrue(rs1.getType() == ResultSet.TYPE_SCROLL_INSENSITIVE); + rs1.next(); + assertTrue(rs1.isFirst() && rs1.isLast()); + assertTrue(rs1.getRow() == 1); + // Check original row is not changed + assertTrue(rs1.getInt(1) == origId); + assertTrue(rs1.getString(2).equals(origCoffee)); + assertTrue(rs1.getInt(5) == origSales); + // Check current row + assertTrue(rs.getInt(1) == id); + assertTrue(rs.getString(2).equals(coffee)); + assertTrue(rs.getInt(5) == sales); + assertEquals(getPrimaryKeys(rs), updatedPkeys); + } + rs.close(); + } + + /* + * Validate that restoreOrginal will restore the RowSet to its + * state prior to the insert of a row + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0058(CachedRowSet rs) throws Exception { + int rowToInsert = 1961; + assertTrue(rs.size() == COFFEE_HOUSES_ROWS); + try ( // Add new row + CachedRowSet crs1 = rsf.createCachedRowSet()) { + rs.beforeFirst(); + crs1.populate(rs); + TestRowSetListener rsl = new TestRowSetListener(); + crs1.addRowSetListener(rsl); + crs1.moveToInsertRow(); + crs1.updateInt(1, rowToInsert); + crs1.updateString(2, "GOTHAM"); + crs1.updateInt(3, 3450); + crs1.updateInt(4, 2005); + crs1.updateInt(5, 5455); + crs1.insertRow(); + assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED)); + crs1.moveToCurrentRow(); + assertTrue(findRowByPrimaryKey(crs1, rowToInsert, 1)); + // Restore back to our original state and the + // previously inserted row should not be there + rsl.resetFlag(); + crs1.restoreOriginal(); + assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED)); + assertTrue(crs1.isBeforeFirst()); + crs1.last(); + assertFalse(crs1.rowInserted()); + assertFalse(findRowByPrimaryKey(crs1, rowToInsert, 1)); + } + rs.close(); + } + + /* + * Validate that restoreOrginal will restore the RowSet to its + * state prior to deleting a row + */ + @Test(dataProvider = "rowsetUsingCoffees", enabled = true) + public void commonCachedRowSetTest0059(CachedRowSet rs) throws Exception { + int rowToDelete = 2; + try (CachedRowSet crs1 = rsf.createCachedRowSet()) { + rs.beforeFirst(); + crs1.populate(rs); + TestRowSetListener rsl = new TestRowSetListener(); + crs1.addRowSetListener(rsl); + // Delete a row, the PK is also the absolute position as a List + // backs the RowSet + crs1.absolute(rowToDelete); + crs1.deleteRow(); + assertTrue(crs1.rowDeleted()); + assertFalse(findRowByPrimaryKey(crs1, rowToDelete, 1)); + // Restore back to our original state and the + // previously deleted row should be there + rsl.resetFlag(); + crs1.restoreOriginal(); + assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED)); + assertTrue(crs1.isBeforeFirst()); + crs1.absolute(rowToDelete); + assertFalse(crs1.rowDeleted()); + assertTrue(findRowByPrimaryKey(crs1, rowToDelete, 1)); + } + rs.close(); + } + + /* + * Validate that restoreOrginal will restore the RowSet to its + * state prior to updating a row + */ + @Test(dataProvider = "rowsetUsingCoffees", enabled = true) + public void commonCachedRowSetTest0060(CachedRowSet rs) throws Exception { + int rowToUpdate = 2; + String coffee = "Hazelnut"; + try (CachedRowSet crs1 = rsf.createCachedRowSet()) { + rs.beforeFirst(); + crs1.populate(rs); + TestRowSetListener rsl = new TestRowSetListener(); + crs1.addRowSetListener(rsl); + // Delete a row, the PK is also the absolute position as a List + // backs the RowSet + crs1.absolute(rowToUpdate); + String origCoffee = crs1.getString(2); + crs1.updateString(2, coffee); + assertTrue(crs1.columnUpdated(2)); + crs1.updateRow(); + assertTrue(crs1.rowUpdated()); + assertFalse(origCoffee.equals(crs1.getString(2))); + // Restore back to our original state and the + // previous value for the column within the row should be there + rsl.resetFlag(); + crs1.restoreOriginal(); + assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED)); + assertTrue(crs1.isBeforeFirst()); + // absolute() is failing for some reason so need to look at this later + crs1.next(); + crs1.next(); + assertFalse(crs1.columnUpdated(2)); + assertFalse(crs1.rowUpdated()); + assertTrue(origCoffee.equals(crs1.getString(2))); + } + rs.close(); + } + + /* + * Initialize a RowSet via the populate method. Validate it matches + * the original ResultSet + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0061(CachedRowSet rs) throws Exception { + try (CachedRowSet crs1 = rsf.createCachedRowSet()) { + rs.beforeFirst(); + crs1.populate(rs); + compareRowSets(rs, crs1); + } + rs.close(); + } + + /* + * Initialize a RowSet via the populate method specifying a starting row. + * Validate it matches the original ResultSet starting for the specofied + * offset + */ + @Test(dataProvider = "rowsetUsingCoffeeHouses") + public void commonCachedRowSetTest0062(CachedRowSet rs) throws Exception { + Object[] expectedRows = { + 32001, 10042, 10024, 10039, 10041, 33005, 33010, 10035, 10037, + 10034, 32004 + }; + int startingRow = 4; + try (CachedRowSet crs1 = rsf.createCachedRowSet()) { + rs.beforeFirst(); + crs1.populate(rs, startingRow); + assertEquals(crs1.size(), COFFEE_HOUSES_ROWS - startingRow + 1); + assertEquals(getPrimaryKeys(crs1), expectedRows); + } + rs.close(); + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/filteredrowset/CityFilter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/filteredrowset/CityFilter.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,100 @@ +/* + * 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. + */ +package test.rowset.filteredrowset; + +import java.sql.SQLException; +import javax.sql.RowSet; +import javax.sql.rowset.Predicate; + +/* + * Simple implementation of Predicate which is used to filter rows based + * on a City. + */ +public class CityFilter implements Predicate { + + private final String[] cities; + private String colName = null; + private int colNumber = -1; + + public CityFilter(String[] cities, String colName) { + this.cities = cities; + this.colName = colName; + } + + public CityFilter(String[] cities, int colNumber) { + this.cities = cities; + this.colNumber = colNumber; + } + + public boolean evaluate(Object value, String colName) { + + if (colName.equalsIgnoreCase(this.colName)) { + for (String city : cities) { + if (city.equalsIgnoreCase((String) value)) { + return true; + } + } + } + return false; + } + + public boolean evaluate(Object value, int colNumber) { + + if (colNumber == this.colNumber) { + for (String city : this.cities) { + if (city.equalsIgnoreCase((String) value)) { + return true; + } + } + } + return false; + } + + public boolean evaluate(RowSet rs) { + + boolean result = false; + + if (rs == null) { + return false; + } + + try { + for (String city : cities) { + + String val = ""; + if (colNumber > 0) { + val = (String) rs.getObject(colNumber); + } else if (colName != null) { + val = (String) rs.getObject(colName); + } + + if (val.equalsIgnoreCase(city)) { + return true; + } + } + } catch (SQLException e) { + result = false; + } + return result; + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/filteredrowset/FilteredRowSetTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/filteredrowset/FilteredRowSetTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,140 @@ +/* + * 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. + */ +package test.rowset.filteredrowset; + +import java.sql.SQLException; +import javax.sql.RowSet; +import javax.sql.rowset.FilteredRowSet; +import javax.sql.rowset.Predicate; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNull; +import static org.testng.Assert.assertTrue; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import test.rowset.webrowset.CommonWebRowSetTests; + +public class FilteredRowSetTests extends CommonWebRowSetTests { + + private FilteredRowSet frs; + + @BeforeMethod + public void setUpMethod() throws Exception { + frs = createCoffeeHousesRowSet(); + } + + @AfterMethod + public void tearDownMethod() throws Exception { + frs.close(); + } + + protected FilteredRowSet newInstance() throws SQLException { + return rsf.createFilteredRowSet(); + } + + /* + * Validate getFilter returns null if setFilter has not been called + */ + @Test + public void FilteredRowSetTest0000() throws SQLException { + assertNull(frs.getFilter()); + } + + /* + * Call setFilter to set a Predicate and validate that getFilter + * returns the correct Predicate + */ + @Test + public void FilteredRowSetTest0001() throws SQLException { + Predicate p = new PrimaryKeyFilter(0, 100030, 1); + frs.setFilter(p); + assertTrue(frs.getFilter().equals(p)); + frs.setFilter(null); + assertNull(frs.getFilter()); + } + + /* + * Validate that the correct rows are returned when a Predicate using + * a column index is used + */ + @Test + public void FilteredRowSetTest0002() throws SQLException { + Object[] expectedKeys = { + 10023, 10040, 10042, 10024, 10039, 10041, 10035, 10037, 10034 + }; + frs.setFilter(new PrimaryKeyFilter(10000, 10999, 1)); + assertEquals(getPrimaryKeys(frs), expectedKeys); + } + + /* + * Validate that the correct rows are returned when a Predicate using + * a column Label is used + */ + @Test + public void FilteredRowSetTest0003() throws SQLException { + Object[] expectedKeys = { + 10023, 10040, 10042, 10024, 10039, 10041, 10035, 10037, 10034 + }; + frs.setFilter(new PrimaryKeyFilter(10000, 10999, "STORE_ID")); + assertEquals(getPrimaryKeys(frs), expectedKeys); + + } + + /* + * Validate that the correct rows are returned when a Predicate using + * a column index is used + */ + @Test + public void FilteredRowSetTest0004() throws SQLException { + Object[] expectedKeys = { + 10040, 10042, 10041, 10035, 10037 + }; + String[] cityArray = {"SF", "LA"}; + frs.setFilter(new CityFilter(cityArray, 2)); + assertEquals(getPrimaryKeys(frs), expectedKeys); + } + + /* + * Validate that the correct rows are returned when a Predicate using + * a column Label is used + */ + @Test + public void FilteredRowSetTest0005() throws SQLException { + Object[] expectedKeys = { + 10040, 10042, 10041, 10035, 10037 + }; + String[] cityArray = {"SF", "LA"}; + frs.setFilter(new CityFilter(cityArray, "CITY")); + assertEquals(getPrimaryKeys(frs), expectedKeys); + } + + + // Tests that are common but need to be disabled due to an implementation bug + + + @Test(dataProvider = "rowSetType", enabled = false) + public void commonCachedRowSetTest0043(RowSet rs) throws Exception { + // Need to fix bug in FilteredRowSets + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/filteredrowset/PrimaryKeyFilter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/filteredrowset/PrimaryKeyFilter.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,93 @@ +/* + * 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. + */ +package test.rowset.filteredrowset; + +import javax.sql.RowSet; +import javax.sql.rowset.Predicate; + +/* + * Simple implementation of Predicate which is used to filter rows based + * on the Primary Key. + */ +public class PrimaryKeyFilter implements Predicate { + + private final int lo; + private final int hi; + private String colName = null; + private int colNumber = -1; + + public PrimaryKeyFilter(int lo, int hi, int colNumber) { + this.lo = lo; + this.hi = hi; + this.colNumber = colNumber; + } + + public PrimaryKeyFilter(int lo, int hi, String colName) { + this.lo = lo; + this.hi = hi; + this.colName = colName; + } + + public boolean evaluate(Object value, String columnName) { + + boolean result = false; + if (columnName.equalsIgnoreCase(this.colName)) { + int columnValue = ((Integer) value); + result = (columnValue >= this.lo) && (columnValue <= this.hi); + } + return result; + } + + public boolean evaluate(Object value, int columnNumber) { + + boolean result = false; + if (this.colNumber == columnNumber) { + int columnValue = (Integer) value; + result = (columnValue >= this.lo) && (columnValue <= this.hi); + } + return result; + } + + public boolean evaluate(RowSet rs) { + + boolean result = false; + try { + int columnValue = -1; + + if (this.colNumber > 0) { + columnValue = rs.getInt(this.colNumber); + } else if (this.colName != null) { + columnValue = rs.getInt(this.colName); + } + if ((columnValue >= this.lo) && (columnValue <= this.hi)) { + result = true; + } + + } catch (Exception e) { + System.out.println("Error:" + e.getMessage()); + result = false; + } + return result; + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/joinrowset/JoinRowSetTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/joinrowset/JoinRowSetTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,324 @@ +/* + * 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. + */ +package test.rowset.joinrowset; + +import java.sql.SQLException; +import java.sql.Types; +import java.util.ArrayList; +import java.util.List; +import javax.sql.RowSet; +import javax.sql.rowset.CachedRowSet; +import javax.sql.rowset.JoinRowSet; +import javax.sql.rowset.RowSetMetaDataImpl; +import javax.sql.rowset.WebRowSet; +import static org.testng.Assert.assertEquals; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import test.rowset.webrowset.CommonWebRowSetTests; + +public class JoinRowSetTests extends CommonWebRowSetTests { + + private final String SUPPLIERS_TABLE = "SUPPLIERS"; + // Expected COF_IDs to be found + private final Object[] EXPECTED = {4, 1}; + // SUPPLIERS Primary Key to use to validate the joins + private final int SUP_ID = 101; + // Join Column between the SUPPLIERS and COFFEES table + private final String JOIN_COLNAME = "SUP_ID"; + // Column index in COFFEES table which contains SUP_ID + private final int COFFEES_JOIN_COLUMN_INDEX = 3; + // Column index in SUPPLIERS table which contains SUP_ID + private final int SUPPLIERS_JOIN_COLUMN_INDEX = 1; + + @Override + protected JoinRowSet newInstance() throws SQLException { + return rsf.createJoinRowSet(); + } + + /* + * Initializes the SUPPLIERS metadata + */ + private void initSuppliersMetaData(CachedRowSet crs) throws SQLException { + RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl(); + + /* + * CREATE TABLE SUPPLIERS ( + * SUP_ID INTEGER NOT NULL, + * SUP_NAME VARCHAR(32) NOT NULL, + * STREET VARCHAR(32) NOT NULL, + * CITY VARCHAR(32) NOT NULL, + * STATE CHAR(2) NOT NULL, + * ZIP CHAR(5) NOT NULL, + * PRIMARY KEY (SUP_ID)) + */ + rsmd.setColumnCount(6); + rsmd.setColumnName(1, "SUP_ID"); + rsmd.setColumnName(2, "SUP_NAME"); + rsmd.setColumnName(3, "STREET"); + rsmd.setColumnName(4, "CITY"); + rsmd.setColumnName(5, "STATE"); + rsmd.setColumnName(6, "ZIP"); + + rsmd.setColumnType(1, Types.INTEGER); + rsmd.setColumnType(2, Types.VARCHAR); + rsmd.setColumnType(3, Types.VARCHAR); + rsmd.setColumnType(4, Types.VARCHAR); + rsmd.setColumnType(5, Types.CHAR); + rsmd.setColumnType(6, Types.CHAR); + crs.setMetaData(rsmd); + crs.setTableName(SUPPLIERS_TABLE); + } + + /* + * Add rows to SUPPLIERS table + */ + protected void createSuppiersRows(RowSet rs) throws SQLException { + + // insert into SUPPLIERS values(49, 'Superior Coffee', '1 Party Place', + // 'Mendocino', 'CA', '95460') + rs.moveToInsertRow(); + rs.updateInt(1, 49); + rs.updateString(2, "Superior Coffee"); + rs.updateString(3, "1 Party Place"); + rs.updateString(4, "Mendocino"); + rs.updateString(5, "CA"); + rs.updateString(6, "95460"); + rs.insertRow(); + + // insert into SUPPLIERS values(101, 'Acme, Inc.', '99 Market Street', + // 'Groundsville', 'CA', '95199') + rs.moveToInsertRow(); + rs.updateInt(1, 101); + rs.updateString(2, "Acme, Inc."); + rs.updateString(3, "99 Market Street"); + rs.updateString(4, "Groundsville"); + rs.updateString(5, "CA"); + rs.updateString(6, "95199"); + rs.insertRow(); + // insert into SUPPLIERS values(150, 'The High Ground', + // '100 Coffee Lane', 'Meadows', 'CA', '93966') + rs.moveToInsertRow(); + rs.updateInt(1, 150); + rs.updateString(2, "The High Ground"); + rs.updateString(3, "100 Coffee Lane"); + rs.updateString(4, "Meadows"); + rs.updateString(5, "CA"); + rs.updateString(6, "93966"); + rs.insertRow(); + // insert into SUPPLIERS values(456," 'Restaurant Supplies, Inc.', + // '200 Magnolia Street', 'Meadows', 'CA', '93966') + rs.moveToInsertRow(); + rs.updateInt(1, 456); + rs.updateString(2, "Restaurant Supplies, Inc."); + rs.updateString(3, "200 Magnolia Stree"); + rs.updateString(4, "Meadows"); + rs.updateString(5, "CA"); + rs.updateString(6, "93966"); + rs.insertRow(); + // insert into SUPPLIERS values(927, 'Professional Kitchen', + // '300 Daisy Avenue', 'Groundsville'," 'CA', '95199') + rs.moveToInsertRow(); + rs.updateInt(1, 927); + rs.updateString(2, "Professional Kitchen"); + rs.updateString(3, "300 Daisy Avenue"); + rs.updateString(4, "Groundsville"); + rs.updateString(5, "CA"); + rs.updateString(6, "95199"); + rs.insertRow(); + } + + /* + * DataProvider used to set parameters for basic types that are supported + */ + @DataProvider(name = "createCachedRowSetsToUse") + private Object[][] createCachedRowSetsToUse() throws SQLException { + CachedRowSet crs = rsf.createCachedRowSet(); + initCoffeesMetaData(crs); + createCoffeesRows(crs); + // Make sure you are not on the insertRow + crs.moveToCurrentRow(); + CachedRowSet crs1 = rsf.createCachedRowSet(); + initSuppliersMetaData(crs1); + createSuppiersRows(crs1); + // Make sure you are not on the insertRow + crs1.moveToCurrentRow(); + return new Object[][]{ + {crs, crs1} + }; + } + + /* + * Validate that the correct coffees are returned for SUP_ID + */ + private void validateResults(final JoinRowSet jrs) throws SQLException { + List results = new ArrayList<>(); + jrs.beforeFirst(); + while (jrs.next()) { + if (jrs.getInt(JOIN_COLNAME) == SUP_ID) { + results.add(jrs.getInt("COF_ID")); + } + } + assertEquals(results.toArray(), EXPECTED); + } + + /* + * Join two CachedRowSets specifying a column name to join against + */ + @Test(dataProvider = "createCachedRowSetsToUse") + public void joinRowSetTests0000(CachedRowSet crs, CachedRowSet crs1) + throws Exception { + + try (JoinRowSet jrs = newInstance()) { + jrs.addRowSet(crs, JOIN_COLNAME); + jrs.addRowSet(crs1, JOIN_COLNAME); + validateResults(jrs); + crs.close(); + crs1.close(); + } + } + + /* + * Join two CachedRowSets specifying a column index to join against + */ + @Test(dataProvider = "createCachedRowSetsToUse") + public void joinRowSetTests0001(CachedRowSet crs, CachedRowSet crs1) + throws Exception { + + try (JoinRowSet jrs = newInstance()) { + jrs.addRowSet(crs, COFFEES_JOIN_COLUMN_INDEX); + jrs.addRowSet(crs1, SUPPLIERS_JOIN_COLUMN_INDEX); + validateResults(jrs); + crs.close(); + crs1.close(); + } + } + + /* + * Join two CachedRowSets specifying a column name to join against + */ + @Test(dataProvider = "createCachedRowSetsToUse") + public void joinRowSetTests0002(CachedRowSet crs, CachedRowSet crs1) + throws Exception { + + try (JoinRowSet jrs = newInstance()) { + RowSet[] rowsets = {crs, crs1}; + String[] joinCols = {JOIN_COLNAME, JOIN_COLNAME}; + jrs.addRowSet(rowsets, joinCols); + validateResults(jrs); + crs.close(); + crs1.close(); + } + } + + /* + * Join two CachedRowSets specifying a column index to join against + */ + @Test(dataProvider = "createCachedRowSetsToUse") + public void joinRowSetTests0003(CachedRowSet crs, CachedRowSet crs1) + throws Exception { + + try (JoinRowSet jrs = newInstance()) { + RowSet[] rowsets = {crs, crs1}; + int[] joinCols = {COFFEES_JOIN_COLUMN_INDEX, + SUPPLIERS_JOIN_COLUMN_INDEX}; + jrs.addRowSet(rowsets, joinCols); + validateResults(jrs); + crs.close(); + crs1.close(); + } + } + + /* + * Join two CachedRowSets specifying a column name to join against + */ + @Test(dataProvider = "createCachedRowSetsToUse") + public void joinRowSetTests0005(CachedRowSet crs, CachedRowSet crs1) + throws Exception { + + try (JoinRowSet jrs = newInstance()) { + crs.setMatchColumn(JOIN_COLNAME); + crs1.setMatchColumn(JOIN_COLNAME); + jrs.addRowSet(crs); + jrs.addRowSet(crs1); + validateResults(jrs); + crs.close(); + crs1.close(); + } + } + + /* + * Join two CachedRowSets specifying a column index to join against + */ + @Test(dataProvider = "createCachedRowSetsToUse") + public void joinRowSetTests0006(CachedRowSet crs, CachedRowSet crs1) + throws Exception { + + try (JoinRowSet jrs = newInstance()) { + crs.setMatchColumn(COFFEES_JOIN_COLUMN_INDEX); + crs1.setMatchColumn(SUPPLIERS_JOIN_COLUMN_INDEX); + + jrs.addRowSet(crs); + jrs.addRowSet(crs1); + validateResults(jrs); + crs.close(); + crs1.close(); + } + } + + // Disabled tests due to bugs in JoinRowSet + @Test(dataProvider = "rowSetType", enabled = false) + public void commonCachedRowSetTest0004(CachedRowSet rs) throws Exception { + } + + @Test(dataProvider = "rowSetType", enabled = false) + public void commonCachedRowSetTest0005(CachedRowSet rs) throws Exception { + } + + @Test(dataProvider = "rowSetType", enabled = false) + public void commonCachedRowSetTest0008(CachedRowSet rs) throws Exception { + } + + @Test(dataProvider = "rowSetType", enabled = false) + public void commonCachedRowSetTest0026(CachedRowSet rs) throws Exception { + } + + @Test(dataProvider = "rowSetType", enabled = false) + public void commonCachedRowSetTest0027(CachedRowSet rs) throws Exception { + } + + @Test(dataProvider = "rowSetType", enabled = false) + public void commonCachedRowSetTest0053(CachedRowSet rs) throws Exception { + } + + @Test(dataProvider = "rowSetType", enabled = false) + public void commonCachedRowSetTest0054(CachedRowSet rs) throws Exception { + } + + @Test(dataProvider = "rowSetType", enabled = false) + public void commonCachedRowSetTest0055(CachedRowSet rs) throws Exception { + } + + @Test(dataProvider = "rowSetType") + public void WebRowSetTest0009(WebRowSet wrs1) throws Exception { + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/serial/SQLInputImplTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/serial/SQLInputImplTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,211 @@ +/* + * 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.rowset.serial; + +import java.net.URL; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Ref; +import java.sql.SQLException; +import java.sql.Struct; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import javax.sql.rowset.serial.SQLInputImpl; +import static org.testng.Assert.*; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import util.BaseTest; +import util.StubArray; +import util.StubBlob; +import util.StubClob; +import util.StubRef; +import util.StubStruct; +import util.SuperHero; +import util.TestSQLDataImpl; + +public class SQLInputImplTests extends BaseTest { + + // Copy of the array of data type values + private Object[] typeValues; + private TestSQLDataImpl impl; + private Map> map ; + private SuperHero hero; + private final String sqlType = "SUPERHERO"; + + @BeforeMethod + @Override + public void setUpMethod() throws Exception { + map = new HashMap<>(); + impl = new TestSQLDataImpl("TestSQLData"); + typeValues = Arrays.copyOf(TestSQLDataImpl.attributes, + TestSQLDataImpl.attributes.length); + hero = new SuperHero(sqlType, "Bruce", "Wayne", + 1939, "Batman"); + } + + /* + * Validate that a SQLException is thrown if the attribute value is + * null + */ + @Test(expectedExceptions = SQLException.class) + public void test() throws Exception { + SQLInputImpl x = new SQLInputImpl(null, map); + } + + /* + * Validate that a SQLException is thrown if the map value is + * null + */ + @Test(expectedExceptions = SQLException.class) + public void test02() throws Exception { + SQLInputImpl x = new SQLInputImpl(typeValues, null); + } + + /* + * Read in the various datatypes via readSQL (which will exercise the + * various readXXX methods and validate that results are as expected + */ + @Test() + public void test03() throws Exception { + impl.readSQL(new SQLInputImpl(typeValues, map), "misc"); + assertTrue(Arrays.equals(impl.toArray(), typeValues)); + // Null out a field and make sure the arrays do not match + typeValues[2] = null; + assertFalse(Arrays.equals(impl.toArray(), typeValues)); + } + + /* + * Validate that wasNull indicates if a null was read in + */ + @Test() + public void test04() throws Exception { + Object[] values = {"Hello", null, 1}; + SQLInputImpl sqli = new SQLInputImpl(values, map); + String s = sqli.readString(); + assertFalse(sqli.wasNull()); + s = sqli.readString(); + assertTrue(sqli.wasNull()); + int i = sqli.readInt(); + assertFalse(sqli.wasNull()); + } + + /* + * Validate that readObject returns the correct value + */ + @Test() + public void test05() throws Exception { + Object[] values = {hero}; + SQLInputImpl sqli = new SQLInputImpl(values, map); + Object o = sqli.readObject(); + assertTrue(hero.equals(o)); + + } + + /* + * Validate a Array can be read + */ + @Test(enabled = true) + public void test06() throws Exception { + Object[] coffees = new Object[]{"Espresso", "Colombian", "French Roast", + "Cappuccino"}; + Array a = new StubArray("VARCHAR", coffees); + Object[] values = {a}; + SQLInputImpl sqli = new SQLInputImpl(values, map); + Array a2 = sqli.readArray(); + assertTrue(Arrays.equals((Object[]) a2.getArray(), (Object[]) a.getArray())); + assertTrue(a.getBaseTypeName().equals(a2.getBaseTypeName())); + } + + /* + * Validate a Blob can be read + */ + @Test(enabled = true) + public void test07() throws Exception { + Blob b = new StubBlob(); + Object[] values = {b}; + SQLInputImpl sqli = new SQLInputImpl(values, map); + Blob b2 = sqli.readBlob(); + assertTrue(Arrays.equals( + b.getBytes(1, (int) b.length()), + b2.getBytes(1, (int) b2.length()))); + } + + /* + * Validate a Clob can be read + */ + @Test(enabled = true) + public void test08() throws Exception { + Clob c = new StubClob(); + Object[] values = {c}; + SQLInputImpl sqli = new SQLInputImpl(values, map); + Clob c2 = sqli.readClob(); + assertTrue(c.getSubString(1, + (int) c.length()).equals(c2.getSubString(1, (int) c2.length()))); + } + + /* + * Validate a Ref can be read + */ + @Test(enabled = true) + public void test09() throws Exception { + Ref ref = new StubRef(sqlType, hero); + Object[] values = {ref}; + SQLInputImpl sqli = new SQLInputImpl(values, map); + Ref ref2 = sqli.readRef(); + assertTrue(ref.getObject().equals(ref2.getObject())); + assertTrue(ref.getBaseTypeName().equals(ref2.getBaseTypeName())); + } + + /* + * Validate a URL can be read + */ + @Test(enabled = true) + public void test10() throws Exception { + URL u = new URL("http://www.oracle.com/");; + Object[] values = {u}; + SQLInputImpl sqli = new SQLInputImpl(values, map); + URL u2 = sqli.readURL(); + assertTrue(u2.equals(u)); + assertTrue(u2.sameFile(u)); + } + + /* + * Validate that readObject returns the correct value when a Struct is + * next on the stream + */ + @Test() + public void test11() throws Exception { + Object[] attributes = new Object[]{"Bruce", "Wayne", 1939, + "Batman"}; + map.put(sqlType, Class.forName("util.SuperHero")); + Struct struct = new StubStruct(sqlType, attributes); + Object[] values = {struct}; + SQLInputImpl sqli = new SQLInputImpl(values, map); + Object o = sqli.readObject(); + + assertTrue(hero.equals(o)); + + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/serial/SQLOutputImplTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/serial/SQLOutputImplTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,199 @@ +/* + * 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.rowset.serial; + +import java.net.URL; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Ref; +import java.sql.SQLException; +import java.sql.Struct; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Vector; +import javax.sql.rowset.serial.SQLInputImpl; +import javax.sql.rowset.serial.SQLOutputImpl; +import javax.sql.rowset.serial.SerialArray; +import javax.sql.rowset.serial.SerialBlob; +import javax.sql.rowset.serial.SerialClob; +import javax.sql.rowset.serial.SerialDatalink; +import javax.sql.rowset.serial.SerialRef; +import javax.sql.rowset.serial.SerialStruct; +import static org.testng.Assert.*; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import util.BaseTest; +import util.StubArray; +import util.StubBlob; +import util.StubClob; +import util.StubRef; +import util.StubStruct; +import util.SuperHero; +import util.TestSQLDataImpl; + +public class SQLOutputImplTests extends BaseTest { + + // Copy of the array of data type values + private Object[] typeValues; + private TestSQLDataImpl impl; + private Map> map = new HashMap<>(); + private Vector results; + private final String sqlType = "SUPERHERO"; + private SuperHero hero; + private SQLOutputImpl outImpl; + + @BeforeMethod + @Override + public void setUpMethod() throws Exception { + results = new Vector(); + impl = new TestSQLDataImpl("TestSQLData"); + typeValues = Arrays.copyOf(TestSQLDataImpl.attributes, + TestSQLDataImpl.attributes.length); + hero = new SuperHero(sqlType, "Bruce", "Wayne", 1939, "Batman"); + outImpl = new SQLOutputImpl(results, map); + } + + /* + * Validate that a SQLException is thrown if the attribute value is + * null + */ + @Test(expectedExceptions = SQLException.class) + public void test() throws Exception { + SQLOutputImpl x = new SQLOutputImpl(null, map); + } + + /* + * Validate that a SQLException is thrown if the map value is + * null + */ + @Test(expectedExceptions = SQLException.class) + public void test02() throws Exception { + SQLOutputImpl x = new SQLOutputImpl(results, null); + } + + /* + * Read in the various datatypes via readSQL (which will exercise the + * various readXXX methods and validate that results are as expected + */ + @Test() + public void test03() throws Exception { + impl.readSQL(new SQLInputImpl(typeValues, map), "misc"); + impl.writeSQL(outImpl); + assertTrue(Arrays.equals(results.toArray(), typeValues)); + // Null out a field and make sure the arrays do not match + typeValues[2] = null; + assertFalse(Arrays.equals(results.toArray(), typeValues)); + } + + /* + * Validate a Array can be written and returned + */ + @Test(enabled = true) + public void test04() throws Exception { + Object[] coffees = new Object[]{"Espresso", "Colombian", "French Roast", + "Cappuccino"}; + Array a = new StubArray("VARCHAR", coffees); + outImpl.writeArray(a); + SerialArray sa = (SerialArray) results.get(0); + assertTrue(Arrays.equals(coffees, (Object[]) sa.getArray())); + assertTrue(a.getBaseTypeName().equals(sa.getBaseTypeName())); + } + + /* + * Validate a Blob can be written and returned + */ + @Test(enabled = true) + public void test05() throws Exception { + Blob b = new StubBlob(); + outImpl.writeBlob(b); + SerialBlob sb = (SerialBlob) results.get(0); + assertTrue(Arrays.equals( + b.getBytes(1, (int) b.length()), + sb.getBytes(1, (int) sb.length()))); + } + + /* + * Validate a Clob can be written and returned + */ + @Test(enabled = true) + public void test06() throws Exception { + Clob c = new StubClob(); + outImpl.writeClob(c); + SerialClob sc = (SerialClob) results.get(0); + assertTrue(c.getSubString(1, + (int) c.length()).equals(sc.getSubString(1, (int) sc.length()))); + } + + /* + * Validate a Ref can be written and returned + */ + @Test(enabled = true) + public void test07() throws Exception { + Ref ref = new StubRef(sqlType, hero); + outImpl.writeRef(ref); + SerialRef sr = (SerialRef) results.get(0); + assertTrue(hero.equals(sr.getObject())); + } + + /* + * Validate a Struct can be written and returned + */ + @Test(enabled = true) + public void test08() throws Exception { + Object[] attributes = new Object[]{"Bruce", "Wayne", 1939, + "Batman"}; + Struct s = new StubStruct(sqlType, attributes); + outImpl.writeStruct(s); + SerialStruct ss = (SerialStruct) results.get(0); + assertTrue(Arrays.equals(attributes, (Object[]) ss.getAttributes())); + assertTrue(sqlType.equals(ss.getSQLTypeName())); + } + + /* + * Validate a DataLink can be written and returned + */ + @Test(enabled = true) + public void test09() throws Exception { + URL u = new URL("http://www.oracle.com/"); + outImpl.writeURL(u); + SerialDatalink sdl = (SerialDatalink) results.get(0); + URL u2 = sdl.getDatalink(); + assertTrue(u2.equals(u)); + assertTrue(u2.sameFile(u)); + } + + /* + * Validate an Object implementing SQLData can be written and returned + */ + @Test(enabled = true) + public void test10() throws Exception { + Object[] attributes = new Object[]{"Bruce", "Wayne", 1939, + "Batman"}; + outImpl.writeObject(hero); + SerialStruct ss = (SerialStruct) results.get(0); + assertTrue(Arrays.equals(attributes, (Object[]) ss.getAttributes())); + assertTrue(sqlType.equals(ss.getSQLTypeName())); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/serial/SerialArrayTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/serial/SerialArrayTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,236 @@ +/* + * 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.rowset.serial; + +import java.sql.Array; +import java.sql.SQLException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import javax.sql.rowset.serial.SerialArray; +import javax.sql.rowset.serial.SerialException; +import static org.testng.Assert.*; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import util.BaseTest; +import util.StubArray; + +public class SerialArrayTests extends BaseTest { + + private Object[] coffees; + private final String sqlType = "VARCHAR"; + private Array a; + private Map> map; + + @BeforeMethod + public void setUpMethod() throws Exception { + coffees = new Object[]{"Espresso", "Colombian", "French Roast", + "Cappuccino"}; + a = new StubArray(sqlType, coffees); + map = new HashMap<>(); + } + + /* + * Validate a SerialArray can be created from an Array + */ + @Test + public void test01() throws Exception { + SerialArray sa = new SerialArray(a); + } + + /* + * Validate a SQLException is thrown if the map is null + */ + @Test(expectedExceptions = SQLException.class) + public void test02() throws Exception { + SerialArray sa = new SerialArray(a, null); + } + + /* + * Validate a SerialException is thrown when getResultSet() is called + */ + @Test(expectedExceptions = SerialException.class) + public void test03() throws Exception { + SerialArray sa = new SerialArray(a); + sa.getResultSet(); + } + + /* + * Validate a SerialException is thrown when getResultSet() is called + */ + @Test(expectedExceptions = SerialException.class) + public void test04() throws Exception { + SerialArray sa = new SerialArray(a); + sa.getResultSet(null); + } + + /* + * Validate a SerialException is thrown when getResultSet() is called + */ + @Test(expectedExceptions = SerialException.class) + public void test05() throws Exception { + SerialArray sa = new SerialArray(a); + sa.getResultSet(1, 1); + } + + /* + * Validate a SerialException is thrown when getResultSet() is called + */ + @Test(expectedExceptions = SerialException.class) + public void test06() throws Exception { + SerialArray sa = new SerialArray(a); + sa.getResultSet(1, 1, null); + } + + /* + * Validate a SerialException is thrown when getArray() is invoked after + * free() is called + */ + @Test(expectedExceptions = SerialException.class) + public void test07() throws Exception { + SerialArray sa = new SerialArray(a); + sa.free(); + sa.getArray(); + } + + /* + * Validate a SerialException is thrown when getArray() is invoked after + * free() is called + */ + @Test(expectedExceptions = SerialException.class) + public void test08() throws Exception { + SerialArray sa = new SerialArray(a); + sa.free(); + sa.getArray(map); + } + + /* + * Validate a SerialException is thrown when getArray() is invoked after + * free() is called + */ + @Test(expectedExceptions = SerialException.class) + public void test09() throws Exception { + SerialArray sa = new SerialArray(a); + sa.free(); + sa.getArray(1, 1, map); + } + + /* + * Validate a SerialException is thrown when getArray() is invoked after + * free() is called + */ + @Test(expectedExceptions = SerialException.class) + public void test10() throws Exception { + SerialArray sa = new SerialArray(a); + sa.free(); + sa.getArray(1, 1); + } + + /* + * Validate a SerialException is thrown when getBaseType() is invoked after + * free() is called + */ + @Test(expectedExceptions = SerialException.class) + public void test11() throws Exception { + SerialArray sa = new SerialArray(a); + sa.free(); + sa.getBaseType(); + } + + /* + * Validate a SerialException is thrown when getBaseTypeName() is invoked after + * free() is called + */ + @Test(expectedExceptions = SerialException.class) + public void test12() throws Exception { + SerialArray sa = new SerialArray(a); + sa.free(); + sa.getBaseTypeName(); + } + + /* + * Validate getArray() returns the same Object[] used to create the + * SerialArray + */ + @Test + public void test13() throws Exception { + SerialArray sa = new SerialArray(a); + Object[] o = (Object[]) sa.getArray(); + assertTrue(Arrays.equals(o, coffees)); + } + + /* + * Validate getArray() returns the same Object[] used to create the + * SerialArray + */ + @Test + public void test14() throws Exception { + SerialArray sa = new SerialArray(a); + Object[] o = (Object[]) sa.getArray(map); + assertTrue(Arrays.equals(o, coffees)); + } + + /* + * Validate getArray() returns the same Object[] used to create the + * SerialArray + */ + @Test + public void test15() throws Exception { + SerialArray sa = new SerialArray(a); + Object[] o = (Object[]) sa.getArray(1, 2); + assertTrue(Arrays.equals(o, Arrays.copyOfRange(coffees, 1, 3))); + } + + /* + * Validate getArray() returns the same Object[] used to create the + * SerialArray + */ + @Test + public void test16() throws Exception { + SerialArray sa = new SerialArray(a); + Object[] o = (Object[]) sa.getArray(1, 2, map); + assertTrue(Arrays.equals(o, Arrays.copyOfRange(coffees, 1, 3))); + } + + /* + * clone() a SerialArray and check that it is equal to the + * object it was cloned from + */ + @Test + public void test17() throws Exception { + SerialArray sa = new SerialArray(a); + SerialArray sa1 = (SerialArray) sa.clone(); + assertTrue(sa.equals(sa1)); + } + + /* + * Validate that a SerialArray that is serialized & deserialized is equal to + * itself + */ + @Test + public void test18() throws Exception { + SerialArray sa = new SerialArray(a); + SerialArray sa1 = serializeDeserializeObject(sa);; + assertTrue(sa.equals(sa1)); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/serial/SerialBlobTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/serial/SerialBlobTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,399 @@ +/* + * 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.rowset.serial; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Arrays; +import javax.sql.rowset.serial.SerialBlob; +import javax.sql.rowset.serial.SerialException; +import static org.testng.Assert.*; +import org.testng.annotations.Test; +import util.BaseTest; +import util.StubBlob; + +public class SerialBlobTests extends BaseTest { + + // byte[] used to populate SerialBlob + private byte[] bytes = new byte[]{1, 2, 3, 4, 5}; + + /* + * Validate calling free() does not throw an Exception + */ + @Test + public void test() throws Exception { + SerialBlob sb = new SerialBlob(new StubBlob()); + sb.free(); + } + + /* + * Validate calling getBinaryStream() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test01() throws Exception { + SerialBlob sb = new SerialBlob(new StubBlob()); + sb.free(); + sb.getBinaryStream(); + } + + /* + * Validate calling getBinaryStream() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test02() throws Exception { + SerialBlob sb = new SerialBlob(new StubBlob()); + sb.free(); + sb.getBinaryStream(1, 5); + } + + /* + * Validate calling getBytes() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test03() throws Exception { + SerialBlob sb = new SerialBlob(new StubBlob()); + sb.free(); + sb.getBytes(1, 1); + } + + /* + * Validate calling getLength() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test04() throws Exception { + SerialBlob sb = new SerialBlob(new StubBlob()); + sb.free(); + sb.length(); + } + + /* + * Validate calling position() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test05() throws Exception { + SerialBlob sb = new SerialBlob(new StubBlob()); + sb.free(); + sb.position(new byte[5], 1); + } + + /* + * Validate calling position() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test06() throws Exception { + SerialBlob sb = new SerialBlob(new StubBlob()); + sb.free(); + sb.position(new StubBlob(), 1); + } + + /* + * Validate calling free() after calling setBinaryStream() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test07() throws Exception { + SerialBlob sb = new SerialBlob(new StubBlob()); + sb.free(); + sb.setBinaryStream(5); + } + + /* + * Validate calling free() after calling setBytes() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test08() throws Exception { + SerialBlob sb = new SerialBlob(new StubBlob()); + sb.free(); + sb.setBytes(1, new byte[5]); + } + + /* + * Validate calling setBytes() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test09() throws Exception { + SerialBlob sb = new SerialBlob(new StubBlob()); + sb.free(); + sb.setBytes(1, new byte[10], 0, 5); + } + + /* + * Validate calling truncate() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test10() throws Exception { + SerialBlob sb = new SerialBlob(new StubBlob()); + sb.free(); + sb.truncate(1); + } + + /* + * Validate getBinaryStream returns the correct bytes + */ + @Test + public void test11() throws Exception { + byte[] expected = new byte[]{1, 2, 3}; + SerialBlob sb = new SerialBlob(bytes); + InputStream is = sb.getBinaryStream(1, 3); + for (byte b : expected) { + byte val = (byte) is.read(); + assertTrue(b == val, val + " does not match " + b); + } + } + + /* + * Validate a SerialException is thrown if pos < 0 for getBinaryStream + */ + @Test(expectedExceptions = SerialException.class) + public void test12() throws Exception { + SerialBlob sb = new SerialBlob(bytes); + InputStream is = sb.getBinaryStream(-1, 3); + } + + /* + * Validate a SerialException is thrown if pos = 0 for getBinaryStream + */ + @Test(expectedExceptions = SerialException.class) + public void test13() throws Exception { + SerialBlob sb = new SerialBlob(bytes); + InputStream is = sb.getBinaryStream(0, 3); + } + + /* + * Validate a SerialException is thrown if len > the length of the stream + * for getBinaryStream + */ + @Test(expectedExceptions = SerialException.class) + public void test14() throws Exception { + SerialBlob sb = new SerialBlob(bytes); + InputStream is = sb.getBinaryStream(0, 3); + } + + /* + * Validate a SerialException is thrown if length < 1 + */ + @Test(expectedExceptions = SerialException.class) + public void test15() throws Exception { + SerialBlob sb = new SerialBlob(bytes); + InputStream is = sb.getBinaryStream(1, 0); + } + + /* + * Validate a SerialException is thrown if length > byte array length + */ + @Test(expectedExceptions = SerialException.class) + public void test16() throws Exception { + SerialBlob sb = new SerialBlob(bytes); + InputStream is = sb.getBinaryStream(1, 6); + } + + /* + * Validate a SerialException is thrown if pos > byte array length + */ + @Test(expectedExceptions = SerialException.class) + public void test17() throws Exception { + SerialBlob sb = new SerialBlob(bytes); + InputStream is = sb.getBinaryStream(bytes.length + 2, 6); + } + + /* + * Validate that a cloned SerializedBlob bytes match the original + */ + @Test + public void test18() throws Exception { + SerialBlob sb = new SerialBlob(bytes); + SerialBlob sb2 = (SerialBlob) sb.clone(); + assertTrue( + Arrays.equals(sb.getBytes(1, (int) sb.length()), + sb2.getBytes(1, (int) sb2.length())), + "arrays do not match "); + } + + /* + * Test clone after free has been called that the clone is not accessible + */ + @Test(expectedExceptions = SerialException.class) + public void test19() throws Exception { + SerialBlob sb = new SerialBlob(bytes); + sb.free(); + SerialBlob sb2 = (SerialBlob) sb.clone(); + InputStream is = sb2.getBinaryStream(1, 3); + } + + /* + * Validate that a SerialBlob that is serialized & deserialized is equal to + * itself + */ + @Test + public void test20() throws Exception { + SerialBlob sb = new SerialBlob(bytes); + SerialBlob sb2 = serializeDeserializeObject(sb); + assertTrue(sb.equals(sb2), "SerialBlob not equal"); + } + + /* + * Validate a SerialException is thrown if byte[] is used to + * create the SeriablBlob and setBinaryStream is called + */ + @Test(expectedExceptions = SerialException.class) + public void test21() throws Exception { + SerialBlob sb = new SerialBlob(bytes); + sb.setBinaryStream(3); + } + + /* + * Validate that setBytes will properly write a set of bytes to the + * specified location in the SerialBlob and the correct count is returned + * for bytes written + */ + @Test + public void test22() throws Exception { + byte[] diff = new byte[]{7, 8, 9}; + byte[] expected = new byte[]{1, 7, 8, 9, 5}; + SerialBlob sb = new SerialBlob(bytes); + int written = sb.setBytes(2, diff); + assertEquals(written, diff.length); + assertTrue( + Arrays.equals(sb.getBytes(1, (int) sb.length()), + expected), + "arrays do not match "); + } + + /* + * Validate that setBytes will properly write a set of bytes to the + * specified location in the SerialBlob and the correct count is returned + * for bytes written + */ + @Test + public void test23() throws Exception { + int bytesToWrite = 3; + byte[] diff = new byte[]{7, 8, 9, 0}; + byte[] expected = new byte[]{1, 8, 9, 0, 5}; + SerialBlob sb = new SerialBlob(bytes); + int written = sb.setBytes(2, diff, 1, bytesToWrite); + assertEquals(written, bytesToWrite); + assertTrue( + Arrays.equals(sb.getBytes(1, (int) sb.length()), + expected), + "arrays do not match "); + } + + /* + * Validate that truncate reduces the length of the SerlizedBlob to the + * specified value + */ + @Test + public void test24() throws Exception { + SerialBlob sb = new SerialBlob(bytes); + sb.truncate(0); + assertTrue(sb.length() == 0); + sb = new SerialBlob(bytes); + sb.truncate(3); + assertTrue(sb.length() == 3); + } + + /* + * Validate getBinaryStream returns the correct bytes + */ + @Test + public void test25() throws Exception { + byte[] expected = bytes; + SerialBlob sb = new SerialBlob(bytes); + InputStream is = sb.getBinaryStream(); + for (byte b : expected) { + byte val = (byte) is.read(); + assertTrue(b == val, val + " does not match " + b); + } + } + + /* + * Validate setBinaryStream returns an OutputStream when passed a Blob + */ + @Test + public void test26() throws Exception { + SerialBlob sb = new SerialBlob(new StubBlob()); + OutputStream os = sb.setBinaryStream(0); + assertTrue(os != null); + } + + /* + * Validate that position returns the correct starting location for a + * pattern in the SerialBlob + */ + @Test + public void test27() throws Exception { + long expectedPos = 3; // starting offset is 1 vs 0 + byte[] pattern = new byte[]{3, 4}; + SerialBlob sb = new SerialBlob(bytes); + long pos = sb.position(pattern, 1); + assertEquals(pos, expectedPos); + } + + /* + * Validate that position returns the correct starting location for a + * pattern in the SerialBlob + */ + @Test + public void test28() throws Exception { + long expectedPos = 3; // starting offset is 1 vs 0 + byte[] pattern = new byte[]{3, 4, 5}; + SerialBlob sb = new SerialBlob(bytes); + long pos = sb.position(pattern, 2); + assertEquals(pos, expectedPos); + } + + /* + * Validate that position returns the correct starting location for a + * pattern in the SerialBlob + */ + @Test + public void test29() throws Exception { + long expectedPos = 2; // starting offset is 1 vs 0 + byte[] pattern = new byte[]{4, 6}; + SerialBlob sb = new SerialBlob(new StubBlob()); + long pos = sb.position(pattern, 1); + assertEquals(pos, expectedPos); + } + + /* + * Validate that position returns the correct starting location for a + * pattern in the SerialBlob + */ + @Test + public void test30() throws Exception { + long expectedPos = 3; // starting offset is 1 vs 0 + byte[] pattern = new byte[]{6, 8}; + SerialBlob sb = new SerialBlob(new StubBlob()); + long pos = sb.position(pattern, 2); + assertEquals(pos, expectedPos); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/serial/SerialClobTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/serial/SerialClobTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,499 @@ +/* + * 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.rowset.serial; + +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Reader; +import java.io.Writer; +import javax.sql.rowset.serial.SerialClob; +import javax.sql.rowset.serial.SerialException; +import static org.testng.Assert.*; +import org.testng.annotations.Test; +import util.BaseTest; +import util.StubClob; + +public class SerialClobTests extends BaseTest { + + // char[] used to populate SerialClob + private final char[] chars; + + public SerialClobTests() { + this.chars = new char[]{'h', 'e', 'l', 'l', 'o', ' ', 'w', + 'o', 'r', 'l', 'd'}; + } + + /* + * Validate calling free() does not throw an Exception + */ + @Test + public void test() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + sc.free(); + } + + /* + * Validate calling getCharacterStream() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test01() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + sc.free(); + sc.getCharacterStream(); + } + + /* + * Validate calling getCharacterStream() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test02() throws Exception { + SerialClob sc = new SerialClob(chars); + sc.free(); + sc.getCharacterStream(); + } + + /* + * Validate calling getCharacterStream() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test03() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + sc.free(); + sc.getCharacterStream(1, 5); + } + + /* + * Validate calling getSubString() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test04() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + sc.free(); + sc.getSubString(1, 1); + } + + /* + * Validate calling truncate() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test05() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + sc.free(); + sc.truncate(1); + } + + /* + * Validate calling getAsciiStream() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test06() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + sc.free(); + sc.getAsciiStream(); + } + + /* + * Validate calling length() after calling free() throws an SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test07() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + sc.free(); + sc.length(); + } + + /* + * Validate calling position() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test08() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + sc.free(); + sc.position("hello", 1); + } + + /* + * Validate calling position() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test09() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + sc.free(); + sc.position(new StubClob(), 1); + } + + /* + * Validate calling setAsciiStream() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test10() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + sc.free(); + sc.setAsciiStream(5); + } + + /* + * Validate calling setCharacterStream() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test11() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + sc.free(); + sc.setCharacterStream(5); + } + + /* + * Validate calling setString() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test12() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + sc.free(); + sc.setString(1, "hello"); + } + + /* + * Validate calling setString() after calling free() throws an + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test13() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + sc.free(); + sc.setString(1, "hello", 0, 5); + } + + /* + * Test that SerialException is thrown if pos < 0 on a call to + * getCharacterStream + */ + @Test(expectedExceptions = SerialException.class) + public void test14() throws Exception { + SerialClob sc = new SerialClob(chars); + sc.getCharacterStream(-1, 5); + } + + /* + * Test that SerialException is thrown if pos = 0 on a call to + * getCharacterStream + */ + @Test(expectedExceptions = SerialException.class) + public void test15() throws Exception { + SerialClob sc = new SerialClob(chars); + sc.getCharacterStream(0, 5); + } + + /* + * Test that SerialException is thrown if pos = 0 on a call to + * getCharacterStream + */ + @Test(expectedExceptions = SerialException.class) + public void test16() throws Exception { + SerialClob sc = new SerialClob(chars); + sc.getCharacterStream(1, 100); + } + + /* + * Test that SerialException is thrown if length = 0 on a call to + * getCharacterStream + */ + @Test(expectedExceptions = SerialException.class) + public void test17() throws Exception { + SerialClob sc = new SerialClob(chars); + sc.getCharacterStream(1, 0); + } + + /* + * Test that SerialException is thrown if pos > length on a call to + * getCharacterStream + */ + @Test(expectedExceptions = SerialException.class) + public void test18() throws Exception { + SerialClob sc = new SerialClob(chars); + sc.getCharacterStream(100, 5); + } + + /* + * Clone a SerialClob and check that it is equal to itself + */ + @Test + public void test19() throws Exception { + SerialClob sc = new SerialClob(chars); + SerialClob sc1 = (SerialClob) sc.clone(); + assertTrue(sc.equals(sc1), "SerialClobs not equal"); + } + + /* + * Validate that a getAsciiStream() returns an InputStream when a Clob is + * used to create the SerialClob + */ + @Test + public void test20() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + InputStream is = sc.getAsciiStream(); + assertTrue(is != null); + } + + /* + * Validate that a getCharacterStream() returns an Reader when a Clob is + * used to create the SerialClob + */ + @Test + public void test21() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + Reader is = sc.getCharacterStream(); + assertTrue(is != null); + } + + /* + * Validate that a getCharacterStream() returns an Reader when a char[] is + * used to create the SerialClob + */ + @Test + public void test22() throws Exception { + SerialClob sc = new SerialClob(chars); + Reader is = sc.getCharacterStream(); + assertTrue(is != null); + } + + /* + * Validate that a getSubString() returns the correct value when a char[] is + * used to create the SerialClob + */ + @Test + public void test23() throws Exception { + SerialClob sc = new SerialClob(chars); + String expected = "world"; + assertEquals(expected, sc.getSubString(7, 5)); + } + + /* + * Validate that a getSubString() returns the correct value when a Clob is + * used to create the SerialClob + */ + @Test + public void test24() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + String expected = "test string"; + assertEquals(expected, sc.getSubString(5, 11)); + } + + /* + * Validate that position() returns the correct value when a Clob is used to + * create the SerialClob + */ + @Test + public void test25() throws Exception { + long expectedPos = 5; + SerialClob sc = new SerialClob(new StubClob()); + String expected = "test string"; + long pos = sc.position(expected, 1); + assertEquals(expectedPos, pos); + } + + /* + * Validate that position returned is -1 when an the search string is not + * part of the SerialClob + */ + @Test + public void test26() throws Exception { + long expectedPos = -1; + SerialClob sc = new SerialClob(chars); + String expected = "test string"; + long pos = sc.position(expected, 1); + assertEquals(expectedPos, pos); + } + + /* + * Validate that position() returned is -1 when an the search string is not + * part of the SerialClob + */ + @Test + public void test27() throws Exception { + long expectedPos = -1; + SerialClob sc = new SerialClob(new StubClob()); + String expected = "I am Batman"; + long pos = sc.position(expected, 2); + assertEquals(expectedPos, pos); + } + + /* + * Validate that position() returns the correct value when a char[] is used + * to create the SerialClob + */ + @Test + public void test28() throws Exception { + long expectedPos = 2; + SerialClob sc = new SerialClob(chars); + String expected = "ello"; + long pos = sc.position(expected, 1); + assertEquals(expectedPos, pos); + } + + /* + * Validate that position() returns the correct value when a SerialClob is + * used for the search argument + */ + @Test + public void test29() throws Exception { + long expectedPos = 21; + String expected = "Batman"; + String buf = "I am Joker, not the Batman, hahaha"; + SerialClob sc = new SerialClob(expected.toCharArray()); + SerialClob sc1 = new SerialClob(buf.toCharArray()); + long pos = sc1.position(sc, 1); + assertEquals(expectedPos, pos); + } + + /* + * Validate that position() returns the correct value when a SerialClob is + * used for the search argument + */ + @Test + public void test30() throws Exception { + long expectedPos = 17; + String expected = "012"; + SerialClob sc = new SerialClob(expected.toCharArray()); + SerialClob sc1 = new SerialClob(new StubClob()); + long pos = sc1.position(sc, 1); + assertEquals(expectedPos, pos); + } + + /* + * Check that setString() updates the appropriate characters in the + * SerialClob + */ + @Test + public void test31() throws Exception { + String val = "Hello, I am Bruce Wayne"; + String val1 = "the Batman!"; + String expected = "Hello, I am the Batman!"; + SerialClob sc = new SerialClob(val.toCharArray()); + int written = sc.setString(13, val1); + assertEquals(val1.length(), written); + assertTrue(expected.equals(sc.getSubString(1, (int) sc.length()))); + } + + /* + * Check that setString() updates the appropriate characters in the + * SerialClob + */ + @Test(enabled = false) + public void test32() throws Exception { + int expectedWritten = 9; + String val = "Hi, I am Catwoman!!!!!!"; + String val1 = "Hahaha the Joker, who are you?!"; + String expected = "Hi, I am the Joker!"; + SerialClob sc = new SerialClob(val.toCharArray()); + int written = sc.setString(10, val1, 8, expectedWritten+1); + assertEquals(written, expectedWritten); + + } + + /* + * Check that setCharacterStream() returns a non-null Writer for an + * SerialClob created from a Clob + */ + @Test + public void test33() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + Writer w = sc.setCharacterStream(1); + assertTrue(w != null); + } + + /* + * Check that setAsciiStream() returns a non-null OutputStream for an SerialClob + * created from a Clob + */ + @Test + public void test34() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + OutputStream os = sc.setAsciiStream(1); + assertTrue(os != null); + } + + /* + * Check that truncate() truncates the length of the SerialClob to the + * specified size + */ + @Test + public void test35() throws Exception { + SerialClob sc = new SerialClob(new StubClob()); + sc.truncate(0); + assertTrue(sc.length() == 0); + sc = new SerialClob(chars); + sc.truncate(5); + assertTrue(sc.length() == 5); + } + + /* + * Check that getCharacterStream() returns a Reader and that the char[] that + * was specified to create the SerialClob can be returned via the Reader + */ + @Test + public void test36() throws Exception { + SerialClob sc = new SerialClob(chars); + Reader r = sc.getCharacterStream(); + for (char c : chars) { + char val = (char) r.read(); + assertTrue(c == val, val + " does not match " + c); + } + } + + /* + * Check that getCharacterStream() returns a Reader and that the char[] that + * was specified to create the SerialClob can be returned via the Reader + */ + @Test(enabled = false) + public void test37() throws Exception { + SerialClob sc = new SerialClob(chars); + String expected = "ello w"; + Reader r = sc.getCharacterStream(2, 6); + for (char c : expected.toCharArray()) { + char val = (char) r.read(); + assertTrue(c == val, val + " does not match " + c); + } + } + + /* + * Validate that a SerialClob that is serialized & deserialized is equal to + * itself + */ + @Test + public void test38() throws Exception { + SerialClob sc = new SerialClob(chars); + SerialClob sc2 = serializeDeserializeObject(sc); + assertTrue(sc.equals(sc2), "SerialClobs not equal"); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/serial/SerialDataLinkTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/serial/SerialDataLinkTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,110 @@ +/* + * 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.rowset.serial; + +import java.net.URL; +import javax.sql.rowset.serial.SerialDatalink; +import javax.sql.rowset.serial.SerialException; +import static org.testng.Assert.*; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import util.BaseTest; + +public class SerialDataLinkTests extends BaseTest { + + private URL u; + private URL u1; + private SerialDatalink dl; + + @BeforeMethod + public void setUpMethod() throws Exception { + u = new URL("http://www.oracle.com/"); + u1 = new URL("http://www.usatoday.com/"); + dl = new SerialDatalink(u); + } + + /* + * Validate that a SerialException is thrown if the URL is null + */ + @Test(expectedExceptions = SerialException.class) + public void test() throws Exception { + SerialDatalink dl1 = new SerialDatalink(null); + } + + /* + * Validate that getDatalink() returns the same URL used to create the + * SerialDatalink object + */ + @Test + public void test01() throws Exception { + URL u2 = dl.getDatalink(); + assertTrue(u2.equals(u)); + assertTrue(u2.sameFile(u)); + } + + /* + * Validate that URL returned from getDatalink() differs from a URL that was + * not used to create the SerialDatalink + */ + @Test + public void test02() throws Exception { + URL u2 = dl.getDatalink(); + assertFalse(u2.equals(u1)); + assertFalse(u2.sameFile(u1)); + } + + /* + * Create a clone of a SerialDatalink and validate that it is equal to the + * SerialDatalink it was cloned from + */ + @Test + public void test03() throws Exception { + SerialDatalink dl2 = (SerialDatalink) dl.clone(); + assertTrue(dl.equals(dl2)); + SerialDatalink dl3 = new SerialDatalink(u1); + assertFalse(dl2.equals(dl3)); + } + + /* + * Validate that a SerialDatalink that is serialized & deserialized is + * equal to itself + */ + @Test + public void test04() throws Exception { + SerialDatalink dl2 = serializeDeserializeObject(dl); + SerialDatalink dl3 = new SerialDatalink(u); + assertTrue(dl.equals(dl2)); + assertTrue(dl3.equals(dl2)); + } + + /** + * Validate that a SerialDatalink that is serialized & deserialized is not equal + * to to a SerialDatalink created using a different URL + */ + @Test + public void test05() throws Exception { + SerialDatalink dl2 = serializeDeserializeObject(dl); + SerialDatalink d3 = new SerialDatalink(u1); + assertFalse(d3.equals(dl2)); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/serial/SerialExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/serial/SerialExceptionTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,113 @@ +/* + * 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.rowset.serial; + +import java.sql.SQLException; +import javax.sql.rowset.serial.SerialException; +import static org.testng.Assert.*; +import org.testng.annotations.Test; +import util.BaseTest; + +public class SerialExceptionTests extends BaseTest { + + /* + * Create SerialException with no-arg constructor + */ + @Test + public void test01() { + SerialException ex = new SerialException(); + assertTrue(ex.getMessage() == null + && ex.getSQLState() == null + && ex.getCause() == null + && ex.getErrorCode() == 0); + } + + /* + * Create SerialException with message + */ + @Test + public void test02() { + SerialException ex = new SerialException(reason); + assertTrue(ex.getMessage().equals(reason) + && ex.getSQLState() == null + && ex.getCause() == null + && ex.getErrorCode() == 0); + } + + /* + * Validate that the ordering of the returned Exceptions is correct using + * for-each loop + */ + @Test + public void test03() { + SerialException ex = new SerialException("Exception 1"); + ex.initCause(t1); + SerialException ex1 = new SerialException("Exception 2"); + SerialException ex2 = new SerialException("Exception 3"); + ex2.initCause(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 test04() { + SQLException ex = new SerialException("Exception 1"); + ex.initCause(t1); + SerialException ex1 = new SerialException("Exception 2"); + SerialException ex2 = new SerialException("Exception 3"); + ex2.initCause(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(); + } + } + + /* + * Serialize a SerialException and make sure you can read it back properly + */ + @Test + public void test05() throws Exception { + SerialException e = new SerialException(reason); + SerialException ex1 = createSerializedException(e); + assertTrue(ex1.getMessage().equals(reason) + && ex1.getSQLState() == null + && ex1.getCause() == null + && ex1.getErrorCode() == 0);; + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/serial/SerialJavaObjectTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/serial/SerialJavaObjectTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,100 @@ +/* + * 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.rowset.serial; + +import java.lang.reflect.Field; +import java.util.Arrays; +import javax.sql.rowset.RowSetMetaDataImpl; +import javax.sql.rowset.serial.SerialException; +import javax.sql.rowset.serial.SerialJavaObject; +import static org.testng.Assert.*; +import org.testng.annotations.Test; +import util.BaseTest; + +public class SerialJavaObjectTests extends BaseTest { + + /* + * Validate that an NPE is thrown when null is specified to create + * the SerialJavaObject + */ + @Test(expectedExceptions = NullPointerException.class) + public void test() throws Exception { + SerialJavaObject sjo = new SerialJavaObject(null); + } + + /* + * Validate that an SerialExcepion is thrown when the object specified + * contains public static fields + */ + @Test(expectedExceptions = SerialException.class, enabled = false) + public void test01() throws Exception { + SerialJavaObject sjo = new SerialJavaObject(new RowSetMetaDataImpl()); + } + + /* + * Validate that an getFields()s returns the same Field[] for the object + * used to create the SerialJavaObject + */ + @Test + public void test02() throws Exception { + SerialException e = new SerialException(); + SerialJavaObject sjo = new SerialJavaObject(e); + Field[] f = e.getClass().getFields(); + assertTrue(Arrays.equals(f, sjo.getFields())); + assertFalse(Arrays.equals("hello".getClass().getFields(), + sjo.getFields())); + } + + /* + * clone() a SerialJavaObject and check that it is equal to the + * object it was cloned from + */ + @Test + public void test03() throws Exception { + SerialJavaObject sjo = new SerialJavaObject("Hello"); + SerialJavaObject sjo2 = (SerialJavaObject) sjo.clone(); + assertTrue(sjo.equals(sjo2)); + } + + /** + * Validate that a SerialJavaObject that is serialized & deserialized is + * equal to itself + */ + @Test + public void test04() throws Exception { + SerialJavaObject sjo = new SerialJavaObject("Hello"); + SerialJavaObject sjo2 = serializeDeserializeObject(sjo); + assertTrue(sjo.equals(sjo2)); + } + + /* + * Validate that a getObject() returns an object used to create the + * SerialJavaObject + */ + @Test + public void test05() throws Exception { + String s = "Hello world"; + SerialJavaObject sjo = new SerialJavaObject(s); + assertTrue(s.equals(sjo.getObject())); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/serial/SerialRefTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/serial/SerialRefTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,131 @@ +/* + * 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.rowset.serial; + +import java.sql.Ref; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.Map; +import javax.sql.rowset.serial.SerialRef; +import static org.testng.Assert.*; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import util.BaseTest; +import util.StubRef; +import util.SuperHero; + +public class SerialRefTests extends BaseTest { + + private static Map> map = new HashMap<>(); + private Ref ref; + private final String sqlType = "SUPERHERO"; + private SuperHero hero; + + @BeforeMethod + public void setUpMethod() throws Exception { + map.put(sqlType, Class.forName("util.SuperHero")); + hero = new SuperHero(sqlType, "Bruce", "Wayne", 1939, "Batman"); + ref = new StubRef(sqlType, hero); + } + + /* + * Validate that a SQLException() is thrown if the Ref is null + */ + @Test(expectedExceptions = SQLException.class) + public void test01() throws Exception { + SerialRef sr = new SerialRef(null); + } + + /* + * Validate that a SQLException() is thrown if the typeName is null in the + * Ref used to create the SerialRef + */ + @Test(expectedExceptions = SQLException.class) + public void test02() throws Exception { + SerialRef sr = new SerialRef(new StubRef(null, hero)); + } + + /* + * Validate that getBaseTypeName() returns the same SQLType specified + * to create the Ref + */ + @Test + public void test03() throws Exception { + SerialRef sr = new SerialRef(ref); + assertEquals(sr.getBaseTypeName(), sqlType); + } + + /* + * Validate that getObject() returns the same object used to create the Ref + */ + @Test + public void test04() throws Exception { + SerialRef sr = new SerialRef(ref); + assertTrue(hero.equals(sr.getObject())); + } + + /* + * Validate that getObject() returns the same object used to create the Ref + */ + @Test(enabled = false) + public void test05() throws Exception { + SerialRef sr = new SerialRef(ref); + assertTrue(hero.equals(sr.getObject(map))); + } + + /* + * Validate that setObject() can be used to change the value of the object + * pointed to by the SerialRef + */ + @Test + public void test06() throws Exception { + SerialRef sr = new SerialRef(ref); + assertTrue(hero.equals(sr.getObject())); + SuperHero h = new SuperHero(sqlType, "Dick", "Grayson", 1940, "Robin"); + sr.setObject(h); + assertFalse(hero.equals(sr.getObject())); + } + + /* + * clone() a SerialRef and check that it is equal to the + * object it was cloned from + */ + @Test + public void test09() throws Exception { + SerialRef sr = new SerialRef(ref); + SerialRef sr1 = (SerialRef) sr.clone(); + assertTrue(sr.equals(sr1)); + } + + /** + * Validate that a SerialRef that is serialized & deserialized is equal to + * itself for the Object & baseTypeName + */ + @Test + public void test10() throws Exception { + SerialRef sr = new SerialRef(ref); + SerialRef sr1 = serializeDeserializeObject(sr); + assertTrue(sr1.getObject().equals(sr.getObject()) + && sr1.getBaseTypeName().equals(sr.getBaseTypeName())); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/serial/SerialStructTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/serial/SerialStructTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,140 @@ +/* + * 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.rowset.serial; + +import java.sql.Struct; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import javax.sql.rowset.serial.SerialStruct; +import static org.testng.Assert.*; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import util.BaseTest; +import util.StubStruct; +import util.SuperHero; + +public class SerialStructTests extends BaseTest { + + private static Map> map = new HashMap<>(); + private Object[] attributes; + private Struct struct; + private final String sqlType = "SUPERHERO"; + private SuperHero hero; + + @BeforeMethod + public void setUpMethod() throws Exception { + attributes = new Object[]{"Bruce", "Wayne", 1939, + "Batman"}; + map.put(sqlType, Class.forName("util.SuperHero")); + struct = new StubStruct(sqlType, attributes); + hero = new SuperHero(sqlType, "Bruce", "Wayne", 1939, "Batman"); + } + + /* + * Validate that getSQLTypeName() returns the same SQLType specified by + * the Struct used to create the object + */ + @Test + public void test01() throws Exception { + SerialStruct ss = new SerialStruct(struct, map); + assertEquals(ss.getSQLTypeName(), sqlType); + } + + /* + * Validate that getSQLTypeName() returns the same SQLType specified by + * the Struct used to create the object + */ + @Test + public void test02() throws Exception { + SerialStruct ss = new SerialStruct(hero, map); + assertEquals(ss.getSQLTypeName(), sqlType); + } + + /* + * Validate that getAttributes() returns the same attributes specified by + * the Struct used to create the object + */ + @Test + public void test03() throws Exception { + SerialStruct ss = new SerialStruct(struct, map); + assertTrue(Arrays.equals(attributes, + ss.getAttributes())); + } + + /* + * Validate that getAttributes() returns the same attributes specified by + * the Struct used to create the object + */ + @Test + public void test04() throws Exception { + SerialStruct ss = new SerialStruct(hero, map); + assertTrue(Arrays.equals(attributes, + ss.getAttributes())); + } + + /* + * Validate that getAttributes() returns the + same attributes specified by + * the Struct used to create the object + */ + @Test + public void test05() throws Exception { + SerialStruct ss = new SerialStruct(struct, map); + assertTrue(Arrays.equals(attributes, + ss.getAttributes(map))); + } + + /* + * Validate that getAttributes() returns the same attributes specified by + * the Struct used to create the object + */ + @Test + public void test06() throws Exception { + SerialStruct ss = new SerialStruct(hero, map); + assertTrue(Arrays.equals(attributes, + ss.getAttributes(map))); + } + + /* + * clone() a SerialStruct and check that it is equal to the + * object it was cloned from + */ + @Test + public void test07() throws Exception { + SerialStruct ss = new SerialStruct(struct, map); + SerialStruct ss1 = (SerialStruct) ss.clone(); + assertTrue(ss.equals(ss1)); + } + + /** + * Validate that a SerialStruct that is serialized & deserialized is equal + * to itself + */ + @Test + public void test08() throws Exception { + SerialStruct ss = new SerialStruct(struct, map); + SerialStruct ss1 = serializeDeserializeObject(ss);; + assertTrue(ss.equals(ss1)); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/spi/SyncFactoryExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/spi/SyncFactoryExceptionTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,113 @@ +/* + * 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.rowset.spi; + +import java.sql.SQLException; +import javax.sql.rowset.spi.SyncFactoryException; +import static org.testng.Assert.*; +import org.testng.annotations.Test; +import util.BaseTest; + +public class SyncFactoryExceptionTests extends BaseTest { + + /* + * Create SyncFactoryException with no-arg constructor + */ + @Test + public void test01() { + SyncFactoryException ex = new SyncFactoryException(); + assertTrue(ex.getMessage() == null + && ex.getSQLState() == null + && ex.getCause() == null + && ex.getErrorCode() == 0); + } + + /* + * Create SyncFactoryException with message + */ + @Test + public void test02() { + SyncFactoryException ex = new SyncFactoryException(reason); + assertTrue(ex.getMessage().equals(reason) + && ex.getSQLState() == null + && ex.getCause() == null + && ex.getErrorCode() == 0); + } + + /* + * Validate that the ordering of the returned Exceptions is correct using + * for-each loop + */ + @Test + public void test03() { + SyncFactoryException ex = new SyncFactoryException("Exception 1"); + ex.initCause(t1); + SyncFactoryException ex1 = new SyncFactoryException("Exception 2"); + SyncFactoryException ex2 = new SyncFactoryException("Exception 3"); + ex2.initCause(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 test04() { + SQLException ex = new SyncFactoryException("Exception 1"); + ex.initCause(t1); + SyncFactoryException ex1 = new SyncFactoryException("Exception 2"); + SyncFactoryException ex2 = new SyncFactoryException("Exception 3"); + ex2.initCause(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(); + } + } + + /* + * Serialize a SyncFactoryException and make sure you can read it back properly + */ + @Test + public void test05() throws Exception { + SyncFactoryException e = new SyncFactoryException(reason); + SyncFactoryException ex1 = createSerializedException(e); + assertTrue(ex1.getMessage().equals(reason) + && ex1.getSQLState() == null + && ex1.getCause() == null + && ex1.getErrorCode() == 0); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/spi/SyncFactoryPermissionsTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/spi/SyncFactoryPermissionsTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,179 @@ +/* + * 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.rowset.spi; + +import java.security.AccessControlException; +import java.security.Policy; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.naming.Context; +import javax.sql.rowset.spi.SyncFactory; +import javax.sql.rowset.spi.SyncFactoryException; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import util.BaseTest; +import util.StubContext; +import util.TestPolicy; + +public class SyncFactoryPermissionsTests extends BaseTest { + + Context ctx; + private static Policy policy; + private static SecurityManager sm; + private final Logger alogger = Logger.getLogger(this.getClass().getName()); + + /* + * Install a SeeurityManager 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); + } + + /* + * Initialize a Context to be used in our tests. + * Save off the original Policy and SecurityManager + */ + public SyncFactoryPermissionsTests() { + policy = Policy.getPolicy(); + sm = System.getSecurityManager(); + ctx = new StubContext(); + } + + /* + * Validate that AccessControlException is thrown if + * SQLPermission("setSyncFactory") has not been granted + */ + @Test(expectedExceptions = AccessControlException.class) + public void test() throws Exception { + setPolicy(new TestPolicy()); + SyncFactory.setJNDIContext(ctx); + } + + /* + * Validate that a SyncFactoryException is thrown if the Logger is null + */ + @Test(expectedExceptions = SyncFactoryException.class) + public void test00() throws SyncFactoryException { + Logger l = SyncFactory.getLogger(); + } + + /* + * Validate that setJNDIContext succeeds if SQLPermission("setSyncFactory") + * has been granted + */ + @Test + public void test01() throws Exception { + setPolicy(new TestPolicy("setSyncFactory")); + SyncFactory.setJNDIContext(ctx); + } + + /* + * Validate that setJNDIContext succeeds if AllPermissions has been granted + */ + @Test + public void test02() throws Exception { + setPolicy(new TestPolicy("all")); + SyncFactory.setJNDIContext(ctx); + } + + /* + * Validate that AccessControlException is thrown if + * SQLPermission("setSyncFactory") has not been granted + */ + @Test(expectedExceptions = AccessControlException.class) + public void test03() throws Exception { + setPolicy(new TestPolicy()); + SyncFactory.setLogger(alogger); + } + + /* + * Validate that setLogger succeeds if SQLPermission("setSyncFactory") + * has been granted + */ + @Test + public void test04() throws Exception { + setPolicy(new TestPolicy("setSyncFactory")); + SyncFactory.setLogger(alogger); + } + + /* + * Validate that setLogger succeeds if AllPermissions has been granted + */ + @Test + public void test05() throws Exception { + setPolicy(new TestPolicy("all")); + SyncFactory.setLogger(alogger); + } + + /* + * Validate that AccessControlException is thrown if + * SQLPermission("setSyncFactory") has not been granted + */ + @Test(expectedExceptions = AccessControlException.class) + public void test06() throws Exception { + setPolicy(new TestPolicy()); + SyncFactory.setLogger(alogger, Level.INFO); + } + + /* + * Validate that AccessControlException is thrown if + * SQLPermission("setSyncFactory") and LoggingPermission("control", null) + * have not been granted + */ + @Test(expectedExceptions = AccessControlException.class) + public void test07() throws Exception { + setPolicy(new TestPolicy("setSyncFactory")); + SyncFactory.setLogger(alogger, Level.INFO); + } + + /* + * Validate that setLogger succeeds if SQLPermission("setSyncFactory") + * has been granted + */ + @Test + public void test08() throws Exception { + setPolicy(new TestPolicy("setSyncFactoryLogger")); + SyncFactory.setLogger(alogger, Level.INFO); + } + + /* + * Validate that setLogger succeeds if AllPermissions has been granted + */ + @Test + public void test09() throws Exception { + setPolicy(new TestPolicy("all")); + SyncFactory.setLogger(alogger, Level.INFO); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/spi/SyncFactoryTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/spi/SyncFactoryTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,220 @@ +/* + * 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.rowset.spi; + +import com.sun.rowset.providers.RIOptimisticProvider; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Enumeration; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.naming.Context; +import javax.sql.rowset.spi.SyncFactory; +import javax.sql.rowset.spi.SyncFactoryException; +import javax.sql.rowset.spi.SyncProvider; +import static org.testng.Assert.*; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import util.PropertyStubProvider; +import util.StubSyncProvider; +import util.StubContext; + +//com.sun.jndi.ldap.LdapCtxFactory +public class SyncFactoryTests { + private static String origFactory; + + private final String stubProvider = "util.StubSyncProvider"; + private final String propertyStubProvider = "util.PropertyStubProvider"; + private final Logger alogger = Logger.getLogger(this.getClass().getName()); + // Initial providers including those set via a property + List initialProviders; + // All providers including those specifically registered + List allProviders; + private Context ctx= null; + + public SyncFactoryTests() { + + // Add a provider via a property + System.setProperty("rowset.provider.classname", propertyStubProvider); + initialProviders = Arrays.asList( + "com.sun.rowset.providers.RIOptimisticProvider", + "com.sun.rowset.providers.RIXMLProvider", + propertyStubProvider); + allProviders = new ArrayList<>(); + allProviders.addAll(initialProviders); + allProviders.add(stubProvider); + ctx = new StubContext(); + } + + @BeforeMethod + public void setUpMethod() throws Exception { + // Make sure the provider provider that is registered is removed + // before each run + SyncFactory.unregisterProvider(stubProvider); + } + + /* + * Validate a non-null factory is returned + */ + @Test + public void test() throws SyncFactoryException { + SyncFactory syncFactory = SyncFactory.getSyncFactory(); + assertTrue(syncFactory != null); + } + + /* + * Check that the correct SyncProvider is returned for the specified + * providerID for the provider registered via a property + */ + @Test + public void test00() throws SyncFactoryException { + SyncProvider p = SyncFactory.getInstance(propertyStubProvider); + assertTrue(p instanceof PropertyStubProvider); + } + + /* + * Check that the correct SyncProvider is returned for the specified + * providerID + */ + @Test + public void test01() throws SyncFactoryException { + SyncFactory.registerProvider(stubProvider); + SyncProvider p = SyncFactory.getInstance(stubProvider); + assertTrue(p instanceof StubSyncProvider); + } + + /* + * Check that the Default SyncProvider is returned if an empty String is + * passed or if an invalid providerID is specified + */ + @Test + public void test02() throws SyncFactoryException { + SyncProvider p = SyncFactory.getInstance(""); + assertTrue(p instanceof RIOptimisticProvider); + // Attempt to get an invalid provider and get the default provider + p = SyncFactory.getInstance("util.InvalidSyncProvider"); + assertTrue(p instanceof RIOptimisticProvider); + } + + /* + * Validate that a SyncFactoryException is thrown if the ProviderID is null + */ + @Test(expectedExceptions = SyncFactoryException.class) + public void test03() throws SyncFactoryException { + SyncProvider p = SyncFactory.getInstance(null); + } + + /* + * Validate that a SyncFactoryException is thrown if the Logger is null + */ + @Test(expectedExceptions = SyncFactoryException.class,enabled=true) + public void test04() throws SyncFactoryException { + Logger l = SyncFactory.getLogger(); + } + + /* + * Validate that the correct logger is returned by getLogger + */ + @Test + public void test05() throws SyncFactoryException { + SyncFactory.setLogger(alogger); + Logger l = SyncFactory.getLogger(); + assertTrue(l.equals(alogger)); + } + + /* + * Validate that the correct logger is returned by getLogger + */ + @Test + public void test06() throws SyncFactoryException { + SyncFactory.setLogger(alogger, Level.INFO); + Logger l = SyncFactory.getLogger(); + assertTrue(l.equals(alogger)); + } + + /* + * Validate that a driver that is registered is returned by + * getRegisteredProviders and if it is unregistered, that it is + * not returned by getRegisteredProviders + */ + @Test + public void test07() throws SyncFactoryException { + + // Validate that only the default providers and any specified via + // a System property are available + validateProviders(initialProviders); + + // Register a provider and make sure it is avaiable + SyncFactory.registerProvider(stubProvider); + validateProviders(allProviders); + + // Check that if a provider is unregistered, it does not show as + // registered + SyncFactory.unregisterProvider(stubProvider); + validateProviders(initialProviders); + } + + /* + * Validate that setJNDIContext throws a SyncFactoryException if the + * context is null + */ + @Test(expectedExceptions = SyncFactoryException.class, enabled=true) + public void test08() throws Exception { + SyncFactory.setJNDIContext(null); + } + + /* + * Validate that setJNDIContext succeeds + */ + @Test(enabled=true) + public void test09() throws Exception { + SyncFactory.setJNDIContext(ctx); + } + + /* + * Utility method to validate the expected providers are regsitered + */ + private void validateProviders(List expectedProviders) + throws SyncFactoryException { + List results = new ArrayList<>(); + Enumeration providers = SyncFactory.getRegisteredProviders(); + + while (providers.hasMoreElements()) { + SyncProvider p = providers.nextElement(); + results.add(p.getProviderID()); + } + assertTrue(expectedProviders.containsAll(results) + && results.size() == expectedProviders.size()); + } + + /* + * Utility method to dump out SyncProvider info for a registered provider + */ + private void showImpl(SyncProvider impl) { + System.out.println("Provider implementation:" + + "\nVendor: " + impl.getVendor() + + "\nVersion: " + impl.getVersion() + + "\nProviderID: " + impl.getProviderID()); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/spi/SyncProviderExceptionTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/spi/SyncProviderExceptionTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,187 @@ +/* + * 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.rowset.spi; + +import com.sun.rowset.internal.SyncResolverImpl; +import java.sql.SQLException; +import javax.sql.rowset.spi.SyncProviderException; +import static org.testng.Assert.*; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import util.BaseTest; +import util.StubSyncResolver; + +public class SyncProviderExceptionTests extends BaseTest { + @BeforeClass + public static void setUpClass() throws Exception { + System.out.println(System.getProperty("java.naming.factory.initial")); + } + + @AfterClass + public static void tearDownClass() throws Exception { + } + /* + * Create SyncProviderException with no-arg constructor + */ + @Test + public void test() { + SyncProviderException ex = new SyncProviderException(); + assertTrue(ex.getMessage() == null + && ex.getSQLState() == null + && ex.getCause() == null + && ex.getErrorCode() == 0 + && ex.getSyncResolver() instanceof SyncResolverImpl); + } + + /* + * Create SyncProviderException with no-arg constructor and + * call setSyncResolver to indicate the SyncResolver to use + */ + @Test + public void test01() { + SyncProviderException ex = new SyncProviderException(); + ex.setSyncResolver(new StubSyncResolver()); + assertTrue(ex.getMessage() == null + && ex.getSQLState() == null + && ex.getCause() == null + && ex.getErrorCode() == 0 + && ex.getSyncResolver() instanceof StubSyncResolver); + } + + /* + * Create SyncProviderException with message + */ + @Test + public void test02() { + SyncProviderException ex = new SyncProviderException(reason); + assertTrue(ex.getMessage().equals(reason) + && ex.getSQLState() == null + && ex.getCause() == null + && ex.getErrorCode() == 0 + && ex.getSyncResolver() instanceof SyncResolverImpl); + } + + /* + * Create SyncProviderException with message and + * call setSyncResolver to indicate the SyncResolver to use + */ + @Test + public void test03() { + SyncProviderException ex = new SyncProviderException(reason); + ex.setSyncResolver(new StubSyncResolver()); + + assertTrue(ex.getMessage().equals(reason) + && ex.getSQLState() == null + && ex.getCause() == null + && ex.getErrorCode() == 0 + && ex.getSyncResolver() instanceof StubSyncResolver); + } + + /* + * Create SyncProviderException with and specify the SyncResolver to use + */ + @Test + public void test04() { + SyncProviderException ex = new SyncProviderException(new StubSyncResolver()); + assertTrue(ex.getMessage() == null + && ex.getSQLState() == null + && ex.getCause() == null + && ex.getErrorCode() == 0 + && ex.getSyncResolver() instanceof StubSyncResolver); + } + + /* + * Validate that the ordering of the returned Exceptions is correct using + * for-each loop + */ + @Test + public void test05() { + SyncProviderException ex = new SyncProviderException("Exception 1"); + ex.initCause(t1); + SyncProviderException ex1 = new SyncProviderException("Exception 2"); + SyncProviderException ex2 = new SyncProviderException("Exception 3"); + ex2.initCause(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 test06() { + SQLException ex = new SyncProviderException("Exception 1"); + ex.initCause(t1); + SyncProviderException ex1 = new SyncProviderException("Exception 2"); + SyncProviderException ex2 = new SyncProviderException("Exception 3"); + ex2.initCause(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(); + } + } + + /* + * Serialize a SyncProviderException and make sure you can read it back properly + */ + @Test + public void test07() throws Exception { + SyncProviderException e = new SyncProviderException(reason); + SyncProviderException ex1 = createSerializedException(e); + assertTrue(ex1.getMessage().equals(reason) + && ex1.getSQLState() == null + && ex1.getCause() == null + && ex1.getErrorCode() == 0 + && ex1.getSyncResolver() instanceof SyncResolverImpl, ex1.getSyncResolver().getClass().getName()); + } + + /* + * Serialize a SyncProviderException and make sure you can read it back properly + */ + @Test + public void test08() throws Exception { + SyncProviderException e = new SyncProviderException(reason); + e.setSyncResolver(new StubSyncResolver()); + + SyncProviderException ex1 = createSerializedException(e); + assertTrue(ex1.getMessage().equals(reason) + && ex1.getSQLState() == null + && ex1.getCause() == null + && ex1.getErrorCode() == 0 + && ex1.getSyncResolver() instanceof StubSyncResolver); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/webrowset/CommonWebRowSetTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/webrowset/CommonWebRowSetTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,400 @@ +/* + * 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. + */ +package test.rowset.webrowset; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileReader; +import java.io.InputStreamReader; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.OutputStreamWriter; +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.util.Arrays; +import javax.sql.rowset.WebRowSet; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertEqualsNoOrder; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertTrue; +import org.testng.annotations.Test; +import test.rowset.cachedrowset.CommonCachedRowSetTests; + +public abstract class CommonWebRowSetTests extends CommonCachedRowSetTests { + + protected final String XMLFILEPATH = System.getProperty("test.src", ".") + + File.separatorChar + "xml" + File.separatorChar; + protected final String COFFEE_ROWS_XML = XMLFILEPATH + "COFFEE_ROWS.xml"; + protected final String DELETED_COFFEE_ROWS_XML + = XMLFILEPATH + "DELETED_COFFEE_ROWS.xml"; + protected final String MODFIED_DELETED_COFFEE_ROWS_XML + = XMLFILEPATH + "MODFIED_DELETED_COFFEE_ROWS.xml"; + protected final String UPDATED_COFFEE_ROWS_XML + = XMLFILEPATH + "UPDATED_COFFEE_ROWS.xml"; + protected final String INSERTED_COFFEE_ROWS_XML + = XMLFILEPATH + "INSERTED_COFFEE_ROWS.xml"; + protected final String UPDATED_INSERTED_COFFEE_ROWS_XML + = XMLFILEPATH + "UPDATED_INSERTED_COFFEE_ROWS.xml"; + + + /* + * Utility method to write a WebRowSet XML file via an OutputStream + */ + protected ByteArrayOutputStream writeWebRowSetWithOutputStream(WebRowSet rs) throws Exception { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try (ObjectOutputStream oos = new ObjectOutputStream(baos)) { + rs.writeXml(oos); + } + return baos; + } + + /* + * Utility method to write a WebRowSet XML file via an OutputStream + * and populating the WebRowSet via a ResultSet + */ + protected ByteArrayOutputStream writeWebRowSetWithOutputStream(ResultSet rs) throws Exception { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try (ObjectOutputStream oos = new ObjectOutputStream(baos)) { + WebRowSet wrs = rsf.createWebRowSet(); + wrs.writeXml(rs, oos); + } + return baos; + } + + + /* + * Utility method to popoulate a WebRowSet via a InputStream + */ + protected WebRowSet readWebRowSetWithOInputStream(ByteArrayOutputStream baos) throws Exception { + WebRowSet wrs1 = rsf.createWebRowSet(); + try (ObjectInputStream ois + = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))) { + wrs1.readXml(ois); + } + return wrs1; + } + + /* + * Utility method to write a WebRowSet XML file via an Writer + */ + protected ByteArrayOutputStream writeWebRowSetWithOutputStreamWithWriter(WebRowSet rs) throws Exception { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + OutputStreamWriter osw = new OutputStreamWriter(baos); + rs.writeXml(osw); + return baos; + } + + /* + * Utility method to write a WebRowSet XML file via an Writer and populating + * the WebRowSet via a ResultSet + */ + protected ByteArrayOutputStream writeWebRowSetWithOutputStreamWithWriter(ResultSet rs) throws Exception { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + OutputStreamWriter osw = new OutputStreamWriter(baos); + WebRowSet wrs = rsf.createWebRowSet(); + wrs.writeXml(rs, osw); + return baos; + } + + /* + * Utility method to popoulate a WebRowSet via a Readar + */ + protected WebRowSet readWebRowSetWithOInputStreamWithReader(ByteArrayOutputStream baos) throws Exception { + WebRowSet wrs1 = rsf.createWebRowSet(); + InputStreamReader isr = new InputStreamReader(new ByteArrayInputStream(baos.toByteArray())); + wrs1.readXml(isr); + return wrs1; + } + + /* + * Validate the expected Rows are contained within the RowSet + */ + @Test(dataProvider = "rowsetUsingCoffees") + public void WebRowSetTest0000(WebRowSet wrs) throws Exception { + assertEquals(getPrimaryKeys(wrs), COFFEES_PRIMARY_KEYS); + assertEquals(wrs.size(), COFFEES_ROWS); + wrs.close(); + } + + /* + * Validate the expected Rows are contained within the RowSet + * populated by readXML(Reader) + */ + @Test(dataProvider = "rowSetType") + public void WebRowSetTest0001(WebRowSet wrs1) throws Exception { + + try (FileReader fr = new FileReader(COFFEE_ROWS_XML)) { + wrs1.readXml(fr); + } + assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS); + assertEquals(wrs1.size(), COFFEES_ROWS); + wrs1.close(); + + } + + /* + * Validate the expected Rows are contained within the RowSet + * populated by readXML(InputStream) + */ + @Test(dataProvider = "rowSetType") + public void WebRowSetTest0002(WebRowSet wrs1) throws Exception { + try (FileInputStream fis = new FileInputStream(COFFEE_ROWS_XML)) { + wrs1.readXml(fis); + } + assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS); + assertEquals(wrs1.size(), COFFEES_ROWS); + wrs1.close(); + } + + /* + * Write a WebRowSet via writeXML(OutputStream), read it + * back via readXML(InputStream) and validate the primary keys + * are the same + */ + @Test(dataProvider = "rowsetUsingCoffees") + public void WebRowSetTest0003(WebRowSet wrs) throws Exception { + ByteArrayOutputStream baos = writeWebRowSetWithOutputStream(wrs); + try (WebRowSet wrs1 = readWebRowSetWithOInputStream(baos)) { + assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS); + assertEquals(wrs1.size(), COFFEES_ROWS); + } + } + + /* + * Write a ResultSet via writeXML(OutputStream), read it + * back via readXML(InputStream) and validate the primary keys + * are the same + */ + @Test(dataProvider = "rowsetUsingCoffees") + public void WebRowSetTest0004(WebRowSet wrs) throws Exception { + ResultSet rs = wrs; + rs.beforeFirst(); + ByteArrayOutputStream baos = writeWebRowSetWithOutputStream(rs); + try (WebRowSet wrs1 = readWebRowSetWithOInputStream(baos)) { + assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS); + assertEquals(wrs1.size(), COFFEES_ROWS); + } + } + + /* + * Write a WebRowSet via writeXML(Writer), read it + * back via readXML(Reader) and validate the primary keys + * are the same + */ + @Test(dataProvider = "rowsetUsingCoffees") + public void WebRowSetTest0005(WebRowSet wrs) throws Exception { + ByteArrayOutputStream baos = writeWebRowSetWithOutputStreamWithWriter(wrs); + try (WebRowSet wrs1 = readWebRowSetWithOInputStreamWithReader(baos)) { + assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS); + assertEquals(wrs1.size(), COFFEES_ROWS); + } + } + + /* + * Write a WebRowSet via writeXML(Writer), read it + * back via readXML(Reader) and validate the primary keys + * are the same + */ + @Test(dataProvider = "rowsetUsingCoffees") + public void WebRowSetTest0006(WebRowSet wrs) throws Exception { + ResultSet rs = wrs; + rs.beforeFirst(); + ByteArrayOutputStream baos = writeWebRowSetWithOutputStreamWithWriter(rs); + try (WebRowSet wrs1 = readWebRowSetWithOInputStreamWithReader(baos)) { + assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS); + assertEquals(wrs1.size(), COFFEES_ROWS); + } + } + + /* + * Validate the expected Rows are contained within the RowSet + * after deleting the specified rows + */ + @Test(dataProvider = "rowsetUsingCoffees", enabled = false) + public void WebRowSetTest0007(WebRowSet wrs) throws Exception { + assertEquals(getPrimaryKeys(wrs), COFFEES_PRIMARY_KEYS); + int[] rowsToDelete = {2, 4}; + assertEquals(getPrimaryKeys(wrs), COFFEES_PRIMARY_KEYS); + for (int row : rowsToDelete) { + assertTrue(deleteRowByPrimaryKey(wrs, row, 1)); + } + + FileInputStream fis = new FileInputStream(MODFIED_DELETED_COFFEE_ROWS_XML); + try (WebRowSet wrs1 = rsf.createWebRowSet()) { + wrs1.readXml(fis); + // With setShowDeleted(false) which is the default, + // the deleted row should not be visible + for (int row : rowsToDelete) { + assertTrue(findRowByPrimaryKey(wrs1, row, 1)); + } + assertTrue(wrs.size() == COFFEES_ROWS); + // With setShowDeleted(true), the deleted row should be visible + for (int row : rowsToDelete) { + assertTrue(findRowByPrimaryKey(wrs, row, 1)); + } + } + } + + /* + * Validate the expected Rows are contained within the RowSet + * that was populated by reading an xml file with all rows + * marked as a currentRow + */ + @Test(dataProvider = "rowSetType") + public void WebRowSetTest0008(WebRowSet wrs1) throws Exception { + FileInputStream fis = new FileInputStream(COFFEE_ROWS_XML); + wrs1.readXml(fis); + assertTrue(wrs1.size() == COFFEES_ROWS); + assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS); + // Validate that the rows are not marked as deleted, inserted or updated + wrs1.beforeFirst(); + while (wrs1.next()) { + assertFalse(wrs1.rowDeleted()); + assertFalse(wrs1.rowInserted()); + assertFalse(wrs1.rowUpdated()); + } + wrs1.close(); + } + + /* + * Read an XML file to populate a WebRowSet and validate that the rows + * that are marked as deleted are marked as such in the WebRowSet + * Also validate that they are or are not visible based on the + * setShowDeleted value + */ + @Test(dataProvider = "rowSetType") + public void WebRowSetTest0009(WebRowSet wrs1) throws Exception { + int[] rowsToDelete = {2, 4}; + Object[] expectedRows = {1, 3, 5}; + FileInputStream fis = new FileInputStream(DELETED_COFFEE_ROWS_XML); + wrs1.readXml(fis); + assertTrue(wrs1.size() == COFFEES_ROWS); + assertEquals(getPrimaryKeys(wrs1), expectedRows); + // With setShowDeleted(false) which is the default, + // the deleted row should not be visible + for (int row : rowsToDelete) { + assertFalse(findRowByPrimaryKey(wrs1, row, 1)); + } + // With setShowDeleted(true), the deleted row should be visible + wrs1.setShowDeleted(true); + for (int row : rowsToDelete) { + assertTrue(findRowByPrimaryKey(wrs1, row, 1)); + } + assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS); + wrs1.close(); + + } + + /* + * Validate that the correct row in the WebRowSet that had been created + * from an xml file is marked as updated and contains the correct values + */ + @Test(dataProvider = "rowSetType") + public void WebRowSetTest0010(WebRowSet wrs1) throws Exception { + FileInputStream fis = new FileInputStream(UPDATED_COFFEE_ROWS_XML); + wrs1.readXml(fis); + assertTrue(wrs1.size() == COFFEES_ROWS); + assertEquals(getPrimaryKeys(wrs1), COFFEES_PRIMARY_KEYS); + wrs1.beforeFirst(); + while (wrs1.next()) { + if (wrs1.getInt(1) == 3) { + assertTrue(wrs1.rowUpdated()); + assertTrue(wrs1.getInt(5) == 21 && wrs1.getInt(6) == 69); + assertFalse(wrs1.rowDeleted()); + assertFalse(wrs1.rowInserted()); + } else { + assertFalse(wrs1.rowUpdated()); + assertFalse(wrs1.rowDeleted()); + assertFalse(wrs1.rowInserted()); + } + } + wrs1.close(); + } + + /* + * Validate the correct row is marked as inserted in a WebRowSet + * that is read from an xml file + */ + @Test(dataProvider = "rowSetType") + public void WebRowSetTest0011(WebRowSet wrs1) throws Exception { + int expectedSize = COFFEES_ROWS + 2; + int addedRowPK = 15; + int addedRowPK2 = 20; + Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize); + expected[expectedSize - 2] = addedRowPK; + expected[expectedSize - 1] = addedRowPK2; + FileInputStream fis = new FileInputStream(INSERTED_COFFEE_ROWS_XML); + wrs1.readXml(fis); + assertTrue(wrs1.size() == expectedSize); + assertEqualsNoOrder(getPrimaryKeys(wrs1), expected); + wrs1.beforeFirst(); + while (wrs1.next()) { + if (wrs1.getInt(1) == 15 || wrs1.getInt(1) == 20) { + assertTrue(wrs1.rowInserted()); + assertFalse(wrs1.rowDeleted()); + assertFalse(wrs1.rowUpdated()); + } else { + assertFalse(wrs1.rowInserted()); + assertFalse(wrs1.rowDeleted()); + assertFalse(wrs1.rowUpdated()); + } + } + wrs1.close(); + } + + /* + * Read an xml file which contains a row that was inserted and updated + */ + @Test(dataProvider = "rowSetType") + public void WebRowSetTest0012(WebRowSet wrs1) throws Exception { + int expectedSize = COFFEES_ROWS + 1; + int addedRowPK = 100; + Object[] expected = Arrays.copyOf(COFFEES_PRIMARY_KEYS, expectedSize); + expected[expectedSize - 1] = addedRowPK; + FileInputStream fis = new FileInputStream(UPDATED_INSERTED_COFFEE_ROWS_XML); + wrs1.readXml(fis); + assertTrue(wrs1.size() == expectedSize); + assertEquals(getPrimaryKeys(wrs1), expected); + wrs1.beforeFirst(); + while (wrs1.next()) { + if (wrs1.getInt(1) == addedRowPK) { + // Row that was inserted and updated + assertTrue(wrs1.rowUpdated()); + assertTrue( + wrs1.getBigDecimal(4).equals(BigDecimal.valueOf(12.99)) + && wrs1.getInt(6) == 125); + assertFalse(wrs1.rowDeleted()); + assertTrue(wrs1.rowInserted()); + } else { + // Remaining rows should only be inserted + assertFalse(wrs1.rowUpdated()); + assertFalse(wrs1.rowDeleted()); + assertTrue(wrs1.rowInserted()); + } + } + wrs1.close(); + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/test/rowset/webrowset/WebRowSetTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/test/rowset/webrowset/WebRowSetTests.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,35 @@ +/* + * 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. + */ +package test.rowset.webrowset; + +import java.sql.SQLException; +import javax.sql.rowset.WebRowSet; + +public class WebRowSetTests extends CommonWebRowSetTests { + + @Override + protected WebRowSet newInstance() throws SQLException { + return rsf.createWebRowSet(); + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/PropertyStubProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/PropertyStubProvider.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,27 @@ +/* + * 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 PropertyStubProvider extends StubSyncProvider { + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubArray.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubArray.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,99 @@ +/* + * 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.Array; +import java.sql.JDBCType; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Arrays; +import java.util.Map; + +public class StubArray implements Array { + + private String typeName; + Object[] elements; + + public StubArray(String name, Object[] values) { + typeName = name; + elements = Arrays.copyOf(values, values.length); + + } + + @Override + public String getBaseTypeName() throws SQLException { + return typeName; + } + + @Override + public int getBaseType() throws SQLException { + return JDBCType.valueOf(typeName).getVendorTypeNumber(); + } + + @Override + public Object getArray() throws SQLException { + return Arrays.copyOf(elements, elements.length); + } + + @Override + public Object getArray(Map> map) throws SQLException { + return getArray(); + } + + @Override + public Object getArray(long index, int count) throws SQLException { + return getArray(); + } + + @Override + public Object getArray(long index, int count, Map> map) throws SQLException { + return getArray(); + } + + @Override + public ResultSet getResultSet() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSet getResultSet(Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSet getResultSet(long index, int count) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSet getResultSet(long index, int count, Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void free() throws SQLException { + elements = null; + typeName = null; + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubBaseRowSet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubBaseRowSet.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,1001 @@ +/* + * 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.InputStream; +import java.io.Reader; +import java.math.BigDecimal; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Date; +import java.sql.NClob; +import java.sql.Ref; +import java.sql.ResultSetMetaData; +import java.sql.RowId; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.sql.SQLXML; +import java.sql.Statement; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.Map; +import javax.sql.RowSet; +import javax.sql.rowset.BaseRowSet; + +public class StubBaseRowSet extends BaseRowSet implements RowSet { + + public StubBaseRowSet() { + super(); + // Must call initParams() as part of initialization + super.initParams(); + } + + public void notifyCursorMoved() throws SQLException { + super.notifyCursorMoved(); + } + + public void notifyRowChanged() throws SQLException { + super.notifyRowChanged(); + } + + public void notifyRowSetChanged() throws SQLException { + super.notifyRowSetChanged(); + } + + public void initParams() { + super.initParams(); + } + + // Methods required by RowSet interace, not used + @Override + public void execute() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean next() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void close() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean wasNull() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getString(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getBoolean(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte getByte(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public short getShort(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getInt(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLong(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFloat(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getDouble(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte[] getBytes(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getAsciiStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getUnicodeStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getBinaryStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getString(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getBoolean(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte getByte(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public short getShort(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getInt(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLong(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFloat(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getDouble(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte[] getBytes(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getAsciiStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getUnicodeStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getBinaryStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLWarning getWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void clearWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getCursorName() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSetMetaData getMetaData() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int findColumn(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getCharacterStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getCharacterStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isBeforeFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isAfterLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void beforeFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void afterLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean first() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean last() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean absolute(int row) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean relative(int rows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean previous() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowUpdated() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowInserted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowDeleted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNull(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBoolean(int columnIndex, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateByte(int columnIndex, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateShort(int columnIndex, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInt(int columnIndex, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateLong(int columnIndex, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateFloat(int columnIndex, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDouble(int columnIndex, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateString(int columnIndex, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBytes(int columnIndex, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDate(int columnIndex, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTime(int columnIndex, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(int columnIndex, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNull(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBoolean(String columnLabel, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateByte(String columnLabel, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateShort(String columnLabel, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInt(String columnLabel, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateLong(String columnLabel, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateFloat(String columnLabel, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDouble(String columnLabel, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateString(String columnLabel, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBytes(String columnLabel, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDate(String columnLabel, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTime(String columnLabel, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(String columnLabel, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void insertRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void deleteRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void refreshRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void cancelRowUpdates() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void moveToInsertRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void moveToCurrentRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Statement getStatement() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(int columnIndex, Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Ref getRef(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Blob getBlob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Clob getClob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Array getArray(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(String columnLabel, Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Ref getRef(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Blob getBlob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Clob getClob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Array getArray(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public java.net.URL getURL(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public java.net.URL getURL(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRef(int columnIndex, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRef(String columnLabel, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateArray(int columnIndex, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateArray(String columnLabel, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowId getRowId(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowId getRowId(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRowId(int columnIndex, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRowId(String columnLabel, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getHoldability() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isClosed() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNString(int columnIndex, String nString) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNString(String columnLabel, String nString) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, NClob nClob) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, NClob nClob) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public NClob getNClob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public NClob getNClob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLXML getSQLXML(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLXML getSQLXML(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getNString(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getNString(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getNCharacterStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getNCharacterStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T getObject(int columnIndex, Class type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T getObject(String columnLabel, Class type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T unwrap(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isWrapperFor(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubBlob.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubBlob.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,100 @@ +/* + * 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.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.ObjectOutputStream; +import java.io.OutputStream; +import java.sql.Blob; +import java.sql.SQLException; +import java.util.Arrays; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class StubBlob implements Blob { + + private byte[] bytes; + + public StubBlob() { + bytes = new byte[]{2, 4, 6, 8}; + } + + public long length() throws SQLException { + return bytes.length; + } + + public byte[] getBytes(long pos, int length) + throws SQLException { + return Arrays.copyOfRange(bytes, (int) pos - 1, length); + } + + public InputStream getBinaryStream() + throws SQLException { + return null; + } + + public long position(byte[] pattern, long start) + throws SQLException { + return 0; + } + + public long position(Blob pattern, long start) + throws SQLException { + return 0; + } + + public int setBytes(long pos, byte[] bytes) + throws SQLException { + return 0; + } + + public int setBytes(long pos, byte[] bytes, int offset, int len) + throws SQLException { + return 0; + } + + public OutputStream setBinaryStream(long pos) + throws SQLException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = null; + try { + oos = new ObjectOutputStream(baos); + } catch (IOException ex) { + Logger.getLogger(StubBlob.class.getName()).log(Level.SEVERE, null, ex); + } + return oos; + } + + public void truncate(long len) + throws SQLException { + } + + public void free() throws SQLException { + } + + public InputStream getBinaryStream(long pos, long length) throws SQLException { + return null; + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubCachedRowSetImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubCachedRowSetImpl.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,1848 @@ +/* + * 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.InputStream; +import java.io.Reader; +import java.math.BigDecimal; +import java.net.URL; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Connection; +import java.sql.Date; +import java.sql.NClob; +import java.sql.Ref; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.RowId; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.sql.SQLXML; +import java.sql.Savepoint; +import java.sql.Statement; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.Collection; +import java.util.Map; +import javax.sql.RowSet; +import javax.sql.RowSetEvent; +import javax.sql.RowSetListener; +import javax.sql.RowSetMetaData; +import javax.sql.rowset.CachedRowSet; +import javax.sql.rowset.RowSetWarning; +import javax.sql.rowset.spi.SyncProvider; +import javax.sql.rowset.spi.SyncProviderException; + +public class StubCachedRowSetImpl implements CachedRowSet { + + public StubCachedRowSetImpl() { + } + + @Override + public void populate(ResultSet data) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void execute(Connection conn) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void acceptChanges() throws SyncProviderException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void acceptChanges(Connection con) throws SyncProviderException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void restoreOriginal() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void release() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void undoDelete() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void undoInsert() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void undoUpdate() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean columnUpdated(int idx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean columnUpdated(String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Collection toCollection() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Collection toCollection(int column) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Collection toCollection(String column) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SyncProvider getSyncProvider() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSyncProvider(String provider) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int size() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMetaData(RowSetMetaData md) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSet getOriginal() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSet getOriginalRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setOriginalRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getTableName() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTableName(String tabName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int[] getKeyColumns() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setKeyColumns(int[] keys) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowSet createShared() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CachedRowSet createCopy() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CachedRowSet createCopySchema() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CachedRowSet createCopyNoConstraints() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowSetWarning getRowSetWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getShowDeleted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShowDeleted(boolean b) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void commit() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rollback() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rollback(Savepoint s) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void populate(ResultSet rs, int startRow) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPageSize(int size) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getPageSize() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean nextPage() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean previousPage() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getUrl() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setUrl(String url) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getDataSourceName() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDataSourceName(String name) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getUsername() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setUsername(String name) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getPassword() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPassword(String password) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getTransactionIsolation() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTransactionIsolation(int level) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Map> getTypeMap() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTypeMap(Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getCommand() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCommand(String cmd) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isReadOnly() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setReadOnly(boolean value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaxFieldSize() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaxFieldSize(int max) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaxRows() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaxRows(int max) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getEscapeProcessing() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setEscapeProcessing(boolean enable) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getQueryTimeout() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setQueryTimeout(int seconds) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setType(int type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setConcurrency(int concurrency) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(int parameterIndex, int sqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(String parameterName, int sqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(String parameterName, int sqlType, String typeName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBoolean(int parameterIndex, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBoolean(String parameterName, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setByte(int parameterIndex, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setByte(String parameterName, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShort(int parameterIndex, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShort(String parameterName, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setInt(int parameterIndex, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setInt(String parameterName, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLong(int parameterIndex, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLong(String parameterName, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFloat(int parameterIndex, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFloat(String parameterName, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDouble(int parameterIndex, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDouble(String parameterName, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setString(int parameterIndex, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setString(String parameterName, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBytes(int parameterIndex, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBytes(String parameterName, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(int parameterIndex, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(int parameterIndex, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(String parameterName, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(String parameterName, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(String parameterName, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRef(int i, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int i, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int i, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int parameterIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setArray(int i, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(String parameterName, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(String parameterName, Date x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(String parameterName, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(String parameterName, Time x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void clearParameters() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void execute() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void addRowSetListener(RowSetListener listener) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeRowSetListener(RowSetListener listener) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRowId(int parameterIndex, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRowId(String parameterName, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNString(int parameterIndex, String value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNString(String parameterName, String value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(String parameterName, Reader value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, NClob value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, NClob value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setURL(int parameterIndex, URL x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean next() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void close() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean wasNull() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getString(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getBoolean(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte getByte(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public short getShort(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getInt(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLong(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFloat(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getDouble(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte[] getBytes(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getAsciiStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getUnicodeStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getBinaryStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getString(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getBoolean(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte getByte(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public short getShort(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getInt(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLong(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFloat(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getDouble(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte[] getBytes(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getAsciiStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getUnicodeStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getBinaryStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLWarning getWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void clearWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getCursorName() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSetMetaData getMetaData() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int findColumn(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getCharacterStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getCharacterStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isBeforeFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isAfterLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void beforeFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void afterLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean first() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean last() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean absolute(int row) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean relative(int rows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean previous() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFetchDirection(int direction) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFetchDirection() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFetchSize(int rows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFetchSize() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getType() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getConcurrency() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowUpdated() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowInserted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowDeleted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNull(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBoolean(int columnIndex, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateByte(int columnIndex, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateShort(int columnIndex, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInt(int columnIndex, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateLong(int columnIndex, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateFloat(int columnIndex, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDouble(int columnIndex, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateString(int columnIndex, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBytes(int columnIndex, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDate(int columnIndex, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTime(int columnIndex, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(int columnIndex, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNull(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBoolean(String columnLabel, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateByte(String columnLabel, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateShort(String columnLabel, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInt(String columnLabel, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateLong(String columnLabel, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateFloat(String columnLabel, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDouble(String columnLabel, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateString(String columnLabel, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBytes(String columnLabel, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDate(String columnLabel, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTime(String columnLabel, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(String columnLabel, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void insertRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void deleteRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void refreshRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void cancelRowUpdates() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void moveToInsertRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void moveToCurrentRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Statement getStatement() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(int columnIndex, Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Ref getRef(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Blob getBlob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Clob getClob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Array getArray(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(String columnLabel, Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Ref getRef(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Blob getBlob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Clob getClob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Array getArray(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public URL getURL(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public URL getURL(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRef(int columnIndex, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRef(String columnLabel, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateArray(int columnIndex, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateArray(String columnLabel, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowId getRowId(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowId getRowId(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRowId(int columnIndex, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRowId(String columnLabel, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getHoldability() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isClosed() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNString(int columnIndex, String nString) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNString(String columnLabel, String nString) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, NClob nClob) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, NClob nClob) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public NClob getNClob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public NClob getNClob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLXML getSQLXML(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLXML getSQLXML(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getNString(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getNString(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getNCharacterStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getNCharacterStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T getObject(int columnIndex, Class type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T getObject(String columnLabel, Class type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T unwrap(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isWrapperFor(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(int columnIdx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(int[] columnIdxes) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(String[] columnNames) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int[] getMatchColumnIndexes() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String[] getMatchColumnNames() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(int columnIdx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(int[] columnIdxes) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(String[] columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubClob.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubClob.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,113 @@ +/* + * 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.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.ObjectOutputStream; +import java.io.OutputStream; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.io.Writer; +import java.sql.Clob; +import java.sql.SQLException; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class StubClob implements Clob { + + public String buf = "The test string 0123456789"; + + @Override + public String getSubString(long pos, int length) throws SQLException { + return buf; + } + + @Override + public long length() throws SQLException { + return buf.length(); + } + + @Override + public Reader getCharacterStream() throws SQLException { + return new StringReader(buf); + } + + @Override + public InputStream getAsciiStream() throws SQLException { + return new java.io.StringBufferInputStream(buf); + } + + @Override + public int setString(long pos, String str) throws SQLException { + return str.length(); + } + + @Override + public int setString(long pos, String str, int offset, int len) throws SQLException { + return len; + } + + @Override + public long position(String searchstr, long start) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long position(Clob searchstr, long start) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public OutputStream setAsciiStream(long pos) throws SQLException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = null; + try { + oos = new ObjectOutputStream(baos); + } catch (IOException ex) { + Logger.getLogger(StubBlob.class.getName()).log(Level.SEVERE, null, ex); + } + return oos; + } + + @Override + public Writer setCharacterStream(long pos) throws SQLException { + return new StringWriter(); + } + + @Override + public void truncate(long len) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void free() throws SQLException { + } + + @Override + public Reader getCharacterStream(long pos, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubContext.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubContext.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,220 @@ +/* + * 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.util.Hashtable; +import javax.naming.Binding; +import javax.naming.Context; +import javax.naming.Name; +import javax.naming.NameClassPair; +import javax.naming.NameParser; +import javax.naming.NamingEnumeration; +import javax.naming.NamingException; + +@SuppressWarnings("unchecked") +public class StubContext implements Context { + + @Override + public Object lookup(Name name) throws NamingException { + return null; + } + + @Override + public Object lookup(String name) throws NamingException { + return null; + } + + @Override + public void bind(Name name, Object obj) throws NamingException { + + } + + @Override + public void bind(String name, Object obj) throws NamingException { + + } + + @Override + public void rebind(Name name, Object obj) throws NamingException { + + } + + @Override + public void rebind(String name, Object obj) throws NamingException { + + } + + @Override + public void unbind(Name name) throws NamingException { + + } + + @Override + public void unbind(String name) throws NamingException { + + } + + @Override + public void rename(Name oldName, Name newName) throws NamingException { + + } + + @Override + public void rename(String oldName, String newName) throws NamingException { + + } + + @Override + public NamingEnumeration list(Name name) throws NamingException { + return new NamingEnumerationStub(); + } + + @Override + public NamingEnumeration list(String name) throws NamingException { + return new NamingEnumerationStub(); + } + + @Override + public NamingEnumeration listBindings(Name name) throws NamingException { + return new NamingEnumerationStub(); + } + + @Override + public NamingEnumeration listBindings(String name) throws NamingException { + return new NamingEnumerationStub(); + } + + @Override + public void destroySubcontext(Name name) throws NamingException { + + } + + @Override + public void destroySubcontext(String name) throws NamingException { + + } + + @Override + public Context createSubcontext(Name name) throws NamingException { + return null; + } + + @Override + public Context createSubcontext(String name) throws NamingException { + return null; + } + + @Override + public Object lookupLink(Name name) throws NamingException { + return null; + } + + @Override + public Object lookupLink(String name) throws NamingException { + return null; + } + + @Override + public NameParser getNameParser(Name name) throws NamingException { + return new NameParserStub(); + } + + @Override + public NameParser getNameParser(String name) throws NamingException { + return new NameParserStub(); + } + + @Override + public Name composeName(Name name, Name prefix) throws NamingException { + return null; + } + + @Override + public String composeName(String name, String prefix) throws NamingException { + return null; + } + + @Override + public Object addToEnvironment(String propName, Object propVal) throws NamingException { + return null; + } + + @Override + public Object removeFromEnvironment(String propName) throws NamingException { + return null; + } + + @Override + public Hashtable getEnvironment() throws NamingException { + return new Hashtable(); + } + + @Override + public void close() throws NamingException { + + } + + @Override + public String getNameInNamespace() throws NamingException { + return null; + } + + class NamingEnumerationStub implements NamingEnumeration { + + @Override + public Object next() throws NamingException { + return null; + } + + @Override + public boolean hasMore() throws NamingException { + return false; + } + + @Override + public void close() throws NamingException { + + } + + @Override + public boolean hasMoreElements() { + return false; + } + + @Override + public Object nextElement() { + return null; + } + + } + + class NameParserStub implements NameParser { + + @Override + public Name parse(String name) throws NamingException { + return null; + } + + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubFilteredRowSetImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubFilteredRowSetImpl.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,1892 @@ +/* + * 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.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Reader; +import java.io.Writer; +import java.math.BigDecimal; +import java.net.URL; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Connection; +import java.sql.Date; +import java.sql.NClob; +import java.sql.Ref; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.RowId; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.sql.SQLXML; +import java.sql.Savepoint; +import java.sql.Statement; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.Collection; +import java.util.Map; +import javax.sql.RowSet; +import javax.sql.RowSetEvent; +import javax.sql.RowSetListener; +import javax.sql.RowSetMetaData; +import javax.sql.rowset.CachedRowSet; +import javax.sql.rowset.FilteredRowSet; +import javax.sql.rowset.Predicate; +import javax.sql.rowset.RowSetWarning; +import javax.sql.rowset.spi.SyncProvider; +import javax.sql.rowset.spi.SyncProviderException; + +public class StubFilteredRowSetImpl implements FilteredRowSet { + + public StubFilteredRowSetImpl() { + } + + @Override + public void setFilter(Predicate p) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Predicate getFilter() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void readXml(Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void readXml(InputStream iStream) throws SQLException, IOException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void writeXml(ResultSet rs, Writer writer) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void writeXml(ResultSet rs, OutputStream oStream) throws SQLException, IOException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void writeXml(Writer writer) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void writeXml(OutputStream oStream) throws SQLException, IOException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void populate(ResultSet data) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void execute(Connection conn) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void acceptChanges() throws SyncProviderException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void acceptChanges(Connection con) throws SyncProviderException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void restoreOriginal() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void release() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void undoDelete() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void undoInsert() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void undoUpdate() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean columnUpdated(int idx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean columnUpdated(String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Collection toCollection() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Collection toCollection(int column) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Collection toCollection(String column) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SyncProvider getSyncProvider() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSyncProvider(String provider) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int size() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMetaData(RowSetMetaData md) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSet getOriginal() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSet getOriginalRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setOriginalRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getTableName() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTableName(String tabName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int[] getKeyColumns() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setKeyColumns(int[] keys) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowSet createShared() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CachedRowSet createCopy() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CachedRowSet createCopySchema() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CachedRowSet createCopyNoConstraints() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowSetWarning getRowSetWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getShowDeleted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShowDeleted(boolean b) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void commit() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rollback() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rollback(Savepoint s) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void populate(ResultSet rs, int startRow) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPageSize(int size) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getPageSize() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean nextPage() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean previousPage() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getUrl() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setUrl(String url) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getDataSourceName() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDataSourceName(String name) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getUsername() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setUsername(String name) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getPassword() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPassword(String password) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getTransactionIsolation() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTransactionIsolation(int level) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Map> getTypeMap() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTypeMap(Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getCommand() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCommand(String cmd) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isReadOnly() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setReadOnly(boolean value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaxFieldSize() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaxFieldSize(int max) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaxRows() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaxRows(int max) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getEscapeProcessing() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setEscapeProcessing(boolean enable) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getQueryTimeout() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setQueryTimeout(int seconds) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setType(int type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setConcurrency(int concurrency) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(int parameterIndex, int sqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(String parameterName, int sqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(String parameterName, int sqlType, String typeName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBoolean(int parameterIndex, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBoolean(String parameterName, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setByte(int parameterIndex, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setByte(String parameterName, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShort(int parameterIndex, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShort(String parameterName, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setInt(int parameterIndex, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setInt(String parameterName, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLong(int parameterIndex, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLong(String parameterName, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFloat(int parameterIndex, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFloat(String parameterName, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDouble(int parameterIndex, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDouble(String parameterName, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setString(int parameterIndex, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setString(String parameterName, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBytes(int parameterIndex, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBytes(String parameterName, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(int parameterIndex, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(int parameterIndex, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(String parameterName, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(String parameterName, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(String parameterName, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRef(int i, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int i, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int i, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int parameterIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setArray(int i, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(String parameterName, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(String parameterName, Date x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(String parameterName, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(String parameterName, Time x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void clearParameters() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void execute() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void addRowSetListener(RowSetListener listener) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeRowSetListener(RowSetListener listener) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRowId(int parameterIndex, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRowId(String parameterName, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNString(int parameterIndex, String value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNString(String parameterName, String value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(String parameterName, Reader value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, NClob value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, NClob value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setURL(int parameterIndex, URL x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean next() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void close() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean wasNull() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getString(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getBoolean(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte getByte(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public short getShort(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getInt(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLong(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFloat(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getDouble(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte[] getBytes(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getAsciiStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getUnicodeStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getBinaryStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getString(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getBoolean(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte getByte(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public short getShort(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getInt(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLong(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFloat(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getDouble(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte[] getBytes(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getAsciiStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getUnicodeStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getBinaryStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLWarning getWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void clearWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getCursorName() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSetMetaData getMetaData() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int findColumn(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getCharacterStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getCharacterStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isBeforeFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isAfterLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void beforeFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void afterLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean first() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean last() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean absolute(int row) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean relative(int rows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean previous() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFetchDirection(int direction) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFetchDirection() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFetchSize(int rows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFetchSize() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getType() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getConcurrency() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowUpdated() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowInserted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowDeleted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNull(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBoolean(int columnIndex, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateByte(int columnIndex, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateShort(int columnIndex, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInt(int columnIndex, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateLong(int columnIndex, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateFloat(int columnIndex, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDouble(int columnIndex, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateString(int columnIndex, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBytes(int columnIndex, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDate(int columnIndex, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTime(int columnIndex, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(int columnIndex, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNull(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBoolean(String columnLabel, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateByte(String columnLabel, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateShort(String columnLabel, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInt(String columnLabel, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateLong(String columnLabel, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateFloat(String columnLabel, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDouble(String columnLabel, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateString(String columnLabel, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBytes(String columnLabel, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDate(String columnLabel, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTime(String columnLabel, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(String columnLabel, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void insertRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void deleteRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void refreshRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void cancelRowUpdates() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void moveToInsertRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void moveToCurrentRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Statement getStatement() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(int columnIndex, Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Ref getRef(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Blob getBlob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Clob getClob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Array getArray(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(String columnLabel, Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Ref getRef(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Blob getBlob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Clob getClob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Array getArray(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public URL getURL(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public URL getURL(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRef(int columnIndex, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRef(String columnLabel, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateArray(int columnIndex, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateArray(String columnLabel, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowId getRowId(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowId getRowId(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRowId(int columnIndex, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRowId(String columnLabel, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getHoldability() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isClosed() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNString(int columnIndex, String nString) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNString(String columnLabel, String nString) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, NClob nClob) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, NClob nClob) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public NClob getNClob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public NClob getNClob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLXML getSQLXML(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLXML getSQLXML(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getNString(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getNString(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getNCharacterStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getNCharacterStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T getObject(int columnIndex, Class type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T getObject(String columnLabel, Class type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T unwrap(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isWrapperFor(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(int columnIdx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(int[] columnIdxes) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(String[] columnNames) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int[] getMatchColumnIndexes() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String[] getMatchColumnNames() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(int columnIdx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(int[] columnIdxes) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(String[] columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubJdbcRowSetImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubJdbcRowSetImpl.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,1672 @@ +/* + * 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.InputStream; +import java.io.Reader; +import java.math.BigDecimal; +import java.net.URL; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Date; +import java.sql.NClob; +import java.sql.Ref; +import java.sql.ResultSetMetaData; +import java.sql.RowId; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.sql.SQLXML; +import java.sql.Savepoint; +import java.sql.Statement; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.Map; +import javax.sql.RowSetListener; +import javax.sql.rowset.JdbcRowSet; +import javax.sql.rowset.RowSetWarning; + +public class StubJdbcRowSetImpl implements JdbcRowSet { + + @Override + public boolean getShowDeleted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShowDeleted(boolean b) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowSetWarning getRowSetWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void commit() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getAutoCommit() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAutoCommit(boolean autoCommit) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rollback() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rollback(Savepoint s) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getUrl() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setUrl(String url) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getDataSourceName() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDataSourceName(String name) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getUsername() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setUsername(String name) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getPassword() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPassword(String password) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getTransactionIsolation() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTransactionIsolation(int level) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Map> getTypeMap() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTypeMap(Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getCommand() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCommand(String cmd) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isReadOnly() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setReadOnly(boolean value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaxFieldSize() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaxFieldSize(int max) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaxRows() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaxRows(int max) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getEscapeProcessing() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setEscapeProcessing(boolean enable) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getQueryTimeout() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setQueryTimeout(int seconds) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setType(int type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setConcurrency(int concurrency) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(int parameterIndex, int sqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(String parameterName, int sqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(String parameterName, int sqlType, String typeName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBoolean(int parameterIndex, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBoolean(String parameterName, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setByte(int parameterIndex, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setByte(String parameterName, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShort(int parameterIndex, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShort(String parameterName, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setInt(int parameterIndex, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setInt(String parameterName, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLong(int parameterIndex, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLong(String parameterName, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFloat(int parameterIndex, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFloat(String parameterName, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDouble(int parameterIndex, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDouble(String parameterName, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setString(int parameterIndex, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setString(String parameterName, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBytes(int parameterIndex, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBytes(String parameterName, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(int parameterIndex, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(int parameterIndex, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(String parameterName, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(String parameterName, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(String parameterName, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRef(int i, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int i, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int i, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int parameterIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setArray(int i, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(String parameterName, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(String parameterName, Date x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(String parameterName, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(String parameterName, Time x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void clearParameters() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void execute() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void addRowSetListener(RowSetListener listener) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeRowSetListener(RowSetListener listener) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRowId(int parameterIndex, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRowId(String parameterName, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNString(int parameterIndex, String value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNString(String parameterName, String value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(String parameterName, Reader value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, NClob value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, NClob value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setURL(int parameterIndex, URL x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean next() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void close() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean wasNull() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getString(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getBoolean(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte getByte(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public short getShort(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getInt(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLong(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFloat(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getDouble(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte[] getBytes(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getAsciiStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getUnicodeStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getBinaryStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getString(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getBoolean(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte getByte(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public short getShort(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getInt(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLong(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFloat(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getDouble(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte[] getBytes(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getAsciiStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getUnicodeStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getBinaryStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLWarning getWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void clearWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getCursorName() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSetMetaData getMetaData() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int findColumn(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getCharacterStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getCharacterStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isBeforeFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isAfterLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void beforeFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void afterLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean first() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean last() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean absolute(int row) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean relative(int rows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean previous() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFetchDirection(int direction) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFetchDirection() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFetchSize(int rows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFetchSize() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getType() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getConcurrency() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowUpdated() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowInserted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowDeleted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNull(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBoolean(int columnIndex, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateByte(int columnIndex, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateShort(int columnIndex, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInt(int columnIndex, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateLong(int columnIndex, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateFloat(int columnIndex, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDouble(int columnIndex, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateString(int columnIndex, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBytes(int columnIndex, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDate(int columnIndex, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTime(int columnIndex, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(int columnIndex, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNull(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBoolean(String columnLabel, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateByte(String columnLabel, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateShort(String columnLabel, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInt(String columnLabel, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateLong(String columnLabel, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateFloat(String columnLabel, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDouble(String columnLabel, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateString(String columnLabel, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBytes(String columnLabel, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDate(String columnLabel, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTime(String columnLabel, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(String columnLabel, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void insertRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void deleteRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void refreshRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void cancelRowUpdates() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void moveToInsertRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void moveToCurrentRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Statement getStatement() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(int columnIndex, Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Ref getRef(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Blob getBlob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Clob getClob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Array getArray(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(String columnLabel, Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Ref getRef(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Blob getBlob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Clob getClob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Array getArray(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public URL getURL(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public URL getURL(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRef(int columnIndex, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRef(String columnLabel, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateArray(int columnIndex, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateArray(String columnLabel, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowId getRowId(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowId getRowId(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRowId(int columnIndex, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRowId(String columnLabel, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getHoldability() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isClosed() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNString(int columnIndex, String nString) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNString(String columnLabel, String nString) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, NClob nClob) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, NClob nClob) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public NClob getNClob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public NClob getNClob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLXML getSQLXML(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLXML getSQLXML(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getNString(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getNString(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getNCharacterStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getNCharacterStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T getObject(int columnIndex, Class type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T getObject(String columnLabel, Class type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T unwrap(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isWrapperFor(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(int columnIdx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(int[] columnIdxes) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(String[] columnNames) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int[] getMatchColumnIndexes() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String[] getMatchColumnNames() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(int columnIdx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(int[] columnIdxes) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(String[] columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubJoinRowSetImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubJoinRowSetImpl.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,1962 @@ +/* + * 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.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Reader; +import java.io.Writer; +import java.math.BigDecimal; +import java.net.URL; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Connection; +import java.sql.Date; +import java.sql.NClob; +import java.sql.Ref; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.RowId; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.sql.SQLXML; +import java.sql.Savepoint; +import java.sql.Statement; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.Collection; +import java.util.Map; +import javax.sql.RowSet; +import javax.sql.RowSetEvent; +import javax.sql.RowSetListener; +import javax.sql.RowSetMetaData; +import javax.sql.rowset.CachedRowSet; +import javax.sql.rowset.JoinRowSet; +import javax.sql.rowset.Joinable; +import javax.sql.rowset.RowSetWarning; +import javax.sql.rowset.spi.SyncProvider; +import javax.sql.rowset.spi.SyncProviderException; + +class StubJoinRowSetImpl implements JoinRowSet { + + public StubJoinRowSetImpl() { + } + + @Override + public void addRowSet(Joinable rowset) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void addRowSet(RowSet rowset, int columnIdx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void addRowSet(RowSet rowset, String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void addRowSet(RowSet[] rowset, int[] columnIdx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void addRowSet(RowSet[] rowset, String[] columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Collection getRowSets() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String[] getRowSetNames() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CachedRowSet toCachedRowSet() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean supportsCrossJoin() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean supportsInnerJoin() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean supportsLeftOuterJoin() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean supportsRightOuterJoin() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean supportsFullJoin() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setJoinType(int joinType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getWhereClause() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getJoinType() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void readXml(Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void readXml(InputStream iStream) throws SQLException, IOException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void writeXml(ResultSet rs, Writer writer) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void writeXml(ResultSet rs, OutputStream oStream) throws SQLException, IOException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void writeXml(Writer writer) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void writeXml(OutputStream oStream) throws SQLException, IOException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void populate(ResultSet data) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void execute(Connection conn) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void acceptChanges() throws SyncProviderException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void acceptChanges(Connection con) throws SyncProviderException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void restoreOriginal() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void release() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void undoDelete() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void undoInsert() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void undoUpdate() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean columnUpdated(int idx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean columnUpdated(String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Collection toCollection() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Collection toCollection(int column) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Collection toCollection(String column) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SyncProvider getSyncProvider() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSyncProvider(String provider) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int size() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMetaData(RowSetMetaData md) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSet getOriginal() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSet getOriginalRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setOriginalRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getTableName() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTableName(String tabName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int[] getKeyColumns() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setKeyColumns(int[] keys) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowSet createShared() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CachedRowSet createCopy() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CachedRowSet createCopySchema() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CachedRowSet createCopyNoConstraints() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowSetWarning getRowSetWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getShowDeleted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShowDeleted(boolean b) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void commit() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rollback() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rollback(Savepoint s) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void populate(ResultSet rs, int startRow) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPageSize(int size) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getPageSize() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean nextPage() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean previousPage() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getUrl() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setUrl(String url) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getDataSourceName() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDataSourceName(String name) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getUsername() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setUsername(String name) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getPassword() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPassword(String password) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getTransactionIsolation() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTransactionIsolation(int level) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Map> getTypeMap() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTypeMap(Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getCommand() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCommand(String cmd) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isReadOnly() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setReadOnly(boolean value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaxFieldSize() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaxFieldSize(int max) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaxRows() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaxRows(int max) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getEscapeProcessing() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setEscapeProcessing(boolean enable) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getQueryTimeout() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setQueryTimeout(int seconds) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setType(int type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setConcurrency(int concurrency) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(int parameterIndex, int sqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(String parameterName, int sqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(String parameterName, int sqlType, String typeName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBoolean(int parameterIndex, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBoolean(String parameterName, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setByte(int parameterIndex, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setByte(String parameterName, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShort(int parameterIndex, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShort(String parameterName, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setInt(int parameterIndex, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setInt(String parameterName, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLong(int parameterIndex, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLong(String parameterName, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFloat(int parameterIndex, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFloat(String parameterName, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDouble(int parameterIndex, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDouble(String parameterName, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setString(int parameterIndex, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setString(String parameterName, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBytes(int parameterIndex, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBytes(String parameterName, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(int parameterIndex, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(int parameterIndex, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(String parameterName, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(String parameterName, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(String parameterName, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRef(int i, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int i, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int i, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int parameterIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setArray(int i, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(String parameterName, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(String parameterName, Date x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(String parameterName, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(String parameterName, Time x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void clearParameters() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void execute() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void addRowSetListener(RowSetListener listener) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeRowSetListener(RowSetListener listener) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRowId(int parameterIndex, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRowId(String parameterName, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNString(int parameterIndex, String value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNString(String parameterName, String value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(String parameterName, Reader value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, NClob value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, NClob value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setURL(int parameterIndex, URL x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean next() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void close() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean wasNull() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getString(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getBoolean(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte getByte(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public short getShort(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getInt(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLong(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFloat(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getDouble(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte[] getBytes(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getAsciiStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getUnicodeStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getBinaryStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getString(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getBoolean(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte getByte(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public short getShort(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getInt(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLong(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFloat(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getDouble(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte[] getBytes(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getAsciiStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getUnicodeStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getBinaryStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLWarning getWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void clearWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getCursorName() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSetMetaData getMetaData() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int findColumn(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getCharacterStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getCharacterStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isBeforeFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isAfterLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void beforeFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void afterLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean first() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean last() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean absolute(int row) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean relative(int rows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean previous() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFetchDirection(int direction) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFetchDirection() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFetchSize(int rows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFetchSize() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getType() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getConcurrency() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowUpdated() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowInserted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowDeleted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNull(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBoolean(int columnIndex, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateByte(int columnIndex, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateShort(int columnIndex, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInt(int columnIndex, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateLong(int columnIndex, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateFloat(int columnIndex, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDouble(int columnIndex, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateString(int columnIndex, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBytes(int columnIndex, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDate(int columnIndex, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTime(int columnIndex, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(int columnIndex, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNull(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBoolean(String columnLabel, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateByte(String columnLabel, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateShort(String columnLabel, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInt(String columnLabel, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateLong(String columnLabel, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateFloat(String columnLabel, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDouble(String columnLabel, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateString(String columnLabel, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBytes(String columnLabel, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDate(String columnLabel, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTime(String columnLabel, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(String columnLabel, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void insertRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void deleteRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void refreshRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void cancelRowUpdates() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void moveToInsertRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void moveToCurrentRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Statement getStatement() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(int columnIndex, Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Ref getRef(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Blob getBlob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Clob getClob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Array getArray(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(String columnLabel, Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Ref getRef(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Blob getBlob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Clob getClob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Array getArray(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public URL getURL(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public URL getURL(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRef(int columnIndex, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRef(String columnLabel, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateArray(int columnIndex, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateArray(String columnLabel, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowId getRowId(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowId getRowId(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRowId(int columnIndex, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRowId(String columnLabel, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getHoldability() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isClosed() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNString(int columnIndex, String nString) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNString(String columnLabel, String nString) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, NClob nClob) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, NClob nClob) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public NClob getNClob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public NClob getNClob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLXML getSQLXML(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLXML getSQLXML(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getNString(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getNString(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getNCharacterStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getNCharacterStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T getObject(int columnIndex, Class type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T getObject(String columnLabel, Class type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T unwrap(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isWrapperFor(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(int columnIdx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(int[] columnIdxes) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(String[] columnNames) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int[] getMatchColumnIndexes() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String[] getMatchColumnNames() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(int columnIdx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(int[] columnIdxes) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(String[] columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubNClob.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubNClob.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,29 @@ +/* + * 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.NClob; + +public class StubNClob extends StubClob implements NClob { + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubRef.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubRef.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,60 @@ +/* + * 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.Serializable; +import java.sql.Ref; +import java.sql.SQLException; +import java.util.Map; + +public class StubRef implements Ref, Serializable { + + private final String baseTypeName; + private Object obj; + + public StubRef(String type, Object o) { + baseTypeName = type; + obj = o; + } + + @Override + public String getBaseTypeName() throws SQLException { + return baseTypeName; + } + + @Override + public Object getObject(Map> map) throws SQLException { + return obj; + } + + @Override + public Object getObject() throws SQLException { + return getObject(null); + } + + @Override + public void setObject(Object value) throws SQLException { + obj = value; + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubRowId.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubRowId.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,34 @@ +/* + * 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.RowId; + +public class StubRowId implements RowId { + + @Override + public byte[] getBytes() { + throw new UnsupportedOperationException("Not supported yet."); + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubRowSetFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubRowSetFactory.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,60 @@ +/* + * 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.SQLException; +import javax.sql.rowset.CachedRowSet; +import javax.sql.rowset.FilteredRowSet; +import javax.sql.rowset.JdbcRowSet; +import javax.sql.rowset.JoinRowSet; +import javax.sql.rowset.RowSetFactory; +import javax.sql.rowset.WebRowSet; + +public class StubRowSetFactory implements RowSetFactory { + + @Override + public CachedRowSet createCachedRowSet() throws SQLException { + return new StubCachedRowSetImpl(); + } + + @Override + public FilteredRowSet createFilteredRowSet() throws SQLException { + return new StubFilteredRowSetImpl(); + } + + @Override + public JdbcRowSet createJdbcRowSet() throws SQLException { + return new StubJdbcRowSetImpl(); + } + + @Override + public JoinRowSet createJoinRowSet() throws SQLException { + return new StubJoinRowSetImpl(); + } + + @Override + public WebRowSet createWebRowSet() throws SQLException { + return new StubWebRowSetImpl(); + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubSQLXML.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubSQLXML.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,81 @@ +/* + * 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.InputStream; +import java.io.OutputStream; +import java.io.Reader; +import java.io.Writer; +import java.sql.SQLException; +import java.sql.SQLXML; +import javax.xml.transform.Result; +import javax.xml.transform.Source; + +public class StubSQLXML implements SQLXML{ + + @Override + public void free() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getBinaryStream() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public OutputStream setBinaryStream() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getCharacterStream() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Writer setCharacterStream() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getString() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setString(String value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T getSource(Class sourceClass) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T setResult(Class resultClass) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubStruct.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubStruct.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,55 @@ +/* + * 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.SQLException; +import java.sql.Struct; +import java.util.Arrays; +import java.util.Map; + +public class StubStruct implements Struct { + + private final String type; + private final Object[] attribs; + + public StubStruct(String type, Object[] o) { + this.type = type; + this.attribs = Arrays.copyOf(o, o.length); + } + + @Override + public String getSQLTypeName() throws SQLException { + return type; + } + + @Override + public Object[] getAttributes() throws SQLException { + return attribs; + } + + @Override + public Object[] getAttributes(Map> map) throws SQLException { + return attribs; + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubSyncProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubSyncProvider.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,92 @@ +/* + * 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 + * 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 javax.sql.RowSetReader; +import javax.sql.RowSetWriter; +import javax.sql.rowset.spi.SyncProvider; +import javax.sql.rowset.spi.SyncProviderException; + +public class StubSyncProvider extends SyncProvider { + + /** + * The unique provider identifier. + */ + private String providerID = "util.StubSyncProvider"; + + /** + * The vendor name of this SyncProvider implementation + */ + private String vendorName = "Oracle Corporation"; + + /** + * The version number of this SyncProvider implementation + */ + private String versionNumber = "1.0"; + + @Override + public String getProviderID() { + return providerID; + } + + @Override + public RowSetReader getRowSetReader() { + return null; + } + + @Override + public RowSetWriter getRowSetWriter() { + return null; + } + + @Override + public int getProviderGrade() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDataSourceLock(int datasource_lock) throws SyncProviderException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getDataSourceLock() throws SyncProviderException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int supportsUpdatableView() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getVersion() { + return versionNumber; + } + + @Override + public String getVendor() { + return vendorName; + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubSyncResolver.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubSyncResolver.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,1616 @@ +/* + * 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.InputStream; +import java.io.Reader; +import java.io.Serializable; +import java.math.BigDecimal; +import java.net.URL; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Date; +import java.sql.NClob; +import java.sql.Ref; +import java.sql.ResultSetMetaData; +import java.sql.RowId; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.sql.SQLXML; +import java.sql.Statement; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.Map; +import javax.sql.RowSetListener; +import javax.sql.rowset.spi.SyncResolver; + +public class StubSyncResolver implements SyncResolver, Serializable { + + @Override + public int getStatus() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getConflictValue(int index) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getConflictValue(String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setResolvedValue(int index, Object obj) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setResolvedValue(String columnName, Object obj) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean nextConflict() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean previousConflict() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getUrl() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setUrl(String url) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getDataSourceName() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDataSourceName(String name) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getUsername() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setUsername(String name) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getPassword() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPassword(String password) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getTransactionIsolation() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTransactionIsolation(int level) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Map> getTypeMap() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTypeMap(Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getCommand() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCommand(String cmd) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isReadOnly() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setReadOnly(boolean value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaxFieldSize() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaxFieldSize(int max) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaxRows() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaxRows(int max) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getEscapeProcessing() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setEscapeProcessing(boolean enable) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getQueryTimeout() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setQueryTimeout(int seconds) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setType(int type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setConcurrency(int concurrency) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(int parameterIndex, int sqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(String parameterName, int sqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(String parameterName, int sqlType, String typeName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBoolean(int parameterIndex, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBoolean(String parameterName, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setByte(int parameterIndex, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setByte(String parameterName, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShort(int parameterIndex, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShort(String parameterName, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setInt(int parameterIndex, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setInt(String parameterName, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLong(int parameterIndex, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLong(String parameterName, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFloat(int parameterIndex, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFloat(String parameterName, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDouble(int parameterIndex, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDouble(String parameterName, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setString(int parameterIndex, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setString(String parameterName, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBytes(int parameterIndex, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBytes(String parameterName, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(int parameterIndex, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(int parameterIndex, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(String parameterName, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(String parameterName, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(String parameterName, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRef(int i, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int i, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int i, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int parameterIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setArray(int i, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(String parameterName, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(String parameterName, Date x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(String parameterName, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(String parameterName, Time x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void clearParameters() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void execute() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void addRowSetListener(RowSetListener listener) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeRowSetListener(RowSetListener listener) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRowId(int parameterIndex, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRowId(String parameterName, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNString(int parameterIndex, String value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNString(String parameterName, String value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(String parameterName, Reader value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, NClob value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, NClob value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setURL(int parameterIndex, URL x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean next() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void close() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean wasNull() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getString(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getBoolean(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte getByte(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public short getShort(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getInt(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLong(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFloat(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getDouble(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte[] getBytes(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getAsciiStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getUnicodeStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getBinaryStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getString(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getBoolean(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte getByte(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public short getShort(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getInt(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLong(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFloat(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getDouble(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte[] getBytes(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getAsciiStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getUnicodeStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getBinaryStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLWarning getWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void clearWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getCursorName() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSetMetaData getMetaData() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int findColumn(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getCharacterStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getCharacterStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isBeforeFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isAfterLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void beforeFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void afterLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean first() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean last() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean absolute(int row) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean relative(int rows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean previous() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFetchDirection(int direction) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFetchDirection() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFetchSize(int rows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFetchSize() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getType() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getConcurrency() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowUpdated() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowInserted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowDeleted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNull(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBoolean(int columnIndex, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateByte(int columnIndex, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateShort(int columnIndex, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInt(int columnIndex, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateLong(int columnIndex, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateFloat(int columnIndex, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDouble(int columnIndex, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateString(int columnIndex, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBytes(int columnIndex, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDate(int columnIndex, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTime(int columnIndex, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(int columnIndex, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNull(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBoolean(String columnLabel, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateByte(String columnLabel, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateShort(String columnLabel, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInt(String columnLabel, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateLong(String columnLabel, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateFloat(String columnLabel, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDouble(String columnLabel, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateString(String columnLabel, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBytes(String columnLabel, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDate(String columnLabel, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTime(String columnLabel, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(String columnLabel, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void insertRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void deleteRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void refreshRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void cancelRowUpdates() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void moveToInsertRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void moveToCurrentRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Statement getStatement() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(int columnIndex, Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Ref getRef(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Blob getBlob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Clob getClob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Array getArray(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(String columnLabel, Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Ref getRef(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Blob getBlob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Clob getClob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Array getArray(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public URL getURL(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public URL getURL(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRef(int columnIndex, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRef(String columnLabel, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateArray(int columnIndex, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateArray(String columnLabel, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowId getRowId(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowId getRowId(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRowId(int columnIndex, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRowId(String columnLabel, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getHoldability() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isClosed() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNString(int columnIndex, String nString) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNString(String columnLabel, String nString) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, NClob nClob) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, NClob nClob) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public NClob getNClob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public NClob getNClob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLXML getSQLXML(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLXML getSQLXML(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getNString(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getNString(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getNCharacterStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getNCharacterStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T getObject(int columnIndex, Class type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T getObject(String columnLabel, Class type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T unwrap(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isWrapperFor(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/StubWebRowSetImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/StubWebRowSetImpl.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,1879 @@ +/* + * 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.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Reader; +import java.io.Writer; +import java.math.BigDecimal; +import java.net.URL; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Connection; +import java.sql.Date; +import java.sql.NClob; +import java.sql.Ref; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.RowId; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.sql.SQLXML; +import java.sql.Savepoint; +import java.sql.Statement; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.Collection; +import java.util.Map; +import javax.sql.RowSet; +import javax.sql.RowSetEvent; +import javax.sql.RowSetListener; +import javax.sql.RowSetMetaData; +import javax.sql.rowset.CachedRowSet; +import javax.sql.rowset.RowSetWarning; +import javax.sql.rowset.WebRowSet; +import javax.sql.rowset.spi.SyncProvider; +import javax.sql.rowset.spi.SyncProviderException; + +public class StubWebRowSetImpl implements WebRowSet { + + @Override + public void readXml(Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void readXml(InputStream iStream) throws SQLException, IOException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void writeXml(ResultSet rs, Writer writer) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void writeXml(ResultSet rs, OutputStream oStream) throws SQLException, IOException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void writeXml(Writer writer) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void writeXml(OutputStream oStream) throws SQLException, IOException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void populate(ResultSet data) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void execute(Connection conn) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void acceptChanges() throws SyncProviderException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void acceptChanges(Connection con) throws SyncProviderException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void restoreOriginal() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void release() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void undoDelete() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void undoInsert() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void undoUpdate() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean columnUpdated(int idx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean columnUpdated(String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Collection toCollection() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Collection toCollection(int column) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Collection toCollection(String column) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SyncProvider getSyncProvider() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSyncProvider(String provider) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int size() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMetaData(RowSetMetaData md) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSet getOriginal() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSet getOriginalRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setOriginalRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getTableName() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTableName(String tabName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int[] getKeyColumns() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setKeyColumns(int[] keys) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowSet createShared() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CachedRowSet createCopy() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CachedRowSet createCopySchema() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public CachedRowSet createCopyNoConstraints() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowSetWarning getRowSetWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getShowDeleted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShowDeleted(boolean b) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void commit() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rollback() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rollback(Savepoint s) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void populate(ResultSet rs, int startRow) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPageSize(int size) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getPageSize() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean nextPage() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean previousPage() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getUrl() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setUrl(String url) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getDataSourceName() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDataSourceName(String name) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getUsername() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setUsername(String name) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getPassword() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPassword(String password) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getTransactionIsolation() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTransactionIsolation(int level) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Map> getTypeMap() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTypeMap(Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getCommand() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCommand(String cmd) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isReadOnly() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setReadOnly(boolean value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaxFieldSize() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaxFieldSize(int max) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaxRows() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaxRows(int max) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getEscapeProcessing() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setEscapeProcessing(boolean enable) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getQueryTimeout() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setQueryTimeout(int seconds) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setType(int type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setConcurrency(int concurrency) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(int parameterIndex, int sqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(String parameterName, int sqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNull(String parameterName, int sqlType, String typeName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBoolean(int parameterIndex, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBoolean(String parameterName, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setByte(int parameterIndex, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setByte(String parameterName, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShort(int parameterIndex, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setShort(String parameterName, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setInt(int parameterIndex, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setInt(String parameterName, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLong(int parameterIndex, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLong(String parameterName, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFloat(int parameterIndex, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFloat(String parameterName, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDouble(int parameterIndex, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDouble(String parameterName, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setString(int parameterIndex, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setString(String parameterName, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBytes(int parameterIndex, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBytes(String parameterName, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(int parameterIndex, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(int parameterIndex, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(String parameterName, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAsciiStream(String parameterName, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBinaryStream(String parameterName, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCharacterStream(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(String parameterName, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setObject(int parameterIndex, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRef(int i, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int i, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBlob(String parameterName, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int i, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int parameterIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setClob(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setArray(int i, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(String parameterName, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setDate(String parameterName, Date x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(String parameterName, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTime(String parameterName, Time x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void clearParameters() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void execute() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void addRowSetListener(RowSetListener listener) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeRowSetListener(RowSetListener listener) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRowId(int parameterIndex, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRowId(String parameterName, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNString(int parameterIndex, String value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNString(String parameterName, String value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNCharacterStream(String parameterName, Reader value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, NClob value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(String parameterName, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, NClob value) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNClob(int parameterIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setURL(int parameterIndex, URL x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean next() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void close() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean wasNull() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getString(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getBoolean(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte getByte(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public short getShort(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getInt(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLong(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFloat(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getDouble(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte[] getBytes(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getAsciiStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getUnicodeStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getBinaryStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getString(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getBoolean(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte getByte(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public short getShort(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getInt(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLong(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFloat(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getDouble(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public byte[] getBytes(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getAsciiStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getUnicodeStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InputStream getBinaryStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLWarning getWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void clearWarnings() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getCursorName() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ResultSetMetaData getMetaData() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int findColumn(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getCharacterStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getCharacterStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isBeforeFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isAfterLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void beforeFirst() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void afterLast() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean first() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean last() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean absolute(int row) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean relative(int rows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean previous() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFetchDirection(int direction) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFetchDirection() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFetchSize(int rows) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFetchSize() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getType() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getConcurrency() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowUpdated() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowInserted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean rowDeleted() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNull(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBoolean(int columnIndex, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateByte(int columnIndex, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateShort(int columnIndex, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInt(int columnIndex, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateLong(int columnIndex, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateFloat(int columnIndex, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDouble(int columnIndex, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateString(int columnIndex, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBytes(int columnIndex, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDate(int columnIndex, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTime(int columnIndex, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(int columnIndex, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNull(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBoolean(String columnLabel, boolean x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateByte(String columnLabel, byte x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateShort(String columnLabel, short x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInt(String columnLabel, int x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateLong(String columnLabel, long x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateFloat(String columnLabel, float x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDouble(String columnLabel, double x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateString(String columnLabel, String x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBytes(String columnLabel, byte[] x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateDate(String columnLabel, Date x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTime(String columnLabel, Time x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateObject(String columnLabel, Object x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void insertRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void deleteRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void refreshRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void cancelRowUpdates() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void moveToInsertRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void moveToCurrentRow() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Statement getStatement() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(int columnIndex, Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Ref getRef(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Blob getBlob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Clob getClob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Array getArray(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Object getObject(String columnLabel, Map> map) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Ref getRef(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Blob getBlob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Clob getClob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Array getArray(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Date getDate(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Time getTime(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public URL getURL(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public URL getURL(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRef(int columnIndex, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRef(String columnLabel, Ref x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, Blob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Clob x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateArray(int columnIndex, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateArray(String columnLabel, Array x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowId getRowId(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public RowId getRowId(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRowId(int columnIndex, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateRowId(String columnLabel, RowId x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getHoldability() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isClosed() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNString(int columnIndex, String nString) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNString(String columnLabel, String nString) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, NClob nClob) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, NClob nClob) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public NClob getNClob(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public NClob getNClob(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLXML getSQLXML(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public SQLXML getSQLXML(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getNString(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getNString(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getNCharacterStream(int columnIndex) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Reader getNCharacterStream(String columnLabel) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(int columnIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateClob(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(int columnIndex, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateNClob(String columnLabel, Reader reader) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T getObject(int columnIndex, Class type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T getObject(String columnLabel, Class type) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T unwrap(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isWrapperFor(Class iface) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(int columnIdx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(int[] columnIdxes) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMatchColumn(String[] columnNames) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int[] getMatchColumnIndexes() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String[] getMatchColumnNames() throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(int columnIdx) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(int[] columnIdxes) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(String columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void unsetMatchColumn(String[] columnName) throws SQLException { + throw new UnsupportedOperationException("Not supported yet."); + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/SuperHero.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/SuperHero.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,110 @@ +/* + * 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.Serializable; +import java.sql.SQLData; +import java.sql.SQLException; +import java.sql.SQLInput; +import java.sql.SQLOutput; + +public class SuperHero implements SQLData, Serializable { + + private String first; + private String last; + private String type = "SUPERHERO"; + private Integer firstYear; + private String secretIdentity; + + public SuperHero() { + + } + + public SuperHero(String sqlType, String fname, String lname, Integer year, + String identity) { + first = fname; + last = lname; + type = sqlType; + firstYear = year; + secretIdentity = identity; + } + + @Override + public String getSQLTypeName() throws SQLException { + return type; + } + + @Override + public void readSQL(SQLInput stream, String typeName) throws SQLException { + first = stream.readString(); + last = stream.readString(); + firstYear = stream.readInt(); + secretIdentity = stream.readString(); + } + + @Override + public void writeSQL(SQLOutput stream) throws SQLException { + stream.writeString(first); + stream.writeString(last); + stream.writeInt(firstYear); + stream.writeString(secretIdentity); + } + + @Override + public String toString() { + return "[ name =" + first + " " + last + " " + + firstYear + " " + secretIdentity + " ]"; + } + + public void setIdentity(String identity) { + secretIdentity = identity; + } + + public String getIdentity() { + return secretIdentity; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof SuperHero) { + SuperHero ss = (SuperHero) obj; + return first.equals(ss.first) && last.equals(ss.last) + && firstYear.equals(ss.firstYear) + && type.equals(ss.type) + && secretIdentity.equals(ss.secretIdentity); + } + return false; + } + + @Override + public int hashCode() { + return ((31 + first.hashCode()) * 31) * 31 + + ((31 + last.hashCode()) * 31) * 31 + + ((31 + firstYear.hashCode()) * 31) * 31 + + ((31 + type.hashCode()) * 31) * 31 + + secretIdentity.hashCode(); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/TestRowSetListener.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/TestRowSetListener.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,64 @@ +/* + * 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 javax.sql.RowSetEvent; +import javax.sql.RowSetListener; + +public class TestRowSetListener implements RowSetListener { + + // Flags to indicate which listener events should have been notified + public final static int ROWSET_CHANGED = 1; + public final static int ROW_CHANGED = 2; + public final static int CURSOR_MOVED = 4; + private int flag; + + @Override + public void rowSetChanged(RowSetEvent event) { + flag |= ROWSET_CHANGED; + } + + @Override + public void rowChanged(RowSetEvent event) { + flag |= ROW_CHANGED; + } + + @Override + public void cursorMoved(RowSetEvent event) { + flag |= CURSOR_MOVED; + } + + /* + * Clear the flag indicating which events we were notified for + */ + public void resetFlag() { + flag = 0; + } + + /* + * Method used to validate that the correct event was notified + */ + public boolean isNotified( int val) { + return flag == val; + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/util/TestSQLDataImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/util/TestSQLDataImpl.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,125 @@ +/* + * 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.math.BigDecimal; +import java.sql.Date; +import java.sql.SQLData; +import java.sql.SQLException; +import java.sql.SQLInput; +import java.sql.SQLOutput; +import java.sql.Time; +import java.sql.Timestamp; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.Arrays; + +public class TestSQLDataImpl implements SQLData { + + private final int stringPos = 0; + private final int datePos = 1; + private final int timePos = 2; + private final int timestampPos = 3; + private final int intPos = 4; + private final int longPos = 5; + private final int shortPos = 6; + private final int bigDecimalPos = 7; + private final int doublePos = 8; + private final int booleanPos = 9; + private final int floatPos = 10; + private final int bytePos = 11; + private final int bytesPos = 12; + private final int MAX_TYPES = bytesPos + 1; + private final Object[] types = new Object[MAX_TYPES]; + + private final static byte[] b = {1, 2, 3}; + + // attributes entries must line up with the ordering of the reading and + // writing of the fields in readSQL and writeSQL + public final static Object[] attributes = {"The Dark Knight", + Date.valueOf(LocalDate.now()), Time.valueOf(LocalTime.now()), + Timestamp.valueOf(LocalDateTime.now()), Integer.MAX_VALUE, + Long.MAX_VALUE, Short.MIN_VALUE, BigDecimal.ONE, + Double.MAX_VALUE, true, 1.5f, Byte.MAX_VALUE, b}; + + private String sqlType; + + public TestSQLDataImpl(String type) { + sqlType = type; + } + + @Override + public String getSQLTypeName() throws SQLException { + return sqlType; + } + + @Override + public void readSQL(SQLInput stream, String typeName) throws SQLException { + + sqlType = typeName; + types[stringPos] = stream.readString(); + types[datePos] = stream.readDate(); + types[timePos] = stream.readTime(); + types[timestampPos] = stream.readTimestamp(); + types[intPos] = stream.readInt(); + types[longPos] = stream.readLong(); + types[shortPos] = stream.readShort(); + types[bigDecimalPos] = stream.readBigDecimal(); + types[doublePos] = stream.readDouble(); + types[booleanPos] = stream.readBoolean(); + types[floatPos] = stream.readFloat(); + types[bytePos] = stream.readByte(); + types[bytesPos] = stream.readBytes(); + } + + @Override + public void writeSQL(SQLOutput stream) throws SQLException { + + stream.writeString((String) types[stringPos]); + stream.writeDate((Date) types[datePos]); + stream.writeTime((Time) types[timePos]); + stream.writeTimestamp((Timestamp) types[timestampPos]); + stream.writeInt((Integer) types[intPos]); + stream.writeLong((Long) types[longPos]); + stream.writeShort((Short) types[shortPos]); + stream.writeBigDecimal((BigDecimal) types[bigDecimalPos]); + stream.writeDouble((Double) types[doublePos]); + stream.writeBoolean((Boolean) types[booleanPos]); + stream.writeFloat((Float) types[floatPos]); + stream.writeByte((Byte) types[bytePos]); + stream.writeBytes((byte[]) types[bytesPos]); + } + + public Object[] toArray() { + + Object[] result = Arrays.copyOf(types, types.length); + return result; + } + + @Override + public String toString() { + return "[" + sqlType + " " + types + "]"; + } + +} diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/xml/COFFEE_ROWS.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/xml/COFFEE_ROWS.xml Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,191 @@ + + + + + 1008 + + true + 1000 + 0 + 2 + + + + + 0 + 0 + 0 + true + ResultSet.TYPE_SCROLL_INSENSITIVE + false + COFFEES + + + com.sun.rowset.providers.RIOptimisticProvider + Oracle Corporation + 1.0 + 2 + 1 + + + + 6 + + 1 + false + false + false + 0 + false + false + 0 + + COF_NAME + + 0 + 0 + + + 4 + + + + 2 + false + false + false + 0 + false + false + 0 + + SUP_ID + + 0 + 0 + + + 12 + + + + 3 + false + false + false + 0 + false + false + 0 + + PRICE + + 0 + 0 + + + 4 + + + + 4 + false + false + false + 0 + false + false + 0 + + SALES + + 10 + 2 + + + 2 + + + + 5 + false + false + false + 0 + false + false + 0 + + TOTAL + + 0 + 0 + + + 4 + + + + 6 + false + false + false + 0 + false + false + 0 + + + + 0 + 0 + + + 4 + + + + + + 1 + Colombian + 101 + 7.99 + 0 + 0 + + + 2 + French_Roast + 49 + 8.99 + 0 + 0 + + + 3 + Espresso + 150 + 9.99 + 0 + 0 + + + 4 + Colombian_Decaf + 101 + 8.99 + 0 + 0 + + + 5 + French_Roast_Decaf + 49 + 9.99 + 0 + 0 + + + diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/xml/DELETED_COFFEE_ROWS.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/xml/DELETED_COFFEE_ROWS.xml Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,191 @@ + + + + SELECT * FROM COFFEES + 1008 + + true + 1000 + 0 + 2 + + + + + 0 + 0 + 0 + true + ResultSet.TYPE_SCROLL_INSENSITIVE + false + COFFEES + jdbc:derby://localhost:1527/testDB;create=true + + com.sun.rowset.providers.RIOptimisticProvider + Oracle Corporation + 1.0 + 2 + 1 + + + + 6 + + 1 + false + false + false + 0 + false + false + 0 + + COF_NAME + + 0 + 0 + + + 4 + + + + 2 + false + false + false + 0 + false + false + 0 + + SUP_ID + + 0 + 0 + + + 12 + + + + 3 + false + false + false + 0 + false + false + 0 + + PRICE + + 0 + 0 + + + 4 + + + + 4 + false + false + false + 0 + false + false + 0 + + SALES + + 10 + 2 + + + 2 + + + + 5 + false + false + false + 0 + false + false + 0 + + TOTAL + + 0 + 0 + + + 4 + + + + 6 + false + false + false + 0 + false + false + 0 + + + + 0 + 0 + + + 4 + + + + + + 1 + Colombian + 101 + 7.99 + 0 + 0 + + + 2 + French_Roast + 49 + 8.99 + 0 + 0 + + + 3 + Espresso + 150 + 9.99 + 0 + 0 + + + 4 + Colombian_Decaf + 101 + 8.99 + 0 + 0 + + + 5 + French_Roast_Decaf + 49 + 9.99 + 0 + 0 + + + diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/xml/INSERTED_COFFEE_ROWS.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/xml/INSERTED_COFFEE_ROWS.xml Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,207 @@ + + + + + 1008 + + true + 1000 + 0 + 2 + + + + + 0 + 0 + 0 + true + ResultSet.TYPE_SCROLL_INSENSITIVE + false + COFFEES + + + com.sun.rowset.providers.RIOptimisticProvider + Oracle Corporation + 1.0 + 2 + 1 + + + + 6 + + 1 + false + false + false + 0 + false + false + 0 + + COF_NAME + + 0 + 0 + + + 4 + + + + 2 + false + false + false + 0 + false + false + 0 + + SUP_ID + + 0 + 0 + + + 12 + + + + 3 + false + false + false + 0 + false + false + 0 + + PRICE + + 0 + 0 + + + 4 + + + + 4 + false + false + false + 0 + false + false + 0 + + SALES + + 10 + 2 + + + 2 + + + + 5 + false + false + false + 0 + false + false + 0 + + TOTAL + + 0 + 0 + + + 4 + + + + 6 + false + false + false + 0 + false + false + 0 + + + + 0 + 0 + + + 4 + + + + + + 1 + Colombian + 101 + 7.99 + 0 + 0 + + + 2 + French_Roast + 49 + 8.99 + 0 + 0 + + + 3 + Espresso + 150 + 9.99 + 0 + 0 + + + 4 + Colombian_Decaf + 101 + 8.99 + 0 + 0 + + + 15 + Hazelnut + 101 + 8.99 + 0 + 0 + + + 20 + French Vanilla + 49 + 9.99 + 0 + 0 + + + 5 + French_Roast_Decaf + 49 + 9.99 + 0 + 0 + + + diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/xml/MODFIED_DELETED_COFFEE_ROWS.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/xml/MODFIED_DELETED_COFFEE_ROWS.xml Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,191 @@ + + + + + 1008 + + true + 1000 + 0 + 2 + + + + + 0 + 0 + 0 + true + ResultSet.TYPE_SCROLL_INSENSITIVE + false + COFFEES + + + com.sun.rowset.providers.RIOptimisticProvider + Oracle Corporation + 1.0 + 2 + 1 + + + + 6 + + 1 + false + false + false + 0 + false + false + 0 + + COF_NAME + + 0 + 0 + + + 4 + + + + 2 + false + false + false + 0 + false + false + 0 + + SUP_ID + + 0 + 0 + + + 12 + + + + 3 + false + false + false + 0 + false + false + 0 + + PRICE + + 0 + 0 + + + 4 + + + + 4 + false + false + false + 0 + false + false + 0 + + SALES + + 10 + 2 + + + 2 + + + + 5 + false + false + false + 0 + false + false + 0 + + TOTAL + + 0 + 0 + + + 4 + + + + 6 + false + false + false + 0 + false + false + 0 + + + + 0 + 0 + + + 4 + + + + + + 1 + Colombian + 101 + 7.99 + 0 + 0 + + + 2 + French_Roast + 49 + 8.99 + 0 + 0 + + + 3 + Espresso + 150 + 9.99 + 0 + 0 + + + 4 + Colombian_Decaf + 101 + 8.99 + 0 + 0 + + + 5 + French_Roast_Decaf + 49 + 9.99 + 0 + 0 + + + diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/xml/UPDATED_COFFEE_ROWS.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/xml/UPDATED_COFFEE_ROWS.xml Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,193 @@ + + + + SELECT * FROM COFFEES + 1008 + + true + 1000 + 0 + 2 + + + + + 0 + 0 + 0 + true + ResultSet.TYPE_SCROLL_INSENSITIVE + false + COFFEES + jdbc:derby://localhost:1527/testDB;create=true + + com.sun.rowset.providers.RIOptimisticProvider + Oracle Corporation + 1.0 + 2 + 1 + + + + 6 + + 1 + false + false + false + 0 + false + false + 0 + + COF_NAME + + 0 + 0 + + + 4 + + + + 2 + false + false + false + 0 + false + false + 0 + + SUP_ID + + 0 + 0 + + + 12 + + + + 3 + false + false + false + 0 + false + false + 0 + + PRICE + + 0 + 0 + + + 4 + + + + 4 + false + false + false + 0 + false + false + 0 + + SALES + + 10 + 2 + + + 2 + + + + 5 + false + false + false + 0 + false + false + 0 + + TOTAL + + 0 + 0 + + + 4 + + + + 6 + false + false + false + 0 + false + false + 0 + + + + 0 + 0 + + + 4 + + + + + + 1 + Colombian + 101 + 7.99 + 0 + 0 + + + 2 + French_Roast + 49 + 8.99 + 0 + 0 + + + 3 + Espresso + 150 + 9.99 + 0 + 21 + 0 + 69 + + + 4 + Colombian_Decaf + 101 + 8.99 + 0 + 0 + + + 5 + French_Roast_Decaf + 49 + 9.99 + 0 + 0 + + + diff -r 37d98293b182 -r 309156990bcf test/javax/sql/testng/xml/UPDATED_INSERTED_COFFEE_ROWS.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/sql/testng/xml/UPDATED_INSERTED_COFFEE_ROWS.xml Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,201 @@ + + + + + 1008 + + true + 1000 + 0 + 2 + + + + + 0 + 0 + 0 + true + ResultSet.TYPE_SCROLL_INSENSITIVE + false + COFFEES + + + com.sun.rowset.providers.RIOptimisticProvider + Oracle Corporation + 1.0 + 2 + 1 + + + + 6 + + 1 + false + false + false + 0 + false + false + 0 + + COF_NAME + + 0 + 0 + + + 4 + + + + 2 + false + false + false + 0 + false + false + 0 + + SUP_ID + + 0 + 0 + + + 12 + + + + 3 + false + false + false + 0 + false + false + 0 + + PRICE + + 0 + 0 + + + 4 + + + + 4 + false + false + false + 0 + false + false + 0 + + SALES + + 10 + 2 + + + 2 + + + + 5 + false + false + false + 0 + false + false + 0 + + TOTAL + + 0 + 0 + + + 4 + + + + 6 + false + false + false + 0 + false + false + 0 + + + + 0 + 0 + + + 4 + + + + + + 1 + Colombian + 101 + 7.99 + 0 + 0 + + + 2 + French_Roast + 49 + 8.99 + 0 + 0 + + + 3 + Espresso + 150 + 9.99 + 0 + 0 + + + 4 + Colombian_Decaf + 101 + 8.99 + 0 + 0 + + + 5 + French_Roast_Decaf + 49 + 9.99 + 0 + 0 + + + 100 + Mocha + 49 + 9.99 + 12.99 + 20 + 35 + 125 + + + diff -r 37d98293b182 -r 309156990bcf test/javax/swing/JTextArea/TextViewOOM/TextViewOOM.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/swing/JTextArea/TextViewOOM/TextViewOOM.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,95 @@ +/* + * 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.EventQueue; + +import javax.swing.JFrame; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; + +/** + * @test + * @bug 8072775 + * @run main/othervm -Xmx80m TextViewOOM + */ +public class TextViewOOM { + + private static JFrame frame; + private static JTextArea ta; + private static final String STRING = "\uDC00\uD802\uDFFF"; + private static final int N = 5000; + + private static void createAndShowGUI() { + frame = new JFrame(); + final JScrollPane jScrollPane1 = new JScrollPane(); + ta = new JTextArea(); + + ta.setEditable(false); + ta.setColumns(20); + ta.setRows(5); + jScrollPane1.setViewportView(ta); + frame.add(ta); + + frame.pack(); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + public static void main(final String[] args) throws Exception { + /* Create and display the form */ + EventQueue.invokeAndWait(TextViewOOM::createAndShowGUI); + for (int i = 0; i < 10; i++) { + System.gc(); + Thread.sleep(1000); + } + long mem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); + System.err.println("Memory before creating the text: "+mem); + final StringBuilder sb = new StringBuilder(N * STRING.length()); + for (int i = 0; i < N; i++) { + sb.append(STRING); + } + for (int i = 0; i < 10; i++) { + System.gc(); + Thread.sleep(1000); + } + mem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); + System.err.println("Memory after creating the text: "+mem); + + EventQueue.invokeAndWait(() -> { + ta.setText(sb.toString()); + for (int i = 0; i < 10; i++) { + System.gc(); + try {Thread.sleep(200);} catch (InterruptedException iex) {} + } + long mem1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); + System.err.println("Memory after setting the text: " + mem1); + }); + for (int i = 0; i < 10; i++) { + System.gc(); + Thread.sleep(1000); + } + mem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); + System.err.println("Final memory after everything: " + mem); + EventQueue.invokeAndWait(frame::dispose); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/swing/RepaintManager/DisplayListenerLeak/DisplayListenerLeak.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/swing/RepaintManager/DisplayListenerLeak/DisplayListenerLeak.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,82 @@ +/* + * 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.BorderLayout; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.GraphicsEnvironment; + +import javax.swing.JFrame; +import javax.swing.JLabel; + +import sun.java2d.SunGraphicsEnvironment; + +/** + * @test + * @bug 8041654 + * @run main/othervm -Xmx80m DisplayListenerLeak + */ +public final class DisplayListenerLeak { + + private static JFrame frame; + private volatile static boolean failed = false; + + private static void createAndShowGUI() { + Thread.currentThread().setUncaughtExceptionHandler((t, e) -> { + e.printStackTrace(); + failed = true; + }); + frame = new JFrame(); + JLabel emptyLabel = new JLabel(""); + emptyLabel.setPreferredSize(new Dimension(600, 400)); + frame.getContentPane().add(emptyLabel, BorderLayout.CENTER); + frame.pack(); + frame.setVisible(true); + } + + public static void main(final String[] args) throws Exception { + GraphicsEnvironment ge = + GraphicsEnvironment.getLocalGraphicsEnvironment(); + if (!(ge instanceof SunGraphicsEnvironment)) { + return; + } + EventQueue.invokeAndWait(() -> createAndShowGUI()); + SunGraphicsEnvironment sge = (SunGraphicsEnvironment) ge; + final long startTime = System.nanoTime(); + while (!failed) { + if (System.nanoTime() - startTime > 60_000_000_000L) { + break; + } + System.gc(); // clear all weak references + EventQueue.invokeAndWait(() -> { + frame.setSize(frame.getHeight(), frame.getWidth()); + frame.pack(); + }); + EventQueue.invokeAndWait(sge::displayChanged); + } + EventQueue.invokeAndWait(frame::dispose); + if (failed) { + throw new RuntimeException(); + } + } +} \ No newline at end of file diff -r 37d98293b182 -r 309156990bcf test/javax/xml/jaxp/common/8032908/TestFunc.java --- a/test/javax/xml/jaxp/common/8032908/TestFunc.java Wed Jun 10 23:15:56 2015 -0700 +++ b/test/javax/xml/jaxp/common/8032908/TestFunc.java Wed Jun 17 21:55:37 2015 -0700 @@ -26,8 +26,9 @@ public class TestFunc { public static String test(Node node) { - String s = node.getTextContent(); - return s; + String textContent = node.getTextContent(); + String nodeValue = node.getNodeValue(); + return textContent + ":" + nodeValue; } } diff -r 37d98293b182 -r 309156990bcf test/javax/xml/jaxp/common/8032908/XSLT.java --- a/test/javax/xml/jaxp/common/8032908/XSLT.java Wed Jun 10 23:15:56 2015 -0700 +++ b/test/javax/xml/jaxp/common/8032908/XSLT.java Wed Jun 17 21:55:37 2015 -0700 @@ -23,9 +23,10 @@ /** * @test - * @bug 8032908 + * @bug 8032908 8081392 * @summary Test if Node.getTextContent() function correctly returns children - * content + * content and also check that Node.getNodeValue() returns null value for + * Element nodes * @compile TestFunc.java XSLT.java * @run main/othervm XSLT */ @@ -40,7 +41,7 @@ static final String XMLTOTRANSFORM = "/in.xml"; static final String XSLTRANSFORMER = "/test.xsl"; - static final String EXPECTEDRESULT = "ABCDEFG"; + static final String EXPECTEDRESULT = "ABCDEFG:null"; public static void main(String[] args) throws TransformerException { ByteArrayOutputStream resStream = new ByteArrayOutputStream(); diff -r 37d98293b182 -r 309156990bcf test/javax/xml/jaxp/testng/parse/jdk7156085/UTF8ReaderBug.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/xml/jaxp/testng/parse/jdk7156085/UTF8ReaderBug.java Wed Jun 17 21:55:37 2015 -0700 @@ -0,0 +1,64 @@ +/* + * Copyright 2014 Google, Inc. 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 parse.jdk7156085; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import org.xml.sax.InputSource; +import org.xml.sax.helpers.DefaultHandler; +import org.testng.annotations.Test; + +/** + * JDK-7156085: ArrayIndexOutOfBoundsException throws in UTF8Reader of SAXParser + * https://bugs.openjdk.java.net/browse/JDK-7156085 + * + * XERCESJ-1257: buffer overflow in UTF8Reader for characters out of BMP + * https://issues.apache.org/jira/browse/XERCESJ-1257 + */ +public class UTF8ReaderBug { + @Test + public void shouldAcceptSupplementaryCharacters() throws Throwable { + StringBuilder b = new StringBuilder(""); + for(int i = 5; i < 8223; i++) { + b.append(' '); + } + // Add surrogate characters which overflow the buffer. This shows the need to place an + // overflow check at -- + // com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:544) + b.append("\uD835\uDC37"); + b.append(""); + sendToParser(b.toString()); + } + + private static void sendToParser(String b) throws Throwable { + byte[] input = b.getBytes("UTF-8"); + ByteArrayInputStream in = new ByteArrayInputStream(input); + + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser p = spf.newSAXParser(); + p.parse(new InputSource(in), new DefaultHandler()); + } +} diff -r 37d98293b182 -r 309156990bcf test/javax/xml/jaxp/transform/8062518/DocumentExtFunc.java --- a/test/javax/xml/jaxp/transform/8062518/DocumentExtFunc.java Wed Jun 10 23:15:56 2015 -0700 +++ b/test/javax/xml/jaxp/transform/8062518/DocumentExtFunc.java Wed Jun 17 21:55:37 2015 -0700 @@ -27,6 +27,6 @@ public static String test(NodeList list) { Node node = list.item(0); - return "["+node.getNodeName() + ":" + node.getNodeValue()+"]"; + return "[" + node.getNodeName() + ":" + node.getTextContent() + "]"; } } diff -r 37d98293b182 -r 309156990bcf test/jdk/net/Sockets/Test.java --- a/test/jdk/net/Sockets/Test.java Wed Jun 10 23:15:56 2015 -0700 +++ b/test/jdk/net/Sockets/Test.java Wed Jun 17 21:55:37 2015 -0700 @@ -23,8 +23,9 @@ /* * @test - * @bug 8032808 + * @bug 8032808 8072384 * @run main/othervm -Xcheck:jni Test + * @run main/othervm -Xcheck:jni -Djava.net.preferIPv4Stack=true Test * @run main/othervm/policy=policy.fail -Xcheck:jni Test fail * @run main/othervm/policy=policy.success -Xcheck:jni Test success */ @@ -100,6 +101,10 @@ System.out.println ("Set SO_RCVBUF to 5000\ngetting returns: "); System.out.println (Sockets.getOption(s, StandardSocketOptions.SO_RCVBUF)); + Sockets.setOption(ss, StandardSocketOptions.IP_TOS, 128); + System.out.println ("Setting TOS to 128\ngetting returns: "); + System.out.println (Sockets.getOption(ss, StandardSocketOptions.IP_TOS)); + try { Sockets.setOption(ss, StandardSocketOptions.TCP_NODELAY, true); throw new RuntimeException("TCP_NODELAY should not be supported for ServerSocket"); diff -r 37d98293b182 -r 309156990bcf test/sun/nio/cs/TestStringCoding.java --- a/test/sun/nio/cs/TestStringCoding.java Wed Jun 10 23:15:56 2015 -0700 +++ b/test/sun/nio/cs/TestStringCoding.java Wed Jun 17 21:55:37 2015 -0700 @@ -22,7 +22,7 @@ */ /* @test - @bug 6636323 6636319 7040220 7096080 7183053 + @bug 6636323 6636319 7040220 7096080 7183053 8080248 @summary Test if StringCoding and NIO result have the same de/encoding result * @run main/othervm/timeout=2000 TestStringCoding */ @@ -199,6 +199,17 @@ */ } + //encode mappable surrogates for hkscs + if (cs.name().equals("Big5-HKSCS") || cs.name().equals("x-MS950-HKSCS")) { + String str = "ab\uD840\uDD0Ccd"; + byte[] expected = new byte[] {(byte)'a', (byte)'b', + (byte)0x88, (byte)0x45, (byte)'c', (byte)'d' }; + if (!Arrays.equals(str.getBytes(cs.name()), expected) || + !Arrays.equals(str.getBytes(cs), expected)) { + throw new RuntimeException("encode(surrogates) failed -> " + + cs.name()); + } + } } static class PermissiveSecurityManger extends SecurityManager {