incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liud...@apache.org
Subject svn commit: r1406043 [2/2] - in /incubator/odf/trunk/simple/src: main/java/org/odftoolkit/simple/ main/java/org/odftoolkit/simple/common/navigation/ main/java/org/odftoolkit/simple/draw/ test/java/org/odftoolkit/simple/common/field/ test/java/org/odfto...
Date Tue, 06 Nov 2012 05:31:30 GMT
Added: incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/common/navigation/TextDocumentSelectionTest.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/common/navigation/TextDocumentSelectionTest.java?rev=1406043&view=auto
==============================================================================
--- incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/common/navigation/TextDocumentSelectionTest.java
(added)
+++ incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/common/navigation/TextDocumentSelectionTest.java
Tue Nov  6 05:31:29 2012
@@ -0,0 +1,131 @@
+/* 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+ */
+
+package org.odftoolkit.simple.common.navigation;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.odftoolkit.simple.Document;
+import org.odftoolkit.simple.TextDocument;
+import org.odftoolkit.simple.utils.ResourceUtilities;
+
+/**
+ * Test the method of class
+ * org.odftoolkit.simple.common.navigation.TextDocumentSelection
+ */
+public class TextDocumentSelectionTest {
+	
+	private static final String TEXT_FILE = "TestTextSelection.odt";
+	TextDocument doc, sourcedoc;
+	TextNavigation search;
+	
+	@BeforeClass
+	public static void setUpClass() throws Exception {
+	}
+	
+	@AfterClass
+	public static void tearDownClass() throws Exception {
+	}
+	
+	@Before
+	public void setUp() {
+		try {
+			doc = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(TEXT_FILE));
+			sourcedoc = TextDocument.newTextDocument();
+			sourcedoc.addParagraph("Hello1 from SIMPLE source document!");
+			sourcedoc.addParagraph("Hello2 from source document!");
+			sourcedoc.addParagraph("Hello3 from source document!");
+		} catch (Exception e) {
+			Logger.getLogger(TextDocumentSelectionTest.class.getName()).log(Level.SEVERE, e.getMessage(),
e);
+			Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
+		}
+	}
+	
+	@After
+	public void tearDown() {
+	}
+	
+	/**
+	 * Test ReplaceWithTextDocument method of
+	 * org.odftoolkit.simple.common.navigation.TextDocumentSelection replace
+	 * "Featured Text" to TextDocument, all Styles be included.
+	 */
+	@Test
+	public void testReplaceWithTextDocument() {
+		search = null;
+		// 6 Simple, at the middle of original Paragraph, split original
+		// Paragraph, insert before the second Paragraph.
+		// Note: you need cache the nextSelection item because after you replace
+		// currtenItem with TextDocument, TextNavigation.nextSelection will
+		// search from the inserted Content,
+		// it will make you into a loop if the Search keyword also can be found
+		// in the inserted Content.
+		int i = 0;
+		search = new TextNavigation("SIMPLE", doc);
+		TextSelection currtenTextSelection, nextTextSelection = null;
+		while (search.hasNext()) {
+			if (nextTextSelection != null) {
+				currtenTextSelection = nextTextSelection;
+			} else {
+				currtenTextSelection = (TextSelection) search.nextSelection();
+			}
+			nextTextSelection = (TextSelection) search.nextSelection();
+			if (currtenTextSelection != null) {
+				TextDocumentSelection nextParagraphSelection = new TextDocumentSelection(currtenTextSelection);
+				try {
+					nextParagraphSelection.replaceWithTextDocument(sourcedoc);
+					i++;
+				} catch (Exception e) {
+					e.printStackTrace();
+					Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
+				}
+			}
+		}
+		if (nextTextSelection != null) {
+			TextDocumentSelection nextParagraphSelection = new TextDocumentSelection(nextTextSelection);
+			try {
+				nextParagraphSelection.replaceWithTextDocument(sourcedoc);
+				i++;
+			} catch (Exception e) {
+				e.printStackTrace();
+				Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
+			}
+		}
+		
+		search = new TextNavigation("Hello1 from SIMPLE source document!", doc);
+		int j = 0;
+		while (search.hasNext()) {
+			search.nextSelection();
+			j++;
+		}
+		Assert.assertTrue(i == j);
+		try {
+			doc.save(ResourceUtilities.newTestOutputFile("TestTextDocumentSelectionResult.odt"));
+		} catch (Exception e) {
+			Logger.getLogger(TextDocumentSelectionTest.class.getName()).log(Level.SEVERE, e.getMessage(),
e);
+			Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
+		}
+	}
+}

