Author: nbelaevski
Date: 2010-11-18 11:37:36 -0500 (Thu, 18 Nov 2010)
New Revision: 20102
Removed:
trunk/core/api/src/main/java/org/ajax4jsf/javascript/StringBuilderWriter.java
trunk/core/api/src/test/java/org/ajax4jsf/javascript/StringBuilderWriterTest.java
Log:
RF-9714
Deleted: trunk/core/api/src/main/java/org/ajax4jsf/javascript/StringBuilderWriter.java
===================================================================
---
trunk/core/api/src/main/java/org/ajax4jsf/javascript/StringBuilderWriter.java 2010-11-18
16:35:18 UTC (rev 20101)
+++
trunk/core/api/src/main/java/org/ajax4jsf/javascript/StringBuilderWriter.java 2010-11-18
16:37:36 UTC (rev 20102)
@@ -1,88 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-
-package org.ajax4jsf.javascript;
-
-import java.io.IOException;
-import java.io.Writer;
-
-/**
- * @author Nick Belaevski
- * @since 3.3.2
- */
-final class StringBuilderWriter extends Writer {
- private StringBuilder builder;
-
- public StringBuilderWriter(StringBuilder builder) {
- super();
- this.builder = builder;
- }
-
- /**
- * Closing this writer doesn't have any effect
- */
- @Override
- public void close() throws IOException {
-
- // do nothing
- }
-
- /*
- * (non-Javadoc)
- * @see java.io.Writer#flush()
- */
- @Override
- public void flush() throws IOException {
-
- // do nothing
- }
-
- /*
- * (non-Javadoc)
- * @see java.io.Writer#write(char[], int, int)
- */
- @Override
- public void write(char[] cbuf, int off, int len) throws IOException {
- builder.append(cbuf, off, len);
- }
-
- @Override
- public void write(char[] cbuf) throws IOException {
- builder.append(cbuf);
- }
-
- @Override
- public void write(String str) throws IOException {
- builder.append(str);
- }
-
- @Override
- public void write(String str, int off, int len) throws IOException {
- builder.append(str, off, off + len);
- }
-
- @Override
- public void write(int c) throws IOException {
- builder.append((char) c);
- }
-}
Deleted:
trunk/core/api/src/test/java/org/ajax4jsf/javascript/StringBuilderWriterTest.java
===================================================================
---
trunk/core/api/src/test/java/org/ajax4jsf/javascript/StringBuilderWriterTest.java 2010-11-18
16:35:18 UTC (rev 20101)
+++
trunk/core/api/src/test/java/org/ajax4jsf/javascript/StringBuilderWriterTest.java 2010-11-18
16:37:36 UTC (rev 20102)
@@ -1,96 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-
-package org.ajax4jsf.javascript;
-
-import java.io.Writer;
-
-import junit.framework.TestCase;
-
-/**
- * @author Nick Belaevski
- * @since 3.3.2
- */
-public class StringBuilderWriterTest extends TestCase {
- private StringBuilder builder;
- private Writer writer;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.builder = new StringBuilder();
- this.writer = new StringBuilderWriter(this.builder);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- this.builder = null;
- this.writer = null;
- }
-
- public void testWrite() throws Exception {
- writer.write(new char[] {'a', 'b'});
- assertEquals("ab", builder.toString());
- }
-
- public void testWrite2() throws Exception {
- writer.write(0x12345678);
-
- String s = builder.toString();
-
- assertEquals(1, s.length());
- assertEquals(0x5678, s.charAt(0));
- }
-
- public void testWrite3() throws Exception {
- writer.write("test");
- assertEquals("test", builder.toString());
- }
-
- public void testWrite4() throws Exception {
- writer.write("abcd".toCharArray(), 1, 2);
- assertEquals("bc", builder.toString());
- writer.write("efgh".toCharArray(), 0, 3);
- assertEquals("bcefg", builder.toString());
- writer.write("ijkl".toCharArray(), 2, 2);
- assertEquals("bcefgkl", builder.toString());
- }
-
- public void testWrite5() throws Exception {
- writer.write("abcd", 1, 2);
- assertEquals("bc", builder.toString());
- writer.write("efgh", 0, 3);
- assertEquals("bcefg", builder.toString());
- writer.write("ijklm", 2, 3);
- assertEquals("bcefgklm", builder.toString());
- }
-
- public void testFlush() throws Exception {
- writer.flush();
- }
-
- public void testClose() throws Exception {
- writer.close();
- }
-}