/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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 5067405
* @summary Basic test for classes which implement Appendable.
*/
}
public class Basic {
private static final String s = "Beware the Jabberwock, my son!";
try {
f.deleteOnExit();
} catch (IOException x) {
fail(x);
}
return f;
}
static void pass() {
pass++;
}
fail++;
}
fail++;
}
first = new RuntimeException(s);
fail++;
}
else
pass();
}
new BasicRunnable() {
try {
} catch (IOException x) {
fail(x);
}
}
public void run() {
}
return bw;
}};
new BasicRunnable() {
private CharArrayWriter cw;
}
public void run() {
}
return cw;
}};
new BasicRunnable() {
try {
} catch (IOException x) {
fail(x);
}
}
public void run() {
try {
while (true) {
break;
}
} catch (IOException x) {
fail(x);
}
}
try {
} catch (IOException x) {
fail(x);
}
return fw;
}};
new BasicRunnable() {
try {
} catch (IOException x) {
fail(x);
}
}
public void run() {
}
return osw;
}};
new BasicRunnable() {
}
public void run() {
}
return pw;
}};
new BasicRunnable() {
private StringWriter sw;
}
public void run() {
}
return new StringWriter();
}};
new BasicRunnable() {
}
public void run() {
}
return ps;
}};
new BasicRunnable() {
private CharBuffer cb;
}
public void run() {
}
return cb;
}};
new BasicRunnable() {
private StringBuffer sb;
}
public void run() {
}
return new StringBuffer();
}};
new BasicRunnable() {
private StringBuilder sb;
}
public void run() {
}
return new StringBuilder();
}};
// appends that should always work
};
try {
} catch (IOException x) {
fail(x);
}
}
// appends that should always throw IndexOutOfBoundsException
};
try {
new IndexOutOfBoundsException());
} catch (IndexOutOfBoundsException x) {
pass();
} catch (IOException x) {
fail(x);
}
}
// appends of null
int start = 1;
int end = 2;
try {
} catch (IOException x) {
fail(x);
}
}
// CharSequences
CharSequence [] ca = { s,
new StringBuffer(s),
new StringBuilder(s),
cb,
dcb,
};
// abstract, no implementing classes in jdk
// { new FilterWriter(), testFilterWriter },
// covered by previous two test cases
// { new PipedWriter(gw), testPipedWriter },
{ new StringWriter(), testStringWriter },
};
CharSequence a = ca[i];
// other Appendables
}
if (fail != 0)
else
}
}