Modified: incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/common/navigation/TextSelectionTest.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/common/navigation/TextSelectionTest.java?rev=1406043&r1=1406042&r2=1406043&view=diff
==============================================================================
--- incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/common/navigation/TextSelectionTest.java
(original)
+++ incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/common/navigation/TextSelectionTest.java
Tue Nov  6 05:31:29 2012
@@ -20,6 +20,7 @@ under the License.
 package org.odftoolkit.simple.common.navigation;
 
 import java.net.MalformedURLException;
+import java.net.URI;
 import java.net.URL;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -31,8 +32,11 @@ import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.odftoolkit.odfdom.dom.element.OdfStyleBase;
+import org.odftoolkit.odfdom.dom.element.draw.DrawImageElement;
 import org.odftoolkit.odfdom.dom.element.style.StyleTextPropertiesElement;
 import org.odftoolkit.odfdom.dom.element.text.TextAElement;
+import org.odftoolkit.odfdom.dom.element.text.TextParagraphElementBase;
+import org.odftoolkit.odfdom.dom.element.text.TextSpanElement;
 import org.odftoolkit.odfdom.dom.style.OdfStyleFamily;
 import org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeAutomaticStyles;
 import org.odftoolkit.odfdom.incubator.doc.style.OdfStyle;
@@ -40,8 +44,16 @@ import org.odftoolkit.odfdom.pkg.OdfElem
 import org.odftoolkit.odfdom.pkg.OdfFileDom;
 import org.odftoolkit.simple.Document;
 import org.odftoolkit.simple.TextDocument;
