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@431 6a642e6f-84f6-412e-ac94-c4a38d5a04b0
This commit is contained in:
parent
4042ea7ae8
commit
f6cc55a315
2 changed files with 75 additions and 0 deletions
12
test/org/test/zlibrary/core/resources/AllTests.java
Normal file
12
test/org/test/zlibrary/core/resources/AllTests.java
Normal file
|
@ -0,0 +1,12 @@
|
|||
package org.test.zlibrary.core.resources;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
public class AllTests {
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite();
|
||||
suite.addTestSuite(TestResources.class);
|
||||
return suite;
|
||||
}
|
||||
}
|
63
test/org/test/zlibrary/core/resources/TestResources.java
Normal file
63
test/org/test/zlibrary/core/resources/TestResources.java
Normal file
|
@ -0,0 +1,63 @@
|
|||
package org.test.zlibrary.core.resources;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.zlibrary.core.resources.ZLResource;
|
||||
import org.zlibrary.core.xml.own.ZLOwnXMLProcessorFactory;
|
||||
import org.zlibrary.ui.swing.library.ZLSwingLibrary;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class TestResources extends TestCase {
|
||||
|
||||
public void setUp() {
|
||||
new ZLSwingLibrary();
|
||||
new ZLOwnXMLProcessorFactory();
|
||||
Locale.setDefault(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
public void testMissingResource() {
|
||||
ZLResource res = ZLResource.resource("");
|
||||
assertFalse(res.hasValue());
|
||||
}
|
||||
|
||||
public void testMissingResourceValue() {
|
||||
ZLResource res = ZLResource.resource("");
|
||||
assertEquals(res.getValue(), "????????");
|
||||
}
|
||||
|
||||
public void testNoValueResource() {
|
||||
ZLResource res = ZLResource.resource("menu");
|
||||
assertFalse(res.hasValue());
|
||||
}
|
||||
|
||||
public void testMissingValue() {
|
||||
ZLResource res = ZLResource.resource("menu");
|
||||
assertEquals(res.getValue(), "????????");
|
||||
}
|
||||
|
||||
public void testNoValueResource2() {
|
||||
ZLResource res = ZLResource.resource("color");
|
||||
assertFalse(res.hasValue());
|
||||
}
|
||||
|
||||
public void testMissingValue2() {
|
||||
ZLResource res = ZLResource.resource("color");
|
||||
assertEquals(res.getValue(), "????????");
|
||||
}
|
||||
|
||||
public void testHasValue() {
|
||||
ZLResource res = ZLResource.resource("menu").getResource("search");
|
||||
assertTrue(res.hasValue());
|
||||
}
|
||||
|
||||
public void testValue() {
|
||||
ZLResource res = ZLResource.resource("menu").getResource("search");
|
||||
assertEquals(res.getValue(), "Find");
|
||||
}
|
||||
|
||||
public void testValue2() {
|
||||
ZLResource res = ZLResource.resource("menu").getResource("search").getResource("find");
|
||||
assertEquals(res.getValue(), "Find Text...");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue