1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-06 03:50:19 +02:00

git-svn-id: https://only.mawhrin.net/repos/FBReaderJ/trunk@57 6a642e6f-84f6-412e-ac94-c4a38d5a04b0

This commit is contained in:
MarinaSokol 2007-10-28 13:35:36 +00:00
parent 17852f1d77
commit bf89948a15
4 changed files with 10 additions and 8 deletions

View file

@ -1,7 +1,9 @@
package org.test.zlibrary.model;
import org.zlibrary.model.entry.ZLTextControlEntry;
import org.zlibrary.model.ZLTextParagraphEntry;
import org.zlibrary.model.impl.ZLModelFactory;
import org.zlibrary.model.impl.ZLTextControlEntryImpl;
import junit.framework.TestCase;
public class TestTextControlEntry extends TestCase {
@ -10,7 +12,7 @@ public class TestTextControlEntry extends TestCase {
public void test() {
boolean start = true;
byte kind = (byte)0;
ZLTextControlEntry entry = factory.createControlEntry(kind, start);
ZLTextControlEntryImpl entry = factory.createControlEntry(kind, start);
assertEquals(entry.getKind(), kind);
assertEquals(entry.isStart(), start);
}

View file

@ -2,7 +2,7 @@ package org.test.zlibrary.model;
import junit.framework.TestCase;
import org.zlibrary.model.entry.ZLTextControlEntryPool;
import org.zlibrary.model.entry.ZLTextParagraphEntry;
import org.zlibrary.model.ZLTextParagraphEntry;
import org.zlibrary.model.impl.ZLModelFactory;
public class TestTextControlEntryPool extends TestCase {

View file

@ -1,7 +1,7 @@
package org.test.zlibrary.model;
import junit.framework.TestCase;
import org.zlibrary.model.entry.ZLTextEntry;
import org.zlibrary.model.impl.ZLTextEntryImpl;
import org.zlibrary.model.impl.ZLModelFactory;
public class TestTextEntry extends TestCase {
@ -9,7 +9,7 @@ public class TestTextEntry extends TestCase {
public void test() {
String str = "marina";
ZLTextEntry entry = factory.createTextEntry(str);
ZLTextEntryImpl entry = factory.createTextEntry(str);
assertEquals(entry.getData(), str);
assertEquals(entry.getDataLength(), str.length());
}

View file

@ -3,8 +3,8 @@ package org.test.zlibrary.model;
import junit.framework.TestCase;
import org.zlibrary.model.ZLTextModel;
import org.zlibrary.model.ZLTextParagraph;
import org.zlibrary.model.entry.ZLTextEntry;
import org.zlibrary.model.impl.ZLModelFactory;
import org.zlibrary.model.impl.ZLTextEntryImpl;
public class TestZLTextModel extends TestCase {
private ZLModelFactory factory = new ZLModelFactory();
@ -28,12 +28,12 @@ public class TestZLTextModel extends TestCase {
assertEquals(model.getParagraphsNumber(), 2);
assertEquals(model.getParagraph(0), paragraph);
model.addText("addText");
assertEquals(((ZLTextEntry)model.getParagraph(1).getEntries().get(0)).getData(), "addText");
assertEquals(((ZLTextEntryImpl)model.getParagraph(1).getEntries().get(0)).getData(), "addText");
StringBuffer sb = new StringBuffer();
sb.append("1");
sb.append("2");
model.addText(sb);
assertEquals(((ZLTextEntry)model.getParagraph(1).getEntries().get(1)).getData(), "12");
assertEquals(((ZLTextEntryImpl)model.getParagraph(1).getEntries().get(1)).getData(), "12");
}
public void testAddControl() {