+import org.odftoolkit.simple.common.field.Field;
+import org.odftoolkit.simple.common.field.Fields;
+import org.odftoolkit.simple.common.field.VariableField;
+import org.odftoolkit.simple.draw.Image;
+import org.odftoolkit.simple.table.Cell;
+import org.odftoolkit.simple.table.Table;
+import org.odftoolkit.simple.text.Paragraph;
 import org.odftoolkit.simple.utils.ResourceUtilities;
 import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 /**
  * Test the method of class
@@ -425,4 +437,366 @@ public class TextSelectionTest {
 		}
 		
 	}
+	
+	/**
+	 * Test replaceWith method of
+	 * org.odftoolkit.simple.common.navigation.TextSelection
+	 */
+	@Test
+	public void testReplacewithTable() throws Exception {
+		doc = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(TEXT_FILE));
+		TextDocument sourcedoc = TextDocument.newTextDocument();
+		String tablename = "Table1";
+		int rowcount = 7, columncount = 5;
+		String[][] data = new String[rowcount][columncount];
+		for (int i = 0; i < rowcount; i++) {
+			for (int j = 0; j < columncount; j++) {
+				data[i][j] = "string" + (i * columncount + j);
+			}
+		}
+		
+		String[] rowlabels = new String[rowcount];
+		for (int i = 0; i < rowcount; i++) {
+			rowlabels[i] = "RowHeader" + i;
+		}
+		
+		String[] columnlabels = new String[columncount];
+		for (int i = 0; i < columncount; i++) {
+			columnlabels[i] = "ColumnHeader" + i;
+		}
+		Table table = Table.newTable(sourcedoc, rowlabels, columnlabels, data);
+		table.setTableName(tablename);
+		
+		String tablename2 = "Table2";
+		int rowcount2 = 10, columncount2 = 4;
+		double[][] data2 = new double[rowcount2][columncount2];
+		for (int i = 0; i < rowcount2; i++) {
+			for (int j = 0; j < columncount2; j++) {
+				data2[i][j] = Math.random();
+			}
+		}
+		
+		String[] rowlabels2 = new String[rowcount2];
+		for (int i = 0; i < rowcount2; i++) {
+			rowlabels2[i] = "RowHeader" + i;
+		}
+		
+		String[] columnlabels2 = new String[columncount2];
+		for (int i = 0; i < columncount2; i++) {
+			columnlabels2[i] = "ColumnHeader" + i;
+		}
+		
+		Table table2 = Table.newTable(sourcedoc, rowlabels2, columnlabels2, data2);
+		table2.setTableName(tablename2);
+		String tablename3 = "Table3";
+		int rownumber3 = 5;
+		int clmnumber3 = 3;
+		Table table1 = Table.newTable(sourcedoc, rownumber3, clmnumber3);
+		table1.setTableName(tablename3);
+		search = null;
+		// 6 Simple, at the middle of original Paragraph, split original
+		// Paragraph, insert before the second Paragraph.
+		search = new TextNavigation("SIMPLE", doc);
+		while (search.hasNext()) {
+			TextSelection item = (TextSelection) search.nextSelection();
+			table = sourcedoc.getTableByName("Table1");
+			Cell cell = table.getCellByPosition(0, 0);
+			cell.setStringValue("SIMPLE");
+			Table newtable = item.replaceWith(table);
+			Assert.assertNotNull(newtable);
+			Assert.assertEquals(1, newtable.getHeaderColumnCount());
+			Assert.assertEquals(1, newtable.getHeaderRowCount());
+			Assert.assertEquals(7 + 1, newtable.getRowCount());
+			Assert.assertEquals(5 + 1, newtable.getColumnCount());
+			cell = newtable.getCellByPosition(1, 1);
+			Assert.assertEquals("string", cell.getValueType());
+		}
+		// 2 Task1, #1 at the start of original Paragraph, #2 replace original
+		// Paragraph
+		search = new TextNavigation("Task1", doc);
+		while (search.hasNext()) {
+			TextSelection item = (TextSelection) search.nextSelection();
+			table = sourcedoc.getTableByName("Table2");
+			Table newtable = item.replaceWith(table);
+			Cell cell = newtable.getCellByPosition(0, 0);
+			cell.setStringValue("From Source Table2");
+			Assert.assertNotNull(newtable);
+			Assert.assertEquals(1, newtable.getHeaderColumnCount());
+			Assert.assertEquals(1, newtable.getHeaderRowCount());
+			Assert.assertEquals(10 + 1, newtable.getRowCount());
+			Assert.assertEquals(4 + 1, newtable.getColumnCount());
+			
+			cell = newtable.getCellByPosition(1, 1);
+			Assert.assertEquals("float", cell.getValueType());
+		}
+		// 1 RESS%>, #1 at the end of original Paragraph,
+		search = new TextNavigation("RESS%>", doc);
+		
+		while (search.hasNext()) {
+			TextSelection item = (TextSelection) search.nextSelection();
+			table = sourcedoc.getTableByName("Table3");
+			Table newtable = item.replaceWith(table);
+			Cell cell = newtable.getCellByPosition(0, 0);
+			cell.setStringValue("From Source Table3");
+			Assert.assertNotNull(newtable);
+			Assert.assertEquals(5, newtable.getRowCount());
+			Assert.assertEquals(3, newtable.getColumnCount());
+		}
+		try {
+			doc.save(ResourceUtilities.newTestOutputFile("TextSelectionReplacewithTableResult.odt"));
+		} catch (Exception e) {
+			Logger.getLogger(TextSelectionTest.class.getName()).log(Level.SEVERE, e.getMessage(),
e);
+			Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
+		}
+	}
+	
+	/**
+	 * Test replaceWith method of
+	 * org.odftoolkit.simple.common.navigation.TextSelection
+	 */
+	@Test
+	public void testReplacewithImage() throws Exception {
+		doc = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(TEXT_FILE));
+		TextDocument sourcedoc = TextDocument.newTextDocument();
+		sourcedoc = TextDocument.newTextDocument();
+		Paragraph para = sourcedoc.addParagraph("helloImage");
+		Image image = Image.newImage(para, ResourceUtilities.getURI("image_list_item.png"));
+		image.setName("this image 1");
+		image.setHyperlink(new URI("http://odftoolkit.org"));
+		Paragraph para2 = sourcedoc.addParagraph("helloImage2");
+		Image image2 = Image.newImage(para2, ResourceUtilities.getURI("testA.jpg"));
+		image2.setName("this image 2");
+		image2.setHyperlink(new URI("http://odftoolkit.org"));
+		search = null;
+		// 6 Simple, at the middle of original Paragraph, split original
+		// Paragraph, insert before the second Paragraph.
+		search = new TextNavigation("SIMPLE", doc);
+		int i = 0;
+		TextSelection item = null;
+		while (search.hasNext()) {
+			item = (TextSelection) search.nextSelection();
+			Paragraph paragraph = sourcedoc.getParagraphByIndex(0, true);
+			TextParagraphElementBase textParaEleBase = paragraph.getOdfElement();
+			NodeList nodeImages = textParaEleBase.getElementsByTagName("draw:image");
+			Node nodeImage = nodeImages.item(0);
+			DrawImageElement im = (DrawImageElement) nodeImage;
+			Image ima = Image.getInstanceof(im);
+			image = item.replaceWith(ima);
+			Assert.assertNotNull(image);
+			if (image.getName().startsWith("replace")) {
+				Assert.assertTrue(true);
+			} else {
+				Assert.fail();
+			}
+			String name = "simple" + (i++);
+			image.setName(name);
+			Assert.assertEquals(name, image.getName());
+		}
+		try {
+			doc.save(ResourceUtilities.newTestOutputFile("TextSelectionReplacewithImageResult.odt"));
+		} catch (Exception e) {
+			Logger.getLogger(TextSelectionTest.class.getName()).log(Level.SEVERE, e.getMessage(),
e);
+			Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
+		}
+		doc = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(TEXT_FILE));
+		search = null;
+		// 6 Simple, at the middle of original Paragraph, split original
+		// Paragraph, insert before the second Paragraph.
+		search = new TextNavigation("SIMPLE", doc);
+		i = 0;
+		try {
+			while (search.hasNext()) {
+				item = (TextSelection) search.nextSelection();
+				URI imageuri = ResourceUtilities.getURI("image_list_item.png");
+				image = item.replaceWith(imageuri);
+				Assert.assertNotNull(image);
+				if (image.getName().startsWith("replace")) {
+					Assert.assertTrue(true);
+				} else {
+					Assert.fail();
+				}
+				String name = "simple" + (i++);
+				image.setName(name);
+				Assert.assertEquals(name, image.getName());
+			}
+			doc.save(ResourceUtilities.newTestOutputFile("TextSelectionReplacewithImageURIResult.odt"));
+		} catch (Exception e) {
+			Logger.getLogger(TextSelectionTest.class.getName()).log(Level.SEVERE, e.getMessage(),
e);
+			Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
+		}
+	}
+	
+	/**
+	 * Test replaceWith method of
+	 * org.odftoolkit.simple.common.navigation.TextSelection
+	 */
+	@Test
+	public void testReplacewithParagraph() throws Exception {
+		doc = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(TEXT_FILE));
+		TextDocument sourcedoc = TextDocument.newTextDocument();
+		sourcedoc.addParagraph("Hello1 from SIMPLE source document!");
+		sourcedoc.addParagraph("Hello2 from source document!");
+		sourcedoc.addParagraph("Hello3 from source document!");
+		
+		search = null;
+		// 6 Simple, at the middle of original Paragraph, split original
+		// Paragraph, insert before the second Paragraph.
+		search = new TextNavigation("SIMPLE", doc);
+		int i = 0;
+		TextSelection item = null;
+		while (search.hasNext()) {
+			item = (TextSelection) search.nextSelection();
+			Paragraph paragraph = sourcedoc.getParagraphByIndex(0, true);
+			item.replaceWith(paragraph);
+			i++;
+		}
+		search = new TextNavigation("Hello1 from SIMPLE source document!", doc);
+		int j = 0;
+		while (search.hasNext()) {
+			search.nextSelection();
+			j++;
+		}
+		Assert.assertTrue(i == j);
+		
+		// 2 Task1, #1 at the start of original Paragraph, #2 replace original
+		// Paragraph
+		search = new TextNavigation("Task1", doc);
+		i = 0;
+		while (search.hasNext()) {
+			item = (TextSelection) search.nextSelection();
+			
+			Paragraph paragraph = sourcedoc.getParagraphByIndex(1, true);
+			item.replaceWith(paragraph);
+			i++;
+		}
+		search = new TextNavigation("Hello2 from source document!", doc);
+		j = 0;
+		while (search.hasNext()) {
+			search.nextSelection();
+			j++;
+		}
+		Assert.assertTrue(i == j);
+		
+		// 1 Container, #1 at the end of original Paragraph,
+		search = new TextNavigation("Container", doc);
+		i = 0;
+		while (search.hasNext()) {
+			item = (TextSelection) search.nextSelection();
+			Paragraph paragraph = sourcedoc.getParagraphByIndex(2, true);
+			item.replaceWith(paragraph);
+			i++;
+		}
+		search = new TextNavigation("Hello3 from source document!", doc);
+		j = 0;
+		while (search.hasNext()) {
+			search.nextSelection();
+			j++;
+		}
+		Assert.assertTrue(i == j);
+		try {
+			doc.save(ResourceUtilities.newTestOutputFile("TextSelectionReplacewithParagraphResult.odt"));
+		} catch (Exception e) {
+			Logger.getLogger(TextSelectionTest.class.getName()).log(Level.SEVERE, e.getMessage(),
e);
+			Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
+		}
+	}
+	/**
+	 * Test replaceWith method of
+	 * org.odftoolkit.simple.common.navigation.TextSelection
+	 */
+	@Test
+	public void testReplacewithField() throws Exception {
+		doc = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(TEXT_FILE));
+		TextDocument sourcedoc = TextDocument.newTextDocument();
+		sourcedoc.addParagraph("Hello1 from SIMPLE source document!");
+		sourcedoc.addParagraph("Hello2 from source document!");
+		sourcedoc.addParagraph("Hello3 from source document!");
+		VariableField variableField = Fields.createUserVariableField(sourcedoc, "test_simple_variable","testReplacewithField");
+		Assert.assertNotNull(variableField);
+		TextSpanElement newTextSpanElement = sourcedoc.newParagraph("Update Variable Field:").newTextSpanElement();
+		variableField.updateField("simple variable content", newTextSpanElement);
+		newTextSpanElement = sourcedoc.newParagraph("Show Variable Field:").newTextSpanElement();
+		variableField.displayField(newTextSpanElement);
+		Field orgField = sourcedoc.getVariableFieldByName("test_simple_variable");
+		// 6 Simple, at the middle of original Paragraph, split original
+		// Paragraph, insert before the second Paragraph.
+		search = new TextNavigation("SIMPLE", doc);
+		while (search.hasNext()) {
+			TextSelection item = (TextSelection) search.nextSelection();
+			try {
+				Field newField = item.replaceWith(orgField);
+			} catch (InvalidNavigationException e) {
+				e.printStackTrace();
+			}
+		}
+		try {
+			doc.save(ResourceUtilities.newTestOutputFile("TextSelectionReplacewithFieldResult.odt"));
+		} catch (Exception e) {
+			Logger.getLogger(TextSelectionTest.class.getName()).log(Level.SEVERE, e.getMessage(),
e);
+			Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
+		}
+	}
+	/**
+	 * Test replaceWith method of
+	 * org.odftoolkit.simple.common.navigation.TextSelection
+	 */
+	@Test
+	public void testReplacewithTextDocument() throws Exception {
+		doc = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath(TEXT_FILE));
+		TextDocument sourcedoc = TextDocument.newTextDocument();
+		sourcedoc.addParagraph("Hello1 from SIMPLE source document!");
+		sourcedoc.addParagraph("Hello2 from source document!");
+		sourcedoc.addParagraph("Hello3 from source document!");
+		search = null;
+		// 6 Simple, at the middle of original Paragraph, split original
+		// Paragraph, insert before the second Paragraph.
+		// Note: you need cache the nextSelection item because after you replace
+		// currtenItem with TextDocument, TextNavigation.nextSelection will
+		// search from the inserted Content,
+		// it will make you into a loop if the Search keyword also can be found
+		// in the inserted Content.
+		int i = 0;
+		search = new TextNavigation("SIMPLE", doc);
+		TextSelection currtenTextSelection, nextTextSelection = null;
+		while (search.hasNext()) {
+			if (nextTextSelection != null) {
+				currtenTextSelection = nextTextSelection;
+			} else {
+				currtenTextSelection = (TextSelection) search.nextSelection();
+			}
+			nextTextSelection = (TextSelection) search.nextSelection();
+			if (currtenTextSelection != null) {
+				
+				try {
+					currtenTextSelection.replaceWith(sourcedoc);
+					i++;
+				} catch (Exception e) {
+					e.printStackTrace();
+					Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
+				}
+			}
+		}
+		if (nextTextSelection != null) {
+			try {
+				nextTextSelection.replaceWith(sourcedoc);
+				i++;
+			} catch (Exception e) {
+				e.printStackTrace();
+				Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
+			}
+		}
+		search = new TextNavigation("Hello1 from SIMPLE source document!", doc);
+		int j = 0;
+		while (search.hasNext()) {
+			search.nextSelection();
+			j++;
+		}
+		Assert.assertTrue(i == j);
+		try {
+			doc.save(ResourceUtilities.newTestOutputFile("TextSelectionReplacewithTextDocumentResult.odt"));
+		} catch (Exception e) {
+			Logger.getLogger(TextSelectionTest.class.getName()).log(Level.SEVERE, e.getMessage(),
e);
+			Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
+		}
+	}
 }



Mime
View raw message