Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 160081 Details for
Bug 183164
[Implementation for] Display of Complex Expressions Containing Bidirectional Text
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Adjusting JUnits 1
patch bidi tests1.txt (text/plain), 9.15 KB, created by
Oleg Besedin
on 2010-02-24 10:53:41 EST
(
hide
)
Description:
Adjusting JUnits 1
Filename:
MIME Type:
Creator:
Oleg Besedin
Created:
2010-02-24 10:53:41 EST
Size:
9.15 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.bidi.tests >Index: src/org/eclipse/equinox/bidi/internal/tests/ComplExpMathTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/components/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/ComplExpMathTest.java,v >retrieving revision 1.1 >diff -u -r1.1 ComplExpMathTest.java >--- src/org/eclipse/equinox/bidi/internal/tests/ComplExpMathTest.java 24 Feb 2010 14:59:36 -0000 1.1 >+++ src/org/eclipse/equinox/bidi/internal/tests/ComplExpMathTest.java 24 Feb 2010 15:45:18 -0000 >@@ -11,60 +11,44 @@ > > package org.eclipse.equinox.bidi.internal.tests; > >-import junit.framework.Test; >-import junit.framework.TestCase; >-import junit.framework.TestSuite; >- >+import org.eclipse.equinox.bidi.complexp.IBiDiProcessor; > import org.eclipse.equinox.bidi.complexp.IComplExpProcessor; > import org.eclipse.equinox.bidi.complexp.StringProcessor; >-import org.eclipse.equinox.bidi.complexp.IBiDiProcessor; > > /** > * Tests RTL arithmetic > */ >-public class ComplExpMathTest extends TestCase { >- public static Test suite() { >- return new TestSuite(ComplExpMathTest.class); >- } >- >- public ComplExpMathTest() { >- super(); >- } >+public class ComplExpMathTest extends ComplExpTestBase { >+ >+ private IComplExpProcessor processor; >+ >+ protected void setUp() throws Exception { >+ super.setUp(); >+ processor = StringProcessor.getProcessor(IBiDiProcessor.RTL_ARITHMETIC); >+ } > >- public ComplExpMathTest(String name) { >- super(name); >- } >- >- static void test1(IComplExpProcessor complexp, String data, >- String resLTR, String resRTL) >+ private void verifyOneLine(String data, String resLTR, String resRTL) > { >- String full, lean; >- >- System.out.println(); >- System.out.println(">>> text=" + data); >- lean = Tools.toUT16(data); >- complexp.assumeOrientation(IComplExpProcessor.ORIENT_LTR); >- full = complexp.leanToFullText(lean); >- Tools.verify("LTR full", full, resLTR); >- complexp.assumeOrientation(IComplExpProcessor.ORIENT_RTL); >- full = complexp.leanToFullText(lean); >- Tools.verify("RTL full", full, resRTL); >+ String lean = toUT16(data); >+ processor.assumeOrientation(IComplExpProcessor.ORIENT_LTR); >+ String fullLTR = processor.leanToFullText(lean); >+ assertEquals(resLTR, toPseudo(fullLTR)); >+ >+ processor.assumeOrientation(IComplExpProcessor.ORIENT_RTL); >+ String fullRTL = processor.leanToFullText(lean); >+ assertEquals(resRTL, toPseudo(fullRTL)); > } >- >- public static void testRTLarithmetic() { >- Tools.separ("ComplExpMathTest"); >- IComplExpProcessor complexp = StringProcessor.getProcessor(IBiDiProcessor.RTL_ARITHMETIC); >- test1(complexp, "", "", ""); >- test1(complexp, "1+abc", "<&1+abc&^", "1+abc"); >- test1(complexp, "2+abc-def", "<&2+abc&-def&^", "2+abc&-def"); >- test1(complexp, "a+3*bc/def", "<&a&+3*bc&/def&^", "a&+3*bc&/def"); >- test1(complexp, "4+abc/def", "<&4+abc&/def&^", "4+abc&/def"); >- test1(complexp, "13ABC", "<&13ABC&^", "13ABC"); >- test1(complexp, "14ABC-DE", "<&14ABC-DE&^", "14ABC-DE"); >- test1(complexp, "15ABC+DE", "<&15ABC+DE&^", "15ABC+DE"); >- test1(complexp, "16ABC*DE", "<&16ABC*DE&^", "16ABC*DE"); >- test1(complexp, "17ABC/DE", "<&17ABC/DE&^", "17ABC/DE"); >- >- Tools.printStepErrorCount(); >+ >+ public void testRTLarithmetic() { >+ verifyOneLine("", "", ""); >+ verifyOneLine("1+abc", "<&1+abc&^", "1+abc"); >+ verifyOneLine("2+abc-def", "<&2+abc&-def&^", "2+abc&-def"); >+ verifyOneLine("a+3*bc/def", "<&a&+3*bc&/def&^", "a&+3*bc&/def"); >+ verifyOneLine("4+abc/def", "<&4+abc&/def&^", "4+abc&/def"); >+ verifyOneLine("13ABC", "<&13ABC&^", "13ABC"); >+ verifyOneLine("14ABC-DE", "<&14ABC-DE&^", "14ABC-DE"); >+ verifyOneLine("15ABC+DE", "<&15ABC+DE&^", "15ABC+DE"); >+ verifyOneLine("16ABC*DE", "<&16ABC*DE&^", "16ABC*DE"); >+ verifyOneLine("17ABC/DE", "<&17ABC/DE&^", "17ABC/DE"); > } > } >Index: src/org/eclipse/equinox/bidi/internal/tests/ComplExpTestBase.java >=================================================================== >RCS file: src/org/eclipse/equinox/bidi/internal/tests/ComplExpTestBase.java >diff -N src/org/eclipse/equinox/bidi/internal/tests/ComplExpTestBase.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/equinox/bidi/internal/tests/ComplExpTestBase.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,95 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ ******************************************************************************/ >+ >+package org.eclipse.equinox.bidi.internal.tests; >+ >+import junit.framework.TestCase; >+ >+/** >+ * Base functionality for the processor tests. >+ */ >+public class ComplExpTestBase extends TestCase { >+ >+ static final private char LRM = 0x200E; >+ static final private char RLM = 0x200F; >+ static final private char LRE = 0x202A; >+ static final private char RLE = 0x202B; >+ static final private char PDF = 0x202C; >+ >+ protected String toPseudo(String text) >+ { >+ char[] chars = text.toCharArray(); >+ int len = chars.length; >+ >+ for (int i = 0; i < len; i++) { >+ char c = chars[i]; >+ if (c >= 'A' && c <= 'Z') >+ chars[i] = (char)(c + 'a' - 'A'); >+ else if (c >= 0x05D0 && c < 0x05EA) >+ chars[i] = (char)(c + 'A' - 0x05D0); >+ else if (c == 0x05EA) >+ chars[i] = '~'; >+ else if (c == 0x0644) >+ chars[i] = '#'; >+ else if (c >= 0x0665 && c <= 0x0669) >+ chars[i] = (char)(c + '5' - 0x0665); >+ else if (c == LRM) >+ chars[i] = '@'; >+ else if (c == RLM) >+ chars[i] = '&'; >+ else if (c == LRE) >+ chars[i] = '>'; >+ else if (c == RLE) >+ chars[i] = '<'; >+ else if (c == PDF) >+ chars[i] = '^'; >+ else if (c == '\n') >+ chars[i] = '|'; >+ else if (c == '\r') >+ chars[i] = '`'; >+ } >+ return new String(chars); >+ } >+ >+ protected String toUT16(String text) >+ { >+ char[] chars = text.toCharArray(); >+ int len = chars.length; >+ >+ for (int i = 0; i < len; i++) { >+ char c = chars[i]; >+ if (c >= '5' && c <= '9') >+ chars[i] = (char)(0x0665 + c - '5'); >+ else if (c >= 'A' && c <= 'Z') >+ chars[i] = (char)(0x05D0 + c - 'A'); >+ else if (c == '~') >+ chars[i] = (char)(0x05EA); >+ else if (c == '#') >+ chars[i] = (char)(0x0644); >+ else if (c == '@') >+ chars[i] = LRM; >+ else if (c == '&') >+ chars[i] = RLM; >+ else if (c == '>') >+ chars[i] = LRE; >+ else if (c == '<') >+ chars[i] = RLE; >+ else if (c == '^') >+ chars[i] = PDF; >+ else if (c == '|') >+ chars[i] = '\n'; >+ else if (c == '`') >+ chars[i] = '\r'; >+ } >+ return new String(chars); >+ } >+ >+} >Index: src/org/eclipse/equinox/bidi/internal/tests/ExtensibilityTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/components/bundles/org.eclipse.equinox.bidi.tests/src/org/eclipse/equinox/bidi/internal/tests/ExtensibilityTest.java,v >retrieving revision 1.3 >diff -u -r1.3 ExtensibilityTest.java >--- src/org/eclipse/equinox/bidi/internal/tests/ExtensibilityTest.java 19 Feb 2010 19:46:20 -0000 1.3 >+++ src/org/eclipse/equinox/bidi/internal/tests/ExtensibilityTest.java 24 Feb 2010 15:45:21 -0000 >@@ -11,9 +11,7 @@ > > package org.eclipse.equinox.bidi.internal.tests; > >-import junit.framework.Test; > import junit.framework.TestCase; >-import junit.framework.TestSuite; > > import org.eclipse.equinox.bidi.complexp.IComplExpProcessor; > import org.eclipse.equinox.bidi.complexp.StringProcessor; >@@ -22,17 +20,6 @@ > * Tests contribution of BiDi processors. > */ > public class ExtensibilityTest extends TestCase { >- public static Test suite() { >- return new TestSuite(ExtensibilityTest.class); >- } >- >- public ExtensibilityTest() { >- super(); >- } >- >- public ExtensibilityTest(String name) { >- super(name); >- } > > public void testBaseContributions() { > String[] types = StringProcessor.getKnownTypes();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 183164
:
148967
|
157821
|
158092
|
158531
|
160015
|
160017
| 160081 |
160698
|
160858
|
162228
|
162229
|
164476
|
186038
|
186054
|
186488
|
186490
|
188406
|
188407
|
188408
|
188627
|
194078
|
194079
|
195082
|
195084
|
196575
|
196576
|
199068
|
199070
|
199113
|
199855
|
200008
|
200389
|
200629
|
200630
|
200631
|
200742
|
200743
|
200803
|
200805
|
200905
|
200907
|
201464
|
201465
|
201467
|
201468
|
201469
|
201470
|
201676
|
201677
|
201785
|
201787
|
202172
|
202173
|
205767
|
205768
|
206588
|
210657